createNonceAccountWithSeed static method

List<TransactionInstruction> createNonceAccountWithSeed({
  1. required Pubkey fromPubkey,
  2. required Pubkey noncePubkey,
  3. required Pubkey authorizedPubkey,
  4. required bu64 lamports,
  5. required Pubkey basePubkey,
  6. required String seed,
})

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,
      )
    ];