SystemInstruction.createAccountWithSeed constructor
SystemInstruction.createAccountWithSeed({
- required Ed25519HDPublicKey fundingAccount,
- required Ed25519HDPublicKey newAccount,
- required Ed25519HDPublicKey base,
- required String seed,
- required int lamports,
- required int space,
- required Ed25519HDPublicKey owner,
Create a new account at an address derived from a base pubkey and
a seed.
Implementation
factory SystemInstruction.createAccountWithSeed({
required Ed25519HDPublicKey fundingAccount,
required Ed25519HDPublicKey newAccount,
required Ed25519HDPublicKey base,
required String seed,
required int lamports,
required int space,
required Ed25519HDPublicKey owner,
}) =>
SystemInstruction._(
accounts: [
AccountMeta.writeable(pubKey: fundingAccount, isSigner: true),
AccountMeta.writeable(pubKey: newAccount, isSigner: false),
AccountMeta.readonly(pubKey: base, isSigner: true),
],
data: ByteArray.merge([
SystemProgram.createAccountWithSeedInstructionIndex,
base.toByteArray(),
ByteArray.fromString(seed),
ByteArray.u64(lamports),
ByteArray.u64(space),
owner.toByteArray(),
]),
);