Updated on 2026-08-14
This commit is contained in:
parent
00107432cf
commit
8bc33fe272
5 changed files with 89 additions and 37 deletions
|
|
@ -141,5 +141,45 @@
|
|||
"info":"swapTokensForExactETC",
|
||||
"source":"https://etc.blockscout.com/tx/0xd79e03ca6b71529c94d576ff78c55b4371e2ef3ff8f9a47007995e5b9e77f879",
|
||||
"name":"swap"
|
||||
},
|
||||
"0x6ab15071": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0x490d2f31faa3f2fdb1a9505888761d89aba1dd3dcfeb65f08651d094c1ee5021",
|
||||
"name": "buyVoucher"
|
||||
},
|
||||
"0xe4457a8a": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0xb7b67ea0261fe2067e285eb942be6883ef34b3d313160f3ce122cad3e91f95f7",
|
||||
"name": "buyVoucherPOL"
|
||||
},
|
||||
"0xc83ec04d": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0x0f7fa7154be5ae9bbe229963e3c0d3eea16b74311c50c4a35f3fcffc9519baed",
|
||||
"name": "sellVoucher_new"
|
||||
},
|
||||
"0xe570b78b": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0xde1dda9ff3aed8b1d5feff53f72032cbd106a57c1ae2e7fa80016349e2e68341",
|
||||
"name": "sellVoucher_newPOL"
|
||||
},
|
||||
"0xe97fddc2": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0x0478bc1229722c049eed737ef5a56baee6d7bde7ae21afad7a10e029700b378c",
|
||||
"name": "unstakeClaimTokens_new"
|
||||
},
|
||||
"0x8759c234": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0x79075778b470358bef4cfc25a74a43e7ae60f1bc292e0bca3ebc163fee8bf0c7",
|
||||
"name": "unstakeClaimTokens_newPOL"
|
||||
},
|
||||
"0xc7b8981c": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0xc2df9b41f7b3780a2dd06f0dfff72ecd5d3a5bde3f1d3f0eb926e14ff975e957",
|
||||
"name": "withdrawRewards"
|
||||
},
|
||||
"0xe0db556b": {
|
||||
"info": "stakePOL",
|
||||
"source": "https://etherscan.io/tx/0x96ee64ad31a045982a4776336d852af3c25dc39b6d01bea987aefd460b816773",
|
||||
"name": "withdrawRewardsPOL"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,19 +21,19 @@ internal class SdkTransactionTypeConverter(
|
|||
TxHistoryItem.TransactionType.Transfer
|
||||
}
|
||||
is TransactionType.TronStakingTransactionType.FreezeBalanceV2Contract -> {
|
||||
TxHistoryItem.TransactionType.TronStakingTransactionType.Stake
|
||||
TxHistoryItem.TransactionType.StakingTransactionType.Stake
|
||||
}
|
||||
is TransactionType.TronStakingTransactionType.UnfreezeBalanceV2Contract -> {
|
||||
TxHistoryItem.TransactionType.TronStakingTransactionType.Unstake
|
||||
TxHistoryItem.TransactionType.StakingTransactionType.Unstake
|
||||
}
|
||||
is TransactionType.TronStakingTransactionType.VoteWitnessContract -> {
|
||||
TxHistoryItem.TransactionType.TronStakingTransactionType.Vote(value.validatorAddress)
|
||||
TxHistoryItem.TransactionType.StakingTransactionType.Vote(value.validatorAddress)
|
||||
}
|
||||
is TransactionType.TronStakingTransactionType.WithdrawBalanceContract -> {
|
||||
TxHistoryItem.TransactionType.TronStakingTransactionType.ClaimRewards
|
||||
TxHistoryItem.TransactionType.StakingTransactionType.ClaimRewards
|
||||
}
|
||||
is TransactionType.TronStakingTransactionType.WithdrawExpireUnfreezeContract -> {
|
||||
TxHistoryItem.TransactionType.TronStakingTransactionType.Withdraw
|
||||
TxHistoryItem.TransactionType.StakingTransactionType.Withdraw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +43,18 @@ internal class SdkTransactionTypeConverter(
|
|||
"transfer" -> TxHistoryItem.TransactionType.Transfer
|
||||
"approve" -> TxHistoryItem.TransactionType.Approve
|
||||
"swap" -> TxHistoryItem.TransactionType.Swap
|
||||
"buyVoucher",
|
||||
"buyVoucherPOL",
|
||||
-> TxHistoryItem.TransactionType.StakingTransactionType.Stake
|
||||
"sellVoucher_new",
|
||||
"sellVoucher_newPOL",
|
||||
-> TxHistoryItem.TransactionType.StakingTransactionType.Unstake
|
||||
"unstakeClaimTokens_new",
|
||||
"unstakeClaimTokens_newPOL",
|
||||
-> TxHistoryItem.TransactionType.StakingTransactionType.Withdraw
|
||||
"withdrawRewards",
|
||||
"withdrawRewardsPOL",
|
||||
-> TxHistoryItem.TransactionType.StakingTransactionType.ClaimRewards
|
||||
null -> TxHistoryItem.TransactionType.UnknownOperation
|
||||
else -> TxHistoryItem.TransactionType.Operation(name = methodName.replaceFirstChar { it.titlecase() })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ data class TxHistoryItem(
|
|||
data object UnknownOperation : TransactionType
|
||||
data class Operation(val name: String) : TransactionType
|
||||
|
||||
sealed interface TronStakingTransactionType : TransactionType {
|
||||
data class Vote(val validatorAddress: String) : TronStakingTransactionType
|
||||
data object ClaimRewards : TronStakingTransactionType
|
||||
data object Stake : TronStakingTransactionType
|
||||
data object Unstake : TronStakingTransactionType
|
||||
data object Withdraw : TronStakingTransactionType
|
||||
sealed interface StakingTransactionType : TransactionType {
|
||||
data class Vote(val validatorAddress: String) : StakingTransactionType
|
||||
data object ClaimRewards : StakingTransactionType
|
||||
data object Stake : StakingTransactionType
|
||||
data object Unstake : StakingTransactionType
|
||||
data object Withdraw : StakingTransactionType
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ internal class TokenDetailsTxHistoryTransactionStateConverter(
|
|||
} else {
|
||||
when (type) {
|
||||
is TransactionType.Approve -> R.drawable.ic_doc_24
|
||||
is TransactionType.TronStakingTransactionType.Stake,
|
||||
is TransactionType.TronStakingTransactionType.Vote,
|
||||
is TransactionType.StakingTransactionType.Stake,
|
||||
is TransactionType.StakingTransactionType.Vote,
|
||||
-> R.drawable.ic_transaction_history_staking_24
|
||||
is TransactionType.TronStakingTransactionType.ClaimRewards,
|
||||
is TransactionType.StakingTransactionType.ClaimRewards,
|
||||
-> R.drawable.ic_transaction_history_claim_rewards_24
|
||||
is TransactionType.TronStakingTransactionType.Unstake,
|
||||
is TransactionType.TronStakingTransactionType.Withdraw,
|
||||
is TransactionType.StakingTransactionType.Unstake,
|
||||
is TransactionType.StakingTransactionType.Withdraw,
|
||||
-> R.drawable.ic_transaction_history_unstaking_24
|
||||
is TransactionType.Operation,
|
||||
is TransactionType.Swap,
|
||||
|
|
@ -72,11 +72,11 @@ internal class TokenDetailsTxHistoryTransactionStateConverter(
|
|||
is TransactionType.Swap -> resourceReference(R.string.common_swap)
|
||||
is TransactionType.Transfer -> resourceReference(R.string.common_transfer)
|
||||
is TransactionType.UnknownOperation -> resourceReference(R.string.transaction_history_operation)
|
||||
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.ClaimRewards -> resourceReference(R.string.common_claim_rewards)
|
||||
is TransactionType.TronStakingTransactionType.Withdraw -> resourceReference(R.string.staking_withdraw)
|
||||
is TransactionType.StakingTransactionType.Stake -> resourceReference(R.string.common_stake)
|
||||
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)
|
||||
}
|
||||
|
||||
private fun TxHistoryItem.extractSubtitle(): TextReference =
|
||||
|
|
@ -119,9 +119,9 @@ internal class TokenDetailsTxHistoryTransactionStateConverter(
|
|||
}
|
||||
|
||||
private fun TxHistoryItem.getAmount(): String {
|
||||
if (type is TransactionType.TronStakingTransactionType.Vote ||
|
||||
type == TransactionType.TronStakingTransactionType.ClaimRewards ||
|
||||
type == TransactionType.TronStakingTransactionType.Withdraw
|
||||
if (type is TransactionType.StakingTransactionType.Vote ||
|
||||
type == TransactionType.StakingTransactionType.ClaimRewards ||
|
||||
type == TransactionType.StakingTransactionType.Withdraw
|
||||
) {
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,13 +49,13 @@ internal class TxHistoryItemStateConverter(
|
|||
} else {
|
||||
when (type) {
|
||||
is TransactionType.Approve -> R.drawable.ic_doc_24
|
||||
is TransactionType.TronStakingTransactionType.Stake,
|
||||
is TransactionType.TronStakingTransactionType.Vote,
|
||||
is TransactionType.StakingTransactionType.Stake,
|
||||
is TransactionType.StakingTransactionType.Vote,
|
||||
-> R.drawable.ic_transaction_history_staking_24
|
||||
is TransactionType.TronStakingTransactionType.ClaimRewards,
|
||||
is TransactionType.StakingTransactionType.ClaimRewards,
|
||||
-> R.drawable.ic_transaction_history_claim_rewards_24
|
||||
is TransactionType.TronStakingTransactionType.Unstake,
|
||||
is TransactionType.TronStakingTransactionType.Withdraw,
|
||||
is TransactionType.StakingTransactionType.Unstake,
|
||||
is TransactionType.StakingTransactionType.Withdraw,
|
||||
-> R.drawable.ic_transaction_history_unstaking_24
|
||||
is TransactionType.Operation,
|
||||
is TransactionType.Swap,
|
||||
|
|
@ -70,11 +70,11 @@ internal class TxHistoryItemStateConverter(
|
|||
is TransactionType.Operation -> stringReference(type.name)
|
||||
is TransactionType.Swap -> resourceReference(R.string.common_swap)
|
||||
is TransactionType.Transfer -> resourceReference(R.string.common_transfer)
|
||||
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.ClaimRewards -> resourceReference(R.string.common_claim_rewards)
|
||||
is TransactionType.TronStakingTransactionType.Withdraw -> { resourceReference(R.string.staking_withdraw) }
|
||||
is TransactionType.StakingTransactionType.Stake -> resourceReference(R.string.common_stake)
|
||||
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.UnknownOperation -> resourceReference(R.string.transaction_history_operation)
|
||||
}
|
||||
|
||||
|
|
@ -119,9 +119,9 @@ internal class TxHistoryItemStateConverter(
|
|||
}
|
||||
|
||||
private fun TxHistoryItem.getAmount(): String {
|
||||
if (type is TransactionType.TronStakingTransactionType.Vote ||
|
||||
type == TransactionType.TronStakingTransactionType.ClaimRewards ||
|
||||
type == TransactionType.TronStakingTransactionType.Withdraw
|
||||
if (type is TransactionType.StakingTransactionType.Vote ||
|
||||
type == TransactionType.StakingTransactionType.ClaimRewards ||
|
||||
type == TransactionType.StakingTransactionType.Withdraw
|
||||
) {
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue