Class: Ledger
Table of contents
Constructors
Properties
Methods
- addAccount
- applyJsonTransaction
- getAccount
- create
- createTokenAccount
- customTokenId
- customTokenIdChecked
- dummySignature
- fieldOfBase58
- fieldToBase58
- fieldsOfJson
- hashAccountUpdateFromFields
- hashAccountUpdateFromJson
- memoToBase58
- privateKeyOfString
- privateKeyToString
- publicKeyOfString
- publicKeyToString
- signAccountUpdate
- signFeePayer
- signFieldElement
- transactionCommitments
- zkappPublicInput
Constructors
constructor
• new Ledger()
Properties
encoding
▪ Static
encoding: Object
Type declaration
Name | Type |
---|---|
versionBytes | Record <"tokenIdKey" | "receiptChainHash" | "ledgerHash" | "epochSeed" | "stateHash" , number > |
ofBase58 | (base58 : string , versionByte : number ) => MlBytes |
toBase58 | (s : MlBytes , versionByte : number ) => string |
Defined in
hashInputFromJson
▪ Static
hashInputFromJson: Object
Type declaration
Name | Type |
---|---|
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
Methods
addAccount
▸ addAccount(publicKey
, balance
): void
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
balance | string |
Returns
void
Defined in
applyJsonTransaction
▸ applyJsonTransaction(txJson
, accountCreationFee
, networkState
): Account
[]
Parameters
Name | Type |
---|---|
txJson | string |
accountCreationFee | string |
networkState | string |
Returns
Account
[]
Defined in
getAccount
▸ getAccount(publicKey
, tokenId
): undefined
| Account
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
tokenId | Field |
Returns
undefined
| Account
Defined in
create
▸ Static
create(genesisAccounts
): Ledger
Parameters
Name | Type |
---|---|
genesisAccounts | { balance : string ; publicKey : PublicKey_ }[] |
Returns
Defined in
createTokenAccount
▸ Static
createTokenAccount(publicKey
, tokenId
): string
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
tokenId | Field |
Returns
string
Defined in
customTokenId
▸ Static
customTokenId(publicKey
, tokenId
): Field
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
tokenId | Field |
Returns
Defined in
customTokenIdChecked
▸ Static
customTokenIdChecked(publicKey
, tokenId
): Field
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
tokenId | Field |
Returns
Defined in
dummySignature
▸ Static
dummySignature(): string
Returns
string
Defined in
fieldOfBase58
▸ Static
fieldOfBase58(fieldBase58
): Field
Parameters
Name | Type |
---|---|
fieldBase58 | string |
Returns
Defined in
fieldToBase58
▸ Static
fieldToBase58(field
): string
Parameters
Name | Type |
---|---|
field | Field |
Returns
string
Defined in
fieldsOfJson
▸ Static
fieldsOfJson(json
): Field
[]
Parameters
Name | Type |
---|---|
json | string |
Returns
Field
[]
Defined in
hashAccountUpdateFromFields
▸ Static
hashAccountUpdateFromFields(fields
): Field
Parameters
Name | Type |
---|---|
fields | Field [] |
Returns
Defined in
hashAccountUpdateFromJson
▸ Static
hashAccountUpdateFromJson(json
): Field
Parameters
Name | Type |
---|---|
json | string |
Returns
Defined in
memoToBase58
▸ Static
memoToBase58(memoString
): string
Parameters
Name | Type |
---|---|
memoString | string |
Returns
string
Defined in
privateKeyOfString
▸ Static
privateKeyOfString(privateKeyBase58
): Scalar
Parameters
Name | Type |
---|---|
privateKeyBase58 | string |
Returns
Defined in
privateKeyToString
▸ Static
privateKeyToString(privateKey
): string
Parameters
Name | Type |
---|---|
privateKey | Object |
privateKey.s | Scalar |
Returns
string
Defined in
publicKeyOfString
▸ Static
publicKeyOfString(publicKeyBase58
): PublicKey_
Parameters
Name | Type |
---|---|
publicKeyBase58 | string |
Returns
PublicKey_
Defined in
publicKeyToString
▸ Static
publicKeyToString(publicKey
): string
Parameters
Name | Type |
---|---|
publicKey | PublicKey_ |
Returns
string
Defined in
signAccountUpdate
▸ Static
signAccountUpdate(txJson
, privateKey
, i
): string
Parameters
Name | Type |
---|---|
txJson | string |
privateKey | Object |
privateKey.s | Scalar |
i | number |
Returns
string
Defined in
signFeePayer
▸ Static
signFeePayer(txJson
, privateKey
): string
Parameters
Name | Type |
---|---|
txJson | string |
privateKey | Object |
privateKey.s | Scalar |
Returns
string
Defined in
signFieldElement
▸ Static
signFieldElement(messageHash
, privateKey
): string
Parameters
Name | Type |
---|---|
messageHash | Field |
privateKey | Object |
privateKey.s | Scalar |
Returns
string
Defined in
transactionCommitments
▸ Static
transactionCommitments(txJson
): Object
Parameters
Name | Type |
---|---|
txJson | string |
Returns
Object
Name | Type |
---|---|
commitment | Field |
fullCommitment | Field |
Defined in
zkappPublicInput
▸ Static
zkappPublicInput(txJson
, accountUpdateIndex
): Object
Parameters
Name | Type |
---|---|
txJson | string |
accountUpdateIndex | number |
Returns
Object
Name | Type |
---|---|
accountUpdate | Field |
calls | Field |