nimiq_rpc/blockchain
Values
pub fn dangerously_get_accounts(
client: process.Subject(@internal Message),
) -> Result(List(account.Account), String)
Fetches all accounts in the accounts tree.
IMPORTANT: This operation iterates over all accounts in the accounts tree and thus is extremely computationally expensive.
pub fn dangerously_get_stakers_by_validator_address(
client: process.Subject(@internal Message),
address address: String,
) -> Result(List(staker.Staker), String)
Fetches all stakers for a given validator.
IMPORTANT: This operation iterates over all stakers of the staking contract and thus is extremely computationally expensive.
pub fn dangerously_get_validators(
client: process.Subject(@internal Message),
) -> Result(List(validator.Validator), String)
Fetches all validators in the staking contract.
IMPORTANT: This operation iterates over all validators in the staking contract and thus is extremely computationally expensive.
pub fn get_account_by_address(
client: process.Subject(@internal Message),
address address: String,
) -> Result(account.Account, String)
Tries to fetch the account at the given address.
pub fn get_active_validators(
client: process.Subject(@internal Message),
) -> Result(List(validator.Validator), String)
Returns a collection of the currently active validator’s addresses and balances.
pub fn get_batch_number(
client: process.Subject(@internal Message),
) -> Result(Int, String)
Returns the batch number for the current head.
pub fn get_block_by_hash(
client: process.Subject(@internal Message),
hash hash: String,
include_body include_body: option.Option(Bool),
) -> Result(block.Block, String)
Tries to fetch a block given its hash. It has an option to include the transactions in the block, which defaults to false.
pub fn get_block_by_number(
client: process.Subject(@internal Message),
number number: Int,
include_body include_body: option.Option(Bool),
) -> Result(block.Block, String)
Tries to fetch a block given its number. It has an option to include the transactions in the block, which defaults to false. Note that this function will only fetch blocks that are part of the main chain.
pub fn get_block_number(
client: process.Subject(@internal Message),
) -> Result(Int, String)
Returns the block number for the current head.
pub fn get_current_penalized_slots(
client: process.Subject(@internal Message),
) -> Result(slot.DisabledSlots, String)
Returns information about the currently penalized slots. This includes slots that lost rewards and that were disabled.
pub fn get_epoch_number(
client: process.Subject(@internal Message),
) -> Result(Int, String)
Returns the epoch number for the current head.
pub fn get_inherents_by_batch_number(
client: process.Subject(@internal Message),
number number: Int,
) -> Result(List(inherent.Inherent), String)
Returns all the inherents (including reward inherents) for the given batch number. Note that this only considers blocks in the main chain.
pub fn get_inherents_by_block_number(
client: process.Subject(@internal Message),
number number: Int,
) -> Result(List(inherent.Inherent), String)
Returns all the inherents (including reward inherents) for the given block number. Note that this only considers blocks in the main chain.
pub fn get_latest_block(
client: process.Subject(@internal Message),
include_body include_body: option.Option(Bool),
) -> Result(block.Block, String)
Returns the block at the head of the main chain. It has an option to include the transactions in the block, which defaults to false.
pub fn get_previous_penalized_slots(
client: process.Subject(@internal Message),
) -> Result(slot.DisabledSlots, String)
Returns information about the penalized slots of the previous batch. This includes slots that lost rewards and that were disabled.
pub fn get_slot_at(
client: process.Subject(@internal Message),
block_number block_number: Int,
offset_opt offset_opt: option.Option(Int),
) -> Result(slot.Slot, String)
Returns information about the proposer slot at the given block height and offset. The offset is optional, it will default to getting the offset for the existing block at the given height.
We only have this information available for the last 2 batches at most.
pub fn get_staker_by_address(
client: process.Subject(@internal Message),
address address: String,
) -> Result(staker.Staker, String)
Tries to fetch a staker information given its address.
pub fn get_transaction_by_hash(
client: process.Subject(@internal Message),
hash hash: String,
) -> Result(transaction.Transaction, String)
Tries to fetch a transaction (including reward transactions) given its hash.
pub fn get_transaction_hashes_by_address(
client: process.Subject(@internal Message),
address address: String,
max max: option.Option(Int),
start_at start_at: option.Option(String),
) -> Result(List(String), String)
Returns the hashes for the latest transactions for a given address. All the transactions where the given address is listed as a recipient or as a sender are considered. Reward transactions are also returned. It has an option to specify the maximum number of hashes to fetch, it defaults to 500. It has also an option to retrieve transactions before a given transaction hash (exclusive). If this hash is not found or does not belong to this address, it will return an empty list. The transaction hashes are returned in descending order, meaning the latest transaction is the first.
pub fn get_transactions_by_address(
client: process.Subject(@internal Message),
address address: String,
max max: option.Option(Int),
start_at start_at: option.Option(String),
) -> Result(List(transaction.Transaction), String)
Returns the latest transactions for a given address. All the transactions where the given address is listed as a recipient or as a sender are considered. Reward transactions are also returned. It has an option to specify the maximum number of transactions to fetch, it defaults to 500. It has also an option to retrieve transactions before a given transaction hash (exclusive). If this hash is not found or does not belong to this address, it will return an empty list. The transactions are returned in descending order, meaning the latest transaction is the first.
pub fn get_transactions_by_batch_number(
client: process.Subject(@internal Message),
number number: Int,
) -> Result(List(transaction.Transaction), String)
Returns all the transactions (including reward transactions) for the given batch number. Note that this only considers blocks in the main chain.
pub fn get_transactions_by_block_number(
client: process.Subject(@internal Message),
number number: Int,
) -> Result(List(transaction.Transaction), String)
Returns all the transactions (including reward transactions) for the given block number. Note that this only considers blocks in the main chain.
pub fn get_validator_by_address(
client: process.Subject(@internal Message),
address address: String,
) -> Result(validator.Validator, String)
Tries to fetch a validator information given its address.