neo3.network.payloads.transaction
Transaction payload and related classes.
HighPriorityAttribute— Attribute to give the transaction processing priority over other transactions.OracleResponse— Oracle response.Transaction— Data to be executed by the NEO virtual machine.TransactionAttribute()— Base class for attributes that can be attached to a Transaction.
neo3.network.payloads.transaction.HighPriorityAttribute()
Attribute to give the transaction processing priority over other transactions.
__len__()— Return the length of the object in number of bytes.deserialize(reader)— Deserialize the object from a binary stream.serialize(writer)— Serialize the object into a binary stream.to_array()(bytes) — Serialize the object into a bytearray.to_json()(dict) — Convert object into JSON representation.deserialize_from_bytes(data)(ISerializable_T) — Parse data into an object instance.from_json(json)— Create object from JSON.deserialize_from(reader)(TransactionAttribute) — Deserialize from a binary stream into a new TransactionAttribute.
deserialize_from_bytes(data)
Parse data into an object instance.
data(bytes | bytearray) — hex escaped bytes.
a deserialized instance of the class.
to_array() → bytes
Serialize the object into a bytearray.
__len__()
Return the length of the object in number of bytes.
deserialize(reader)
Deserialize the object from a binary stream.
reader(BinaryReader) — instance.
deserialize_from(reader) → TransactionAttribute
Deserialize from a binary stream into a new TransactionAttribute.
from_json(json)
Create object from JSON.
serialize(writer)
Serialize the object into a binary stream.
writer(BinaryWriter) — instance.
to_json() → dict
Convert object into JSON representation.
neo3.network.payloads.transaction.OracleResponse(id, code, result)
Oracle response.
allow_multiple— Only one OracleResponse attribute can be attached per transactioncode— The evaluation result codeid— The OracleRequest id to which this is a responseresult— The actual result
__len__()— Return the length of the object in number of bytes.deserialize(reader)— Deserialize the object from a binary stream.serialize(writer)— Serialize the object into a binary stream.to_array()(bytes) — Serialize the object into a bytearray.to_json()(dict) — Convert object into JSON representation.deserialize_from_bytes(data)(ISerializable_T) — Parse data into an object instance.from_json(json)— Create object from JSONdeserialize_from(reader)(TransactionAttribute) — Deserialize from a binary stream into a new TransactionAttribute.
deserialize_from_bytes(data)
Parse data into an object instance.
data(bytes | bytearray) — hex escaped bytes.
a deserialized instance of the class.
to_array() → bytes
Serialize the object into a bytearray.
__len__()
Return the length of the object in number of bytes.
from_json(json)
Create object from JSON
to_json() → dict
Convert object into JSON representation.
deserialize(reader)
Deserialize the object from a binary stream.
reader(BinaryReader) — instance.
deserialize_from(reader) → TransactionAttribute
Deserialize from a binary stream into a new TransactionAttribute.
serialize(writer)
Serialize the object into a binary stream.
writer(BinaryWriter) — instance.
neo3.network.payloads.transaction.OracleResponseCode()
Oracle response status codes.
CONSENSUS_UNREACHABLE(int) — 0x12CONTENT_TYPE_NOT_SUPPORTED(int) — 0x1fERROR(int) — 0xffFORBIDDEN(int) — 0x18INSUFFICIENT_FUNDS(int) — 0x1cNOT_FOUND(int) — 0x14PROTOCOL_NOT_SUPPORTED(int) — 0x10RESPONSE_TOO_LARGE(int) — 0x1aSUCCESS(int) — 0x0TIMEOUT(int) — 0x16
neo3.network.payloads.transaction.Transaction(version, nonce, system_fee, network_fee, valid_until_block, attributes=None, signers=None, script=None, witnesses=None, protocol_magic=None)
Data to be executed by the NEO virtual machine.
block_height— The block height in which the transaction is included.inventory_type(InventoryType) — Inventory type identifier.network_fee— The cost of validation and inclusion in a block by the consensus node.nonce— Random numberscript— The array of instructions to be executed on the chain by the virtual machine.sender(UInt160) — The hash of the account who has sent the transaction to the networksigners(A list of authorities used by the) — func:ChecKWitnesssmart contract system call.system_fee— The cost of executing thescript.valid_until_block— The maximum chain height this transaction is valid.version— Transaction data structure version - for internal usevm_state— The virtual machine result of executing thescript.witnesses(list) — A list of signing authorities used to validate the transaction.
__len__()— Return the length of the object in number of bytes.deserialize(reader)— Deserialize the object from a binary stream.deserialize_unsigned(reader)— Deserialize the unsigned data part of the object from a binary stream.fee_per_byte()(int) — Calculates the network fee per byte.get_hash_data(protocol_magic)(bytes) — Get the unsigned data.get_script_hashes_for_verifying(_)(list) — Helper method to get the data used in verifying the object.hash()(UInt256) — Get a unique block identifier based on the unsigned data portion of the object.serialize(writer)— Serialize the object into a binary stream.serialize_unsigned(writer)— Serialize the unsigned part of the object into a binary stream.to_array()(bytes) — Serialize the object into a bytearray.to_json()(dict) — Convert object into JSON representation.try_get_attribute(needle)(Optional) — Helper method for finding an attribute of a specific type.deserialize_from_bytes(data)(ISerializable_T) — Parse data into an object instance.from_json(json,procotol_magic)— Create object from JSON.
deserialize_from_bytes(data)
Parse data into an object instance.
data(bytes | bytearray) — hex escaped bytes.
a deserialized instance of the class.
to_array() → bytes
Serialize the object into a bytearray.
__len__()
Return the length of the object in number of bytes.
deserialize(reader)
Deserialize the object from a binary stream.
reader(BinaryReader) — instance.
deserialize_unsigned(reader)
Deserialize the unsigned data part of the object from a binary stream.
reader(BinaryReader) — instance.
ValueError— The version is not zero.ValueError— If the system of network fee is negative.ValueError— If there is no script
fee_per_byte() → int
Calculates the network fee per byte.
Fee per byte = the TX's networkfee / TX's size
Warning
Should only be called once the transaction is completely build and will no longer be modified.
from_json(json, procotol_magic=None)
Create object from JSON.
get_script_hashes_for_verifying(_) → list
Helper method to get the data used in verifying the object.
hash() → UInt256
Get a unique block identifier based on the unsigned data portion of the object.
serialize(writer)
Serialize the object into a binary stream.
writer(BinaryWriter) — instance.
serialize_unsigned(writer)
Serialize the unsigned part of the object into a binary stream.
writer(BinaryWriter) — instance.
to_json() → dict
Convert object into JSON representation.
try_get_attribute(needle)
Helper method for finding an attribute of a specific type.
needle(Type) — the type to search for
The attribute matching the type if found. None otherwise.
get_hash_data(protocol_magic) → bytes
Get the unsigned data.
protocol_magic(int) — network protocol number (NEO MainNet = 860833102, Testnet (T5) = 894710606, private net = ?)
neo3.network.payloads.transaction.TransactionAttribute()
Base class for attributes that can be attached to a Transaction.
__len__()— Return the length of the object in number of bytes.deserialize(reader)— Deserialize the object from a binary stream.serialize(writer)— Serialize the object into a binary stream.to_array()(bytes) — Serialize the object into a bytearray.to_json()(dict) — Convert object into JSON representation.deserialize_from_bytes(data)(ISerializable_T) — Parse data into an object instance.from_json(json)— Create object from JSON.deserialize_from(reader)(TransactionAttribute) — Deserialize from a binary stream into a new TransactionAttribute.
deserialize_from_bytes(data)
Parse data into an object instance.
data(bytes | bytearray) — hex escaped bytes.
a deserialized instance of the class.
to_array() → bytes
Serialize the object into a bytearray.
__len__()
Return the length of the object in number of bytes.
deserialize(reader)
Deserialize the object from a binary stream.
reader(BinaryReader) — instance.
deserialize_from(reader) → TransactionAttribute
Deserialize from a binary stream into a new TransactionAttribute.
from_json(json)
Create object from JSON.
serialize(writer)
Serialize the object into a binary stream.
writer(BinaryWriter) — instance.
to_json() → dict
Convert object into JSON representation.
neo3.network.payloads.transaction.TransactionAttributeType()
Various attributes that can be set by consensus committee members.
HIGH_PRIORITY(int) — 0x1ORACLE_RESPONSE(int) — 0x11_INVALID(int) — 0x9999