Updated on 2026-08-14

This commit is contained in:
Tangem 2024-10-03 18:31:26 +03:00
commit a7e1d7b449
4 changed files with 23 additions and 17 deletions

View file

@ -79,6 +79,7 @@ fun NavigationPrimaryButton(primaryButton: NavigationButton?, modifier: Modifier
onClick = button.onClick,
showProgress = button.showProgress,
colors = TangemButtonsDefaults.primaryButtonColors,
textStyle = TangemTheme.typography.subtitle1,
icon = icon,
modifier = Modifier.fillMaxWidth(),
)
@ -134,6 +135,7 @@ private fun ExtraButtons(extraButtons: ImmutableList<NavigationButton>?, txUrl:
TangemButton(
text = button.textReference.resolveReference(),
icon = icon,
textStyle = TangemTheme.typography.subtitle1,
onClick = rememberHapticFeedback(state = button, onAction = button.onClick),
modifier = Modifier.weight(1f),
enabled = button.isEnabled,

View file

@ -766,7 +766,7 @@
<string name="staking_stake_more">Застейкать еще</string>
<string name="staking_summary_description_text">Вы стейкаете %1$s и будете получать %2$s ежегодно</string>
<string name="staking_tap_to_unlock">Нажмите для разблокировки</string>
<string name="staking_tap_to_unlock_or_vote">Нажмите для разблокировки или голосования</string>
<string name="staking_tap_to_unlock_or_vote">Нажмите для разблокировки</string>
<string name="staking_tap_to_withdraw">Нажмите для вывода</string>
<string name="staking_title_stake">Застейкать %s</string>
<string name="staking_title_unstake">Вывести %s</string>

View file

@ -127,20 +127,24 @@ internal class ManagedCryptoCurrencyFactory {
): ManagedCryptoCurrency? {
if (coinResponse.networks.isEmpty() || !coinResponse.active) return null
val updatedNetworks = coinResponse.networks.applyL2Compatibility(coinResponse.id)
val availableNetworks = coinResponse.networks
.applyL2Compatibility(coinResponse.id)
.mapNotNull { network ->
createSource(
networkId = network.networkId,
contractAddress = network.contractAddress,
decimals = network.decimalCount?.toInt(),
derivationStyleProvider = derivationStyleProvider,
)
}
.ifEmpty { return null }
return ManagedCryptoCurrency.Token(
id = ManagedCryptoCurrency.ID(coinResponse.id),
name = coinResponse.name,
symbol = coinResponse.symbol,
iconUrl = getIconUrl(coinResponse.id, imageHost),
availableNetworks = updatedNetworks.mapNotNull { network ->
createSource(
networkId = network.networkId,
contractAddress = network.contractAddress,
decimals = network.decimalCount?.toInt() ?: return@mapNotNull null,
derivationStyleProvider = derivationStyleProvider,
)
},
availableNetworks = availableNetworks,
addedIn = findAddedInNetworks(coinResponse.id, tokensResponse, derivationStyleProvider),
)
}
@ -148,7 +152,7 @@ internal class ManagedCryptoCurrencyFactory {
private fun createSource(
networkId: String,
contractAddress: String?,
decimals: Int,
decimals: Int?,
derivationStyleProvider: DerivationStyleProvider?,
extraDerivationPath: String? = null,
): SourceNetwork? {
@ -158,18 +162,18 @@ internal class ManagedCryptoCurrencyFactory {
val network = getNetwork(blockchain, extraDerivationPath, derivationStyleProvider) ?: return null
return if (contractAddress.isNullOrBlank()) {
SourceNetwork.Main(
return when {
contractAddress.isNullOrBlank() -> SourceNetwork.Main(
network = network,
decimals = blockchain.decimals(),
isL2Network = l2BlockchainsList.contains(blockchain),
)
} else {
SourceNetwork.Default(
network.canHandleTokens -> SourceNetwork.Default(
network = network,
decimals = decimals,
decimals = decimals ?: return null,
contractAddress = contractAddress,
)
else -> null
}
}

View file

@ -89,7 +89,7 @@ markdownComposeView = "0.5.4"
# endregion Other libraries
# region Tangem
tangemBlockchainSdk = "release-app_5.16-807"
tangemBlockchainSdk = "release-app_5.16-813"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "release-app_5.16-386"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^