Commit 2cf030e 1 parent ee9e0dd commit 2cf030e Copy full SHA for 2cf030e
File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -612,10 +612,21 @@ export class ParamType {
612
612
format ( format ?: FormatType ) : string {
613
613
if ( format == null ) { format = "sighash" ; }
614
614
if ( format === "json" ) {
615
- let result : any = {
615
+ const name = this . name || undefined ; // @TODO : Make this "" (minor bump)
616
+
617
+ if ( this . isArray ( ) ) {
618
+ const result = JSON . parse ( this . arrayChildren . format ( "json" ) ) ;
619
+ result . name = name ;
620
+ result . type += `[${ ( this . arrayLength < 0 ? "" : String ( this . arrayLength ) ) } ]` ;
621
+ return JSON . stringify ( result ) ;
622
+ }
623
+
624
+ const result : any = {
616
625
type : ( ( this . baseType === "tuple" ) ? "tuple" : this . type ) ,
617
- name : ( this . name || undefined )
626
+ name
618
627
} ;
628
+
629
+
619
630
if ( typeof ( this . indexed ) === "boolean" ) { result . indexed = this . indexed ; }
620
631
if ( this . isTuple ( ) ) {
621
632
result . components = this . components . map ( ( c ) => JSON . parse ( c . format ( format ) ) ) ;
You can’t perform that action at this time.
0 commit comments