Skip to content

types/app-arc56

@algorandfoundation/algokit-utils / types/app-arc56

Ƭ ABIStruct: Object

Decoded ARC-56 struct as a struct rather than a tuple.

▪ [key: string]: ABIStruct | algosdk.ABIValue

src/types/app-arc56.ts:122


Ƭ ABIType: string

An ABI-encoded type

src/types/app-arc56.ts:453


Ƭ AVMBytes: "AVMBytes"

Raw byteslice without the length prefixed that is specified in ARC-4

src/types/app-arc56.ts:459


Ƭ AVMString: "AVMString"

A utf-8 string without the length prefix that is specified in ARC-4

src/types/app-arc56.ts:462


Ƭ AVMType: AVMBytes | AVMString | AVMUint64

A native AVM type

src/types/app-arc56.ts:468


Ƭ AVMUint64: "AVMUint64"

A 64-bit unsigned integer

src/types/app-arc56.ts:465


Ƭ Arc56MethodArg: Expand<Omit<Method["args"][number], "type"> & { type: algosdk.ABIArgumentType }>

Type to describe an argument within an Arc56Method.

src/types/app-arc56.ts:7


Ƭ Arc56MethodReturnType: Expand<Omit<Method["returns"], "type"> & { type: algosdk.ABIReturnType }>

Type to describe a return type within an Arc56Method.

src/types/app-arc56.ts:14


Ƭ StructName: string

The name of a defined struct

src/types/app-arc56.ts:456

getABIDecodedValue(value, type, structs): algosdk.ABIValue | ABIStruct

Returns the decoded ABI value (or struct for a struct type) for the given raw Algorand value given an ARC-56 type and defined ARC-56 structs.

NameTypeDescription
valuenumber | bigint | Uint8ArrayThe raw Algorand value (bytes or uint64)
typestringThe ARC-56 type - either an ABI Type string or a struct name
structsRecord<string, StructField[]>The defined ARC-56 structs

algosdk.ABIValue | ABIStruct

The decoded ABI value or struct

src/types/app-arc56.ts:134


getABIEncodedValue(value, type, structs): Uint8Array

Returns the ABI-encoded value for the given value.

NameTypeDescription
valueABIValue | ABIStructThe value to encode either already in encoded binary form (Uint8Array), a decoded ABI value or an ARC-56 struct
typestringThe ARC-56 type - either an ABI Type string or a struct name
structsRecord<string, StructField[]>The defined ARC-56 structs

Uint8Array

The binary ABI-encoded value

src/types/app-arc56.ts:159


getABIStructFromABITuple<TReturn>(decodedABITuple, structFields, structs): TReturn

Converts a decoded ABI tuple as a struct.

NameType
TReturnextends ABIStruct = Record<string, any>
NameTypeDescription
decodedABITupleABIValue[]The decoded ABI tuple value
structFieldsStructField[]The struct fields from an ARC-56 app spec
structsRecord<string, StructField[]>-

TReturn

The struct as a Record<string, any>

src/types/app-arc56.ts:71


getABITupleFromABIStruct(struct, structFields, structs): algosdk.ABIValue[]

Converts an ARC-56 struct as an ABI tuple.

NameTypeDescription
structABIStructThe struct to convert
structFieldsStructField[]The struct fields from an ARC-56 app spec
structsRecord<string, StructField[]>-

algosdk.ABIValue[]

The struct as a decoded ABI tuple

src/types/app-arc56.ts:108


getABITupleTypeFromABIStructDefinition(struct, structs): algosdk.ABITupleType

Returns the ABITupleType for the given ARC-56 struct definition

NameTypeDescription
structStructField[]The ARC-56 struct definition
structsRecord<string, StructField[]>-

algosdk.ABITupleType

The ABITupleType

src/types/app-arc56.ts:49


getArc56Method(methodNameOrSignature, appSpec): Arc56Method

Returns the ARC-56 ABI method object for a given method name or signature and ARC-56 app spec.

NameTypeDescription
methodNameOrSignaturestringThe method name or method signature to call if an ABI call is being emitted. e.g. my_method or my_method(unit64,string)bytes
appSpecArc56ContractThe app spec for the app

Arc56Method

The Arc56Method

src/types/app-arc56.ts:189


getArc56ReturnValue<TReturn>(returnValue, method, structs): TReturn

Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type

NameType
TReturnextends undefined | ABIValue | ABIStruct
NameTypeDescription
returnValueundefined | ABIReturnThe smart contract response
methodMethod | Arc56MethodThe method that was called
structsRecord<string, StructField[]>The struct fields from the app spec

TReturn

The smart contract response with an updated return value

src/types/app-arc56.ts:220