createNonceAccountWithSeed static method
Generates a transaction that creates a new Nonce account.
Keys:
[s, w]
fromPubkey
The account that will transfer lamports to the created nonce account.[s, w]
noncePubkey
The public key of the created nonce account.[]
authorizedPubkey
The public key to set as the authority of the created nonce account.
Data:
lamports
The amount of lamports to transfer to the created nonce account.basePubkey
The base public key used to derive the address of the nonce account.seed
The 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,
)
];