diff --git a/app/src/test/kotlin/com/tangem/tap/domain/card/CryptoCurrenciesMocks.kt b/app/src/test/kotlin/com/tangem/tap/domain/card/CryptoCurrenciesMocks.kt index 07f96f215c..2f2e54876b 100644 --- a/app/src/test/kotlin/com/tangem/tap/domain/card/CryptoCurrenciesMocks.kt +++ b/app/src/test/kotlin/com/tangem/tap/domain/card/CryptoCurrenciesMocks.kt @@ -59,7 +59,7 @@ internal class CryptoCurrenciesMocks(private val scanResponse: ScanResponse) { standardType = getNetworkStandardType(blockchain), hasFiatFeeRate = blockchain.feePaidCurrency() !is FeePaidCurrency.FeeResource, canHandleTokens = false, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ) return factory.createCoin(network = network) @@ -87,7 +87,7 @@ internal class CryptoCurrenciesMocks(private val scanResponse: ScanResponse) { standardType = Network.StandardType.ERC20, hasFiatFeeRate = true, canHandleTokens = true, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ), name = "NEVER-MIND", symbol = "NEVER-MIND", diff --git a/data/common/src/main/kotlin/com/tangem/data/common/currency/NetworkOperations.kt b/data/common/src/main/kotlin/com/tangem/data/common/currency/NetworkOperations.kt index c01216de24..23ba62d9fc 100644 --- a/data/common/src/main/kotlin/com/tangem/data/common/currency/NetworkOperations.kt +++ b/data/common/src/main/kotlin/com/tangem/data/common/currency/NetworkOperations.kt @@ -41,7 +41,7 @@ fun getNetwork( standardType = getNetworkStandardType(blockchain), hasFiatFeeRate = blockchain.feePaidCurrency() !is FeePaidCurrency.FeeResource, canHandleTokens = canHandleTokens, - transactionExtras = blockchain.getSupportedTransactionExtras(), + transactionExtrasType = blockchain.getSupportedTransactionExtras(), ) } @@ -70,7 +70,7 @@ fun getNetwork( scanResponse.cardTypesResolver, excludedBlockchains, ), - transactionExtras = blockchain.getSupportedTransactionExtras(), + transactionExtrasType = blockchain.getSupportedTransactionExtras(), ) } @@ -150,9 +150,9 @@ private fun getDefaultDerivationPath( } @Suppress("LongMethod") -private fun Blockchain.getSupportedTransactionExtras(): Network.TransactionExtras { +private fun Blockchain.getSupportedTransactionExtras(): Network.TransactionExtrasType { return when (this) { - Blockchain.XRP -> Network.TransactionExtras.DESTINATION_TAG + Blockchain.XRP -> Network.TransactionExtrasType.DESTINATION_TAG Blockchain.Binance, Blockchain.TON, Blockchain.Cosmos, @@ -164,7 +164,7 @@ private fun Blockchain.getSupportedTransactionExtras(): Network.TransactionExtra Blockchain.Sei, Blockchain.InternetComputer, Blockchain.Casper, - -> Network.TransactionExtras.MEMO + -> Network.TransactionExtrasType.MEMO // region Other blockchains Blockchain.Unknown, Blockchain.Arbitrum, @@ -288,7 +288,7 @@ private fun Blockchain.getSupportedTransactionExtras(): Network.TransactionExtra Blockchain.Canxium, Blockchain.Chiliz, Blockchain.ChilizTestnet, - -> Network.TransactionExtras.NONE + -> Network.TransactionExtrasType.NONE // endregion } } \ No newline at end of file diff --git a/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/Network.kt b/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/Network.kt index 5c9f8277bb..e976a7786a 100644 --- a/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/Network.kt +++ b/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/Network.kt @@ -19,7 +19,7 @@ import kotlinx.serialization.Serializable * that cannot be represented in a fiat currency. * (For those blockchains that have FeeResource instead of a standard type of fee) * @property canHandleTokens Indicates whether the network can handle tokens. - * @property transactionExtras The type of extras supported for sending a transaction. + * @property transactionExtrasType The type of extras supported for sending a transaction. */ @Serializable data class Network( @@ -32,7 +32,7 @@ data class Network( val standardType: StandardType, val hasFiatFeeRate: Boolean, val canHandleTokens: Boolean, - val transactionExtras: TransactionExtras, + val transactionExtrasType: TransactionExtrasType, ) { init { @@ -135,7 +135,7 @@ data class Network( /** * Represents the supported type of extras for sending a transaction. * */ - enum class TransactionExtras { + enum class TransactionExtrasType { /** No transaction extras supported */ NONE, diff --git a/domain/tokens/src/test/kotlin/com/tangem/domain/tokens/mock/MockNetworks.kt b/domain/tokens/src/test/kotlin/com/tangem/domain/tokens/mock/MockNetworks.kt index 9d5caf4cb8..903bc4f2ec 100644 --- a/domain/tokens/src/test/kotlin/com/tangem/domain/tokens/mock/MockNetworks.kt +++ b/domain/tokens/src/test/kotlin/com/tangem/domain/tokens/mock/MockNetworks.kt @@ -23,7 +23,7 @@ internal object MockNetworks { derivationPath = Network.DerivationPath.None, hasFiatFeeRate = true, canHandleTokens = true, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ) val network2 = Network( @@ -36,7 +36,7 @@ internal object MockNetworks { derivationPath = Network.DerivationPath.None, hasFiatFeeRate = true, canHandleTokens = true, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ) val network3 = Network( @@ -49,7 +49,7 @@ internal object MockNetworks { derivationPath = Network.DerivationPath.None, hasFiatFeeRate = true, canHandleTokens = true, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ) val networkStatus1 = NetworkStatus( diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt index 9ef76cfa71..091d67b17c 100644 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewCustomTokenSelectorComponent.kt @@ -62,7 +62,7 @@ internal class PreviewCustomTokenSelectorComponent( standardType = Network.StandardType.ERC20, hasFiatFeeRate = false, canHandleTokens = false, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ), name = "Network $index", type = "N$index", diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewManageTokensComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewManageTokensComponent.kt index b6aab08f17..9a764934fa 100644 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewManageTokensComponent.kt +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewManageTokensComponent.kt @@ -161,7 +161,7 @@ internal class PreviewManageTokensComponent( standardType = Network.StandardType.ERC20, hasFiatFeeRate = false, canHandleTokens = false, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ), name = "NETWORK$networkIndex", type = "N$networkIndex", diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewOnboardingManageTokensComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewOnboardingManageTokensComponent.kt index af0875c822..ed88583e73 100644 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewOnboardingManageTokensComponent.kt +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/component/preview/PreviewOnboardingManageTokensComponent.kt @@ -101,7 +101,7 @@ internal class PreviewOnboardingManageTokensComponent( standardType = Network.StandardType.ERC20, hasFiatFeeRate = false, canHandleTokens = false, - transactionExtras = Network.TransactionExtras.NONE, + transactionExtrasType = Network.TransactionExtrasType.NONE, ), name = "NETWORK$networkIndex", type = "N$networkIndex", diff --git a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/TokenActionsHandler.kt b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/TokenActionsHandler.kt index a89188c0cf..34923a5f2d 100644 --- a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/TokenActionsHandler.kt +++ b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/TokenActionsHandler.kt @@ -110,7 +110,7 @@ internal class TokenActionsHandler @AssistedInject constructor( addresses = networkAddress.availableAddresses .mapToAddressModels(currency) .toImmutableList(), - showMemoDisclaimer = currency.network.transactionExtras != Network.TransactionExtras.NONE, + showMemoDisclaimer = currency.network.transactionExtrasType != Network.TransactionExtrasType.NONE, onCopyClick = {}, onShareClick = {}, ), diff --git a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/recipient/SendRecipientMemoFieldConverter.kt b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/recipient/SendRecipientMemoFieldConverter.kt index e15ff6d8d0..273b6e0b6f 100644 --- a/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/recipient/SendRecipientMemoFieldConverter.kt +++ b/features/send/impl/src/main/java/com/tangem/features/send/impl/presentation/state/recipient/SendRecipientMemoFieldConverter.kt @@ -22,15 +22,15 @@ internal class SendRecipientMemoFieldConverter( val cryptoCurrency = cryptoCurrencyStatus().currency val memo = memoValue ?: "" - return when (cryptoCurrency.network.transactionExtras) { - Network.TransactionExtras.NONE -> null - Network.TransactionExtras.MEMO -> convert( + return when (cryptoCurrency.network.transactionExtrasType) { + Network.TransactionExtrasType.NONE -> null + Network.TransactionExtrasType.MEMO -> convert( value = Data( memo = memo, label = R.string.send_extras_hint_memo, ), ) - Network.TransactionExtras.DESTINATION_TAG -> convert( + Network.TransactionExtrasType.DESTINATION_TAG -> convert( value = Data( memo = memo, label = R.string.send_destination_tag_field, diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt index 613506fa94..649869ebc8 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsStateFactory.kt @@ -248,7 +248,7 @@ internal class TokenDetailsStateFactory( symbol = currency.symbol, network = currency.network.name, addresses = networkAddress.availableAddresses.mapToAddressModels(currency).toImmutableList(), - showMemoDisclaimer = currency.network.transactionExtras != Network.TransactionExtras.NONE, + showMemoDisclaimer = currency.network.transactionExtrasType != Network.TransactionExtrasType.NONE, onCopyClick = sendCopyAnalyticsEvent, onShareClick = sendShareAnalyticsEvent, ), diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt index 11026c9579..f93d82366d 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/VisaWalletIntents.kt @@ -72,7 +72,7 @@ internal class VisaWalletIntentsImplementor @Inject constructor( symbol = currency.symbol, network = currency.network.name, addresses = addresses.mapToAddressModels(currency).toImmutableList(), - showMemoDisclaimer = currency.network.transactionExtras != Network.TransactionExtras.NONE, + showMemoDisclaimer = currency.network.transactionExtrasType != Network.TransactionExtrasType.NONE, onCopyClick = { /* no-op */ }, onShareClick = { /* no-op */ }, ) diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt index bf1227fb07..531c4507b0 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/intents/WalletCurrencyActionsClickIntents.kt @@ -236,7 +236,7 @@ internal class WalletCurrencyActionsClickIntentsImplementor @Inject constructor( symbol = currency.symbol, network = currency.network.name, addresses = addresses.mapToAddressModels(currency).toImmutableList(), - showMemoDisclaimer = currency.network.transactionExtras != Network.TransactionExtras.NONE, + showMemoDisclaimer = currency.network.transactionExtrasType != Network.TransactionExtrasType.NONE, onCopyClick = { analyticsEventHandler.send(TokenReceiveAnalyticsEvent.ButtonCopyAddress(currency.symbol)) },