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: [
from.toSignerAndWritable(),
newAccountPubKey.toSignerAndWritable()
],
programId: SystemProgramConst.programId);
}