array_dynamic_type¶
- class ArrayDynamicType(arg_type: algosdk.abi.base_type.ABIType)¶
Bases:
algosdk.abi.base_type.ABIType
Represents a ArrayDynamic ABI Type for encoding.
- Parameters
child_type (ABIType) – the type of the dynamic array.
- byte_len() → NoReturn¶
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 ArrayDynamic ABI bytestring.
- Parameters
value_array (list | bytes | bytearray) – list of values to be encoded.
the child types are ByteType (If) –
bytes or bytearray can be (then) –
in to be encoded as well. (passed) –
- Returns
encoded bytes of the dynamic array
- Return type
bytes
- decode(array_bytes: Union[bytes, bytearray]) → list¶
Decodes a bytestring to a dynamic list.
- Parameters
array_bytes (bytes | bytearray) – bytestring to be decoded
- Returns
values from the encoded bytestring
- Return type
list