SystemInstruction.assignWithSeed constructor
SystemInstruction.assignWithSeed({
- required Ed25519HDPublicKey account,
- required Ed25519HDPublicKey base,
- required String seed,
- required Ed25519HDPublicKey owner,
Assign account
to a program based on a seed
.
Implementation
factory SystemInstruction.assignWithSeed({
required Ed25519HDPublicKey account,
required Ed25519HDPublicKey base,
required String seed,
required Ed25519HDPublicKey owner,
}) =>
SystemInstruction._(
accounts: [
AccountMeta.writeable(pubKey: account, isSigner: false),
AccountMeta.readonly(pubKey: base, isSigner: true),
],
data: ByteArray.merge([
SystemProgram.assignWithSeedInstructionIndex,
base.toByteArray(),
ByteArray.fromString(seed),
owner.toByteArray(),
]),
);