Skip to main content

Ledger

Defined in: bindings.d.ts:505

Represents the Mina ledger.

Constructors​

Constructor​

new Ledger(): Ledger;

Returns​

Ledger

Methods​

addAccount()​

addAccount(publicKey: MlPublicKey, balance: string): void;

Defined in: bindings.d.ts:519

Adds an account and its balance to the ledger.

Parameters​

publicKey​

MlPublicKey

balance​

string

Returns​

void


applyJsonTransaction()​

applyJsonTransaction(
txJson: string,
accountCreationFee: string,
networkState: string): void;

Defined in: bindings.d.ts:524

Applies a JSON transaction to the ledger.

Parameters​

txJson​

string

accountCreationFee​

string

networkState​

string

Returns​

void


getAccount()​

getAccount(publicKey: MlPublicKey, tokenId: FieldConst): undefined | Account;

Defined in: bindings.d.ts:533

Returns an account.

Parameters​

publicKey​

MlPublicKey

tokenId​

FieldConst

Returns​

undefined | Account


create()​

static create(): Ledger;

Defined in: bindings.d.ts:509

Creates a fresh ledger.

Returns​

Ledger


migrateAccount()​

static migrateAccount(hardforkSlot: number, account: string): Account;

Defined in: bindings.d.ts:514

Migrates a berkeley account to a mesa account.

Parameters​

hardforkSlot​

number

account​

string

Returns​

Account