Skip to content

ABIStructType

Defined in: packages/abi/src/abi-type.ts:730

A struct ABI type with named fields.

new ABIStructType(structName, structFields): ABIStructType

Defined in: packages/abi/src/abi-type.ts:736

Creates a new struct type.

string

The name of the struct

ABIStructField[]

The fields of the struct

ABIStructType

ABIType.constructor

readonly structFields: ABIStructField[]

Defined in: packages/abi/src/abi-type.ts:738

The fields of the struct


readonly structName: string

Defined in: packages/abi/src/abi-type.ts:737

The name of the struct

get displayName(): string

Defined in: packages/abi/src/abi-type.ts:748

Returns a user-friendly display name for this type.

string

The display name for this type

ABIType.displayName


get name(): string

Defined in: packages/abi/src/abi-type.ts:743

Returns the ARC-4 type name string representation.

string

The ARC-4 type string

ABIType.name

byteLen(): number

Defined in: packages/abi/src/abi-type.ts:774

Gets the byte length of the encoded type for static types.

number

The number of bytes needed to encode this type

Error if the type is dynamic

ABIType.byteLen


decode(bytes): ABIStructValue

Defined in: packages/abi/src/abi-type.ts:849

Decodes bytes according to this ABI type.

Uint8Array

The bytes to decode

ABIStructValue

The decoded value

ABIType.decode


encode(value): Uint8Array

Defined in: packages/abi/src/abi-type.ts:835

Encodes a value according to this ABI type.

ABIValue

The value to encode

Uint8Array

The encoded bytes

ABIType.encode


equals(other): boolean

Defined in: packages/abi/src/abi-type.ts:752

Checks if this ABI type is equal to another.

ABIType

The other ABI type to compare with

boolean

True if the types are equal, false otherwise

ABIType.equals


isDynamic(): boolean

Defined in: packages/abi/src/abi-type.ts:769

Checks if this ABI type is dynamic (variable-length).

boolean

True if the type is dynamic, false otherwise

ABIType.isDynamic


toABITupleType(): ABITupleType

Defined in: packages/abi/src/abi-type.ts:783

Converts this struct type to an equivalent tuple type.

ABITupleType

The equivalent tuple type


toString(): string

Defined in: packages/abi/src/abi-type.ts:57

Returns the ARC-4 type name string representation.

string

The ARC-4 type string

ABIType.toString


static from(str): ABIType

Defined in: packages/abi/src/abi-type.ts:100

Creates an ABI type from an ARC-4 type string.

string

The ARC-4 type string (e.g., “uint256”, “bool”, “(uint8,address)“)

ABIType

The corresponding ABI type

ABIType.from


static fromStruct(structName, structs): ABIStructType

Defined in: packages/abi/src/abi-type.ts:804

Creates an ABIStructType from struct name and struct definitions.

string

The name of the struct

Record<string, StructField[]>

A record of struct definitions

ABIStructType

The struct type