SPLTokenProgram.approveChecked constructor

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

Approves a delegate. A delegate is given the authority over tokens on behalf of the source account's owner.

This instruction differs from Approve in that the token mint and decimals value is checked by the caller.

Implementation

factory SPLTokenProgram.approveChecked(
    {required SPLTokenApproveCheckedLayout layout,

    /// The source account.
    required SolAddress account,

    /// The token mint.
    required SolAddress mint,

    /// The delegate.
    required SolAddress delegate,

    /// The source account owner.
    required SolAddress owner,
    SolAddress programId = SPLTokenProgramConst.tokenProgramId,

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