File tree Expand file tree Collapse file tree 3 files changed +60
-2
lines changed Expand file tree Collapse file tree 3 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,8 @@ export class Transaction extends BaseTransaction {
402
402
const decodedInstructions = instructionParamsFactory (
403
403
this . _type ,
404
404
this . _solTransaction . instructions ,
405
- this . _coinConfig . name
405
+ this . _coinConfig . name ,
406
+ this . _instructionsData
406
407
) ;
407
408
408
409
let memo : string | undefined = undefined ;
Original file line number Diff line number Diff line change @@ -75,7 +75,12 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
75
75
this . sender ( sender ) ;
76
76
this . feePayer ( txData . feePayer as string ) ;
77
77
this . nonce ( txData . nonce , txData . durableNonce ) ;
78
- this . _instructionsData = instructionParamsFactory ( tx . type , tx . solTransaction . instructions , this . _coinConfig . name ) ;
78
+ this . _instructionsData = instructionParamsFactory (
79
+ tx . type ,
80
+ tx . solTransaction . instructions ,
81
+ this . _coinConfig . name ,
82
+ txData . instructionsData
83
+ ) ;
79
84
// Parse priority fee instruction data
80
85
const filteredPriorityFeeInstructionsData = txData . instructionsData . filter (
81
86
( data ) => data . type === InstructionBuilderTypes . SetPriorityFee
Original file line number Diff line number Diff line change @@ -823,6 +823,58 @@ describe('Sol Transaction', () => {
823
823
} ) ;
824
824
} ) ;
825
825
826
+ it ( 'should explain single token transfer transaction with optional params' , async function ( ) {
827
+ const tx = await factory
828
+ . getTokenTransferBuilder ( )
829
+ . nonce ( blockHash )
830
+ . sender ( sender )
831
+ . send ( {
832
+ address,
833
+ amount,
834
+ tokenName : 'tsol:ams' ,
835
+ tokenAddress : 'F4uLeXioFz3hw13MposuwaQbMcZbCjqvEGPPeRRB1Byf' ,
836
+ programId : 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ,
837
+ decimalPlaces : 9 ,
838
+ } )
839
+ . fee ( { amount : 5000 } )
840
+ . build ( ) ;
841
+
842
+ const explainedTransaction = tx . explainTransaction ( ) ;
843
+ explainedTransaction . should . deepEqual ( {
844
+ displayOrder : [
845
+ 'id' ,
846
+ 'type' ,
847
+ 'blockhash' ,
848
+ 'durableNonce' ,
849
+ 'outputAmount' ,
850
+ 'changeAmount' ,
851
+ 'outputs' ,
852
+ 'changeOutputs' ,
853
+ 'fee' ,
854
+ 'memo' ,
855
+ ] ,
856
+ id : 'UNAVAILABLE' ,
857
+ type : 'Send' ,
858
+ changeOutputs : [ ] ,
859
+ changeAmount : '0' ,
860
+ outputAmount : '0' ,
861
+ outputs : [
862
+ {
863
+ address : 'DesU7XscZjng8yj5VX6AZsk3hWSW4sQ3rTG2LuyQ2P4H' ,
864
+ amount : '10000' ,
865
+ tokenName : 'tsol:ams' ,
866
+ } ,
867
+ ] ,
868
+ fee : {
869
+ fee : '5000' ,
870
+ feeRate : 5000 ,
871
+ } ,
872
+ memo : undefined ,
873
+ blockhash : '5ne7phA48Jrvpn39AtupB8ZkCCAy8gLTfpGihZPuDqen' ,
874
+ durableNonce : undefined ,
875
+ } ) ;
876
+ } ) ;
877
+
826
878
it ( 'should explain multi token transfer with durable nonce and memo transaction' , async function ( ) {
827
879
const tx = await factory
828
880
. getTokenTransferBuilder ( )
You can’t perform that action at this time.
0 commit comments