Interface IAccountStateDelta
An interface to manipulate account states with maintaining the set of UpdatedAddresses.
It is like a map which is virtually initialized such
that every possible Address exists and
is mapped to null
. That means that:
Inherited Members
Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IAccountStateDelta : IAccountStateView
Remarks
This interface is immutable. SetState(Address, IValue) method does not manipulate the instance, but returns a new IAccountStateDelta instance with updated states.
Properties
| Improve this Doc View SourceStateUpdatedAddresses
Addresses of the accounts whose states have been updated since then.
Declaration
IImmutableSet<Address> StateUpdatedAddresses { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<Address> |
TotalSupplyUpdatedCurrencies
Currency with their total supplies updated.
Declaration
IImmutableSet<Currency> TotalSupplyUpdatedCurrencies { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<Currency> |
UpdatedAddresses
Addresses of the accounts that have been updated since then.
Declaration
IImmutableSet<Address> UpdatedAddresses { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<Address> |
UpdatedFungibleAssets
Addresses and sets of Currency whose fungible assets have been updated since then.
For example, if A transfers 10 FOO to B and B transfers 20 BAR to C,
UpdatedFungibleAssets become likes
{ [A] = { FOO }, [B] = { FOO, BAR }, [C] = { BAR } }
.
Declaration
IImmutableDictionary<Address, IImmutableSet<Currency>> UpdatedFungibleAssets { get; }
Property Value
Type | Description |
---|---|
IImmutableDictionary<Address, IImmutableSet<Currency>> |
Methods
| Improve this Doc View SourceBurnAsset(Address, FungibleAssetValue)
Burns the fungible asset value
(i.e., in-game monetary) from
owner
's balance.
Declaration
IAccountStateDelta BurnAsset(Address owner, FungibleAssetValue value)
Parameters
Type | Name | Description |
---|---|---|
Address | owner | The address who owns the fungible asset to burn. |
FungibleAssetValue | value | The fungible asset |
Returns
Type | Description |
---|---|
IAccountStateDelta | A new IAccountStateDelta instance that the given |
Exceptions
Type | Condition |
---|---|
CurrencyPermissionException | Thrown when a transaction signer (or a miner in case of block actions) is not a member of the Currency's Minters. |
InsufficientBalanceException | Thrown when the |
MintAsset(Address, FungibleAssetValue)
Mints the fungible asset value
(i.e., in-game monetary),
and give it to the recipient
.
Declaration
IAccountStateDelta MintAsset(Address recipient, FungibleAssetValue value)
Parameters
Type | Name | Description |
---|---|---|
Address | recipient | The address who receives the minted asset. |
FungibleAssetValue | value | The asset value to mint. |
Returns
Type | Description |
---|---|
IAccountStateDelta | A new IAccountStateDelta instance that the given |
Exceptions
Type | Condition |
---|---|
CurrencyPermissionException | Thrown when a transaction signer (or a miner in case of block actions) is not a member of the Currency's Minters. |
SupplyOverflowException | Thrown when the sum of the
|
SetState(Address, IValue)
Gets a new instance that the account state of the given
address
is set to the given
state
.
Declaration
IAccountStateDelta SetState(Address address, IValue state)
Parameters
Type | Name | Description |
---|---|---|
Address | address | The Address referring the account to set its state. |
IValue | state | The new state to fill the account with. |
Returns
Type | Description |
---|---|
IAccountStateDelta | A new IAccountStateDelta instance that
the account state of the given |
Remarks
This method method does not manipulate the instance, but returns a new IAccountStateDelta instance with updated states instead.
TransferAsset(Address, Address, FungibleAssetValue, Boolean)
Transfers the fungible asset value
(i.e., in-game monetary)
from the sender
to the recipient
.
Declaration
IAccountStateDelta TransferAsset(Address sender, Address recipient, FungibleAssetValue value, bool allowNegativeBalance = false)
Parameters
Type | Name | Description |
---|---|---|
Address | sender | The address who sends the fungible asset to
the |
Address | recipient | The address who receives the fungible asset from
the |
FungibleAssetValue | value | The asset value to transfer. |
Boolean | allowNegativeBalance | Turn on to allow |
Returns
Type | Description |
---|---|
IAccountStateDelta | A new IAccountStateDelta instance that the given |
Exceptions
Type | Condition |
---|---|
InsufficientBalanceException | Thrown when the |