From ea7bca649419308e3e1eab7d94c70bdb2ae28375 Mon Sep 17 00:00:00 2001 From: Noel Hawat Date: Tue, 7 Oct 2025 10:37:30 -0400 Subject: [PATCH] feat(sdk-core): staking tx STX validate type the staking tx type will always be contract call type but the one in the staking params is staking lock so the checks will fail need to validate it is actually `ContractCall` SC-3403 TICKET: SC-3403 --- modules/sdk-core/src/bitgo/staking/stakingWallet.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/sdk-core/src/bitgo/staking/stakingWallet.ts b/modules/sdk-core/src/bitgo/staking/stakingWallet.ts index 8458ec76f3..574aadb0df 100644 --- a/modules/sdk-core/src/bitgo/staking/stakingWallet.ts +++ b/modules/sdk-core/src/bitgo/staking/stakingWallet.ts @@ -184,6 +184,10 @@ export class StakingWallet implements IStakingWallet { ); } + private isStx() { + return this.wallet.baseCoin.getFamily() === 'stx'; + } + private isTrxStaking(transaction: StakingTransaction) { return this.wallet.baseCoin.getFamily() === 'trx'; } @@ -448,7 +452,8 @@ export class StakingWallet implements IStakingWallet { if ( buildParams?.type && (explainedTransaction as any).type !== undefined && - TransactionType[buildParams.type] !== (explainedTransaction as any).type + ((this.isStx() && TransactionType.ContractCall !== (explainedTransaction as any).type) || // for STX the tx type should always ContractCall + (!this.isStx() && TransactionType[buildParams.type] !== (explainedTransaction as any).type)) ) { mismatchErrors.push( `Transaction type mismatch. Expected: '${buildParams.type}', Got: '${(explainedTransaction as any).type}'`