SPLToken2022ExtensionsProgram.withdrawWithheldTokensFromMint constructor
SPLToken2022ExtensionsProgram.withdrawWithheldTokensFromMint({
- required SolAddress mint,
- required SolAddress destination,
- required SolAddress authority,
- SolAddress programId = SPLTokenProgramConst.token2022ProgramId,
- List<
SolAddress> multiSigners = const [],
Transfer all withheld tokens in the mint to an account. Signed by the mint's withdraw withheld tokens authority.
Implementation
factory SPLToken2022ExtensionsProgram.withdrawWithheldTokensFromMint({
/// The token mint.
required SolAddress mint,
/// The fee receiver account.
required SolAddress destination,
/// The mint's withdraw withheld authority.
required SolAddress authority,
SolAddress programId = SPLTokenProgramConst.token2022ProgramId,
/// Multisignature owner/delegate
List<SolAddress> multiSigners = const [],
}) {
if (programId == SPLTokenProgramConst.tokenProgramId) {
throw const MessageException("Token program does not support extensions");
}
return SPLToken2022ExtensionsProgram(
keys: SPLTokenUtils.buildKeys(
keys: [mint.toWritable(), destination.toWritable()],
owner: authority,
multiSigners: multiSigners),
programId: programId,
layout: SPLToken2022WithdrawWithheldTokensFromMintLayout());
}