File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
modules/sdk-coin-ton/src/lib Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ export class Transaction extends BaseTransaction {
317317 payload = WITHDRAW_OPCODE + queryId . toString ( 16 ) . padStart ( 16 , '0' ) + withdrawAmount ;
318318 this . transactionType = TransactionType . SingleNominatorWithdraw ;
319319 } else if ( opcode === JETTON_TRANSFER_OPCODE ) {
320+ this . transactionType = TransactionType . SendToken ;
320321 const queryId = order . loadUint ( 64 ) . toNumber ( ) ;
321322 if ( queryId !== 0 ) throw new Error ( 'invalid queryId for jetton transfer' ) ;
322323
Original file line number Diff line number Diff line change @@ -15,8 +15,18 @@ export class TransactionBuilderFactory extends BaseTransactionBuilderFactory {
1515 from ( raw : string ) : TransactionBuilder {
1616 let builder : TransactionBuilder ;
1717 try {
18- const tx = this . _coinConfig . isToken ? new TokenTransaction ( this . _coinConfig ) : new Transaction ( this . _coinConfig ) ;
19- tx . fromRawTransaction ( raw ) ;
18+ const checkTx = new Transaction ( this . _coinConfig ) ;
19+ checkTx . fromRawTransaction ( raw ) ;
20+
21+ let tx : Transaction ;
22+ if ( checkTx . type === TransactionType . SendToken ) {
23+ // It's a token transaction, so use TokenTransaction for proper parsing
24+ tx = new TokenTransaction ( this . _coinConfig ) ;
25+ tx . fromRawTransaction ( raw ) ;
26+ } else {
27+ // It's a regular transaction, use the already parsed one
28+ tx = checkTx ;
29+ }
2030 switch ( tx . type ) {
2131 case TransactionType . Send :
2232 builder = this . getTransferBuilder ( ) ;
You can’t perform that action at this time.
0 commit comments