SPLTokenProgram.initializeMint constructor

SPLTokenProgram.initializeMint({
  1. required SPLTokenInitializeMintLayout layout,
  2. required SolAddress mint,
  3. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
})

Initializes a new mint and optionally deposits all the newly minted tokens in an account.

Implementation

factory SPLTokenProgram.initializeMint(
    {required SPLTokenInitializeMintLayout layout,

    /// The mint to initialize.
    required SolAddress mint,
    SolAddress programId = SPLTokenProgramConst.tokenProgramId}) {
  return SPLTokenProgram(
      layout: layout,
      keys: [
        mint.toWritable(),
        SystemProgramConst.sysvarRentPubkey.toReadOnly()
      ],
      programId: programId);
}