SPLTokenProgram.burn constructor

SPLTokenProgram.burn({
  1. required SPLTokenBurnLayout layout,
  2. required SolAddress account,
  3. required SolAddress mint,
  4. required SolAddress owner,
  5. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
  6. List<SolAddress> multiSigners = const [],
})

Burns tokens by removing them from an account. SPLTokenProgram.burn does not support accounts associated with the native mint, use SPLTokenProgram.closeAccount instead.

Implementation

factory SPLTokenProgram.burn(
    {required SPLTokenBurnLayout layout,

    ///  The account to burn from.
    required SolAddress account,

    /// The token mint.
    required SolAddress mint,

    /// The account's owner/delegate.
    required SolAddress owner,
    SolAddress programId = SPLTokenProgramConst.tokenProgramId,

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