@provablehq/wasm 0.13.1 → 0.13.2

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.
@@ -10565,6 +10565,60 @@ class ProgramManager {
10565
10565
  const ret = wasm.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
10566
10566
  return takeObject(ret);
10567
10567
  }
10568
+ /**
10569
+ * Create a `ProvingRequest` object, pricing the base fee at the consensus version active at
10570
+ * a given block height. This is identical to `buildProvingRequest` except for how the fee is
10571
+ * priced: `buildProvingRequest` always uses the latest consensus version known to the SDK,
10572
+ * which can differ from what the network charges while a consensus upgrade is pending
10573
+ * activation.
10574
+ *
10575
+ * @param private_key The private key of the signer.
10576
+ * @param program The program source code containing the function to authorize.
10577
+ * @param function_name The function to authorize.
10578
+ * @param inputs A javascript array of inputs to the function.
10579
+ * @param base_fee_credits The base fee to be paid for the authorization
10580
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
10581
+ * @param fee_record The record to spend the fee from
10582
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
10583
+ * @param broadcast (optional) Flag to indicate if the transaction should be broadcast
10584
+ * @param block_height (optional) The latest block height of the network the request targets.
10585
+ * If omitted, the latest consensus version known to the SDK is used.
10586
+ * @returns {ProvingRequest}
10587
+ * @param {PrivateKey} private_key
10588
+ * @param {string} program
10589
+ * @param {string} function_name
10590
+ * @param {Array<any>} inputs
10591
+ * @param {number} base_fee_credits
10592
+ * @param {number} priority_fee_credits
10593
+ * @param {RecordPlaintext | null | undefined} fee_record
10594
+ * @param {object | null | undefined} imports
10595
+ * @param {boolean} broadcast
10596
+ * @param {boolean} unchecked
10597
+ * @param {number | null | undefined} edition
10598
+ * @param {boolean} use_fee_master
10599
+ * @param {ProgramImports | null} [program_imports]
10600
+ * @param {number | null} [block_height]
10601
+ * @returns {Promise<ProvingRequest>}
10602
+ */
10603
+ static buildProvingRequestAtHeight(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition, use_fee_master, program_imports, block_height) {
10604
+ _assertClass(private_key, PrivateKey);
10605
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10606
+ const len0 = WASM_VECTOR_LEN;
10607
+ const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10608
+ const len1 = WASM_VECTOR_LEN;
10609
+ let ptr2 = 0;
10610
+ if (!isLikeNone(fee_record)) {
10611
+ _assertClass(fee_record, RecordPlaintext);
10612
+ ptr2 = fee_record.__destroy_into_raw();
10613
+ }
10614
+ let ptr3 = 0;
10615
+ if (!isLikeNone(program_imports)) {
10616
+ _assertClass(program_imports, ProgramImports);
10617
+ ptr3 = program_imports.__destroy_into_raw();
10618
+ }
10619
+ const ret = wasm.programmanager_buildProvingRequestAtHeight(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), base_fee_credits, priority_fee_credits, ptr2, isLikeNone(imports) ? 0 : addHeapObject(imports), broadcast, unchecked, isLikeNone(edition) ? 0xFFFFFF : edition, use_fee_master, ptr3, isLikeNone(block_height) ? Number.MAX_SAFE_INTEGER : (block_height) >>> 0);
10620
+ return takeObject(ret);
10621
+ }
10568
10622
  /**
10569
10623
  * Build a proving request from a `Request` object. By default this method currently uses the feemaster.
10570
10624
  *
@@ -18174,7 +18228,7 @@ function getMaxProgramImports() {
18174
18228
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
18175
18229
  *
18176
18230
  * Set the consensus version heights.
18177
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21");
18231
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22");
18178
18232
  * @param {string | null} [heights]
18179
18233
  * @returns {Array<any>}
18180
18234
  */
@@ -18481,6 +18535,9 @@ function __wbg_get_imports(memory) {
18481
18535
  wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
18482
18536
  }
18483
18537
  },
18538
+ __wbg_error_d53ccea1197d8bda: function(arg0, arg1) {
18539
+ console.error(getStringFromWasm0(arg0, arg1));
18540
+ },
18484
18541
  __wbg_executionresponse_new: function(arg0) {
18485
18542
  const ret = ExecutionResponse.__wrap(arg0);
18486
18543
  return addHeapObject(ret);
@@ -18604,7 +18661,7 @@ function __wbg_get_imports(memory) {
18604
18661
  const ret = getObject(arg0).length;
18605
18662
  return ret;
18606
18663
  },
18607
- __wbg_log_19868767c118515a: function(arg0, arg1) {
18664
+ __wbg_log_8dfb2fe5b15b7518: function(arg0, arg1) {
18608
18665
  console.log(getStringFromWasm0(arg0, arg1));
18609
18666
  },
18610
18667
  __wbg_new_1dbf7428bba60a42: function(arg0) {
@@ -18623,6 +18680,10 @@ function __wbg_get_imports(memory) {
18623
18680
  const ret = new Int32Array(getObject(arg0));
18624
18681
  return addHeapObject(ret);
18625
18682
  },
18683
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
18684
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
18685
+ return addHeapObject(ret);
18686
+ },
18626
18687
  __wbg_new_5502aad30c185fc8: function(arg0, arg1) {
18627
18688
  try {
18628
18689
  var state0 = {a: arg0, b: arg1};
@@ -18630,7 +18691,7 @@ function __wbg_get_imports(memory) {
18630
18691
  const a = state0.a;
18631
18692
  state0.a = 0;
18632
18693
  try {
18633
- return __wasm_bindgen_func_elem_8317(a, state0.b, arg0, arg1);
18694
+ return __wasm_bindgen_func_elem_8392(a, state0.b, arg0, arg1);
18634
18695
  } finally {
18635
18696
  state0.a = a;
18636
18697
  }
@@ -18668,7 +18729,7 @@ function __wbg_get_imports(memory) {
18668
18729
  const a = state0.a;
18669
18730
  state0.a = 0;
18670
18731
  try {
18671
- return __wasm_bindgen_func_elem_8317(a, state0.b, arg0, arg1);
18732
+ return __wasm_bindgen_func_elem_8392(a, state0.b, arg0, arg1);
18672
18733
  } finally {
18673
18734
  state0.a = a;
18674
18735
  }
@@ -18815,7 +18876,7 @@ function __wbg_get_imports(memory) {
18815
18876
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
18816
18877
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
18817
18878
  },
18818
- __wbg_spawnWorker_7ace2f33abee22af: function(arg0, arg1, arg2, arg3) {
18879
+ __wbg_spawnWorker_d5db1c8be59c20d6: function(arg0, arg1, arg2, arg3) {
18819
18880
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18820
18881
  return addHeapObject(ret);
18821
18882
  },
@@ -18902,18 +18963,18 @@ function __wbg_get_imports(memory) {
18902
18963
  return addHeapObject(ret);
18903
18964
  },
18904
18965
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
18905
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 253, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18906
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3065);
18966
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 257, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18967
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3074);
18907
18968
  return addHeapObject(ret);
18908
18969
  },
18909
18970
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
18910
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 532, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
18911
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8007);
18971
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 543, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
18972
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8082);
18912
18973
  return addHeapObject(ret);
18913
18974
  },
18914
18975
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
18915
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 335, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18916
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7941);
18976
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 346, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18977
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8017);
18917
18978
  return addHeapObject(ret);
18918
18979
  },
18919
18980
  __wbindgen_generic_0000000000000004: function(arg0) {
@@ -18975,22 +19036,22 @@ function __wbg_get_imports(memory) {
18975
19036
  };
18976
19037
  }
18977
19038
 
18978
- function __wasm_bindgen_func_elem_7941(arg0, arg1) {
18979
- wasm.__wasm_bindgen_func_elem_7941(arg0, arg1);
19039
+ function __wasm_bindgen_func_elem_8017(arg0, arg1) {
19040
+ wasm.__wasm_bindgen_func_elem_8017(arg0, arg1);
18980
19041
  }
18981
19042
 
18982
- function __wasm_bindgen_func_elem_3065(arg0, arg1, arg2) {
18983
- wasm.__wasm_bindgen_func_elem_3065(arg0, arg1, addHeapObject(arg2));
19043
+ function __wasm_bindgen_func_elem_3074(arg0, arg1, arg2) {
19044
+ wasm.__wasm_bindgen_func_elem_3074(arg0, arg1, addHeapObject(arg2));
18984
19045
  }
18985
19046
 
18986
- function __wasm_bindgen_func_elem_8317(arg0, arg1, arg2, arg3) {
18987
- wasm.__wasm_bindgen_func_elem_8317(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
19047
+ function __wasm_bindgen_func_elem_8392(arg0, arg1, arg2, arg3) {
19048
+ wasm.__wasm_bindgen_func_elem_8392(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
18988
19049
  }
18989
19050
 
18990
- function __wasm_bindgen_func_elem_8007(arg0, arg1, arg2) {
19051
+ function __wasm_bindgen_func_elem_8082(arg0, arg1, arg2) {
18991
19052
  try {
18992
19053
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
18993
- wasm.__wasm_bindgen_func_elem_8007(retptr, arg0, arg1, addHeapObject(arg2));
19054
+ wasm.__wasm_bindgen_func_elem_8082(retptr, arg0, arg1, addHeapObject(arg2));
18994
19055
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
18995
19056
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
18996
19057
  if (r1) {