From 90b795635a683d48b1e80e59a5bfd6c13bd677d4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 4 Nov 2024 13:34:20 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../src/main/assets/contract_methods.json | 20 +++++++++++++++++++ .../utils/SdkTransactionTypeConverter.kt | 4 ++++ .../domain/txhistory/models/TxHistoryItem.kt | 1 + ...tailsTxHistoryTransactionStateConverter.kt | 2 ++ .../converter/TxHistoryItemStateConverter.kt | 4 +++- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/domain/legacy/src/main/assets/contract_methods.json b/domain/legacy/src/main/assets/contract_methods.json index 6a8d6dafc4..671f0b7d6b 100644 --- a/domain/legacy/src/main/assets/contract_methods.json +++ b/domain/legacy/src/main/assets/contract_methods.json @@ -181,5 +181,25 @@ "info": "stakePOL", "source": "https://etherscan.io/tx/0x96ee64ad31a045982a4776336d852af3c25dc39b6d01bea987aefd460b816773", "name": "withdrawRewardsPOL" + }, + "0x982ef0a7": { + "info": "stakeBSC", + "source": "https://bscscan.com/tx/0xd5ab62ee525f3dc2821de44c31e278f2b49a0202f4e0279e6d0fced05a034595", + "name": "delegate" + }, + "0x4d99dd16": { + "info": "stakeBSC", + "source": "https://bscscan.com/tx/0x866ba857e96051d7cea271723fccde4113c9909dccb534202a2a87ad4c56cb67", + "name": "undelegate" + }, + "0x59491871": { + "info": "stakeBSC", + "source": "https://bscscan.com/tx/0x69615650be1e8a6d94258483f4e880fc6b4d4d9ae53d967c82d847691d91dd71", + "name": "redelegate" + }, + "0xaad3ec96": { + "info": "stakeBSC", + "source": "https://bscscan.com/tx/0xfcbeac6e0a4ba5768d97d14b5115d08dda92defa8a8deee8bba34e2f0655c52b", + "name": "claim" } } diff --git a/domain/legacy/src/main/java/com/tangem/domain/walletmanager/utils/SdkTransactionTypeConverter.kt b/domain/legacy/src/main/java/com/tangem/domain/walletmanager/utils/SdkTransactionTypeConverter.kt index fa74187f5a..4b2fb14d78 100644 --- a/domain/legacy/src/main/java/com/tangem/domain/walletmanager/utils/SdkTransactionTypeConverter.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/walletmanager/utils/SdkTransactionTypeConverter.kt @@ -45,16 +45,20 @@ internal class SdkTransactionTypeConverter( "swap" -> TxHistoryItem.TransactionType.Swap "buyVoucher", "buyVoucherPOL", + "delegate", -> TxHistoryItem.TransactionType.StakingTransactionType.Stake "sellVoucher_new", "sellVoucher_newPOL", + "undelegate", -> TxHistoryItem.TransactionType.StakingTransactionType.Unstake "unstakeClaimTokens_new", "unstakeClaimTokens_newPOL", + "claim", -> TxHistoryItem.TransactionType.StakingTransactionType.Withdraw "withdrawRewards", "withdrawRewardsPOL", -> TxHistoryItem.TransactionType.StakingTransactionType.ClaimRewards + "redelegate" -> TxHistoryItem.TransactionType.StakingTransactionType.Restake null -> TxHistoryItem.TransactionType.UnknownOperation else -> TxHistoryItem.TransactionType.Operation(name = methodName.replaceFirstChar { it.titlecase() }) } diff --git a/domain/txhistory/models/src/main/kotlin/com/tangem/domain/txhistory/models/TxHistoryItem.kt b/domain/txhistory/models/src/main/kotlin/com/tangem/domain/txhistory/models/TxHistoryItem.kt index 526be8774c..f331f6a2a1 100644 --- a/domain/txhistory/models/src/main/kotlin/com/tangem/domain/txhistory/models/TxHistoryItem.kt +++ b/domain/txhistory/models/src/main/kotlin/com/tangem/domain/txhistory/models/TxHistoryItem.kt @@ -46,6 +46,7 @@ data class TxHistoryItem( data object Stake : StakingTransactionType data object Unstake : StakingTransactionType data object Withdraw : StakingTransactionType + data object Restake : StakingTransactionType } } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/txhistory/TokenDetailsTxHistoryTransactionStateConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/txhistory/TokenDetailsTxHistoryTransactionStateConverter.kt index 91863e54cd..4091224cdc 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/txhistory/TokenDetailsTxHistoryTransactionStateConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/txhistory/TokenDetailsTxHistoryTransactionStateConverter.kt @@ -52,6 +52,7 @@ internal class TokenDetailsTxHistoryTransactionStateConverter( is TransactionType.Approve -> R.drawable.ic_doc_24 is TransactionType.StakingTransactionType.Stake, is TransactionType.StakingTransactionType.Vote, + is TransactionType.StakingTransactionType.Restake, -> R.drawable.ic_transaction_history_staking_24 is TransactionType.StakingTransactionType.ClaimRewards, -> R.drawable.ic_transaction_history_claim_rewards_24 @@ -77,6 +78,7 @@ internal class TokenDetailsTxHistoryTransactionStateConverter( is TransactionType.StakingTransactionType.Vote -> resourceReference(R.string.staking_vote) is TransactionType.StakingTransactionType.ClaimRewards -> resourceReference(R.string.common_claim_rewards) is TransactionType.StakingTransactionType.Withdraw -> resourceReference(R.string.staking_withdraw) + is TransactionType.StakingTransactionType.Restake -> resourceReference(R.string.staking_restake) } private fun TxHistoryItem.extractSubtitle(): TextReference = diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/TxHistoryItemStateConverter.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/TxHistoryItemStateConverter.kt index 36ea12af34..10e1cb4f76 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/TxHistoryItemStateConverter.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/transformers/converter/TxHistoryItemStateConverter.kt @@ -51,6 +51,7 @@ internal class TxHistoryItemStateConverter( is TransactionType.Approve -> R.drawable.ic_doc_24 is TransactionType.StakingTransactionType.Stake, is TransactionType.StakingTransactionType.Vote, + is TransactionType.StakingTransactionType.Restake, -> R.drawable.ic_transaction_history_staking_24 is TransactionType.StakingTransactionType.ClaimRewards, -> R.drawable.ic_transaction_history_claim_rewards_24 @@ -74,7 +75,8 @@ internal class TxHistoryItemStateConverter( is TransactionType.StakingTransactionType.Unstake -> resourceReference(R.string.common_unstake) is TransactionType.StakingTransactionType.Vote -> resourceReference(R.string.staking_vote) is TransactionType.StakingTransactionType.ClaimRewards -> resourceReference(R.string.common_claim_rewards) - is TransactionType.StakingTransactionType.Withdraw -> { resourceReference(R.string.staking_withdraw) } + is TransactionType.StakingTransactionType.Withdraw -> resourceReference(R.string.staking_withdraw) + is TransactionType.StakingTransactionType.Restake -> resourceReference(R.string.staking_restake) is TransactionType.UnknownOperation -> resourceReference(R.string.transaction_history_operation) }