Skip to main content

Ledger

o1js / Modules / Ledger

Class: Ledger

Represents the Mina ledger.

Table of contents

Constructors

Methods

Constructors

constructor

new Ledger()

Methods

addAccount

addAccount(publicKey, balance): void

Adds an account and its balance to the ledger.

Parameters

NameType
publicKeyMlPublicKey
balancestring

Returns

void

Defined in

snarky.d.ts:596


applyJsonTransaction

applyJsonTransaction(txJson, accountCreationFee, networkState): void

Applies a JSON transaction to the ledger.

Parameters

NameType
txJsonstring
accountCreationFeestring
networkStatestring

Returns

void

Defined in

snarky.d.ts:601


getAccount

getAccount(publicKey, tokenId): undefined | Account

Returns an account.

Parameters

NameType
publicKeyMlPublicKey
tokenIdFieldConst

Returns

undefined | Account

Defined in

snarky.d.ts:610


create

Static create(): Ledger

Creates a fresh ledger.

Returns

Ledger

Defined in

snarky.d.ts:591