ABIStructType
Defined in: packages/abi/src/abi-type.ts:730
A struct ABI type with named fields.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ABIStructType(
structName,structFields):ABIStructType
Defined in: packages/abi/src/abi-type.ts:736
Creates a new struct type.
Parameters
Section titled “Parameters”structName
Section titled “structName”string
The name of the struct
structFields
Section titled “structFields”The fields of the struct
Returns
Section titled “Returns”ABIStructType
Overrides
Section titled “Overrides”Properties
Section titled “Properties”structFields
Section titled “structFields”
readonlystructFields:ABIStructField[]
Defined in: packages/abi/src/abi-type.ts:738
The fields of the struct
structName
Section titled “structName”
readonlystructName:string
Defined in: packages/abi/src/abi-type.ts:737
The name of the struct
Accessors
Section titled “Accessors”displayName
Section titled “displayName”Get Signature
Section titled “Get Signature”get displayName():
string
Defined in: packages/abi/src/abi-type.ts:748
Returns a user-friendly display name for this type.
Returns
Section titled “Returns”string
The display name for this type
Overrides
Section titled “Overrides”Get Signature
Section titled “Get Signature”get name():
string
Defined in: packages/abi/src/abi-type.ts:743
Returns the ARC-4 type name string representation.
Returns
Section titled “Returns”string
The ARC-4 type string
Overrides
Section titled “Overrides”Methods
Section titled “Methods”byteLen()
Section titled “byteLen()”byteLen():
number
Defined in: packages/abi/src/abi-type.ts:774
Gets the byte length of the encoded type for static types.
Returns
Section titled “Returns”number
The number of bytes needed to encode this type
Throws
Section titled “Throws”Error if the type is dynamic
Overrides
Section titled “Overrides”decode()
Section titled “decode()”decode(
bytes):ABIStructValue
Defined in: packages/abi/src/abi-type.ts:849
Decodes bytes according to this ABI type.
Parameters
Section titled “Parameters”Uint8Array
The bytes to decode
Returns
Section titled “Returns”ABIStructValue
The decoded value
Overrides
Section titled “Overrides”encode()
Section titled “encode()”encode(
value):Uint8Array
Defined in: packages/abi/src/abi-type.ts:835
Encodes a value according to this ABI type.
Parameters
Section titled “Parameters”The value to encode
Returns
Section titled “Returns”Uint8Array
The encoded bytes
Overrides
Section titled “Overrides”equals()
Section titled “equals()”equals(
other):boolean
Defined in: packages/abi/src/abi-type.ts:752
Checks if this ABI type is equal to another.
Parameters
Section titled “Parameters”The other ABI type to compare with
Returns
Section titled “Returns”boolean
True if the types are equal, false otherwise
Overrides
Section titled “Overrides”isDynamic()
Section titled “isDynamic()”isDynamic():
boolean
Defined in: packages/abi/src/abi-type.ts:769
Checks if this ABI type is dynamic (variable-length).
Returns
Section titled “Returns”boolean
True if the type is dynamic, false otherwise
Overrides
Section titled “Overrides”toABITupleType()
Section titled “toABITupleType()”toABITupleType():
ABITupleType
Defined in: packages/abi/src/abi-type.ts:783
Converts this struct type to an equivalent tuple type.
Returns
Section titled “Returns”The equivalent tuple type
toString()
Section titled “toString()”toString():
string
Defined in: packages/abi/src/abi-type.ts:57
Returns the ARC-4 type name string representation.
Returns
Section titled “Returns”string
The ARC-4 type string
Inherited from
Section titled “Inherited from”from()
Section titled “from()”
staticfrom(str):ABIType
Defined in: packages/abi/src/abi-type.ts:100
Creates an ABI type from an ARC-4 type string.
Parameters
Section titled “Parameters”string
The ARC-4 type string (e.g., “uint256”, “bool”, “(uint8,address)“)
Returns
Section titled “Returns”The corresponding ABI type
Inherited from
Section titled “Inherited from”fromStruct()
Section titled “fromStruct()”
staticfromStruct(structName,structs):ABIStructType
Defined in: packages/abi/src/abi-type.ts:804
Creates an ABIStructType from struct name and struct definitions.
Parameters
Section titled “Parameters”structName
Section titled “structName”string
The name of the struct
structs
Section titled “structs”Record<string, StructField[]>
A record of struct definitions
Returns
Section titled “Returns”ABIStructType
The struct type