SPLToken2022ExtensionsProgram.harvestWithheldTokensToMint constructor
SPLToken2022ExtensionsProgram.harvestWithheldTokensToMint({
- required SolAddress mint,
- required List<
SolAddress> sources, - SolAddress programId = SPLTokenProgramConst.token2022ProgramId,
Permissionless instruction to transfer all withheld tokens to the mint.
Implementation
factory SPLToken2022ExtensionsProgram.harvestWithheldTokensToMint(
{
/// The mint.
required SolAddress mint,
/// The source accounts to harvest from.
required List<SolAddress> sources,
SolAddress programId = SPLTokenProgramConst.token2022ProgramId}) {
if (programId == SPLTokenProgramConst.tokenProgramId) {
throw const MessageException("Token program does not support extensions");
}
return SPLToken2022ExtensionsProgram(
keys: [mint.toWritable(), ...sources.map((e) => e.toWritable())],
programId: programId,
layout: SPLToken2022HarvestWithheldTokensToMintLayout());
}