SPLTokenProgram.transfer constructor

SPLTokenProgram.transfer({
  1. required SPLTokenTransferLayout layout,
  2. required SolAddress source,
  3. required SolAddress destination,
  4. required SolAddress owner,
  5. SolAddress programId = SPLTokenProgramConst.tokenProgramId,
  6. List<SolAddress> multiSigners = const [],
})

Transfers tokens from one account to another either directly or via a delegate. If this account is associated with the native mint then equal amounts of SOL and Tokens will be transferred to the destination account.

Implementation

factory SPLTokenProgram.transfer({
  required SPLTokenTransferLayout layout,

  /// The source account.
  required SolAddress source,

  /// The destination account.
  required SolAddress destination,

  /// The source 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: [
        source.toWritable(),
        destination.toWritable(),
      ], owner: owner, multiSigners: multiSigners),
      programId: programId);
}