SPLTokenProgram.approve constructor

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

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

Implementation

factory SPLTokenProgram.approve(
    {required SPLTokenApproveLayout layout,

    /// The source account.
    required SolAddress account,

    /// The delegate.
    required SolAddress delegate,

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

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