Show / Hide Table of Contents

Class AccountState

A default implementation of IAccountState interface.

Inheritance
Object
AccountState
Implements
IAccountState
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Action.State
Assembly: Libplanet.Action.dll
Syntax
public class AccountState : IAccountState

Constructors

| Improve this Doc View Source

AccountState(ITrie)

A default implementation of IAccountState interface.

Declaration
public AccountState(ITrie trie)
Parameters
Type Name Description
ITrie trie

Properties

| Improve this Doc View Source

Trie

A default implementation of IAccountState interface.

Declaration
public ITrie Trie { get; }
Property Value
Type Description
ITrie

Methods

| Improve this Doc View Source

GetBalance(Address, Currency)

Queries address's balance of the currency.

Declaration
public 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 address's balance of the currency.

| Improve this Doc View Source

GetState(Address)

Gets the account state of the given address.

Declaration
public 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 address. If it has never been set to any state it returns null instead.

| Improve this Doc View Source

GetStates(IReadOnlyList<Address>)

Gets multiple account states associated with the specified addresses at once.

Declaration
public 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 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)

Returns the total supply of a currency.

Declaration
public FungibleAssetValue GetTotalSupply(Currency currency)
Parameters
Type Name Description
Currency currency

The currency type to query.

Returns
Type Description
FungibleAssetValue

The total supply of the currency.

Exceptions
Type Condition
TotalSupplyNotTrackableException

Thrown when the total supply of the given currency is not trackable.

See Also
MaximumSupply
| Improve this Doc View Source

GetValidatorSet()

Returns the validator set.

Declaration
public ValidatorSet GetValidatorSet()
Returns
Type Description
ValidatorSet

The validator set of type ValidatorSet.

Implements

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