SystemProgram.createAccountWithSeed constructor

SystemProgram.createAccountWithSeed({
  1. required SolAddress from,
  2. required SolAddress newAccount,
  3. required SolAddress baseAccount,
  4. required SystemCreateWithSeedLayout layout,
})

Create account with seed system transaction

Implementation

factory SystemProgram.createAccountWithSeed({
  /// The account that will transfer lamports to the created account
  required SolAddress from,

  /// address of the created account.
  required SolAddress newAccount,

  /// Base address to use to derive the address of the created account
  required SolAddress baseAccount,
  required SystemCreateWithSeedLayout layout,
}) {
  return SystemProgram(
      layout: layout,
      keys: [
        AccountMeta(publicKey: from, isSigner: true, isWritable: true),
        AccountMeta(publicKey: newAccount, isSigner: false, isWritable: true)
      ],
      programId: SystemProgramConst.programId);
}