@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.
@@ -3440,6 +3440,27 @@ export class ProgramManager {
3440
3440
  * @returns {Transaction} Transaction object
3441
3441
  */
3442
3442
  static buildJoinTransaction(private_key: PrivateKey, record_1: RecordPlaintext, record_2: RecordPlaintext, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, join_proving_key?: ProvingKey | null, join_verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, query?: QueryOption | null): Promise<Transaction>;
3443
+ /**
3444
+ * Create a `ProvingRequest` object, pricing the base fee at the consensus version active at
3445
+ * a given block height. This is identical to `buildProvingRequest` except for how the fee is
3446
+ * priced: `buildProvingRequest` always uses the latest consensus version known to the SDK,
3447
+ * which can differ from what the network charges while a consensus upgrade is pending
3448
+ * activation.
3449
+ *
3450
+ * @param private_key The private key of the signer.
3451
+ * @param program The program source code containing the function to authorize.
3452
+ * @param function_name The function to authorize.
3453
+ * @param inputs A javascript array of inputs to the function.
3454
+ * @param base_fee_credits The base fee to be paid for the authorization
3455
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
3456
+ * @param fee_record The record to spend the fee from
3457
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
3458
+ * @param broadcast (optional) Flag to indicate if the transaction should be broadcast
3459
+ * @param block_height (optional) The latest block height of the network the request targets.
3460
+ * If omitted, the latest consensus version known to the SDK is used.
3461
+ * @returns {ProvingRequest}
3462
+ */
3463
+ static buildProvingRequestAtHeight(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, base_fee_credits: number, priority_fee_credits: number, fee_record: RecordPlaintext | null | undefined, imports: object | null | undefined, broadcast: boolean, unchecked: boolean, edition: number | null | undefined, use_fee_master: boolean, program_imports?: ProgramImports | null, block_height?: number | null): Promise<ProvingRequest>;
3443
3464
  /**
3444
3465
  * Build a proving request from a `Request` object. By default this method currently uses the feemaster.
3445
3466
  *
@@ -6091,7 +6112,7 @@ export function getMaxProgramImports(): number;
6091
6112
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
6092
6113
  *
6093
6114
  * Set the consensus version heights.
6094
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21");
6115
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22");
6095
6116
  */
6096
6117
  export function getOrInitConsensusVersionTestHeights(heights?: string | null): Array<any>;
6097
6118
 
Binary file
@@ -10571,6 +10571,60 @@ class ProgramManager {
10571
10571
  const ret = wasm$1.programmanager_buildJoinTransaction(private_key.__wbg_ptr, ptr0, ptr1, priority_fee_credits, ptr2, ptr3, len3, ptr4, ptr5, ptr6, ptr7, ptr8);
10572
10572
  return takeObject(ret);
10573
10573
  }
10574
+ /**
10575
+ * Create a `ProvingRequest` object, pricing the base fee at the consensus version active at
10576
+ * a given block height. This is identical to `buildProvingRequest` except for how the fee is
10577
+ * priced: `buildProvingRequest` always uses the latest consensus version known to the SDK,
10578
+ * which can differ from what the network charges while a consensus upgrade is pending
10579
+ * activation.
10580
+ *
10581
+ * @param private_key The private key of the signer.
10582
+ * @param program The program source code containing the function to authorize.
10583
+ * @param function_name The function to authorize.
10584
+ * @param inputs A javascript array of inputs to the function.
10585
+ * @param base_fee_credits The base fee to be paid for the authorization
10586
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
10587
+ * @param fee_record The record to spend the fee from
10588
+ * @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
10589
+ * @param broadcast (optional) Flag to indicate if the transaction should be broadcast
10590
+ * @param block_height (optional) The latest block height of the network the request targets.
10591
+ * If omitted, the latest consensus version known to the SDK is used.
10592
+ * @returns {ProvingRequest}
10593
+ * @param {PrivateKey} private_key
10594
+ * @param {string} program
10595
+ * @param {string} function_name
10596
+ * @param {Array<any>} inputs
10597
+ * @param {number} base_fee_credits
10598
+ * @param {number} priority_fee_credits
10599
+ * @param {RecordPlaintext | null | undefined} fee_record
10600
+ * @param {object | null | undefined} imports
10601
+ * @param {boolean} broadcast
10602
+ * @param {boolean} unchecked
10603
+ * @param {number | null | undefined} edition
10604
+ * @param {boolean} use_fee_master
10605
+ * @param {ProgramImports | null} [program_imports]
10606
+ * @param {number | null} [block_height]
10607
+ * @returns {Promise<ProvingRequest>}
10608
+ */
10609
+ 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) {
10610
+ _assertClass(private_key, PrivateKey);
10611
+ const ptr0 = passStringToWasm0(program, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
10612
+ const len0 = WASM_VECTOR_LEN;
10613
+ const ptr1 = passStringToWasm0(function_name, wasm$1.__wbindgen_export, wasm$1.__wbindgen_export2);
10614
+ const len1 = WASM_VECTOR_LEN;
10615
+ let ptr2 = 0;
10616
+ if (!isLikeNone(fee_record)) {
10617
+ _assertClass(fee_record, RecordPlaintext);
10618
+ ptr2 = fee_record.__destroy_into_raw();
10619
+ }
10620
+ let ptr3 = 0;
10621
+ if (!isLikeNone(program_imports)) {
10622
+ _assertClass(program_imports, ProgramImports);
10623
+ ptr3 = program_imports.__destroy_into_raw();
10624
+ }
10625
+ const ret = wasm$1.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);
10626
+ return takeObject(ret);
10627
+ }
10574
10628
  /**
10575
10629
  * Build a proving request from a `Request` object. By default this method currently uses the feemaster.
10576
10630
  *
@@ -18180,7 +18234,7 @@ function getMaxProgramImports() {
18180
18234
  * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';
18181
18235
  *
18182
18236
  * Set the consensus version heights.
18183
- * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21");
18237
+ * getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22");
18184
18238
  * @param {string | null} [heights]
18185
18239
  * @returns {Array<any>}
18186
18240
  */
@@ -18487,6 +18541,9 @@ function __wbg_get_imports(memory) {
18487
18541
  wasm$1.__wbindgen_export4(deferred0_0, deferred0_1, 1);
18488
18542
  }
18489
18543
  },
18544
+ __wbg_error_d53ccea1197d8bda: function(arg0, arg1) {
18545
+ console.error(getStringFromWasm0(arg0, arg1));
18546
+ },
18490
18547
  __wbg_executionresponse_new: function(arg0) {
18491
18548
  const ret = ExecutionResponse.__wrap(arg0);
18492
18549
  return addHeapObject(ret);
@@ -18610,7 +18667,7 @@ function __wbg_get_imports(memory) {
18610
18667
  const ret = getObject(arg0).length;
18611
18668
  return ret;
18612
18669
  },
18613
- __wbg_log_19868767c118515a: function(arg0, arg1) {
18670
+ __wbg_log_8dfb2fe5b15b7518: function(arg0, arg1) {
18614
18671
  console.log(getStringFromWasm0(arg0, arg1));
18615
18672
  },
18616
18673
  __wbg_new_1dbf7428bba60a42: function(arg0) {
@@ -18629,6 +18686,10 @@ function __wbg_get_imports(memory) {
18629
18686
  const ret = new Int32Array(getObject(arg0));
18630
18687
  return addHeapObject(ret);
18631
18688
  },
18689
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
18690
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
18691
+ return addHeapObject(ret);
18692
+ },
18632
18693
  __wbg_new_5502aad30c185fc8: function(arg0, arg1) {
18633
18694
  try {
18634
18695
  var state0 = {a: arg0, b: arg1};
@@ -18636,7 +18697,7 @@ function __wbg_get_imports(memory) {
18636
18697
  const a = state0.a;
18637
18698
  state0.a = 0;
18638
18699
  try {
18639
- return __wasm_bindgen_func_elem_8316(a, state0.b, arg0, arg1);
18700
+ return __wasm_bindgen_func_elem_8391(a, state0.b, arg0, arg1);
18640
18701
  } finally {
18641
18702
  state0.a = a;
18642
18703
  }
@@ -18674,7 +18735,7 @@ function __wbg_get_imports(memory) {
18674
18735
  const a = state0.a;
18675
18736
  state0.a = 0;
18676
18737
  try {
18677
- return __wasm_bindgen_func_elem_8316(a, state0.b, arg0, arg1);
18738
+ return __wasm_bindgen_func_elem_8391(a, state0.b, arg0, arg1);
18678
18739
  } finally {
18679
18740
  state0.a = a;
18680
18741
  }
@@ -18821,7 +18882,7 @@ function __wbg_get_imports(memory) {
18821
18882
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
18822
18883
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
18823
18884
  },
18824
- __wbg_spawnWorker_7ace2f33abee22af: function(arg0, arg1, arg2, arg3) {
18885
+ __wbg_spawnWorker_d5db1c8be59c20d6: function(arg0, arg1, arg2, arg3) {
18825
18886
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
18826
18887
  return addHeapObject(ret);
18827
18888
  },
@@ -18908,18 +18969,18 @@ function __wbg_get_imports(memory) {
18908
18969
  return addHeapObject(ret);
18909
18970
  },
18910
18971
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
18911
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 252, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18912
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3061);
18972
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 256, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18973
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3070);
18913
18974
  return addHeapObject(ret);
18914
18975
  },
18915
18976
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
18916
- // 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`.
18917
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8006);
18977
+ // 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`.
18978
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8081);
18918
18979
  return addHeapObject(ret);
18919
18980
  },
18920
18981
  __wbindgen_generic_0000000000000003: function(arg0, arg1) {
18921
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 334, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18922
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7940);
18982
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 345, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
18983
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8016);
18923
18984
  return addHeapObject(ret);
18924
18985
  },
18925
18986
  __wbindgen_generic_0000000000000004: function(arg0) {
@@ -18981,22 +19042,22 @@ function __wbg_get_imports(memory) {
18981
19042
  };
18982
19043
  }
18983
19044
 
18984
- function __wasm_bindgen_func_elem_7940(arg0, arg1) {
18985
- wasm$1.__wasm_bindgen_func_elem_7940(arg0, arg1);
19045
+ function __wasm_bindgen_func_elem_8016(arg0, arg1) {
19046
+ wasm$1.__wasm_bindgen_func_elem_8016(arg0, arg1);
18986
19047
  }
18987
19048
 
18988
- function __wasm_bindgen_func_elem_3061(arg0, arg1, arg2) {
18989
- wasm$1.__wasm_bindgen_func_elem_3061(arg0, arg1, addHeapObject(arg2));
19049
+ function __wasm_bindgen_func_elem_3070(arg0, arg1, arg2) {
19050
+ wasm$1.__wasm_bindgen_func_elem_3070(arg0, arg1, addHeapObject(arg2));
18990
19051
  }
18991
19052
 
18992
- function __wasm_bindgen_func_elem_8316(arg0, arg1, arg2, arg3) {
18993
- wasm$1.__wasm_bindgen_func_elem_8316(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
19053
+ function __wasm_bindgen_func_elem_8391(arg0, arg1, arg2, arg3) {
19054
+ wasm$1.__wasm_bindgen_func_elem_8391(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
18994
19055
  }
18995
19056
 
18996
- function __wasm_bindgen_func_elem_8006(arg0, arg1, arg2) {
19057
+ function __wasm_bindgen_func_elem_8081(arg0, arg1, arg2) {
18997
19058
  try {
18998
19059
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
18999
- wasm$1.__wasm_bindgen_func_elem_8006(retptr, arg0, arg1, addHeapObject(arg2));
19060
+ wasm$1.__wasm_bindgen_func_elem_8081(retptr, arg0, arg1, addHeapObject(arg2));
19000
19061
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
19001
19062
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
19002
19063
  if (r1) {