requestHeapFrame method

TransactionInstruction requestHeapFrame({
  1. required u32 bytes,
})

Request a specific transaction-wide program heap region size in bytes. The value requested must be a multiple of 1024. This new heap region size applies to each program executed in the transaction, including all calls to CPIs.

  • bytes - Requested transaction-wide program heap size in bytes. Must be multiple of 1024. Applies to each program, including CPIs.

Implementation

TransactionInstruction requestHeapFrame({
  required final u32 bytes,
}) {
  assert((bytes % 1024) == 0, 'Heap size [bytes] must be a multiple of 1024.');
  final List<Iterable<u8>> data = [
    borsh.u32.encode(bytes),
  ];

  return _instance.createTransactionIntruction(
    ComputeBudgetInstruction.requestHeapFrame,
    keys: const [],
    data: data,
  );
}