SPLTokenProgram.reallocate constructor
SPLTokenProgram.reallocate({
- required SPLTokenReallocateLayout layout,
- required SolAddress account,
- required SolAddress payer,
- required SolAddress owner,
- SolAddress programId = SPLTokenProgramConst.token2022ProgramId,
- List<
SolAddress> multiSigners = const [],
Check to see if a token account is large enough for a list of ExtensionTypes, and if not, use reallocation to increase the data size.
Implementation
factory SPLTokenProgram.reallocate({
required SPLTokenReallocateLayout layout,
/// The account to reallocate.
required SolAddress account,
/// The payer account to fund reallocation
required SolAddress payer,
/// The account's owner.
required SolAddress owner,
SolAddress programId = SPLTokenProgramConst.token2022ProgramId,
/// Multisignature owner
List<SolAddress> multiSigners = const [],
}) {
if (programId == SPLTokenProgramConst.tokenProgramId) {
throw const MessageException("Token program does not support extensions");
}
return SPLTokenProgram(
layout: layout,
keys: SPLTokenUtils.buildKeys(keys: [
account.toWritable(),
payer.toSignerAndWritable(),
SystemProgramConst.programId.toReadOnly(),
], owner: owner, multiSigners: multiSigners),
programId: programId);
}