@@ -27,13 +27,21 @@ const TxnTypeMap: { [key: string]: { version: number; field: string | number } }
2727 6 : { version : 6 , field : "appl" } ,
2828} ;
2929
30+ // each value here is number but they come in array
31+ const arrayNumberFields = new Set ( [ "Assets" , "Applications" ] ) ;
3032// requires their type as number
3133const numberTxnFields : { [ key : number ] : Set < string > } = {
3234 1 : new Set ( ) ,
3335 2 : new Set ( ) ,
3436 3 : new Set ( ) ,
3537 4 : new Set ( ) ,
36- 5 : new Set ( [ "Fee" , "FreezeAssetFrozen" , "ConfigAssetDecimals" , "ConfigAssetDefaultFrozen" ] ) ,
38+ 5 : new Set ( [
39+ "Fee" ,
40+ "FreezeAssetFrozen" ,
41+ "ConfigAssetDecimals" ,
42+ "ConfigAssetDefaultFrozen" ,
43+ ...arrayNumberFields ,
44+ ] ) ,
3745} ;
3846numberTxnFields [ 6 ] = cloneDeep ( numberTxnFields [ 5 ] ) ;
3947[ "VoteFirst" , "VoteLast" , "VoteKeyDilution" , "Nonparticipation" , "ApplicationID" ] . forEach (
@@ -217,6 +225,7 @@ export function setInnerTxField(
217225 }
218226 break ;
219227 }
228+
220229 case "ConfigAssetDecimals" : {
221230 const assetDecimals = txValue as bigint ;
222231 if ( assetDecimals > 19n || assetDecimals < 0n ) {
@@ -297,7 +306,7 @@ export function setInnerTxField(
297306 ( subTxn as any ) . apar = ( subTxn as any ) . apar ?? { } ;
298307 ( subTxn as any ) . apar [ encodedField ] = txValue ;
299308 } else {
300- if ( field === "ApplicationArgs" ) {
309+ if ( field === "ApplicationArgs" || arrayNumberFields . has ( field ) ) {
301310 if ( ( subTxn as any ) [ encodedField ] === undefined ) {
302311 ( subTxn as any ) [ encodedField ] = [ ] ;
303312 }
0 commit comments