SystemInstruction.allocate constructor

SystemInstruction.allocate({
  1. required Ed25519HDPublicKey account,
  2. required int space,
})

Allocate space in a (possibly new) account without funding.

Implementation

factory SystemInstruction.allocate({
  required Ed25519HDPublicKey account,
  required int space,
}) =>
    SystemInstruction._(
      accounts: [AccountMeta.writeable(pubKey: account, isSigner: true)],
      data: ByteArray.merge([
        SystemProgram.allocateInstructionIndex,
        ByteArray.u64(space),
      ]),
    );