_algopy_testing.arc4

Module Contents

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.

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.

Functions

arc4_signature

Convert a signature to ARC4 bytes.

API

arc4_signature(signature: str, /) algopy.Bytes

Convert a signature to ARC4 bytes.

class String(value: algopy.String | str = '', /)

Bases: _algopy_testing.arc4._ABIEncoded

An ARC4 sequence of bytes containing a UTF8 string.

Initialization

property native: algopy.String

Return the String representation of the UTF8 string after ARC4 decoding.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class UIntN(value: algopy.BigUInt | algopy.UInt64 | int = 0, /)

Bases: _algopy_testing.arc4._UIntN, typing.Generic[_algopy_testing.arc4._TBitSize]

An ARC4 UInt consisting of the number of bits specified.

Max Size: 64 bits

Initialization

property native: algopy.UInt64

Return the UInt64 representation of the value after ARC4 decoding.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class BigUIntN(value: algopy.BigUInt | algopy.UInt64 | int = 0, /)

Bases: _algopy_testing.arc4._UIntN, typing.Generic[_algopy_testing.arc4._TBitSize]

An ARC4 UInt consisting of the number of bits specified.

Max size: 512 bits

Initialization

property native: algopy.BigUInt

Return the UInt64 representation of the value after ARC4 decoding.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class Byte

Bases: _algopy_testing.arc4.UIntN[typing.Literal[8]]

An ARC4 alias for a UInt8.

class Bool(value: bool = False, /)

Bases: _algopy_testing.arc4._ABIEncoded

An ARC4 encoded bool.

Initialization

property native: bool

Return the bool representation of the value after ARC4 decoding.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class StaticArray(*_items: _algopy_testing.arc4._TArrayItem)

Bases: _algopy_testing.arc4._ABIEncoded, _algopy_testing.mutable.MutableBytes, typing.Generic[_algopy_testing.arc4._TArrayItem, _algopy_testing.arc4._TArrayLength]

A fixed length ARC4 Array of the specified type and length.

Initialization

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class DynamicArray(*_items: _algopy_testing.arc4._TArrayItem)

Bases: _algopy_testing.arc4._ABIEncoded, _algopy_testing.mutable.MutableBytes, typing.Generic[_algopy_testing.arc4._TArrayItem]

A dynamically sized ARC4 Array of the specified type.

Initialization

property length: algopy.UInt64

Returns the current length of the array.

append(item: _algopy_testing.arc4._TArrayItem, /) None

Append items to this array.

extend(
other: collections.abc.Iterable[_algopy_testing.arc4._TArrayItem],
/,
) None

Extend this array with the contents of another array.

pop() _algopy_testing.arc4._TArrayItem

Remove and return the last item in the array.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
class DynamicBytes(
*value: algopy.Bytes | bytes | _algopy_testing.arc4.Byte | _algopy_testing.arc4.UInt8 | int,
)

Bases: _algopy_testing.arc4.DynamicArray[_algopy_testing.arc4.Byte]

A variable sized array of bytes.

Initialization

class Tuple(_items: tuple[Unpack[_algopy_testing.arc4._TTuple]] = (), /)

Bases: _algopy_testing.arc4._ABIEncoded, _algopy_testing.mutable.MutableBytes, tuple[typing.Unpack[_algopy_testing.arc4._TTuple]], typing.Generic[typing.Unpack[_algopy_testing.arc4._TTuple]]

An ARC4 ABI tuple, containing other ARC4 ABI types.

Initialization

Initialize self. See help(type(self)) for accurate signature.

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
classmethod from_log(log: algopy.Bytes, /) Self
property bytes: algopy.Bytes
count()
index()
class Struct

Bases: _algopy_testing.mutable.MutableBytes, _algopy_testing.arc4._ABIEncoded

Base class for ARC4 Struct types.

Initialization

classmethod from_bytes(value: algopy.Bytes | bytes, /) Self
property bytes: algopy.Bytes

Get the underlying bytes[]

classmethod from_log(log: algopy.Bytes, /) Self