Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-22 12:31:40 +05:00
parent 32ae17c016
commit d594af91fc
18 changed files with 45 additions and 13 deletions

View file

@ -20,5 +20,6 @@ object AccountIconItemStateConverter : Converter<Account, CurrencyIconState.Cryp
isGrayscale = false,
)
}
is Account.Payment -> TODO("[REDACTED_JIRA]")
}
}

View file

@ -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(),

View file

@ -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]")
}
}
}

View file

@ -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,

View file

@ -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")
}
}
}

View file

@ -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 {

View file

@ -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

View file

@ -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,

View file

@ -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)
}

View file

@ -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]")
},
),
)

View file

@ -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
}

View file

@ -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,

View file

@ -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)
}

View file

@ -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]")
},
),
)

View file

@ -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]")
},
),
)

View file

@ -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 {

View file

@ -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(

View file

@ -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
}