thawAccount static method

TransactionInstruction thawAccount({
  1. required Pubkey account,
  2. required Pubkey mint,
  3. required Pubkey authority,
  4. List<Pubkey> signers = const [],
})

Thaw a Frozen account using the Mint's freeze_authority (if set).

Keys:

  • Single owner
  1. [writable] The account to freeze.
  2. [] The token mint.
  3. [signer] The mint freeze authority.
  • Multisignature owner
  1. [writable] The account to freeze.
  2. [] The token mint.
  3. [] The mint's multisignature freeze authority.
  4. ..3+M [signer] M signer accounts.

Implementation

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

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