Updated on 2026-08-14
This commit is contained in:
parent
32ae17c016
commit
d594af91fc
18 changed files with 45 additions and 13 deletions
|
|
@ -20,5 +20,6 @@ object AccountIconItemStateConverter : Converter<Account, CurrencyIconState.Cryp
|
|||
isGrayscale = false,
|
||||
)
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
}
|
||||
|
|
@ -22,21 +22,24 @@ class AccountPortfolioItemUMConverter(
|
|||
) : Converter<Account, UserWalletItemUM> {
|
||||
|
||||
override fun convert(value: Account): UserWalletItemUM {
|
||||
return with(value) {
|
||||
UserWalletItemUM(
|
||||
id = accountId.value,
|
||||
name = accountName.toUM().value,
|
||||
information = getInfo(account = this),
|
||||
balance = getBalanceInfo(),
|
||||
isEnabled = isEnabled,
|
||||
endIcon = endIcon,
|
||||
onClick = onClick,
|
||||
imageState = getImageState(account = this),
|
||||
)
|
||||
return when (value) {
|
||||
is Account.CryptoPortfolio -> with(value) {
|
||||
UserWalletItemUM(
|
||||
id = accountId.value,
|
||||
name = accountName.toUM().value,
|
||||
information = getInfo(account = this),
|
||||
balance = getBalanceInfo(),
|
||||
isEnabled = isEnabled,
|
||||
endIcon = endIcon,
|
||||
onClick = onClick,
|
||||
imageState = getImageState(account = this),
|
||||
)
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
}
|
||||
|
||||
private fun getInfo(account: Account): UserWalletItemUM.Information.Loaded = when (account) {
|
||||
private fun getInfo(account: Account.CryptoPortfolio): UserWalletItemUM.Information.Loaded = when (account) {
|
||||
is Account.CryptoPortfolio -> {
|
||||
val text = pluralReference(
|
||||
R.plurals.common_tokens_count,
|
||||
|
|
@ -47,7 +50,7 @@ class AccountPortfolioItemUMConverter(
|
|||
}
|
||||
}
|
||||
|
||||
private fun getImageState(account: Account) = when (account) {
|
||||
private fun getImageState(account: Account.CryptoPortfolio) = when (account) {
|
||||
is Account.CryptoPortfolio -> UserWalletItemUM.ImageState.Account(
|
||||
name = account.accountName.toUM().value,
|
||||
icon = account.icon.toUM(),
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ data class AccountList private constructor(
|
|||
return accounts.flatMap { account ->
|
||||
when (account) {
|
||||
is Account.CryptoPortfolio -> account.cryptoCurrencies
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ internal class DefaultSingleAccountStatusListProducer @AssistedInject constructo
|
|||
}
|
||||
.distinctUntilChanged()
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -192,6 +193,7 @@ internal class DefaultSingleAccountStatusListProducer @AssistedInject constructo
|
|||
priceChangeLce = lceLoading(),
|
||||
)
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
},
|
||||
totalAccounts = accountList.totalAccounts,
|
||||
|
|
|
|||
|
|
@ -174,4 +174,15 @@ sealed interface Account {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Payment : Account {
|
||||
override val accountId: AccountId
|
||||
get() = TODO("Not yet implemented")
|
||||
override val accountName: AccountName
|
||||
get() = TODO("Not yet implemented")
|
||||
|
||||
init {
|
||||
error("Not yet implemented")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -88,6 +88,7 @@ internal class AccountCreateEditUMBuilder(
|
|||
val Account.portfolioIcon: CryptoPortfolioIcon
|
||||
get() = when (this) {
|
||||
is Account.CryptoPortfolio -> this.icon
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
|
||||
fun AccountCreateEditUM.updateColorSelect(color: CryptoPortfolioIcon.Color): AccountCreateEditUM {
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ internal class AccountDetailsModel @Inject constructor(
|
|||
isLoading = false,
|
||||
)
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
val isMultiCurrency = getUserWalletUseCase(account.accountId.userWalletId).getOrNull()
|
||||
?.isMultiCurrency == true
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ internal class AvailableToAddDataConverter @Inject constructor(
|
|||
): CryptoCurrency? {
|
||||
val derivationIndex = when (account) {
|
||||
is Account.CryptoPortfolio -> account.derivationIndex
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
return getTokenMarketCryptoCurrency(
|
||||
userWalletId = userWallet.walletId,
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ internal class AddTokenModel @Inject constructor(
|
|||
is Account.CryptoPortfolio -> if (!account.isMainAccount) {
|
||||
analyticsEventHandler.send(analyticsEventBuilder.addToNotMainAccount())
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
params.callbacks.onTokenAdded(status.status)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,6 +271,7 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor(
|
|||
name = this.accountName.toUM().value,
|
||||
icon = when (this) {
|
||||
is Account.CryptoPortfolio -> this.icon.toUM()
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ internal class CustomTokenSelectorModel @Inject constructor(
|
|||
|
||||
val accountName = when (account) {
|
||||
is Account.CryptoPortfolio -> account.accountName
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
null -> null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ internal class AvailableToAddDataConverter @Inject constructor(
|
|||
): CryptoCurrency? {
|
||||
val derivationIndex = when (account) {
|
||||
is Account.CryptoPortfolio -> account.derivationIndex
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
return getTokenMarketCryptoCurrency(
|
||||
userWalletId = userWallet.walletId,
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ internal class AddTokenModel @Inject constructor(
|
|||
is Account.CryptoPortfolio -> if (!account.isMainAccount) {
|
||||
analyticsEventHandler.send(analyticsEventBuilder.addToNotMainAccount())
|
||||
}
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
params.callbacks.onTokenAdded(status.status)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor(
|
|||
name = this.accountName.toUM().value,
|
||||
icon = when (this) {
|
||||
is Account.CryptoPortfolio -> this.icon.toUM()
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ internal class UpdateDataStateTransformer(
|
|||
name = this.accountName.toUM().value,
|
||||
icon = when (this) {
|
||||
is Account.CryptoPortfolio -> this.icon.toUM()
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ internal class WcPairModel @Inject constructor(
|
|||
val (wallet, portfolioAccount) = selectedPortfolio
|
||||
val account = when (val account = portfolioAccount.account) {
|
||||
is Account.CryptoPortfolio -> account
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
val isAccountMode = selectorController.isAccountMode.first()
|
||||
val icon: CryptoPortfolioIconUM?
|
||||
|
|
@ -325,6 +326,7 @@ internal class WcPairModel @Inject constructor(
|
|||
if (selectorController.isAccountModeSync() && account != null) {
|
||||
val derivationIndex = when (account) {
|
||||
is Account.CryptoPortfolio -> account.derivationIndex.value
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
analytics.send(WcAnalyticAccountEvents.PairButtonConnect(derivationIndex))
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ internal class WcSessionsAccountModeTransformer(
|
|||
}
|
||||
val accountIcon = when (account) {
|
||||
is Account.CryptoPortfolio -> account.icon
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
}
|
||||
|
||||
val accountTitle = AccountTitleUM.Account(
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ internal class WcPortfolioNameDelegate @AssistedInject constructor(
|
|||
fun createAccountTitleUM(value: WcSession): AccountTitleUM? {
|
||||
val account = when (val account = value.account) {
|
||||
is Account.CryptoPortfolio -> account
|
||||
is Account.Payment -> TODO("[REDACTED_JIRA]")
|
||||
null -> null
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue