Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-24 16:47:06 +03:00
parent cf021480f9
commit a14eaba613
10 changed files with 77 additions and 26 deletions

View file

@ -50,10 +50,12 @@ internal class TxHistoryItemStateConverter(
is TransactionType.Approve -> R.drawable.ic_doc_24
is TransactionType.TronStakingTransactionType.Stake,
is TransactionType.TronStakingTransactionType.Vote,
-> R.drawable.ic_transaction_history_staking
is TransactionType.TronStakingTransactionType.Withdraw,
-> R.drawable.ic_transaction_history_staking_24
is TransactionType.TronStakingTransactionType.ClaimRewards,
-> R.drawable.ic_transaction_history_claim_rewards_24
is TransactionType.TronStakingTransactionType.Unstake,
-> R.drawable.ic_transaction_history_unstaking
is TransactionType.TronStakingTransactionType.Withdraw,
-> R.drawable.ic_transaction_history_unstaking_24
is TransactionType.Operation,
is TransactionType.Swap,
is TransactionType.Transfer,
@ -70,7 +72,8 @@ internal class TxHistoryItemStateConverter(
is TransactionType.TronStakingTransactionType.Stake -> resourceReference(R.string.common_stake)
is TransactionType.TronStakingTransactionType.Unstake -> resourceReference(R.string.common_unstake)
is TransactionType.TronStakingTransactionType.Vote -> resourceReference(R.string.staking_vote)
is TransactionType.TronStakingTransactionType.Withdraw -> resourceReference(R.string.staking_withdraw)
is TransactionType.TronStakingTransactionType.ClaimRewards -> resourceReference(R.string.common_claim_rewards)
is TransactionType.TronStakingTransactionType.Withdraw -> { resourceReference(R.string.staking_withdraw) }
is TransactionType.UnknownOperation -> resourceReference(R.string.transaction_history_operation)
}
@ -96,9 +99,13 @@ internal class TxHistoryItemStateConverter(
},
formatArgs = wrappedList(interactionAddress.address.toBriefAddressFormat()),
)
is InteractionAddressType.Staking -> resourceReference(
id = R.string.common_staking,
is InteractionAddressType.Validator -> resourceReference(
id = R.string.transaction_history_transaction_validator,
formatArgs = wrappedList(interactionAddress.address.toBriefAddressFormat()),
)
null -> {
TextReference.EMPTY
}
}
private fun TxHistoryItem.extractDirection() =
@ -111,7 +118,8 @@ internal class TxHistoryItemStateConverter(
}
private fun TxHistoryItem.getAmount(): String {
if (type == TransactionType.TronStakingTransactionType.Vote ||
if (type is TransactionType.TronStakingTransactionType.Vote ||
type == TransactionType.TronStakingTransactionType.ClaimRewards ||
type == TransactionType.TronStakingTransactionType.Withdraw
) {
return ""