@fluffylabs/anan-as 1.2.0-41e43f6 → 1.2.0-5196d29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/bin/index.js +3 -2
  2. package/dist/bin/src/fuzz.js +1 -1
  3. package/dist/bin/src/test-json.js +2 -6
  4. package/dist/bin/src/trace-replay.js +8 -4
  5. package/dist/build/compiler-inline.js +1 -1
  6. package/dist/build/compiler.d.ts +2 -13
  7. package/dist/build/compiler.js +1 -25
  8. package/dist/build/compiler.wasm +0 -0
  9. package/dist/build/debug-inline.js +1 -1
  10. package/dist/build/debug-raw-inline.js +1 -1
  11. package/dist/build/debug-raw.d.ts +27 -25
  12. package/dist/build/debug-raw.js +58 -57
  13. package/dist/build/debug-raw.wasm +0 -0
  14. package/dist/build/debug.d.ts +27 -25
  15. package/dist/build/debug.js +59 -58
  16. package/dist/build/debug.wasm +0 -0
  17. package/dist/build/js/assembly/api-debugger.d.ts +3 -3
  18. package/dist/build/js/assembly/api-debugger.js +6 -6
  19. package/dist/build/js/assembly/api-internal.d.ts +1 -1
  20. package/dist/build/js/assembly/api-internal.js +2 -3
  21. package/dist/build/js/assembly/api-types.d.ts +0 -1
  22. package/dist/build/js/assembly/api-types.js +0 -1
  23. package/dist/build/js/assembly/api-utils.d.ts +12 -5
  24. package/dist/build/js/assembly/api-utils.js +28 -13
  25. package/dist/build/js/assembly/arguments.d.ts +4 -4
  26. package/dist/build/js/assembly/arguments.js +10 -10
  27. package/dist/build/js/assembly/gas.d.ts +1 -1
  28. package/dist/build/js/assembly/gas.js +3 -2
  29. package/dist/build/js/assembly/instructions/bit.js +22 -22
  30. package/dist/build/js/assembly/instructions/branch.js +56 -56
  31. package/dist/build/js/assembly/instructions/jump.js +10 -10
  32. package/dist/build/js/assembly/instructions/load.js +41 -41
  33. package/dist/build/js/assembly/instructions/logic.js +20 -20
  34. package/dist/build/js/assembly/instructions/math.js +105 -105
  35. package/dist/build/js/assembly/instructions/misc.js +10 -10
  36. package/dist/build/js/assembly/instructions/mov.js +16 -16
  37. package/dist/build/js/assembly/instructions/outcome.d.ts +7 -7
  38. package/dist/build/js/assembly/instructions/outcome.js +63 -36
  39. package/dist/build/js/assembly/instructions/rot.js +18 -18
  40. package/dist/build/js/assembly/instructions/set.js +18 -18
  41. package/dist/build/js/assembly/instructions/shift.js +59 -59
  42. package/dist/build/js/assembly/instructions/store.js +29 -29
  43. package/dist/build/js/assembly/instructions/utils.d.ts +6 -4
  44. package/dist/build/js/assembly/instructions/utils.js +32 -16
  45. package/dist/build/js/assembly/instructions.d.ts +2 -3
  46. package/dist/build/js/assembly/instructions.js +4 -4
  47. package/dist/build/js/assembly/interpreter.d.ts +0 -1
  48. package/dist/build/js/assembly/interpreter.js +15 -22
  49. package/dist/build/js/assembly/math.d.ts +6 -8
  50. package/dist/build/js/assembly/math.js +21 -13
  51. package/dist/build/js/assembly/memory.js +9 -7
  52. package/dist/build/js/assembly/portable.js +1 -0
  53. package/dist/build/js/assembly/program-build.js +4 -4
  54. package/dist/build/js/assembly/program.d.ts +15 -8
  55. package/dist/build/js/assembly/program.js +90 -40
  56. package/dist/build/js/assembly/spi.d.ts +1 -1
  57. package/dist/build/js/assembly/spi.js +2 -2
  58. package/dist/build/js/portable-bundle.js +666 -579
  59. package/dist/build/release-inline.js +1 -1
  60. package/dist/build/release-mini-inline.js +1 -1
  61. package/dist/build/release-mini.d.ts +27 -25
  62. package/dist/build/release-mini.js +59 -58
  63. package/dist/build/release-mini.wasm +0 -0
  64. package/dist/build/release-stub-inline.js +1 -1
  65. package/dist/build/release-stub.d.ts +27 -25
  66. package/dist/build/release-stub.js +59 -58
  67. package/dist/build/release-stub.wasm +0 -0
  68. package/dist/build/release.d.ts +27 -25
  69. package/dist/build/release.js +59 -58
  70. package/dist/build/release.wasm +0 -0
  71. package/dist/build/test-inline.js +1 -1
  72. package/dist/build/test.wasm +0 -0
  73. package/dist/test/test-gas-cost.js +2 -3
  74. package/dist/test/test-w3f-common.js +1 -2
  75. package/package.json +7 -7
  76. package/dist/build/js/assembly/gas-costs.d.ts +0 -6
  77. package/dist/build/js/assembly/gas-costs.js +0 -39
@@ -29,46 +29,49 @@ async function instantiate(module, imports = {}) {
29
29
  },
30
30
  wrapAsProgram(bytecode) {
31
31
  // assembly/program-build/wrapAsProgram(~lib/typedarray/Uint8Array) => ~lib/typedarray/Uint8Array
32
- bytecode = __lowerTypedArray(Uint8Array, 12, 0, bytecode) || __notnull();
32
+ bytecode = __lowerTypedArray(Uint8Array, 15, 0, bytecode) || __notnull();
33
33
  return __liftTypedArray(Uint8Array, exports.wrapAsProgram(bytecode) >>> 0);
34
34
  },
35
- resetJAM(program, pc, initialGas, args, hasMetadata) {
36
- // assembly/api-debugger/resetJAM(~lib/array/Array<u8>, u32, u64, ~lib/array/Array<u8>, bool?) => void
37
- program = __retain(__lowerArray(__setU8, 7, 0, program) || __notnull());
35
+ resetJAM(program, pc, initialGas, args, hasMetadata, useBlockGas) {
36
+ // assembly/api-debugger/resetJAM(~lib/array/Array<u8>, u32, u64, ~lib/array/Array<u8>, bool?, bool?) => void
37
+ program = __retain(__lowerArray(__setU8, 32, 0, program) || __notnull());
38
38
  initialGas = initialGas || 0n;
39
- args = __lowerArray(__setU8, 7, 0, args) || __notnull();
39
+ args = __lowerArray(__setU8, 32, 0, args) || __notnull();
40
40
  hasMetadata = hasMetadata ? 1 : 0;
41
+ useBlockGas = useBlockGas ? 1 : 0;
41
42
  try {
42
43
  exports.__setArgumentsLength(arguments.length);
43
- exports.resetJAM(program, pc, initialGas, args, hasMetadata);
44
+ exports.resetJAM(program, pc, initialGas, args, hasMetadata, useBlockGas);
44
45
  } finally {
45
46
  __release(program);
46
47
  }
47
48
  },
48
- resetGeneric(program, flatRegisters, initialGas, hasMetadata) {
49
- // assembly/api-debugger/resetGeneric(~lib/array/Array<u8>, ~lib/array/Array<u8>, u64, bool?) => void
50
- program = __retain(__lowerArray(__setU8, 7, 0, program) || __notnull());
51
- flatRegisters = __lowerArray(__setU8, 7, 0, flatRegisters) || __notnull();
49
+ resetGeneric(program, flatRegisters, initialGas, hasMetadata, useBlockGas) {
50
+ // assembly/api-debugger/resetGeneric(~lib/array/Array<u8>, ~lib/array/Array<u8>, u64, bool?, bool?) => void
51
+ program = __retain(__lowerArray(__setU8, 32, 0, program) || __notnull());
52
+ flatRegisters = __lowerArray(__setU8, 32, 0, flatRegisters) || __notnull();
52
53
  initialGas = initialGas || 0n;
53
54
  hasMetadata = hasMetadata ? 1 : 0;
55
+ useBlockGas = useBlockGas ? 1 : 0;
54
56
  try {
55
57
  exports.__setArgumentsLength(arguments.length);
56
- exports.resetGeneric(program, flatRegisters, initialGas, hasMetadata);
58
+ exports.resetGeneric(program, flatRegisters, initialGas, hasMetadata, useBlockGas);
57
59
  } finally {
58
60
  __release(program);
59
61
  }
60
62
  },
61
- resetGenericWithMemory(program, flatRegisters, pageMap, chunks, initialGas, hasMetadata) {
62
- // assembly/api-debugger/resetGenericWithMemory(~lib/array/Array<u8>, ~lib/array/Array<u8>, ~lib/typedarray/Uint8Array, ~lib/typedarray/Uint8Array, u64, bool?) => void
63
- program = __retain(__lowerArray(__setU8, 7, 0, program) || __notnull());
64
- flatRegisters = __retain(__lowerArray(__setU8, 7, 0, flatRegisters) || __notnull());
65
- pageMap = __retain(__lowerTypedArray(Uint8Array, 12, 0, pageMap) || __notnull());
66
- chunks = __lowerTypedArray(Uint8Array, 12, 0, chunks) || __notnull();
63
+ resetGenericWithMemory(program, flatRegisters, pageMap, chunks, initialGas, hasMetadata, useBlockGas) {
64
+ // assembly/api-debugger/resetGenericWithMemory(~lib/array/Array<u8>, ~lib/array/Array<u8>, ~lib/typedarray/Uint8Array, ~lib/typedarray/Uint8Array, u64, bool?, bool?) => void
65
+ program = __retain(__lowerArray(__setU8, 32, 0, program) || __notnull());
66
+ flatRegisters = __retain(__lowerArray(__setU8, 32, 0, flatRegisters) || __notnull());
67
+ pageMap = __retain(__lowerTypedArray(Uint8Array, 15, 0, pageMap) || __notnull());
68
+ chunks = __lowerTypedArray(Uint8Array, 15, 0, chunks) || __notnull();
67
69
  initialGas = initialGas || 0n;
68
70
  hasMetadata = hasMetadata ? 1 : 0;
71
+ useBlockGas = useBlockGas ? 1 : 0;
69
72
  try {
70
73
  exports.__setArgumentsLength(arguments.length);
71
- exports.resetGenericWithMemory(program, flatRegisters, pageMap, chunks, initialGas, hasMetadata);
74
+ exports.resetGenericWithMemory(program, flatRegisters, pageMap, chunks, initialGas, hasMetadata, useBlockGas);
72
75
  } finally {
73
76
  __release(program);
74
77
  __release(flatRegisters);
@@ -102,7 +105,7 @@ async function instantiate(module, imports = {}) {
102
105
  },
103
106
  setRegisters(flatRegisters) {
104
107
  // assembly/api-debugger/setRegisters(~lib/array/Array<u8>) => void
105
- flatRegisters = __lowerArray(__setU8, 7, 0, flatRegisters) || __notnull();
108
+ flatRegisters = __lowerArray(__setU8, 32, 0, flatRegisters) || __notnull();
106
109
  exports.setRegisters(flatRegisters);
107
110
  },
108
111
  getPageDump(index) {
@@ -119,7 +122,7 @@ async function instantiate(module, imports = {}) {
119
122
  },
120
123
  setMemory(address, data) {
121
124
  // assembly/api-debugger/setMemory(u32, ~lib/typedarray/Uint8Array) => bool
122
- data = __lowerTypedArray(Uint8Array, 12, 0, data) || __notnull();
125
+ data = __lowerTypedArray(Uint8Array, 15, 0, data) || __notnull();
123
126
  return exports.setMemory(address, data) != 0;
124
127
  },
125
128
  InputKind: (values => (
@@ -134,25 +137,26 @@ async function instantiate(module, imports = {}) {
134
137
  values[values.No = exports["HasMetadata.No"].valueOf()] = "No",
135
138
  values
136
139
  ))({}),
137
- getGasCosts(input, kind, withMetadata) {
138
- // assembly/api-utils/getGasCosts(~lib/array/Array<u8>, i32, i32) => ~lib/array/Array<assembly/gas-costs/BlockGasCost>
139
- input = __lowerArray(__setU8, 7, 0, input) || __notnull();
140
- return __liftArray(pointer => __liftRecord54(__getU32(pointer)), 2, exports.getGasCosts(input, kind, withMetadata) >>> 0);
140
+ getBlockGasCosts(input, kind, withMetadata) {
141
+ // assembly/api-utils/getBlockGasCosts(~lib/array/Array<u8>, i32, i32) => ~lib/array/Array<assembly/api-utils/BlockGasCost>
142
+ input = __lowerArray(__setU8, 32, 0, input) || __notnull();
143
+ return __liftArray(pointer => __liftRecord58(__getU32(pointer)), 2, exports.getBlockGasCosts(input, kind, withMetadata) >>> 0);
141
144
  },
142
145
  disassemble(input, kind, withMetadata) {
143
146
  // assembly/api-utils/disassemble(~lib/array/Array<u8>, i32, i32) => ~lib/string/String
144
- input = __lowerArray(__setU8, 7, 0, input) || __notnull();
147
+ input = __lowerArray(__setU8, 32, 0, input) || __notnull();
145
148
  return __liftString(exports.disassemble(input, kind, withMetadata) >>> 0);
146
149
  },
147
- prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages) {
148
- // assembly/api-utils/prepareProgram(i32, i32, ~lib/array/Array<u8>, ~lib/array/Array<u64>, ~lib/array/Array<assembly/api-types/InitialPage>, ~lib/array/Array<assembly/api-types/InitialChunk>, ~lib/array/Array<u8>, u32) => assembly/spi/StandardProgram
149
- program = __retain(__lowerArray(__setU8, 7, 0, program) || __notnull());
150
- initialRegisters = __retain(__lowerArray(__setU64, 56, 3, initialRegisters) || __notnull());
151
- initialPageMap = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord50(value) || __notnull()); }, 51, 2, initialPageMap) || __notnull());
152
- initialMemory = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord52(value) || __notnull()); }, 53, 2, initialMemory) || __notnull());
153
- args = __lowerArray(__setU8, 7, 0, args) || __notnull();
150
+ prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages, useBlockGas) {
151
+ // assembly/api-utils/prepareProgram(i32, i32, ~lib/array/Array<u8>, ~lib/array/Array<u64>, ~lib/array/Array<assembly/api-types/InitialPage>, ~lib/array/Array<assembly/api-types/InitialChunk>, ~lib/array/Array<u8>, u32, bool) => assembly/spi/StandardProgram
152
+ program = __retain(__lowerArray(__setU8, 32, 0, program) || __notnull());
153
+ initialRegisters = __retain(__lowerArray(__setU64, 60, 3, initialRegisters) || __notnull());
154
+ initialPageMap = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord54(value) || __notnull()); }, 55, 2, initialPageMap) || __notnull());
155
+ initialMemory = __retain(__lowerArray((pointer, value) => { __setU32(pointer, __lowerRecord56(value) || __notnull()); }, 57, 2, initialMemory) || __notnull());
156
+ args = __lowerArray(__setU8, 32, 0, args) || __notnull();
157
+ useBlockGas = useBlockGas ? 1 : 0;
154
158
  try {
155
- return __liftInternref(exports.prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages) >>> 0);
159
+ return __liftInternref(exports.prepareProgram(kind, hasMetadata, program, initialRegisters, initialPageMap, initialMemory, args, preallocateMemoryPages, useBlockGas) >>> 0);
156
160
  } finally {
157
161
  __release(program);
158
162
  __release(initialRegisters);
@@ -160,30 +164,27 @@ async function instantiate(module, imports = {}) {
160
164
  __release(initialMemory);
161
165
  }
162
166
  },
163
- runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) {
164
- // assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?, bool?) => assembly/api-types/VmOutput
167
+ runProgram(program, initialGas, programCounter, logs, dumpMemory) {
168
+ // assembly/api-utils/runProgram(assembly/spi/StandardProgram, i64?, u32?, bool?, bool?) => assembly/api-types/VmOutput
165
169
  program = __lowerInternref(program) || __notnull();
166
170
  initialGas = initialGas || 0n;
167
171
  logs = logs ? 1 : 0;
168
- useSbrkGas = useSbrkGas ? 1 : 0;
169
172
  dumpMemory = dumpMemory ? 1 : 0;
170
173
  exports.__setArgumentsLength(arguments.length);
171
- return __liftRecord59(exports.runProgram(program, initialGas, programCounter, logs, useSbrkGas, dumpMemory) >>> 0);
174
+ return __liftRecord62(exports.runProgram(program, initialGas, programCounter, logs, dumpMemory) >>> 0);
172
175
  },
173
- pvmStart(program, useSbrkGas) {
174
- // assembly/api-utils/pvmStart(assembly/spi/StandardProgram, bool?) => u32
176
+ pvmStart(program) {
177
+ // assembly/api-utils/pvmStart(assembly/spi/StandardProgram) => u32
175
178
  program = __lowerInternref(program) || __notnull();
176
- useSbrkGas = useSbrkGas ? 1 : 0;
177
- exports.__setArgumentsLength(arguments.length);
178
- return exports.pvmStart(program, useSbrkGas) >>> 0;
179
+ return exports.pvmStart(program) >>> 0;
179
180
  },
180
181
  pvmDestroy(pvmId) {
181
182
  // assembly/api-utils/pvmDestroy(u32) => assembly/api-types/VmOutput | null
182
- return __liftRecord59(exports.pvmDestroy(pvmId) >>> 0);
183
+ return __liftRecord62(exports.pvmDestroy(pvmId) >>> 0);
183
184
  },
184
185
  pvmSetRegisters(pvmId, registers) {
185
186
  // assembly/api-utils/pvmSetRegisters(u32, ~lib/array/Array<u64>) => void
186
- registers = __lowerArray(__setU64, 56, 3, registers) || __notnull();
187
+ registers = __lowerArray(__setU64, 60, 3, registers) || __notnull();
187
188
  exports.pvmSetRegisters(pvmId, registers);
188
189
  },
189
190
  pvmReadMemory(pvmId, address, length) {
@@ -196,7 +197,7 @@ async function instantiate(module, imports = {}) {
196
197
  },
197
198
  pvmWriteMemory(pvmId, address, data) {
198
199
  // assembly/api-utils/pvmWriteMemory(u32, u32, ~lib/typedarray/Uint8Array) => bool
199
- data = __lowerTypedArray(Uint8Array, 12, 0, data) || __notnull();
200
+ data = __lowerTypedArray(Uint8Array, 15, 0, data) || __notnull();
200
201
  return exports.pvmWriteMemory(pvmId, address, data) != 0;
201
202
  },
202
203
  pvmResume(pvmId, gas, pc, logs) {
@@ -204,11 +205,11 @@ async function instantiate(module, imports = {}) {
204
205
  gas = gas || 0n;
205
206
  logs = logs ? 1 : 0;
206
207
  exports.__setArgumentsLength(arguments.length);
207
- return __liftRecord65(exports.pvmResume(pvmId, gas, pc, logs) >>> 0);
208
+ return __liftRecord68(exports.pvmResume(pvmId, gas, pc, logs) >>> 0);
208
209
  },
209
210
  }, exports);
210
- function __liftRecord54(pointer) {
211
- // assembly/gas-costs/BlockGasCost
211
+ function __liftRecord58(pointer) {
212
+ // assembly/api-utils/BlockGasCost
212
213
  // Hint: Opt-out from lifting as a record by providing an empty constructor
213
214
  if (!pointer) return null;
214
215
  return {
@@ -216,28 +217,28 @@ async function instantiate(module, imports = {}) {
216
217
  gas: __getU64(pointer + 8),
217
218
  };
218
219
  }
219
- function __lowerRecord50(value) {
220
+ function __lowerRecord54(value) {
220
221
  // assembly/api-types/InitialPage
221
222
  // Hint: Opt-out from lowering as a record by providing an empty constructor
222
223
  if (value == null) return 0;
223
- const pointer = exports.__pin(exports.__new(12, 50));
224
+ const pointer = exports.__pin(exports.__new(12, 54));
224
225
  __setU32(pointer + 0, value.address);
225
226
  __setU32(pointer + 4, value.length);
226
227
  __setU32(pointer + 8, value.access);
227
228
  exports.__unpin(pointer);
228
229
  return pointer;
229
230
  }
230
- function __lowerRecord52(value) {
231
+ function __lowerRecord56(value) {
231
232
  // assembly/api-types/InitialChunk
232
233
  // Hint: Opt-out from lowering as a record by providing an empty constructor
233
234
  if (value == null) return 0;
234
- const pointer = exports.__pin(exports.__new(8, 52));
235
+ const pointer = exports.__pin(exports.__new(8, 56));
235
236
  __setU32(pointer + 0, value.address);
236
- __setU32(pointer + 4, __lowerArray(__setU8, 7, 0, value.data) || __notnull());
237
+ __setU32(pointer + 4, __lowerArray(__setU8, 32, 0, value.data) || __notnull());
237
238
  exports.__unpin(pointer);
238
239
  return pointer;
239
240
  }
240
- function __liftRecord52(pointer) {
241
+ function __liftRecord56(pointer) {
241
242
  // assembly/api-types/InitialChunk
242
243
  // Hint: Opt-out from lifting as a record by providing an empty constructor
243
244
  if (!pointer) return null;
@@ -246,7 +247,7 @@ async function instantiate(module, imports = {}) {
246
247
  data: __liftArray(__getU8, 0, __getU32(pointer + 4)),
247
248
  };
248
249
  }
249
- function __liftRecord59(pointer) {
250
+ function __liftRecord62(pointer) {
250
251
  // assembly/api-types/VmOutput
251
252
  // Hint: Opt-out from lifting as a record by providing an empty constructor
252
253
  if (!pointer) return null;
@@ -257,10 +258,10 @@ async function instantiate(module, imports = {}) {
257
258
  gas: __getU64(pointer + 16),
258
259
  result: __liftArray(__getU8, 0, __getU32(pointer + 24)),
259
260
  registers: __liftArray(pointer => BigInt.asUintN(64, __getU64(pointer)), 3, __getU32(pointer + 28)),
260
- memory: __liftArray(pointer => __liftRecord52(__getU32(pointer)), 2, __getU32(pointer + 32)),
261
+ memory: __liftArray(pointer => __liftRecord56(__getU32(pointer)), 2, __getU32(pointer + 32)),
261
262
  };
262
263
  }
263
- function __liftRecord65(pointer) {
264
+ function __liftRecord68(pointer) {
264
265
  // assembly/api-types/VmPause
265
266
  // Hint: Opt-out from lifting as a record by providing an empty constructor
266
267
  if (!pointer) return null;
@@ -449,7 +450,7 @@ export const {
449
450
  setMemory,
450
451
  InputKind,
451
452
  HasMetadata,
452
- getGasCosts,
453
+ getBlockGasCosts,
453
454
  disassemble,
454
455
  prepareProgram,
455
456
  runProgram,
Binary file
@@ -5,7 +5,7 @@ export declare const memory: WebAssembly.Memory;
5
5
  * @param p `assembly/program/Program`
6
6
  * @returns `~lib/string/String`
7
7
  */
8
- export declare function getAssembly(p: __Internref31): string;
8
+ export declare function getAssembly(p: __Internref35): string;
9
9
  /**
10
10
  * assembly/program-build/wrapAsProgram
11
11
  * @param bytecode `~lib/typedarray/Uint8Array`
@@ -19,16 +19,18 @@ export declare function wrapAsProgram(bytecode: Uint8Array): Uint8Array;
19
19
  * @param initialGas `u64`
20
20
  * @param args `~lib/array/Array<u8>`
21
21
  * @param hasMetadata `bool`
22
+ * @param useBlockGas `bool`
22
23
  */
23
- export declare function resetJAM(program: Array<number>, pc: number, initialGas: bigint, args: Array<number>, hasMetadata?: boolean): void;
24
+ export declare function resetJAM(program: Array<number>, pc: number, initialGas: bigint, args: Array<number>, hasMetadata?: boolean, useBlockGas?: boolean): void;
24
25
  /**
25
26
  * assembly/api-debugger/resetGeneric
26
27
  * @param program `~lib/array/Array<u8>`
27
28
  * @param flatRegisters `~lib/array/Array<u8>`
28
29
  * @param initialGas `u64`
29
30
  * @param hasMetadata `bool`
31
+ * @param useBlockGas `bool`
30
32
  */
31
- export declare function resetGeneric(program: Array<number>, flatRegisters: Array<number>, initialGas: bigint, hasMetadata?: boolean): void;
33
+ export declare function resetGeneric(program: Array<number>, flatRegisters: Array<number>, initialGas: bigint, hasMetadata?: boolean, useBlockGas?: boolean): void;
32
34
  /**
33
35
  * assembly/api-debugger/resetGenericWithMemory
34
36
  * @param program `~lib/array/Array<u8>`
@@ -37,8 +39,9 @@ export declare function resetGeneric(program: Array<number>, flatRegisters: Arra
37
39
  * @param chunks `~lib/typedarray/Uint8Array`
38
40
  * @param initialGas `u64`
39
41
  * @param hasMetadata `bool`
42
+ * @param useBlockGas `bool`
40
43
  */
41
- export declare function resetGenericWithMemory(program: Array<number>, flatRegisters: Array<number>, pageMap: Uint8Array, chunks: Uint8Array, initialGas: bigint, hasMetadata?: boolean): void;
44
+ export declare function resetGenericWithMemory(program: Array<number>, flatRegisters: Array<number>, pageMap: Uint8Array, chunks: Uint8Array, initialGas: bigint, hasMetadata?: boolean, useBlockGas?: boolean): void;
42
45
  /**
43
46
  * assembly/api-debugger/nextStep
44
47
  * @returns `bool`
@@ -131,13 +134,13 @@ export declare enum HasMetadata {
131
134
  No,
132
135
  }
133
136
  /**
134
- * assembly/api-utils/getGasCosts
137
+ * assembly/api-utils/getBlockGasCosts
135
138
  * @param input `~lib/array/Array<u8>`
136
139
  * @param kind `i32`
137
140
  * @param withMetadata `i32`
138
- * @returns `~lib/array/Array<assembly/gas-costs/BlockGasCost>`
141
+ * @returns `~lib/array/Array<assembly/api-utils/BlockGasCost>`
139
142
  */
140
- export declare function getGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<__Record54<never>>;
143
+ export declare function getBlockGasCosts(input: Array<number>, kind: number, withMetadata: number): Array<__Record58<never>>;
141
144
  /**
142
145
  * assembly/api-utils/disassemble
143
146
  * @param input `~lib/array/Array<u8>`
@@ -156,33 +159,32 @@ export declare function disassemble(input: Array<number>, kind: number, withMeta
156
159
  * @param initialMemory `~lib/array/Array<assembly/api-types/InitialChunk>`
157
160
  * @param args `~lib/array/Array<u8>`
158
161
  * @param preallocateMemoryPages `u32`
162
+ * @param useBlockGas `bool`
159
163
  * @returns `assembly/spi/StandardProgram`
160
164
  */
161
- export declare function prepareProgram(kind: number, hasMetadata: number, program: Array<number>, initialRegisters: Array<bigint>, initialPageMap: Array<__Record50<undefined>>, initialMemory: Array<__Record52<undefined>>, args: Array<number>, preallocateMemoryPages: number): __Internref47;
165
+ export declare function prepareProgram(kind: number, hasMetadata: number, program: Array<number>, initialRegisters: Array<bigint>, initialPageMap: Array<__Record54<undefined>>, initialMemory: Array<__Record56<undefined>>, args: Array<number>, preallocateMemoryPages: number, useBlockGas: boolean): __Internref51;
162
166
  /**
163
167
  * assembly/api-utils/runProgram
164
168
  * @param program `assembly/spi/StandardProgram`
165
169
  * @param initialGas `i64`
166
170
  * @param programCounter `u32`
167
171
  * @param logs `bool`
168
- * @param useSbrkGas `bool`
169
172
  * @param dumpMemory `bool`
170
173
  * @returns `assembly/api-types/VmOutput`
171
174
  */
172
- export declare function runProgram(program: __Internref47, initialGas?: bigint, programCounter?: number, logs?: boolean, useSbrkGas?: boolean, dumpMemory?: boolean): __Record59<never>;
175
+ export declare function runProgram(program: __Internref51, initialGas?: bigint, programCounter?: number, logs?: boolean, dumpMemory?: boolean): __Record62<never>;
173
176
  /**
174
177
  * assembly/api-utils/pvmStart
175
178
  * @param program `assembly/spi/StandardProgram`
176
- * @param useSbrkGas `bool`
177
179
  * @returns `u32`
178
180
  */
179
- export declare function pvmStart(program: __Internref47, useSbrkGas?: boolean): number;
181
+ export declare function pvmStart(program: __Internref51): number;
180
182
  /**
181
183
  * assembly/api-utils/pvmDestroy
182
184
  * @param pvmId `u32`
183
185
  * @returns `assembly/api-types/VmOutput | null`
184
186
  */
185
- export declare function pvmDestroy(pvmId: number): __Record59<never> | null;
187
+ export declare function pvmDestroy(pvmId: number): __Record62<never> | null;
186
188
  /**
187
189
  * assembly/api-utils/pvmSetRegisters
188
190
  * @param pvmId `u32`
@@ -220,21 +222,21 @@ export declare function pvmWriteMemory(pvmId: number, address: number, data: Uin
220
222
  * @param logs `bool`
221
223
  * @returns `assembly/api-types/VmPause | null`
222
224
  */
223
- export declare function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean): __Record65<never> | null;
225
+ export declare function pvmResume(pvmId: number, gas: bigint, pc: number, logs?: boolean): __Record68<never> | null;
224
226
  /** assembly/program/Program */
225
- declare class __Internref31 extends Number {
226
- private __nominal31: symbol;
227
+ declare class __Internref35 extends Number {
228
+ private __nominal35: symbol;
227
229
  private __nominal0: symbol;
228
230
  }
229
- /** assembly/gas-costs/BlockGasCost */
230
- declare interface __Record54<TOmittable> {
231
+ /** assembly/api-utils/BlockGasCost */
232
+ declare interface __Record58<TOmittable> {
231
233
  /** @type `u32` */
232
234
  pc: number | TOmittable;
233
235
  /** @type `u64` */
234
236
  gas: bigint | TOmittable;
235
237
  }
236
238
  /** assembly/api-types/InitialPage */
237
- declare interface __Record50<TOmittable> {
239
+ declare interface __Record54<TOmittable> {
238
240
  /** @type `u32` */
239
241
  address: number | TOmittable;
240
242
  /** @type `u32` */
@@ -243,19 +245,19 @@ declare interface __Record50<TOmittable> {
243
245
  access: number | TOmittable;
244
246
  }
245
247
  /** assembly/api-types/InitialChunk */
246
- declare interface __Record52<TOmittable> {
248
+ declare interface __Record56<TOmittable> {
247
249
  /** @type `u32` */
248
250
  address: number | TOmittable;
249
251
  /** @type `~lib/array/Array<u8>` */
250
252
  data: Array<number>;
251
253
  }
252
254
  /** assembly/spi/StandardProgram */
253
- declare class __Internref47 extends Number {
254
- private __nominal47: symbol;
255
+ declare class __Internref51 extends Number {
256
+ private __nominal51: symbol;
255
257
  private __nominal0: symbol;
256
258
  }
257
259
  /** assembly/api-types/VmOutput */
258
- declare interface __Record59<TOmittable> {
260
+ declare interface __Record62<TOmittable> {
259
261
  /** @type `i32` */
260
262
  status: number | TOmittable;
261
263
  /** @type `u32` */
@@ -269,10 +271,10 @@ declare interface __Record59<TOmittable> {
269
271
  /** @type `~lib/array/Array<u64>` */
270
272
  registers: Array<bigint>;
271
273
  /** @type `~lib/array/Array<assembly/api-types/InitialChunk>` */
272
- memory: Array<__Record52<never>>;
274
+ memory: Array<__Record56<never>>;
273
275
  }
274
276
  /** assembly/api-types/VmPause */
275
- declare interface __Record65<TOmittable> {
277
+ declare interface __Record68<TOmittable> {
276
278
  /** @type `i32` */
277
279
  status: number | TOmittable;
278
280
  /** @type `u32` */