Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-25 19:34:39 +03:00
parent 195ffd4391
commit 2c2c994e72
7 changed files with 29 additions and 4 deletions

View file

@ -1787,6 +1787,8 @@
<string name="warning_button_ok">Ok, Got it!</string>
<string name="warning_button_really_cool">Really cool!</string>
<string name="warning_button_refresh">Refresh</string>
<string name="warning_clore_migration_message">According to Clores official documentation, all tokens received before December 21 will be migrated to Clore (ERC20); tokens received after will not. Transfer solution coming — stay tuned.</string>
<string name="warning_clore_migration_title">Clore Network Migration</string>
<string name="warning_demo_mode_message">You are currently in the Demo mode</string>
<string name="warning_demo_mode_title">Demo mode active</string>
<string name="warning_developer_card_message">The card you scanned is a developer card. Do not use it to create your wallet.</string>

View file

@ -57,6 +57,8 @@ sealed class CryptoCurrencyWarning {
data object MigrationMaticToPol : CryptoCurrencyWarning()
data object MigrationClore : CryptoCurrencyWarning()
/**
* Shows a warning about an available fee resource for a transaction in several blockchains (ex. Koinos)
*/

View file

@ -41,16 +41,16 @@ class GetCurrencyWarningsUseCase(
// don't add here notifications that require async requests
return combine(
getCoinRelatedWarnings(
flow = getCoinRelatedWarnings(
userWalletId = userWalletId,
networkId = currency.network.id,
currencyId = currency.id,
derivationPath = derivationPath,
isSingleWalletWithTokens = isSingleWalletWithTokens,
),
flowOf(currencyChecksRepository.getRentInfoWarning(userWalletId, currencyStatus)),
flowOf(currencyChecksRepository.getExistentialDeposit(userWalletId, currency.network)),
flowOf(currencyChecksRepository.getFeeResourceAmount(userWalletId, currency.network)),
flow2 = flowOf(currencyChecksRepository.getRentInfoWarning(userWalletId, currencyStatus)),
flow3 = flowOf(currencyChecksRepository.getExistentialDeposit(userWalletId, currency.network)),
flow4 = flowOf(currencyChecksRepository.getFeeResourceAmount(userWalletId, currency.network)),
) { coinRelatedWarnings, maybeRentWarning, maybeEdWarning, maybeFeeResource ->
setOfNotNull(
maybeRentWarning,
@ -62,6 +62,7 @@ class GetCurrencyWarningsUseCase(
getBeaconChainShutdownWarning(rawId = currency.network.id.rawId),
getAssetRequirementsWarning(userWalletId = userWalletId, currency = currency),
getMigrationFromMaticToPolWarning(currency),
getCloreMigrationWarning(currency),
)
}.flowOn(dispatchers.io)
}
@ -261,11 +262,20 @@ class GetCurrencyWarningsUseCase(
}
}
private fun getCloreMigrationWarning(currency: CryptoCurrency): CryptoCurrencyWarning? {
return if (currency.symbol == CLORE_SYMBOL && BlockchainUtils.isClore(currency.network.rawId)) {
CryptoCurrencyWarning.MigrationClore
} else {
null
}
}
private fun BigDecimal?.isZero(): Boolean {
return this?.signum() == 0
}
companion object {
private const val MATIC_SYMBOL = "MATIC"
private const val CLORE_SYMBOL = "CLORE"
}
}

View file

@ -59,6 +59,7 @@ internal class TokenDetailsNotificationsAnalyticsSender(
is TokenDetailsNotification.RequiredTrustlineWarning,
is TokenDetailsNotification.KoinosMana,
is TokenDetailsNotification.MigrationMaticToPol,
is TokenDetailsNotification.MigrationClore,
is TokenDetailsNotification.UsedOutdatedData,
-> null
}

View file

@ -258,6 +258,11 @@ internal sealed class TokenDetailsNotification(val config: NotificationConfig) {
subtitle = resourceReference(id = R.string.warning_matic_migration_message),
)
data object MigrationClore : Warning(
title = resourceReference(id = R.string.warning_clore_migration_title),
subtitle = resourceReference(id = R.string.warning_clore_migration_message),
)
data object UsedOutdatedData : TokenDetailsNotification(
config = NotificationConfig(
subtitle = resourceReference(R.string.warning_some_token_balances_not_updated),

View file

@ -155,6 +155,7 @@ internal class TokenDetailsNotificationConverter(
},
)
is CryptoCurrencyWarning.MigrationMaticToPol -> MigrationMaticToPol
is CryptoCurrencyWarning.MigrationClore -> MigrationClore
is CryptoCurrencyWarning.UsedOutdatedDataWarning -> UsedOutdatedData
}
}

View file

@ -115,6 +115,10 @@ object BlockchainUtils {
return blockchain == Blockchain.BSC || blockchain == Blockchain.BSCTestnet
}
fun isClore(blockchainId: String): Boolean {
return Blockchain.fromId(blockchainId) == Blockchain.Clore
}
data class BlockchainInfo(
val blockchainId: String,
val name: String,