MCPcopy Create free account
hub / github.com/solana-program/system / getCreateNonceInstructionPlan

Function getCreateNonceInstructionPlan

clients/js/test/_setup.ts:29–50  ·  view source on GitHub ↗
(
    client: ClientWithPayer & ClientWithRpc<GetMinimumBalanceForRentExemptionApi>,
    nonce: TransactionSigner,
    nonceAuthority: TransactionSigner,
)

Source from the content-addressed store, hash-verified

27};
28
29export const getCreateNonceInstructionPlan = async (
30 client: ClientWithPayer & ClientWithRpc<GetMinimumBalanceForRentExemptionApi>,
31 nonce: TransactionSigner,
32 nonceAuthority: TransactionSigner,
33) => {
34 const space = BigInt(getNonceSize());
35 const rent = await client.rpc.getMinimumBalanceForRentExemption(space).send();
36
37 return sequentialInstructionPlan([
38 getCreateAccountInstruction({
39 payer: client.payer,
40 newAccount: nonce,
41 lamports: rent,
42 space,
43 programAddress: SYSTEM_PROGRAM_ADDRESS,
44 }),
45 getInitializeNonceAccountInstruction({
46 nonceAccount: nonce.address,
47 nonceAuthority: nonceAuthority.address,
48 }),
49 ]);
50};

Callers 1

Calls 3

getNonceSizeFunction · 0.90

Tested by

no test coverage detected