Interface IAccountState
An interface to fetch account states.
It is like a readonly map which is virtually initialized such that every possible Address exists and is mapped to null. That means that:
- it does not have length,
- its index getter never throws KeyNotFoundException, but returns null instead, and
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public interface IAccountState
Properties
| Improve this Doc View SourceTrie
The ITrie of the IAccountState.
Declaration
[Pure]
ITrie Trie { get; }
Property Value
Type | Description |
---|---|
ITrie |
Methods
| Improve this Doc View SourceGetBalance(Address, Currency)
Queries address
's balance of the currency
.
Declaration
[Pure]
FungibleAssetValue GetBalance(Address address, Currency currency)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The owner address to query. |
Currency | currency | The currency type to query. |
Returns
Type | Description |
---|---|
FungibleAssetValue | The |
GetState(Address)
Gets the account state of the given address
.
Declaration
[Pure]
IValue GetState(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address referring the account to get its state. |
Returns
Type | Description |
---|---|
Bencodex.Types.IValue | The account state of the given |
GetStates(IReadOnlyList<Address>)
Gets multiple account states associated with the specified addresses
at once.
Declaration
[Pure]
IReadOnlyList<IValue> GetStates(IReadOnlyList<Address> addresses)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<Address> | addresses | The Addresses associated with states to get. |
Returns
Type | Description |
---|---|
IReadOnlyList<Bencodex.Types.IValue> | The states associated to the specified |
GetTotalSupply(Currency)
Returns the total supply of a currency
.
Declaration
[Pure]
FungibleAssetValue GetTotalSupply(Currency currency)
Parameters
Type | Name | Description |
---|---|---|
Currency | currency | The currency type to query. |
Returns
Type | Description |
---|---|
FungibleAssetValue | The total supply of the |
Exceptions
Type | Condition |
---|---|
TotalSupplyNotTrackableException | Thrown when the total supply of the
given |
See Also
| Improve this Doc View SourceGetValidatorSet()
Returns the validator set.
Declaration
[Pure]
ValidatorSet GetValidatorSet()
Returns
Type | Description |
---|---|
ValidatorSet | The validator set of type ValidatorSet. |