Interface IBlockChainStates<T>
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<T>
where T : IAction, new()
Type Parameters
Name | Description |
---|---|
T | An IAction type. |
Methods
| Improve this Doc View SourceGetBalance(Address, Currency, BlockHash, FungibleAssetStateCompleter<T>)
Queries address
's balance of the currency
in the
BlockChain<T> from offset
.
Declaration
FungibleAssetValue GetBalance(Address address, Currency currency, BlockHash offset, FungibleAssetStateCompleter<T> stateCompleter)
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. |
FungibleAssetStateCompleter<T> | stateCompleter | When the BlockChain<T> instance does not contain states dirty of the block which lastly updated states of a requested address, this delegate is called and its return value is used instead. Recalculate makes the incomplete states recalculated and filled on the fly. Reject makes the incomplete states (if needed) to cause IncompleteBlockStatesException instead. |
Returns
Type | Description |
---|---|
FungibleAssetValue | The |
GetStates(IReadOnlyList<Address>, BlockHash, StateCompleter<T>)
Gets multiple states associated to the specified addresses
.
Declaration
IReadOnlyList<IValue?> GetStates(IReadOnlyList<Address> addresses, BlockHash offset, StateCompleter<T> stateCompleter)
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. |
StateCompleter<T> | stateCompleter | When the BlockChain<T> instance does not contain states of the block, this delegate is called and its return values are used instead. Recalculate makes the incomplete states recalculated and filled on the fly. Reject makes the incomplete states (if needed) to cause IncompleteBlockStatesException instead. |
Returns
Type | Description |
---|---|
IReadOnlyList<Nullable<IValue>> | The states associated to the specified |
GetTotalSupply(Currency, BlockHash, TotalSupplyStateCompleter<T>)
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, TotalSupplyStateCompleter<T> stateCompleter)
Parameters
Type | Name | Description |
---|---|---|
Currency | currency | The currency type to query. |
BlockHash | offset | The HashDigest<T> of the block to start finding the state. |
TotalSupplyStateCompleter<T> | stateCompleter | When the BlockChain<T> instance does not contain states of the block, this delegate is called and its return values are used instead. Recalculate makes the incomplete states recalculated and filled on the fly. Reject makes the incomplete states (if needed) to cause IncompleteBlockStatesException instead. |
Returns
Type | Description |
---|---|
FungibleAssetValue | The total supply value of |