ABIType
Defined in: packages/abi/src/abi-type.ts:38
Represents an Algorand ABI type for encoding and decoding values as defined in ARC-0004.
This is the abstract base class for all ABI types.
Extended by
Section titled “Extended by”ABIAddressTypeABIArrayDynamicTypeABIArrayStaticTypeABIBoolTypeABIByteTypeABIStringTypeABIStructTypeABITupleTypeABIUfixedTypeABIUintType
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ABIType():
ABIType
Returns
Section titled “Returns”ABIType
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:49
Returns a user-friendly display name for this type.
Returns
Section titled “Returns”string
The display name for this type
Get Signature
Section titled “Get Signature”get
abstractname():string
Defined in: packages/abi/src/abi-type.ts:43
Returns the ARC-4 type name string representation.
Returns
Section titled “Returns”string
The ARC-4 type string
Methods
Section titled “Methods”byteLen()
Section titled “byteLen()”
abstractbyteLen():number
Defined in: packages/abi/src/abi-type.ts:79
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
decode()
Section titled “decode()”
abstractdecode(bytes):ABIValue
Defined in: packages/abi/src/abi-type.ts:93
Decodes bytes according to this ABI type.
Parameters
Section titled “Parameters”Uint8Array
The bytes to decode
Returns
Section titled “Returns”The decoded value
encode()
Section titled “encode()”
abstractencode(value):Uint8Array
Defined in: packages/abi/src/abi-type.ts:86
Encodes a value according to this ABI type.
Parameters
Section titled “Parameters”The value to encode
Returns
Section titled “Returns”Uint8Array
The encoded bytes
equals()
Section titled “equals()”
abstractequals(other):boolean
Defined in: packages/abi/src/abi-type.ts:66
Checks if this ABI type is equal to another.
Parameters
Section titled “Parameters”ABIType
The other ABI type to compare with
Returns
Section titled “Returns”boolean
True if the types are equal, false otherwise
isDynamic()
Section titled “isDynamic()”
abstractisDynamic():boolean
Defined in: packages/abi/src/abi-type.ts:72
Checks if this ABI type is dynamic (variable-length).
Returns
Section titled “Returns”boolean
True if the type is dynamic, false otherwise
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
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”ABIType
The corresponding ABI type