Show / Hide Table of Contents

Interface IBlockChainStates

A minimal interface to get states from a blockchain.

Note that BlockChain<T> implements this interface.

Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public interface IBlockChainStates

Methods

| Improve this Doc View Source

GetBalance(Address, Currency, BlockHash)

Queries address's balance of the currency in the BlockChain<T> from offset.

Declaration
FungibleAssetValue GetBalance(Address address, Currency currency, BlockHash offset)
Parameters
Type Name Description
Address address

The owner Address to query.

Currency currency

The currency type to query.

BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
FungibleAssetValue

The address's current balance (or balance as of the given offset) of the currency.

| Improve this Doc View Source

GetStates(IReadOnlyList<Address>, BlockHash)

Gets multiple states associated to the specified addresses.

Declaration
IReadOnlyList<IValue> GetStates(IReadOnlyList<Address> addresses, BlockHash offset)
Parameters
Type Name Description
IReadOnlyList<Address> addresses

Addresses of states to query.

BlockHash offset

The HashDigest<T> of the block to start finding the states.

Returns
Type Description
IReadOnlyList<Bencodex.Types.IValue>

The states associated to the specified addresses. Associated values are ordered in the same way to the corresponding addresses. Absent states are represented as null.

| Improve this Doc View Source

GetTotalSupply(Currency, BlockHash)

Gets the total supply of a currency in the BlockChain<T> from offset, and if not found, return 0.

Declaration
FungibleAssetValue GetTotalSupply(Currency currency, BlockHash offset)
Parameters
Type Name Description
Currency currency

The currency type to query.

BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
FungibleAssetValue

The total supply value of currency at offset in FungibleAssetValue.

| Improve this Doc View Source

GetTrie(BlockHash)

Returns the state trie for offset.

Declaration
ITrie GetTrie(BlockHash offset)
Parameters
Type Name Description
BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
ITrie

The merkle trie instance for given offset.

| Improve this Doc View Source

GetValidatorSet(BlockHash)

Returns the validator set in the BlockChain<T> from offset.

Declaration
ValidatorSet GetValidatorSet(BlockHash offset)
Parameters
Type Name Description
BlockHash offset

The HashDigest<T> of the block to start finding the state.

Returns
Type Description
ValidatorSet

The validator set of type ValidatorSet at the offset.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium