SystemProgram.createAccount constructor
SystemProgram.createAccount({
- required SolAddress from,
- required SolAddress newAccountPubKey,
- required SystemCreateLayout layout,
Create account system transaction
Implementation
factory SystemProgram.createAccount({
/// The account that will transfer lamports to the created account
required SolAddress from,
/// address of the created account
required SolAddress newAccountPubKey,
required SystemCreateLayout layout,
}) {
return SystemProgram(
layout: layout,
keys: [
AccountMeta(publicKey: from, isSigner: true, isWritable: true),
AccountMeta(
publicKey: newAccountPubKey, isSigner: true, isWritable: true)
],
programId: SystemProgramConst.programId);
}