SPLTokenProgram.closeAccount constructor
SPLTokenProgram.closeAccount({
- required SolAddress account,
- required SolAddress destination,
- required SolAddress authority,
- SolAddress programId = SPLTokenProgramConst.tokenProgramId,
- List<
SolAddress> multiSigners = const [],
Close an account by transferring all its SOL to the destination account. Non-native accounts may only be closed if its token amount is zero.
Implementation
factory SPLTokenProgram.closeAccount(
{
/// The account to close.
required SolAddress account,
/// The destination account.
required SolAddress destination,
/// The account's owner.
required SolAddress authority,
SolAddress programId = SPLTokenProgramConst.tokenProgramId,
/// Multisignature owner
List<SolAddress> multiSigners = const []}) {
return SPLTokenProgram(
layout: SPLTokenCloseAccountLayout(),
keys: SPLTokenUtils.buildKeys(keys: [
account.toWritable(),
destination.toWritable(),
], owner: authority, multiSigners: multiSigners),
programId: programId);
}