SystemProgram.transfer constructor

SystemProgram.transfer({
  1. required SystemTransferLayout layout,
  2. required SolAddress from,
  3. required SolAddress to,
})

Transfer system transaction

Implementation

factory SystemProgram.transfer({
  required SystemTransferLayout layout,

  /// Account that will transfer lamports
  required SolAddress from,

  /// Account that will receive transferred lamports
  required SolAddress to,
}) {
  return SystemProgram(
      layout: layout,
      keys: [
        AccountMeta(publicKey: from, isSigner: true, isWritable: true),
        AccountMeta(publicKey: to, isSigner: false, isWritable: true)
      ],
      programId: SystemProgramConst.programId);
}