Updated on 2026-08-14
This commit is contained in:
parent
3455dea61a
commit
2a4a1bf8a1
12 changed files with 25 additions and 25 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 = {},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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 */ },
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue