array_static_type

class ArrayStaticType(arg_type: algosdk.abi.base_type.ABIType, array_len: int)

Bases: algosdk.abi.base_type.ABIType

Represents a ArrayStatic ABI Type for encoding.

Parameters
  • child_type (ABIType) – the type of the child_types array.

  • array_len (int) – length of the static array.

child_type
Type

ABIType

static_length
Type

int

byte_len()int

Return the length in bytes of the ABI type.

is_dynamic()bool

Return whether the ABI type is dynamic.

encode(value_array: Union[List[Any], bytes, bytearray])bytes

Encodes a list of values into a ArrayStatic ABI bytestring.

Parameters
  • value_array (list | bytes | bytearray) – list of values to be encoded.

  • number of elements must match the predefined length of array. (The) –

  • the child types are ByteType (If) –

  • bytes or bytearray can be (then) –

  • in to be encoded as well. (passed) –

Returns

encoded bytes of the static array

Return type

bytes

decode(array_bytes: Union[bytes, bytearray])list

Decodes a bytestring to a static list.

Parameters

array_bytes (bytes | bytearray) – bytestring to be decoded

Returns

values from the encoded bytestring

Return type

list