nonceAuthorize static method

TransactionInstruction nonceAuthorize({
  1. required Pubkey noncePubkey,
  2. required Pubkey authorizedPubkey,
  3. required Pubkey newAuthorizedPubkey,
})

Generates a transaction instruction that authorises a new Pubkey as the authority on a Nonce account.

Keys:

  • [w] noncePubkey The nonce account.
  • [s] authorizedPubkey The public key of the current nonce authority.

Data:

  • newAuthorizedPubkey The public key to set as the new nonce authority.

Implementation

static TransactionInstruction nonceAuthorize({
  required final Pubkey noncePubkey,
  required final Pubkey authorizedPubkey,
  required final Pubkey newAuthorizedPubkey,
}) {
  final List<AccountMeta> keys = [
    AccountMeta.writable(noncePubkey),
    AccountMeta.signer(authorizedPubkey),
  ];

  final List<Iterable<int>> data = [
    borsh.pubkey.encode(newAuthorizedPubkey.toBase58()),
  ];

  return _instance.createTransactionIntruction(
    SystemInstruction.authorizeNonceAccount,
    keys: keys,
    data: data,
  );
}