@provablehq/wasm 0.9.10 → 0.9.12

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.
@@ -25,7 +25,7 @@ export function verifyFunctionExecution(execution: Execution, verifying_key: Ver
25
25
  * import { getOrInitConsensusVersionHeights } from @provablehq/sdk;
26
26
  *
27
27
  * Set the consensus version heights.
28
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9");
28
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10");
29
29
  */
30
30
  export function getOrInitConsensusVersionTestHeights(heights?: string | null): Array<any>;
31
31
  /**
@@ -2361,7 +2361,7 @@ export class ProgramManager {
2361
2361
  * @param edition {
2362
2362
  * @returns {u64} Fee in microcredits
2363
2363
  */
2364
- static estimateExecutionFee(program: string, _function: string, imports?: object | null, edition?: number | null): Promise<bigint>;
2364
+ static estimateExecutionFee(program: string, _function: string, imports?: object | null, edition?: number | null): bigint;
2365
2365
  /**
2366
2366
  * Execute an arbitrary function locally
2367
2367
  *
@@ -2396,7 +2396,7 @@ export class ProgramManager {
2396
2396
  * @param edition: Optional edition to estimate the fee for.
2397
2397
  * @returns {u64} Fee in microcredits
2398
2398
  */
2399
- static estimateFeeForAuthorization(authorization: Authorization, program: string, imports?: object | null, edition?: number | null): Promise<bigint>;
2399
+ static estimateFeeForAuthorization(authorization: Authorization, program: string, imports?: object | null, edition?: number | null): bigint;
2400
2400
  /**
2401
2401
  * Execute Aleo function and create an Aleo execution transaction
2402
2402
  *
Binary file
@@ -273,7 +273,7 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
273
273
  * import { getOrInitConsensusVersionHeights } from @provablehq/sdk;
274
274
  *
275
275
  * Set the consensus version heights.
276
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9");
276
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10");
277
277
  * @param {string | null} [heights]
278
278
  * @returns {Array<any>}
279
279
  */
@@ -303,16 +303,12 @@ function getArrayJsValueFromWasm0(ptr, len) {
303
303
  }
304
304
  return result;
305
305
  }
306
- function __wbg_adapter_40(arg0, arg1) {
307
- wasm.__wbindgen_export_6(arg0, arg1);
306
+ function __wbg_adapter_40(arg0, arg1, arg2) {
307
+ wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
308
308
  }
309
309
 
310
- function __wbg_adapter_43(arg0, arg1, arg2) {
311
- wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
312
- }
313
-
314
- function __wbg_adapter_873(arg0, arg1, arg2, arg3) {
315
- wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
310
+ function __wbg_adapter_870(arg0, arg1, arg2, arg3) {
311
+ wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
316
312
  }
317
313
 
318
314
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -7969,15 +7965,26 @@ class ProgramManager {
7969
7965
  * @param {string} _function
7970
7966
  * @param {object | null} [imports]
7971
7967
  * @param {number | null} [edition]
7972
- * @returns {Promise<bigint>}
7968
+ * @returns {bigint}
7973
7969
  */
7974
7970
  static estimateExecutionFee(program, _function, imports, edition) {
7975
- const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7976
- const len0 = WASM_VECTOR_LEN;
7977
- const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7978
- const len1 = WASM_VECTOR_LEN;
7979
- const ret = wasm.programmanager_estimateExecutionFee(ptr0, len0, ptr1, len1, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
7980
- return takeObject(ret);
7971
+ try {
7972
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
7973
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7974
+ const len0 = WASM_VECTOR_LEN;
7975
+ const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7976
+ const len1 = WASM_VECTOR_LEN;
7977
+ wasm.programmanager_estimateExecutionFee(retptr, ptr0, len0, ptr1, len1, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
7978
+ var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
7979
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
7980
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
7981
+ if (r3) {
7982
+ throw takeObject(r2);
7983
+ }
7984
+ return BigInt.asUintN(64, r0);
7985
+ } finally {
7986
+ wasm.__wbindgen_add_to_stack_pointer(16);
7987
+ }
7981
7988
  }
7982
7989
  /**
7983
7990
  * Execute an arbitrary function locally
@@ -8054,14 +8061,25 @@ class ProgramManager {
8054
8061
  * @param {string} program
8055
8062
  * @param {object | null} [imports]
8056
8063
  * @param {number | null} [edition]
8057
- * @returns {Promise<bigint>}
8064
+ * @returns {bigint}
8058
8065
  */
8059
8066
  static estimateFeeForAuthorization(authorization, program, imports, edition) {
8060
- _assertClass(authorization, Authorization);
8061
- const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
8062
- const len0 = WASM_VECTOR_LEN;
8063
- const ret = wasm.programmanager_estimateFeeForAuthorization(authorization.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
8064
- return takeObject(ret);
8067
+ try {
8068
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
8069
+ _assertClass(authorization, Authorization);
8070
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
8071
+ const len0 = WASM_VECTOR_LEN;
8072
+ wasm.programmanager_estimateFeeForAuthorization(retptr, authorization.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
8073
+ var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
8074
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
8075
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
8076
+ if (r3) {
8077
+ throw takeObject(r2);
8078
+ }
8079
+ return BigInt.asUintN(64, r0);
8080
+ } finally {
8081
+ wasm.__wbindgen_add_to_stack_pointer(16);
8082
+ }
8065
8083
  }
8066
8084
  /**
8067
8085
  * Execute Aleo function and create an Aleo execution transaction
@@ -13100,9 +13118,6 @@ async function __wbg_load(module, imports) {
13100
13118
  function __wbg_get_imports() {
13101
13119
  const imports = {};
13102
13120
  imports.wbg = {};
13103
- imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
13104
- getObject(arg0).abort(getObject(arg1));
13105
- };
13106
13121
  imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
13107
13122
  getObject(arg0).abort();
13108
13123
  };
@@ -13141,10 +13156,6 @@ function __wbg_get_imports() {
13141
13156
  const ret = Ciphertext.__wrap(arg0);
13142
13157
  return addHeapObject(ret);
13143
13158
  };
13144
- imports.wbg.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
13145
- const ret = clearTimeout(takeObject(arg0));
13146
- return addHeapObject(ret);
13147
- };
13148
13159
  imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
13149
13160
  const ret = getObject(arg0).crypto;
13150
13161
  return addHeapObject(ret);
@@ -13176,10 +13187,6 @@ function __wbg_get_imports() {
13176
13187
  const ret = getObject(arg0).fetch(getObject(arg1));
13177
13188
  return addHeapObject(ret);
13178
13189
  };
13179
- imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
13180
- const ret = fetch(getObject(arg0));
13181
- return addHeapObject(ret);
13182
- };
13183
13190
  imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
13184
13191
  const ret = fetch(getObject(arg0));
13185
13192
  return addHeapObject(ret);
@@ -13245,7 +13252,7 @@ function __wbg_get_imports() {
13245
13252
  const ret = getObject(arg0).length;
13246
13253
  return ret;
13247
13254
  };
13248
- imports.wbg.__wbg_log_3d00345a85838c37 = function(arg0, arg1) {
13255
+ imports.wbg.__wbg_log_56fc8378195f90bc = function(arg0, arg1) {
13249
13256
  console.log(getStringFromWasm0(arg0, arg1));
13250
13257
  };
13251
13258
  imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
@@ -13263,7 +13270,7 @@ function __wbg_get_imports() {
13263
13270
  const a = state0.a;
13264
13271
  state0.a = 0;
13265
13272
  try {
13266
- return __wbg_adapter_873(a, state0.b, arg0, arg1);
13273
+ return __wbg_adapter_870(a, state0.b, arg0, arg1);
13267
13274
  } finally {
13268
13275
  state0.a = a;
13269
13276
  }
@@ -13411,10 +13418,6 @@ function __wbg_get_imports() {
13411
13418
  imports.wbg.__wbg_send_40a47636ff90f64d = function() { return handleError(function (arg0) {
13412
13419
  getObject(arg0).send();
13413
13420
  }, arguments) };
13414
- imports.wbg.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
13415
- const ret = setTimeout(getObject(arg0), arg1);
13416
- return addHeapObject(ret);
13417
- };
13418
13421
  imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
13419
13422
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
13420
13423
  };
@@ -13454,7 +13457,7 @@ function __wbg_get_imports() {
13454
13457
  const ret = Signature.__wrap(arg0);
13455
13458
  return addHeapObject(ret);
13456
13459
  };
13457
- imports.wbg.__wbg_spawnWorker_11a3cff24c5879d7 = function(arg0, arg1, arg2, arg3) {
13460
+ imports.wbg.__wbg_spawnWorker_b3b660eb297d8ef0 = function(arg0, arg1, arg2, arg3) {
13458
13461
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
13459
13462
  return addHeapObject(ret);
13460
13463
  };
@@ -13574,16 +13577,12 @@ function __wbg_get_imports() {
13574
13577
  const ret = false;
13575
13578
  return ret;
13576
13579
  };
13577
- imports.wbg.__wbindgen_closure_wrapper7305 = function(arg0, arg1, arg2) {
13578
- const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_40);
13579
- return addHeapObject(ret);
13580
- };
13581
- imports.wbg.__wbindgen_closure_wrapper7964 = function(arg0, arg1, arg2) {
13582
- const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_43);
13580
+ imports.wbg.__wbindgen_closure_wrapper7388 = function(arg0, arg1, arg2) {
13581
+ const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
13583
13582
  return addHeapObject(ret);
13584
13583
  };
13585
- imports.wbg.__wbindgen_closure_wrapper7968 = function(arg0, arg1, arg2) {
13586
- const ret = makeMutClosure(arg0, arg1, 533, __wbg_adapter_43);
13584
+ imports.wbg.__wbindgen_closure_wrapper7393 = function(arg0, arg1, arg2) {
13585
+ const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
13587
13586
  return addHeapObject(ret);
13588
13587
  };
13589
13588
  imports.wbg.__wbindgen_is_function = function(arg0) {