SPLTokenProgram.initializeNonTransferableMint constructor

SPLTokenProgram.initializeNonTransferableMint({
  1. required SolAddress mint,
  2. required SolAddress programId,
})

Initialize the non transferable extension for the given mint account

Implementation

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