(
client: ClientWithPayer & ClientWithRpc<GetMinimumBalanceForRentExemptionApi>,
nonce: TransactionSigner,
nonceAuthority: TransactionSigner,
)
| 27 | }; |
| 28 | |
| 29 | export 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 | }; |
no test coverage detected