Skip to content

fix: token consolidation fix for TRX TSS wallets#8567

Merged
bhuvanr159 merged 1 commit into
masterfrom
CHALO-423-sdk-fix
Apr 20, 2026
Merged

fix: token consolidation fix for TRX TSS wallets#8567
bhuvanr159 merged 1 commit into
masterfrom
CHALO-423-sdk-fix

Conversation

@bhuvanr159
Copy link
Copy Markdown
Contributor

@bhuvanr159 bhuvanr159 commented Apr 20, 2026

TICKET: CHALO-423

Summary

  • Add TSS wallet handling to TrxToken.verifyTransaction in sdk-coin-trx
  • Fixes missing required property recipients error thrown during TRX MPC token consolidation signing

Problem

When performing token consolidation on a TRX MPC (TSS/ECDSA) wallet, the SDK's consolidateAccount flow calls verifyTransaction on the TrxToken coin instance with walletType: 'tss'. The method immediately attempts
to resolve recipients from either txParams.recipients or txPrebuild.txInfo.recipients:

const recipients = txParams.recipients || (txPrebuild.txInfo as TronTxInfo).recipients;
if (!recipients) {                                                                                                                                                                                                    
  throw new Error('missing required property recipients');
}                                                                                                                                                                                                                     

For TSS consolidation:

  • txParams.recipients is undefined — the consolidateAccount call params carry no recipients
  • txPrebuild.txInfo is a ParsedTransaction (with inputs/outputs) returned by the platform, not a TronTxInfo with a recipients array

This causes the error to be thrown unconditionally for any TRX token consolidation on a TSS wallet.

Fix

Add an early return for walletType === 'tss', consistent with how Trx.verifyTransaction already handles TRC20 token transfers in TSS mode.

Trx.verifyTransaction has an explicit TSS branch that decodes raw_data_hex and validates TransferContract (native TRX) against recipients. For TriggerSmartContract (all TRC20 transfers), it already returns true
without any recipients check:

// trx.ts — existing behavior
if (walletType === 'tss') {
  ...                                                                                                                                                                                                                 
  if (decodedTx.contractType === Enum.ContractType.Transfer) {
    return this.validateTransferContract(...); // native TRX: validates                                                                                                                                               
  }
  return true; // TriggerSmartContract / TRC20: no recipients check
}                                                                                                                                                                                                                     

TrxToken.verifyTransaction now follows the same convention. The TSS signing protocol itself (ECDSA MPC) provides the cryptographic guarantee that the user approved the specific transaction being signed.

Impact

  • TSS TRX token wallets: verifyTransaction returns true for TSS, unblocking consolidation. Consistent with existing Trx.verifyTransaction behavior for TRC20 in TSS mode.
  • Non-TSS (on-chain multisig) TRX token wallets: completely unaffected — the full recipients validation path still runs when walletType is not 'tss'.

@bhuvanr159 bhuvanr159 requested a review from a team as a code owner April 20, 2026 04:55
TICKET: CHALO-423

TICKET: CHALO-423
@bhuvanr159 bhuvanr159 merged commit eb28af8 into master Apr 20, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants