Skip to main content

Lightnet

o1js / Modules / Lightnet

Namespace: Lightnet

Table of contents

Functions

Functions

acquireKeyPair

acquireKeyPair(options?): Promise<{ privateKey: PrivateKey ; publicKey: PublicKey }>

Gets random key pair (public and private keys) from account manager that operates with accounts configured in target network Genesis Ledger.

If an error is returned by the specified endpoint, an error is thrown. Otherwise, the data is returned.

Parameters

NameTypeDescription
optionsObject-
options.isRegularAccount?booleanWhether to acquire regular or zkApp account (one with already configured verification key)
options.lightnetAccountManagerEndpoint?stringAccount manager endpoint to fetch from

Returns

Promise<{ privateKey: PrivateKey ; publicKey: PublicKey }>

Key pair

Defined in

lib/fetch.ts:1026


releaseKeyPair

releaseKeyPair(options): Promise<string | null>

Releases previously acquired key pair by public key.

Parameters

NameTypeDescription
optionsObject-
options.lightnetAccountManagerEndpoint?stringAccount manager endpoint to fetch from
options.publicKeystringPublic key of previously acquired key pair to release

Returns

Promise<string | null>

Response message from the account manager as string or null if the request failed

Defined in

lib/fetch.ts:1069