Show / Hide Table of Contents

Interface IAccountStateView

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 , but returns null instead, and
  • filling an Address with null state cannot be distinguished from the Address having never been set to any state.
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IAccountStateView

Methods

| Improve this Doc View Source

GetBalance(Address, Currency)

Queries address's balance of the currency.

Declaration
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
IValue? GetState(Address address)
Parameters
Type Name Description
Address address

The Address referring the account to get its state.

Returns
Type Description
Nullable<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
IReadOnlyList<IValue?> GetStates(IReadOnlyList<Address> addresses)
Parameters
Type Name Description
IReadOnlyList<Address> addresses

The Addresses associated with states to get.

Returns
Type Description
IReadOnlyList<Nullable<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
In This Article
Back to top Copyright © 2018–2022 Planetarium