Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-11 14:03:37 +04:00
parent 19fdd19139
commit 078e215ad7
18 changed files with 318 additions and 160 deletions

View file

@ -20,9 +20,14 @@ internal class TokenDetailsBalanceSelectStateConverter(
override fun convert(value: TokenBalanceSegmentedButtonConfig): TokenDetailsState {
return with(currentStateProvider()) {
if (stakingBlocksState !is StakingBlockUM.Staked) return this
val cryptoCurrencyStatus = cryptoCurrencyStatusProvider() ?: return this
if (stakingBlocksState !is StakingBlockUM.Staked &&
stakingBlocksState !is StakingBlockUM.TemporaryUnavailable
) {
return this
}
val yieldBalance = cryptoCurrencyStatus.value.yieldBalance as? YieldBalance.Data
val stakingCryptoAmount = yieldBalance?.getTotalWithRewardsStakingBalance()
val stakingFiatAmount = stakingCryptoAmount?.let { cryptoCurrencyStatus.value.fiatRate?.multiply(it) }