blockchain¶
- class Block¶
Bases:
object
Represents a block.
- Variables
hash (UInt256) – a unique identifier based on the unsigned data portion of the object
version (int) – the data structure version of the block
previous_hash (UInt256) – the hash of the previous block
merkle_root (UInt256) – the merkle root of the transactions
timestamp (int) – UTC timestamp of the block in milliseconds
nonce (int) – a random number used once in the cryptography
index (int) – the index of the block
primary_index (int) – the primary index of the consensus node that generated this block
next_consensus (UInt160) – the script hash of the consensus nodes that generates the next block
transaction_count (int) – the number of transactions on this block
- class Transaction¶
Bases:
object
Represents a transaction.
- Variables
hash (UInt256) – a unique identifier based on the unsigned data portion of the object
version (int) – the data structure version of the transaction
nonce (int) – a random number used once in the cryptography
sender (UInt160) – the sender is the first signer of the transaction, they will pay the fees of the transaction
system_fee (int) – the fee paid for executing the script
network_fee (int) – the fee paid for the validation and inclusion of the transaction in a block by the consensus node
valid_until_block (int) – indicates that the transaction is only valid before this block height
script (bytes) – the array of instructions to be executed on the transaction chain by the virtual machine
- get_contract(hash: boa3.builtin.type.UInt160) → boa3.builtin.interop.contract.contract.Contract¶
Gets a contract with a given hash.
- get_block(index_or_hash: Union[int, boa3.builtin.type.UInt256]) → boa3.builtin.interop.blockchain.block.Block¶
Gets the block with the given index or hash.
- get_transaction(hash_: boa3.builtin.type.UInt256) → boa3.builtin.interop.blockchain.transaction.Transaction¶
Gets a transaction with the given hash.
- Parameters
hash (UInt256) – hash identifier of the transaction
- Returns
the Transaction, if exists. None otherwise
- get_transaction_from_block(block_hash_or_height: Union[boa3.builtin.type.UInt256, int], tx_index: int) → boa3.builtin.interop.blockchain.transaction.Transaction¶
Gets a transaction from a block.
- get_transaction_height(hash_: boa3.builtin.type.UInt256) → int¶
Gets the height of a transaction.
- Parameters
hash (UInt256) – hash identifier of the transaction
- Returns
height of the transaction
- get_transaction_signers(hash_: boa3.builtin.type.UInt256) → List[boa3.builtin.interop.blockchain.signer.Signer]¶
Gets the VM state of a transaction.
- Parameters
hash (UInt256) – hash identifier of the transaction
- Returns
VM state of the transaction
- get_transaction_vm_state(hash_: boa3.builtin.type.UInt256) → boa3.internal.neo3.vm.vmstate.VMState¶
Gets the VM state of a transaction.
- Parameters
hash (UInt256) – hash identifier of the transaction
- Returns
VM state of the transaction
- current_hash: boa3.builtin.type.UInt256¶
Gets the hash of the current block.
Block¶
- class Block¶
Bases:
object
Represents a block.
- Variables
hash (UInt256) – a unique identifier based on the unsigned data portion of the object
version (int) – the data structure version of the block
previous_hash (UInt256) – the hash of the previous block
merkle_root (UInt256) – the merkle root of the transactions
timestamp (int) – UTC timestamp of the block in milliseconds
nonce (int) – a random number used once in the cryptography
index (int) – the index of the block
primary_index (int) – the primary index of the consensus node that generated this block
next_consensus (UInt160) – the script hash of the consensus nodes that generates the next block
transaction_count (int) – the number of transactions on this block
Transaction¶
- class Transaction¶
Bases:
object
Represents a transaction.
- Variables
hash (UInt256) – a unique identifier based on the unsigned data portion of the object
version (int) – the data structure version of the transaction
nonce (int) – a random number used once in the cryptography
sender (UInt160) – the sender is the first signer of the transaction, they will pay the fees of the transaction
system_fee (int) – the fee paid for executing the script
network_fee (int) – the fee paid for the validation and inclusion of the transaction in a block by the consensus node
valid_until_block (int) – indicates that the transaction is only valid before this block height
script (bytes) – the array of instructions to be executed on the transaction chain by the virtual machine