SPLTokenProgram.mintToChecked constructor

SPLTokenProgram.mintToChecked({
  1. required SPLTokenMintToCheckedLayout layout,
  2. required SolAddress mint,
  3. required SolAddress destination,
  4. required SolAddress authority,
  5. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
  6. List<SolAddress> multiSigners = const [],
})

Mints new tokens to an account. The native mint does not support minting.

This instruction differs from MintTo in that the decimals value is checked by the caller.

Implementation

factory SPLTokenProgram.mintToChecked({
  required SPLTokenMintToCheckedLayout layout,

  /// The mint.
  required SolAddress mint,

  /// The account to mint tokens to.
  required SolAddress destination,

  /// The mint's minting authority.
  required SolAddress authority,
  SolAddress programId = SPLTokenProgramConst.tokenProgramId,

  /// Multisignature
  List<SolAddress> multiSigners = const [],
}) {
  return SPLTokenProgram(
      layout: layout,
      keys: SPLTokenUtils.buildKeys(keys: [
        mint.toWritable(),
        destination.toWritable(),
      ], owner: authority, multiSigners: multiSigners),
      programId: programId);
}