Updated on 2026-08-14

This commit is contained in:
Tangem 2024-01-29 21:40:07 +05:00
parent 149e225550
commit 4e99bbbf88
4 changed files with 9 additions and 7 deletions

View file

@ -20,7 +20,7 @@ object FoundTokenConverter : Converter<CoinsResponse.Coin, FoundToken> {
network = value.networks.firstOrNull()?.let { network -> network = value.networks.firstOrNull()?.let { network ->
FoundToken.Network( FoundToken.Network(
id = network.networkId, id = network.networkId,
address = requireNotNull(network.contractAddress), contractAddress = requireNotNull(network.contractAddress),
decimalCount = requireNotNull(network.decimalCount).toString(), decimalCount = requireNotNull(network.decimalCount).toString(),
) )
} ?: error("Found token networks is empty"), } ?: error("Found token networks is empty"),

View file

@ -22,9 +22,9 @@ data class FoundToken(
/** /**
* Found token network * Found token network
* *
* @property id id * @property id id
* @property address address * @property contractAddress address
* @property decimalCount decimal count * @property decimalCount decimal count
*/ */
data class Network(val id: String, val address: String, val decimalCount: String) data class Network(val id: String, val contractAddress: String, val decimalCount: String)
} }

View file

@ -827,11 +827,13 @@ internal class AddCustomTokenViewModel @Inject constructor(
val currency = when (getCustomTokenType()) { val currency = when (getCustomTokenType()) {
CustomTokenType.TOKEN -> { CustomTokenType.TOKEN -> {
val contractAddress = foundToken?.network?.contractAddress
?: uiState.form.contractAddressInputField.value
CustomCurrency.CustomToken( CustomCurrency.CustomToken(
token = Token( token = Token(
name = uiState.form.tokenNameInputField.value, name = uiState.form.tokenNameInputField.value,
symbol = uiState.form.tokenSymbolInputField.value, symbol = uiState.form.tokenSymbolInputField.value,
contractAddress = uiState.form.contractAddressInputField.value, contractAddress = contractAddress,
decimals = requireNotNull(uiState.form.decimalsInputField.value.toIntOrNull()), decimals = requireNotNull(uiState.form.decimalsInputField.value.toIntOrNull()),
id = foundToken?.id, id = foundToken?.id,
), ),

View file

@ -85,7 +85,7 @@ spr-client = "3.6.2"
# endregion Other libraries # endregion Other libraries
# region Tangem # region Tangem
tangemBlockchainSdk = "release-app_5.5-465" tangemBlockchainSdk = "release-app_5.5-466"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.5-323" tangemCardSdk = "release-app_5.5-323"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^