revoke static method

TransactionInstruction revoke({
  1. required Pubkey source,
  2. required Pubkey owner,
  3. List<Pubkey> signers = const [],
})

Revokes the delegate's authority.

Keys:

Single owner

  • [w] source - The source account.
  • [s] owner - The source account owner.

Multisignature owner

  • [w] source - The source account.
  • [] owner - The source account's multisignature owner.
  • [s] signers - The signer accounts.

Implementation

static TransactionInstruction revoke({
  // Keys
  required final Pubkey source,
  required final Pubkey owner,
  final List<Pubkey> signers = const [],
}) {
  // * Single owner
  // 0. `[w]` The source account.
  // 1. `[s]` The source account owner.
  ///
  // * Multisignature owner
  // 0. `[w]` The source account.
  // 1. `[]` The source account's multisignature owner.
  // 2. ..2+M `[s]` M signer accounts.
  final List<AccountMeta> keys = [
    AccountMeta.writable(source),
    AccountMeta(owner, isSigner: signers.isEmpty),
    for (final Pubkey signer in signers) AccountMeta.signer(signer),
  ];

  return _instance.createTransactionIntruction(
    TokenInstruction.revoke,
    keys: keys,
  );
}