Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-16 12:59:42 +02:00
parent 6311ce2e3c
commit 6dc6e28205
4 changed files with 41 additions and 0 deletions

View file

@ -83,6 +83,16 @@ internal class YieldBalancesConverter(
val blockchainId = cryptoCurrencyStatus.currency.network.rawId
val isCoin = cryptoCurrencyStatus.currency.id.isCoin
val p2pEthPoolBalance = stakingBalance as? StakingBalance.Data.P2PEthPool
if (p2pEthPoolBalance != null) {
val hasEarnedRewards = !p2pEthPoolBalance.totalRewards.isZero()
return if (hasEarnedRewards) {
RewardBlockType.EthereumEarnedRewards
} else {
RewardBlockType.RewardUnavailable.DefaultRewardUnavailable
}
}
val stakeKitBalance = stakingBalance as? StakingBalance.Data.StakeKit
val rewards = stakeKitBalance?.balance?.items
?.filter { it.type == BalanceType.REWARDS && !it.amount.isZero() }

View file

@ -243,6 +243,12 @@ private fun StakingRewardBlock(
append(reward.rewardsCrypto.orMaskWithStars(isBalanceHidden))
} to TangemTheme.colors.text.primary1
}
RewardBlockType.EthereumEarnedRewards -> {
resourceReference(
id = R.string.staking_details_autocompound_rewards_earned,
formatArgs = wrappedList(reward.rewardsCrypto.orMaskWithStars(isBalanceHidden)),
) to TangemTheme.colors.text.primary1
}
RewardBlockType.RewardUnavailable.DefaultRewardUnavailable -> {
resourceReference(R.string.staking_details_auto_claiming_rewards_daily_text) to
TangemTheme.colors.text.tertiary