Updated on 2026-08-14
This commit is contained in:
parent
8632680f20
commit
e024d739b7
87 changed files with 386 additions and 374 deletions
|
|
@ -23,7 +23,7 @@ sealed class SwapEvents(
|
|||
params = mapOf("Token" to token),
|
||||
)
|
||||
|
||||
data object SendTokenBalanceClicked : SwapEvents(event = "Send Token Balance Clicked")
|
||||
class SendTokenBalanceClicked : SwapEvents(event = "Send Token Balance Clicked")
|
||||
|
||||
data class ChooseTokenScreenOpened(val availableTokens: Boolean) : SwapEvents(
|
||||
event = "Choose Token Screen Opened",
|
||||
|
|
@ -43,7 +43,7 @@ sealed class SwapEvents(
|
|||
params = mapOf("Send Token" to sendToken, "Receive Token" to receiveToken),
|
||||
)
|
||||
|
||||
data object ButtonGivePermissionClicked : SwapEvents(event = "Button - Give permission")
|
||||
class ButtonGivePermissionClicked : SwapEvents(event = "Button - Give permission")
|
||||
|
||||
data class ButtonPermissionApproveClicked(
|
||||
val sendToken: String,
|
||||
|
|
@ -58,9 +58,9 @@ sealed class SwapEvents(
|
|||
),
|
||||
)
|
||||
|
||||
data object ButtonPermissionCancelClicked : SwapEvents(event = "Button - Permission Cancel")
|
||||
class ButtonPermissionCancelClicked : SwapEvents(event = "Button - Permission Cancel")
|
||||
|
||||
data object ButtonSwipeClicked : SwapEvents(event = "Button - Swipe")
|
||||
class ButtonSwipeClicked : SwapEvents(event = "Button - Swipe")
|
||||
|
||||
data class SwapInProgressScreen(
|
||||
val provider: SwapProvider,
|
||||
|
|
@ -81,7 +81,7 @@ sealed class SwapEvents(
|
|||
),
|
||||
)
|
||||
|
||||
data object ProviderClicked : SwapEvents("Provider Clicked")
|
||||
class ProviderClicked : SwapEvents("Provider Clicked")
|
||||
|
||||
data class ProviderChosen(val provider: SwapProvider) : SwapEvents(
|
||||
event = "Provider Chosen",
|
||||
|
|
@ -98,7 +98,7 @@ sealed class SwapEvents(
|
|||
params = mapOf("Token" to token),
|
||||
)
|
||||
|
||||
data object NoticeNoAvailableTokensToSwap : SwapEvents("Notice - No Available Tokens To Swap")
|
||||
class NoticeNoAvailableTokensToSwap : SwapEvents("Notice - No Available Tokens To Swap")
|
||||
|
||||
data class NoticeNotEnoughFee(val token: String, val blockchain: String) : SwapEvents(
|
||||
event = "Notice - Not Enough Fee",
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ internal class SwapModel @Inject constructor(
|
|||
) {
|
||||
// exceptional case
|
||||
if (selectedCurrency == null) {
|
||||
analyticsEventHandler.send(SwapEvents.NoticeNoAvailableTokensToSwap)
|
||||
analyticsEventHandler.send(SwapEvents.NoticeNoAvailableTokensToSwap())
|
||||
uiState = stateBuilder.createNoAvailableTokensToSwapState(
|
||||
uiStateHolder = uiState,
|
||||
fromToken = initialFromStatus,
|
||||
|
|
@ -1271,7 +1271,7 @@ internal class SwapModel @Inject constructor(
|
|||
|
||||
private fun onAmountSelected(selected: Boolean) {
|
||||
if (selected) {
|
||||
analyticsEventHandler.send(SwapEvents.SendTokenBalanceClicked)
|
||||
analyticsEventHandler.send(SwapEvents.SendTokenBalanceClicked())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1312,7 +1312,7 @@ internal class SwapModel @Inject constructor(
|
|||
},
|
||||
onChangeCardsClicked = {
|
||||
onChangeCardsClicked()
|
||||
analyticsEventHandler.send(SwapEvents.ButtonSwipeClicked)
|
||||
analyticsEventHandler.send(SwapEvents.ButtonSwipeClicked())
|
||||
},
|
||||
onBackClicked = {
|
||||
val bottomSheet = uiState.bottomSheetConfig
|
||||
|
|
@ -1331,10 +1331,10 @@ internal class SwapModel @Inject constructor(
|
|||
onReduceByAmount = ::onReduceAmountClicked,
|
||||
openPermissionBottomSheet = {
|
||||
singleTaskScheduler.cancelTask()
|
||||
analyticsEventHandler.send(SwapEvents.ButtonGivePermissionClicked)
|
||||
analyticsEventHandler.send(SwapEvents.ButtonGivePermissionClicked())
|
||||
uiState = stateBuilder.showPermissionBottomSheet(uiState) {
|
||||
startLoadingQuotesFromLastState(isSilent = true)
|
||||
analyticsEventHandler.send(SwapEvents.ButtonPermissionCancelClicked)
|
||||
analyticsEventHandler.send(SwapEvents.ButtonPermissionCancelClicked())
|
||||
uiState = stateBuilder.dismissBottomSheet(uiState)
|
||||
}
|
||||
},
|
||||
|
|
@ -1362,7 +1362,7 @@ internal class SwapModel @Inject constructor(
|
|||
}
|
||||
},
|
||||
onProviderClick = { providerId ->
|
||||
analyticsEventHandler.send(SwapEvents.ProviderClicked)
|
||||
analyticsEventHandler.send(SwapEvents.ProviderClicked())
|
||||
val states = dataState.lastLoadedSwapStates.getLastLoadedSuccessStates()
|
||||
val pricesLowerBest = getPricesLowerBest(providerId, states)
|
||||
uiState = stateBuilder.showSelectProviderBottomSheet(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue