SPLTokenProgram.initializePermanentDelegate constructor

SPLTokenProgram.initializePermanentDelegate({
  1. required SPLTokenInitializePermanentDelegateLayout layout,
  2. required SolAddress mint,
  3. required SolAddress programId,
})

Initialize the permanent delegate on a new mint.

Implementation

factory SPLTokenProgram.initializePermanentDelegate(
    {required SPLTokenInitializePermanentDelegateLayout layout,
    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);
}