algopy_testing.arc4
Module Contents
Section titled “Module Contents”Classes
Section titled “Classes”String | An ARC4 sequence of bytes containing a UTF8 string. |
|---|---|
UIntN | An ARC4 UInt consisting of the number of bits specified. |
BigUIntN | An ARC4 UInt consisting of the number of bits specified. |
Byte | An ARC4 alias for a UInt8. |
Bool | An ARC4 encoded bool. |
StaticArray | A fixed length ARC4 Array of the specified type and length. |
Address | |
DynamicArray | A dynamically sized ARC4 Array of the specified type. |
DynamicBytes | A variable sized array of bytes. |
Tuple | An ARC4 ABI tuple, containing other ARC4 ABI types. |
Struct | Base class for ARC4 Struct types. |
ARC4Client |
Functions
Section titled “Functions”arc4_signature(→ algopy.Bytes) | Convert a signature to ARC4 bytes. |
|---|---|
emit(→ None) | |
encode(→ algopy.Bytes) | |
decode(→ _TDecode) |
UFixedNxM | |
|---|---|
BigUFixedNxM | |
UInt8 | |
UInt16 | |
UInt32 | |
UInt64 | |
UInt128 | |
UInt256 | |
UInt512 | |
abi_call | |
arc4_create | |
arc4_update |
arc4_signature(signature: str | Callable[_P, _R]) → algopy.Bytes
Section titled “arc4_signature(signature: str | Callable[_P, _R]) → algopy.Bytes”Convert a signature to ARC4 bytes.
class String
Section titled “class String”Bases: _ABIEncoded
An ARC4 sequence of bytes containing a UTF8 string.
property native : algopy.String
Section titled “property native : algopy.String”Return the String representation of the UTF8 string after ARC4 decoding.
class UIntN
Section titled “class UIntN”Bases: _UIntN, Generic[_TBitSize]
An ARC4 UInt consisting of the number of bits specified.
Max Size: 64 bits
property native : algopy.UInt64
Section titled “property native : algopy.UInt64”Return the UInt64 representation of the value after ARC4 decoding.
as_uint64() → algopy.UInt64
Section titled “as_uint64() → algopy.UInt64”Return the UInt64 representation of the value after ARC4 decoding.
as_biguint() → algopy.BigUInt
Section titled “as_biguint() → algopy.BigUInt”Return the BigUInt representation of the value after ARC4 decoding.
class BigUIntN
Section titled “class BigUIntN”Bases: _UIntN, Generic[_TBitSize]
An ARC4 UInt consisting of the number of bits specified.
Max size: 512 bits
property native : algopy.BigUInt
Section titled “property native : algopy.BigUInt”Return the BigUInt representation of the value after ARC4 decoding.
as_uint64() → algopy.UInt64
Section titled “as_uint64() → algopy.UInt64”Return the UInt64 representation of the value after ARC4 decoding.
as_biguint() → algopy.BigUInt
Section titled “as_biguint() → algopy.BigUInt”Return the BigUInt representation of the value after ARC4 decoding.
UFixedNxM
Section titled “UFixedNxM”BigUFixedNxM
Section titled “BigUFixedNxM”class Byte
Section titled “class Byte”Bases: UIntN[Literal[8]]
An ARC4 alias for a UInt8.
type UInt8 = UIntN[Literal[8]]
Section titled “type UInt8 = UIntN[Literal[8]]”type UInt16 = UIntN[Literal[16]]
Section titled “type UInt16 = UIntN[Literal[16]]”type UInt32 = UIntN[Literal[32]]
Section titled “type UInt32 = UIntN[Literal[32]]”type UInt64 = UIntN[Literal[64]]
Section titled “type UInt64 = UIntN[Literal[64]]”type UInt128 = BigUIntN[Literal[128]]
Section titled “type UInt128 = BigUIntN[Literal[128]]”type UInt256 = BigUIntN[Literal[256]]
Section titled “type UInt256 = BigUIntN[Literal[256]]”type UInt512 = BigUIntN[Literal[512]]
Section titled “type UInt512 = BigUIntN[Literal[512]]”class Bool
Section titled “class Bool”Bases: _ABIEncoded
An ARC4 encoded bool.
property native : bool
Section titled “property native : bool”Return the bool representation of the value after ARC4 decoding.
class StaticArray
Section titled “class StaticArray”Bases: _ABIEncoded, algopy_testing.mutable.MutableBytes, Generic[_TArrayItem, _TArrayLength]
A fixed length ARC4 Array of the specified type and length.
property length : algopy.UInt64
Section titled “property length : algopy.UInt64”to_native(element_type: type[_TNativeArrayItem]) → algopy.FixedArray[_TNativeArrayItem, _TArrayLength]
Section titled “to_native(element_type: type[_TNativeArrayItem]) → algopy.FixedArray[_TNativeArrayItem, _TArrayLength]”Convert to an algopy.FixedArray with the specified element type.
Only allowed if the element type is compatible with this arrays element type e.g. arc4.UInt64 -> UInt64
class Address
Section titled “class Address”Bases: StaticArray[Byte, Literal[32]]
property native : Account
Section titled “property native : Account”class DynamicArray
Section titled “class DynamicArray”Bases: _ABIEncoded, algopy_testing.mutable.MutableBytes, Generic[_TArrayItem]
A dynamically sized ARC4 Array of the specified type.
property length : algopy.UInt64
Section titled “property length : algopy.UInt64”Returns the current length of the array.
append(item: _TArrayItem) → None
Section titled “append(item: _TArrayItem) → None”Append items to this array.
extend(other: Iterable[_TArrayItem]) → None
Section titled “extend(other: Iterable[_TArrayItem]) → None”Extend this array with the contents of another array.
pop() → _TArrayItem
Section titled “pop() → _TArrayItem”Remove and return the last item in the array.
to_native(element_type: type[_TNativeArrayItem]) → algopy.Array[_TNativeArrayItem]
Section titled “to_native(element_type: type[_TNativeArrayItem]) → algopy.Array[_TNativeArrayItem]”Convert to an algopy.Array with the specified element type.
Only allowed if the element type is compatible with this arrays element type e.g. arc4.UInt64 -> UInt64
class DynamicBytes
Section titled “class DynamicBytes”Bases: DynamicArray[Byte]
A variable sized array of bytes.
property native : algopy.Bytes
Section titled “property native : algopy.Bytes”class Tuple
Section titled “class Tuple”Bases: _ABIEncoded, algopy_testing.mutable.MutableBytes, tuple[Unpack[_TTuple]], Generic[Unpack[_TTuple]]
An ARC4 ABI tuple, containing other ARC4 ABI types.
property native : tuple[Unpack[_TTuple]]
Section titled “property native : tuple[Unpack[_TTuple]]”class Struct
Section titled “class Struct”Bases: algopy_testing.mutable.MutableBytes, _ABIEncoded
Base class for ARC4 Struct types.
classmethod from_bytes(value: algopy.Bytes | bytes) → Self
Section titled “classmethod from_bytes(value: algopy.Bytes | bytes) → Self”Construct an instance from the underlying bytes (no validation)
property bytes : algopy.Bytes
Section titled “property bytes : algopy.Bytes”Get the underlying bytes[]