ledger

class Ledger

Bases: object

A class used to represent the Ledger native contract

hash: boa3.builtin.type.UInt160
classmethod 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.

Parameters

index_or_hash (int or UInt256) – index or hash identifier of the block

Returns

the desired block, if exists. None otherwise

Return type

Block or None

classmethod get_current_index()int

Gets the index of the current block.

Returns

the index of the current block

Return type

int

classmethod 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

classmethod 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.

Parameters
  • block_hash_or_height (UInt256 or int) – a block identifier

  • tx_index (int) – the transaction identifier in the block

Returns

the Transaction, if exists. None otherwise

classmethod 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

classmethod 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

classmethod 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