type

class Event

Bases: object

Describes an action that happened in the blockchain. Neo3-Boa compiler won’t recognize the __init__ of this class. To create a new Event, use the method CreateNewEvent:

Check out Neo’s Documentation to learn more about Events.

>>> from boa3.builtin.compile_time import CreateNewEvent
... new_event: Event = CreateNewEvent(  # create a new Event with the CreateNewEvent method
...     [
...        ('name', str),
...        ('amount', int)
...     ],
...     'New Event'
... )
class UInt160(arg: bytes | int = 0)

Bases: bytes

Represents a 160-bit unsigned integer.

zero: UInt160
class UInt256(arg: bytes | int = 0)

Bases: bytes

Represents a 256-bit unsigned integer.

zero: UInt256
class ECPoint(arg: bytes)

Bases: bytes

Represents a coordinate pair for elliptic curve cryptography (ECC) structures.

zero: ECPoint
to_script_hash() UInt160

Converts a data to a script hash.

Returns:

the script hash of the data

Return type:

bytes

Address

A type used only to indicate that a parameter or return on the manifest should be treated as an Address. Same as str.

BlockHash

A type used only to indicate that a parameter or return on the manifest should be treated as a BlockHash. Same as UInt256.

PublicKey

A type used only to indicate that a parameter or return on the manifest should be treated as a PublicKey. Same as ECPoint.

ScriptHash

A type used only to indicate that a parameter or return on the manifest should be treated as a ScriptHash. Same as UInt160.

ScriptHashLittleEndian

A type used only to indicate that a parameter or return on the manifest should be treated as a ScriptHashLittleEndian. Same as UInt160.

TransactionId

A type used only to indicate that a parameter or return on the manifest should be treated as a TransactionId. Same as UInt256.

Subpackages

helper

to_bool(value: bytes) bool

Return a bytes value to the boolean it represents.

>>> to_bool(b'\x00')
False
>>> to_bool(b'\x01')
True
>>> to_bool(b'\x02')
True
to_bytes(value: str | int) bytes

Converts a str or integer value to an array of bytes

>>> to_bytes(65)
b'A'
>>> to_bytes('A')
b'A'
to_int(value: bytes) int

Converts a bytes value to the integer it represents.

>>> to_int(b'A')
65
to_str(value: bytes) str

Converts a bytes value to a string.

>>> to_str(b'A')
'A'