SPLTokenProgram.initializeMintCloseAuthority constructor

SPLTokenProgram.initializeMintCloseAuthority({
  1. required SPLTokenInitializeMintCloseAuthorityLayout layout,
  2. required SolAddress mint,
  3. required SolAddress programId,
})

Initialize the close account authority on a new mint.

Implementation

factory SPLTokenProgram.initializeMintCloseAuthority(
    {required SPLTokenInitializeMintCloseAuthorityLayout layout,

    /// The mint to initialize.
    required SolAddress mint,
    required SolAddress programId}) {
  if (programId == SPLTokenProgramConst.tokenProgramId) {
    throw const SolanaPluginException(
        "Token program does not support extensions");
  }
  return SPLTokenProgram(
      layout: layout, keys: [mint.toWritable()], programId: programId);
}