SystemInstruction.allocateWithSeed constructor

SystemInstruction.allocateWithSeed({
  1. required Ed25519HDPublicKey account,
  2. required Ed25519HDPublicKey base,
  3. required String seed,
  4. required int space,
  5. required Ed25519HDPublicKey owner,
})

Allocate space for and assign an account at an address derived from a base public key and a seed.

Implementation

factory SystemInstruction.allocateWithSeed({
  required Ed25519HDPublicKey account,
  required Ed25519HDPublicKey base,
  required String seed,
  required int space,
  required Ed25519HDPublicKey owner,
}) =>
    SystemInstruction._(
      accounts: [
        AccountMeta.writeable(pubKey: account, isSigner: false),
        AccountMeta.writeable(pubKey: base, isSigner: true),
      ],
      data: ByteArray.merge([
        SystemProgram.allocateWithSeedInstructionIndex,
        base.toByteArray(),
        ByteArray.fromString(seed),
        ByteArray.u64(space),
        owner.toByteArray(),
      ]),
    );