type

class UInt160(arg: Union[bytes, int] = 0)

Bases: bytes

Represents a 160-bit unsigned integer.

class UInt256(arg: Union[bytes, int] = 0)

Bases: bytes

Represents a 256-bit unsigned integer.

class ECPoint(arg: bytes)

Bases: bytes

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

to_script_hash() bytes

Converts a data to a script hash.

Returns

the script hash of the data

Return type

bytes

class ByteString

Bases: object

An type annotation for values that can be str or bytes. Same as Union[str, bytes]

to_bytes() bytes

Converts an ByteString value to an array of bytes

to_str() str

Converts an ByteString value to a string.

to_int() int

Return the integer represented by this ByteString.

to_bool() bool

Return the boolean represented by this ByteString.

isdigit() bool

Return True if the ByteString is a digit string, False otherwise.

A ByteString is a digit string if all characters in the ByteString are digits and there is at least one character in the ByteString.

join(__iterable: Sequence[ByteString]) ByteString

Concatenate any number of ByteStrings.

The ByteString whose method is called is inserted in between each given ByteString. The result is returned as a new ByteString.

lower() ByteString

Return a copy of the ByteString converted to lowercase.

startswith(prefix: ByteString, start: int, end: int) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(__chars: ByteString) ByteString

Return a copy of the ByteString with leading and trailing whitespace remove.

If chars is given and not None, remove characters in chars instead.

upper() ByteString

Return a copy of the ByteString converted to uppercase.