Skip to main content

Class: Ledger

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Ledger()

Properties

encoding

Static encoding: Object

Type declaration

NameType
versionBytesRecord<"tokenIdKey" | "receiptChainHash" | "ledgerHash" | "epochSeed" | "stateHash", number>
ofBase58(base58: string, versionByte: number) => MlBytes
toBase58(s: MlBytes, versionByte: number) => string

Defined in

snarky.d.ts:830


hashInputFromJson

Static hashInputFromJson: Object

Type declaration

NameType
accountPrecondition(json: String) => OcamlInput
body(json: String) => OcamlInput
networkPrecondition(json: String) => OcamlInput
packInput(input: OcamlInput) => Field[]
permissions(json: String) => OcamlInput
timing(json: String) => OcamlInput
update(json: String) => OcamlInput

Defined in

snarky.d.ts:819

Methods

addAccount

addAccount(publicKey, balance): void

Parameters

NameType
publicKeyPublicKey_
balancestring

Returns

void

Defined in

snarky.d.ts:773


applyJsonTransaction

applyJsonTransaction(txJson, accountCreationFee, networkState): Account[]

Parameters

NameType
txJsonstring
accountCreationFeestring
networkStatestring

Returns

Account[]

Defined in

snarky.d.ts:775


getAccount

getAccount(publicKey, tokenId): undefined | Account

Parameters

NameType
publicKeyPublicKey_
tokenIdField

Returns

undefined | Account

Defined in

snarky.d.ts:781


create

Static create(genesisAccounts): Ledger

Parameters

NameType
genesisAccounts{ balance: string ; publicKey: PublicKey_ }[]

Returns

Ledger

Defined in

snarky.d.ts:769


createTokenAccount

Static createTokenAccount(publicKey, tokenId): string

Parameters

NameType
publicKeyPublicKey_
tokenIdField

Returns

string

Defined in

snarky.d.ts:805


customTokenId

Static customTokenId(publicKey, tokenId): Field

Parameters

NameType
publicKeyPublicKey_
tokenIdField

Returns

Field

Defined in

snarky.d.ts:803


customTokenIdChecked

Static customTokenIdChecked(publicKey, tokenId): Field

Parameters

NameType
publicKeyPublicKey_
tokenIdField

Returns

Field

Defined in

snarky.d.ts:804


dummySignature

Static dummySignature(): string

Returns

string

Defined in

snarky.d.ts:795


fieldOfBase58

Static fieldOfBase58(fieldBase58): Field

Parameters

NameType
fieldBase58string

Returns

Field

Defined in

snarky.d.ts:812


fieldToBase58

Static fieldToBase58(field): string

Parameters

NameType
fieldField

Returns

string

Defined in

snarky.d.ts:811


fieldsOfJson

Static fieldsOfJson(json): Field[]

Parameters

NameType
jsonstring

Returns

Field[]

Defined in

snarky.d.ts:815


hashAccountUpdateFromFields

Static hashAccountUpdateFromFields(fields): Field

Parameters

NameType
fieldsField[]

Returns

Field

Defined in

snarky.d.ts:816


hashAccountUpdateFromJson

Static hashAccountUpdateFromJson(json): Field

Parameters

NameType
jsonstring

Returns

Field

Defined in

snarky.d.ts:817


memoToBase58

Static memoToBase58(memoString): string

Parameters

NameType
memoStringstring

Returns

string

Defined in

snarky.d.ts:813


privateKeyOfString

Static privateKeyOfString(privateKeyBase58): Scalar

Parameters

NameType
privateKeyBase58string

Returns

Scalar

Defined in

snarky.d.ts:810


privateKeyToString

Static privateKeyToString(privateKey): string

Parameters

NameType
privateKeyObject
privateKey.sScalar

Returns

string

Defined in

snarky.d.ts:809


publicKeyOfString

Static publicKeyOfString(publicKeyBase58): PublicKey_

Parameters

NameType
publicKeyBase58string

Returns

PublicKey_

Defined in

snarky.d.ts:808


publicKeyToString

Static publicKeyToString(publicKey): string

Parameters

NameType
publicKeyPublicKey_

Returns

string

Defined in

snarky.d.ts:807


signAccountUpdate

Static signAccountUpdate(txJson, privateKey, i): string

Parameters

NameType
txJsonstring
privateKeyObject
privateKey.sScalar
inumber

Returns

string

Defined in

snarky.d.ts:797


signFeePayer

Static signFeePayer(txJson, privateKey): string

Parameters

NameType
txJsonstring
privateKeyObject
privateKey.sScalar

Returns

string

Defined in

snarky.d.ts:796


signFieldElement

Static signFieldElement(messageHash, privateKey): string

Parameters

NameType
messageHashField
privateKeyObject
privateKey.sScalar

Returns

string

Defined in

snarky.d.ts:791


transactionCommitments

Static transactionCommitments(txJson): Object

Parameters

NameType
txJsonstring

Returns

Object

NameType
commitmentField
fullCommitmentField

Defined in

snarky.d.ts:783


zkappPublicInput

Static zkappPublicInput(txJson, accountUpdateIndex): Object

Parameters

NameType
txJsonstring
accountUpdateIndexnumber

Returns

Object

NameType
accountUpdateField
callsField

Defined in

snarky.d.ts:787