Interface IBlockChainStates
A minimal interface to get states from a
Note that
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public interface IBlockChainStates
Methods
| Improve this Doc View SourceGetAccountState(Nullable<HashDigest<SHA256>>)
Returns the IAccountState in the hash
.
Declaration
IAccountState GetAccountState(HashDigest<SHA256>? hash)
Parameters
Type | Name | Description |
---|---|---|
Nullable<HashDigest<SHA256>> | hash | The state root hash for which to create an IAccountState. |
Returns
Type | Description |
---|---|
IAccountState | The IAccountState with |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when no ITrie with
|
See Also
| Improve this Doc View SourceGetAccountState(Nullable<BlockHash>)
Returns the IAccountState in the offset
.
Declaration
IAccountState GetAccountState(BlockHash? offset)
Parameters
Type | Name | Description |
---|---|---|
Nullable<BlockHash> | offset | The BlockHash of the Block to create for which to create an IAccountState. |
Returns
Type | Description |
---|---|
IAccountState | The IAccountState at |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when
|
See Also
| Improve this Doc View SourceGetBalance(Address, Currency, Nullable<BlockHash>)
Gets address
's balance for given currency
in the
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. |
Nullable<BlockHash> | offset |
Returns
Type | Description |
---|---|
FungibleAssetValue | The |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when IAccount at
|
GetState(Address, Nullable<BlockHash>)
Gets a state associated to specified address
.
Declaration
IValue GetState(Address address, BlockHash? offset)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address of the state to query. |
Nullable<BlockHash> | offset |
Returns
Type | Description |
---|---|
Bencodex.Types.IValue | The state associated to specified |
Remarks
For performance reasons, it is generally recommended to use GetStates(IReadOnlyList<Address>, Nullable<BlockHash>) with a batch of Addresses instead of iterating over this method.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when
|
GetStates(IReadOnlyList<Address>, Nullable<BlockHash>)
Gets multiple states associated to specified addresses
.
Declaration
IReadOnlyList<IValue> GetStates(IReadOnlyList<Address> addresses, BlockHash? offset)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<Address> | addresses | The Addresses of the states to query. |
Nullable<BlockHash> | offset |
Returns
Type | Description |
---|---|
IReadOnlyList<Bencodex.Types.IValue> | The states associated to specified |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when
|
GetTotalSupply(Currency, Nullable<BlockHash>)
Gets the total supply of a currency
in the
offset
, and if not found, returns 0.
Declaration
FungibleAssetValue GetTotalSupply(Currency currency, BlockHash? offset)
Parameters
Type | Name | Description |
---|---|---|
Currency | currency | The currency type to query. |
Nullable<BlockHash> | offset |
Returns
Type | Description |
---|---|
FungibleAssetValue | The total supply value of |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when IAccount at
|
TotalSupplyNotTrackableException | Thrown when
given |
See Also
| Improve this Doc View SourceGetValidatorSet(Nullable<BlockHash>)
Returns the validator set in the
offset
.
Declaration
ValidatorSet GetValidatorSet(BlockHash? offset)
Parameters
Type | Name | Description |
---|---|---|
Nullable<BlockHash> | offset |
Returns
Type | Description |
---|---|
ValidatorSet | The validator set of type ValidatorSet at
|
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when IAccount at
|