TokenInstruction.freezeAccount constructor
TokenInstruction.freezeAccount({
- required Ed25519HDPublicKey account,
- required Ed25519HDPublicKey mint,
- required Ed25519HDPublicKey freezeAuthority,
- List<
Ed25519HDPublicKey> signers = const <Ed25519HDPublicKey>[],
Freeze an Initialized account
using the mint's freezeAuthority
.
Implementation
factory TokenInstruction.freezeAccount({
required Ed25519HDPublicKey account,
required Ed25519HDPublicKey mint,
required Ed25519HDPublicKey freezeAuthority,
List<Ed25519HDPublicKey> signers = const <Ed25519HDPublicKey>[],
}) =>
TokenInstruction._(
accounts: [
AccountMeta.writeable(pubKey: account, isSigner: false),
AccountMeta.writeable(pubKey: mint, isSigner: false),
AccountMeta.writeable(
pubKey: freezeAuthority,
isSigner: signers.isEmpty,
),
...signers.map(
(pubKey) => AccountMeta.readonly(pubKey: pubKey, isSigner: true),
),
],
data: TokenProgram.freezeAccountInstructionIndex,
);