Skip to main content

acquireKeyPair

function acquireKeyPair(options: {
"isRegularAccount": boolean;
"lightnetAccountManagerEndpoint": string;
}): 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

options= {}

options.isRegularAccount?: boolean

Whether to acquire key pair of regular or zkApp account (one with already configured verification key)

options.lightnetAccountManagerEndpoint?: string

Account manager endpoint to fetch from

Returns

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

Key pair

privateKey

privateKey: PrivateKey;

publicKey

publicKey: PublicKey;

Source

lib/mina/fetch.ts:816