createNonceAccountWithSeed static method
Generates a transaction that creates a new Nonce account.
Keys:
[s, w]fromPubkeyThe account that will transfer lamports to the created nonce account.[s, w]noncePubkeyThe public key of the created nonce account.[]authorizedPubkeyThe public key to set as the authority of the created nonce account.
Data:
lamportsThe amount of lamports to transfer to the created nonce account.basePubkeyThe base public key used to derive the address of the nonce account.seedThe seed used to derive the address of the nonce account.
Implementation
static List<TransactionInstruction> createNonceAccountWithSeed({
required final Pubkey fromPubkey,
required final Pubkey noncePubkey,
required final Pubkey authorizedPubkey,
required final bu64 lamports,
required final Pubkey basePubkey,
required final String seed,
}) => [
SystemProgram.createAccountWithSeed(
fromPubkey: fromPubkey,
newAccountPubkey: noncePubkey,
basePubkey: basePubkey,
seed: seed,
lamports: lamports,
space: NonceAccount.length.toBigInt(),
programId: SystemProgram.programId,
),
nonceInitialize(
noncePubkey: noncePubkey,
authorizedPubkey: authorizedPubkey,
)
];