uint
— UInt160 and UInt256 data structures¶
The UInt classes are bytearray like classes heavily used through the NEO system. See Complex data types.
-
class
neo3.core.types.uint.
UInt160
(data)¶ Bases:
neo3.core.types.uint._UIntBase
Initialize an instance.
- Parameters
data (
bytes
) – hex escaped bytearray.
-
deserialize
(reader)¶ Deserialize the object from a binary stream.
- Parameters
reader (
BinaryReader
) – instance.- Return type
-
classmethod
deserialize_from_bytes
(data)¶ Parse data into an object instance.
- Parameters
data (
bytes
) – hex escaped bytes.- Raises
ValueError – if the length of the supplied bytearray is insufficient for the type.
- Return type
-
classmethod
from_string
(value)¶ Try to parse a string into an instance.
Note
NEO’s string representation is in reverse byte order from the internal bytearray.
- Parameters
value (
str
) – accepts the same input asbytearray.fromhex()
.- Raises
ValueError – if the length of the supplied string does not match.
- Return type
-
serialize
(writer)¶ Serialize the object into a binary stream.
- Parameters
writer (
BinaryWriter
) – instance.- Return type
-
class
neo3.core.types.uint.
UInt256
(data)¶ Bases:
neo3.core.types.uint._UIntBase
Initialize an instance.
- Parameters
data (
bytes
) – hex escaped bytearray.
-
deserialize
(reader)¶ Deserialize the object from a binary stream.
- Parameters
reader (
BinaryReader
) – instance.- Return type
-
classmethod
deserialize_from_bytes
(data)¶ Parse data into an object instance.
- Parameters
data (
bytes
) – hex escaped bytes.- Raises
ValueError – if the length of the supplied bytearray is insufficient for the type.
- Return type
-
classmethod
from_string
(value)¶ Try to parse a string into an instance.
Note
NEO’s string representation is in reverse byte order from the internal bytearray.
- Parameters
value (
str
) – accepts the same input asbytearray.fromhex()
.- Raises
ValueError – if the length of the supplied string does not match.
- Return type
-
serialize
(writer)¶ Serialize the object into a binary stream.
- Parameters
writer (
BinaryWriter
) – instance.- Return type