@proto-kit/libraryDocs


Documentation / @proto-kit/library / Balances

Class: Balances<Config>

Base class for runtime modules providing the necessary utilities.

Extends

Extended by

Type Parameters

Config = NoConfig

Implements

Constructors

new Balances()

new Balances<Config>(): Balances<Config>

Returns

Balances<Config>

Inherited from

RuntimeModule.constructor

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:33

Properties

balances

balances: StateMap<BalancesKey, Balance>

Implementation of

MinimalBalances.balances

Defined in

packages/library/src/runtime/Balances.ts:44


currentConfig

protected currentConfig: undefined | Config

Store the config separately, so that we can apply additional checks when retrieving it via the getter

Inherited from

RuntimeModule.currentConfig

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:17


events?

optional events: RuntimeEvents<any>

Inherited from

RuntimeModule.events

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:31


isRuntimeModule

isRuntimeModule: boolean

This property exists only to typecheck that the RuntimeModule was extended correctly in e.g. a decorator. We need at least one non-optional property in this class to make the typechecking work.

Inherited from

RuntimeModule.isRuntimeModule

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:28


messages?

optional messages: OutgoingMessages<OutgoingMessagesRecord>

Inherited from

RuntimeModule.messages

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:32


name?

optional name: string

Inherited from

RuntimeModule.name

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:29


parent?

optional parent: RuntimeEnvironment

Inherited from

RuntimeModule.parent

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:30


runtimeMethodNames

readonly runtimeMethodNames: string[]

Holds all method names that are callable throw transactions

Inherited from

RuntimeModule.runtimeMethodNames

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:22


presets

static presets: Presets<unknown>

Inherited from

RuntimeModule.presets

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:18

Accessors

config

Get Signature

get config(): Config

Returns

Config

Set Signature

set config(config): void

Parameters

config: Config

Returns

void

Inherited from

RuntimeModule.config

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:18


network

Get Signature

get network(): NetworkState

Returns

NetworkState

Inherited from

RuntimeModule.network

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:36


transaction

Get Signature

get transaction(): RuntimeTransaction

Returns

RuntimeTransaction

Inherited from

RuntimeModule.transaction

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:35

Methods

burn()

burn(tokenId, address, amount): Promise<void>

Parameters

tokenId: TokenId

address: PublicKey

amount: Balance

Returns

Promise<void>

Defined in

packages/library/src/runtime/Balances.ts:94


create()

create(childContainerProvider): void

Parameters

childContainerProvider: ChildContainerProvider

Returns

void

Inherited from

RuntimeModule.create

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:20


getBalance()

getBalance(tokenId, address): Promise<Balance>

Parameters

tokenId: TokenId

address: PublicKey

Returns

Promise<Balance>

Defined in

packages/library/src/runtime/Balances.ts:49


getInputs()

getInputs(): RuntimeMethodExecutionData

Returns

RuntimeMethodExecutionData

Inherited from

RuntimeModule.getInputs

Defined in

packages/module/dist/runtime/RuntimeModule.d.ts:34


mint()

mint(tokenId, address, amount): Promise<void>

Parameters

tokenId: TokenId

address: PublicKey

amount: Balance

Returns

Promise<void>

Defined in

packages/library/src/runtime/Balances.ts:88


setBalance()

setBalance(tokenId, address, amount): Promise<void>

Parameters

tokenId: TokenId

address: PublicKey

amount: Balance

Returns

Promise<void>

Defined in

packages/library/src/runtime/Balances.ts:58


transfer()

transfer(tokenId, from, to, amount): Promise<void>

Parameters

tokenId: TokenId

from: PublicKey

to: PublicKey

amount: Balance

Returns

Promise<void>

Implementation of

MinimalBalances.transfer

Defined in

packages/library/src/runtime/Balances.ts:67


transferSigned()

transferSigned(tokenId, from, to, amount): Promise<void>

Parameters

tokenId: TokenId

from: PublicKey

to: PublicKey

amount: Balance

Returns

Promise<void>

Defined in

packages/library/src/runtime/Balances.ts:102