@provablehq/wasm 0.9.12 → 0.9.13

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.
@@ -2282,6 +2282,48 @@ export class ProgramManager {
2282
2282
  * @returns {Transaction} Transaction object
2283
2283
  */
2284
2284
  static buildSplitTransaction(private_key: PrivateKey, split_amount: number, amount_record: RecordPlaintext, url?: string | null, split_proving_key?: ProvingKey | null, split_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
2285
+ /**
2286
+ * Deploy an Aleo program without synthesizing keys and generating certificates.
2287
+ * Intended for use with Leo Devnode.
2288
+ *
2289
+ * @param private_key The private key of the sender
2290
+ * @param program The source code of the program being deployed
2291
+ * @param imports A javascript object holding the source code of any imported programs in the
2292
+ * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
2293
+ * Note that all imported programs must be deployed on chain before the main program in order
2294
+ * for the deployment to succeed
2295
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
2296
+ * @param fee_record The record to spend the fee from
2297
+ * @param url The url of the Aleo network node to send the transaction to
2298
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
2299
+ * form of a javascript object where the keys are a string of the program name and the values
2300
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2301
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2302
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2303
+ * @returns {Transaction}
2304
+ */
2305
+ static buildDevnodeDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null): Promise<Transaction>;
2306
+ /**
2307
+ * Upgrade a deployed Aleo program without synthesizing keys and generating certificates.
2308
+ * Intended for use with Leo Devnode.
2309
+ *
2310
+ * @param private_key The private key of the sender
2311
+ * @param program The source code of the upgraded program
2312
+ * @param imports A javascript object holding the source code of any imported programs in the
2313
+ * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
2314
+ * Note that all imported programs must be deployed on chain before the main program in order
2315
+ * for the deployment to succeed
2316
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
2317
+ * @param fee_record The record to spend the fee from
2318
+ * @param url The url of the Aleo network node to send the transaction to
2319
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
2320
+ * form of a javascript object where the keys are a string of the program name and the values
2321
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2322
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2323
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2324
+ * @returns {Transaction}
2325
+ */
2326
+ static buildDevnodeUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null): Promise<Transaction>;
2285
2327
  /**
2286
2328
  * Estimate the component of the deployment cost which comes from the fee for the program name.
2287
2329
  * Note that this cost does not represent the entire cost of deployment. It is additional to
@@ -2325,6 +2367,51 @@ export class ProgramManager {
2325
2367
  * @returns {Transaction}
2326
2368
  */
2327
2369
  static buildDeploymentTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
2370
+ /**
2371
+ * Upgrade an Aleo program
2372
+ *
2373
+ * @param private_key The private key of the sender
2374
+ * @param program The source code of the program being upgraded
2375
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
2376
+ * @param fee_record The record to spend the fee from
2377
+ * @param url The url of the Aleo network node to send the transaction to
2378
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
2379
+ * form of a javascript object where the keys are a string of the program name and the values
2380
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2381
+ * Note that all imported programs must be deployed on chain before the main program in order
2382
+ * for the deployment to succeed
2383
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2384
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2385
+ * @returns {Transaction}
2386
+ */
2387
+ static buildUpgradeTransaction(private_key: PrivateKey, program: string, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
2388
+ /**
2389
+ * Generate an execution transaction without a proof.
2390
+ * Intended for use with the Leo devnode tool.
2391
+ *
2392
+ * @param private_key The private key of the sender
2393
+ * @param program The source code of the program being executed
2394
+ * @param function The name of the function to execute
2395
+ * @param inputs A javascript array of inputs to the function
2396
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
2397
+ * @param fee_record The record to spend the fee from
2398
+ * @param url The url of the Aleo network node to send the transaction to
2399
+ * If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
2400
+ * `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
2401
+ * and used for subsequent transactions. If this is set to 'false' the proving and verifying
2402
+ * keys will be deallocated from memory after the transaction is executed.
2403
+ * @param imports (optional) Provide a list of imports to use for the function execution in the
2404
+ * form of a javascript object where the keys are a string of the program name and the values
2405
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
2406
+ * @param proving_key (optional) Provide a verifying key to use for the function execution
2407
+ * @param verifying_key (optional) Provide a verifying key to use for the function execution
2408
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
2409
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
2410
+ * @param offline_query An offline query object to use if building a transaction without an internet connection.
2411
+ * @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
2412
+ * @returns {Transaction}
2413
+ */
2414
+ static buildDevnodeExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, edition?: number | null): Promise<Transaction>;
2328
2415
  /**
2329
2416
  * Estimate the finalize fee component for executing a function. This fee is additional to the
2330
2417
  * size of the execution of the program in bytes. If the function does not have a finalize
Binary file
@@ -307,7 +307,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
307
307
  wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
308
308
  }
309
309
 
310
- function __wbg_adapter_870(arg0, arg1, arg2, arg3) {
310
+ function __wbg_adapter_874(arg0, arg1, arg2, arg3) {
311
311
  wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
312
312
  }
313
313
 
@@ -7748,6 +7748,88 @@ class ProgramManager {
7748
7748
  const ret = wasm.programmanager_buildSplitTransaction(private_key.__wbg_ptr, split_amount, ptr0, ptr1, len1, ptr2, ptr3, ptr4);
7749
7749
  return takeObject(ret);
7750
7750
  }
7751
+ /**
7752
+ * Deploy an Aleo program without synthesizing keys and generating certificates.
7753
+ * Intended for use with Leo Devnode.
7754
+ *
7755
+ * @param private_key The private key of the sender
7756
+ * @param program The source code of the program being deployed
7757
+ * @param imports A javascript object holding the source code of any imported programs in the
7758
+ * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
7759
+ * Note that all imported programs must be deployed on chain before the main program in order
7760
+ * for the deployment to succeed
7761
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
7762
+ * @param fee_record The record to spend the fee from
7763
+ * @param url The url of the Aleo network node to send the transaction to
7764
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
7765
+ * form of a javascript object where the keys are a string of the program name and the values
7766
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
7767
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
7768
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
7769
+ * @returns {Transaction}
7770
+ * @param {PrivateKey} private_key
7771
+ * @param {string} program
7772
+ * @param {number} priority_fee_credits
7773
+ * @param {RecordPlaintext | null} [fee_record]
7774
+ * @param {string | null} [url]
7775
+ * @param {object | null} [imports]
7776
+ * @returns {Promise<Transaction>}
7777
+ */
7778
+ static buildDevnodeDeploymentTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
7779
+ _assertClass(private_key, PrivateKey);
7780
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7781
+ const len0 = WASM_VECTOR_LEN;
7782
+ let ptr1 = 0;
7783
+ if (!isLikeNone(fee_record)) {
7784
+ _assertClass(fee_record, RecordPlaintext);
7785
+ ptr1 = fee_record.__destroy_into_raw();
7786
+ }
7787
+ var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7788
+ var len2 = WASM_VECTOR_LEN;
7789
+ const ret = wasm.programmanager_buildDevnodeDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports));
7790
+ return takeObject(ret);
7791
+ }
7792
+ /**
7793
+ * Upgrade a deployed Aleo program without synthesizing keys and generating certificates.
7794
+ * Intended for use with Leo Devnode.
7795
+ *
7796
+ * @param private_key The private key of the sender
7797
+ * @param program The source code of the upgraded program
7798
+ * @param imports A javascript object holding the source code of any imported programs in the
7799
+ * form \{"program_name1": "program_source_code", "program_name2": "program_source_code", ..\}.
7800
+ * Note that all imported programs must be deployed on chain before the main program in order
7801
+ * for the deployment to succeed
7802
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
7803
+ * @param fee_record The record to spend the fee from
7804
+ * @param url The url of the Aleo network node to send the transaction to
7805
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
7806
+ * form of a javascript object where the keys are a string of the program name and the values
7807
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
7808
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
7809
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
7810
+ * @returns {Transaction}
7811
+ * @param {PrivateKey} private_key
7812
+ * @param {string} program
7813
+ * @param {number} priority_fee_credits
7814
+ * @param {RecordPlaintext | null} [fee_record]
7815
+ * @param {string | null} [url]
7816
+ * @param {object | null} [imports]
7817
+ * @returns {Promise<Transaction>}
7818
+ */
7819
+ static buildDevnodeUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports) {
7820
+ _assertClass(private_key, PrivateKey);
7821
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7822
+ const len0 = WASM_VECTOR_LEN;
7823
+ let ptr1 = 0;
7824
+ if (!isLikeNone(fee_record)) {
7825
+ _assertClass(fee_record, RecordPlaintext);
7826
+ ptr1 = fee_record.__destroy_into_raw();
7827
+ }
7828
+ var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7829
+ var len2 = WASM_VECTOR_LEN;
7830
+ const ret = wasm.programmanager_buildDevnodeUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports));
7831
+ return takeObject(ret);
7832
+ }
7751
7833
  /**
7752
7834
  * Estimate the component of the deployment cost which comes from the fee for the program name.
7753
7835
  * Note that this cost does not represent the entire cost of deployment. It is additional to
@@ -7855,6 +7937,114 @@ class ProgramManager {
7855
7937
  const ret = wasm.programmanager_buildDeploymentTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
7856
7938
  return takeObject(ret);
7857
7939
  }
7940
+ /**
7941
+ * Upgrade an Aleo program
7942
+ *
7943
+ * @param private_key The private key of the sender
7944
+ * @param program The source code of the program being upgraded
7945
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
7946
+ * @param fee_record The record to spend the fee from
7947
+ * @param url The url of the Aleo network node to send the transaction to
7948
+ * @param imports (optional) Provide a list of imports to use for the program deployment in the
7949
+ * form of a javascript object where the keys are a string of the program name and the values
7950
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
7951
+ * Note that all imported programs must be deployed on chain before the main program in order
7952
+ * for the deployment to succeed
7953
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
7954
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
7955
+ * @returns {Transaction}
7956
+ * @param {PrivateKey} private_key
7957
+ * @param {string} program
7958
+ * @param {number} priority_fee_credits
7959
+ * @param {RecordPlaintext | null} [fee_record]
7960
+ * @param {string | null} [url]
7961
+ * @param {object | null} [imports]
7962
+ * @param {ProvingKey | null} [fee_proving_key]
7963
+ * @param {VerifyingKey | null} [fee_verifying_key]
7964
+ * @param {OfflineQuery | null} [offline_query]
7965
+ * @returns {Promise<Transaction>}
7966
+ */
7967
+ static buildUpgradeTransaction(private_key, program, priority_fee_credits, fee_record, url, imports, fee_proving_key, fee_verifying_key, offline_query) {
7968
+ _assertClass(private_key, PrivateKey);
7969
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7970
+ const len0 = WASM_VECTOR_LEN;
7971
+ let ptr1 = 0;
7972
+ if (!isLikeNone(fee_record)) {
7973
+ _assertClass(fee_record, RecordPlaintext);
7974
+ ptr1 = fee_record.__destroy_into_raw();
7975
+ }
7976
+ var ptr2 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
7977
+ var len2 = WASM_VECTOR_LEN;
7978
+ let ptr3 = 0;
7979
+ if (!isLikeNone(fee_proving_key)) {
7980
+ _assertClass(fee_proving_key, ProvingKey);
7981
+ ptr3 = fee_proving_key.__destroy_into_raw();
7982
+ }
7983
+ let ptr4 = 0;
7984
+ if (!isLikeNone(fee_verifying_key)) {
7985
+ _assertClass(fee_verifying_key, VerifyingKey);
7986
+ ptr4 = fee_verifying_key.__destroy_into_raw();
7987
+ }
7988
+ let ptr5 = 0;
7989
+ if (!isLikeNone(offline_query)) {
7990
+ _assertClass(offline_query, OfflineQuery);
7991
+ ptr5 = offline_query.__destroy_into_raw();
7992
+ }
7993
+ const ret = wasm.programmanager_buildUpgradeTransaction(private_key.__wbg_ptr, ptr0, len0, priority_fee_credits, ptr1, ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
7994
+ return takeObject(ret);
7995
+ }
7996
+ /**
7997
+ * Generate an execution transaction without a proof.
7998
+ * Intended for use with the Leo devnode tool.
7999
+ *
8000
+ * @param private_key The private key of the sender
8001
+ * @param program The source code of the program being executed
8002
+ * @param function The name of the function to execute
8003
+ * @param inputs A javascript array of inputs to the function
8004
+ * @param priority_fee_credits The optional priority fee to be paid for the transaction
8005
+ * @param fee_record The record to spend the fee from
8006
+ * @param url The url of the Aleo network node to send the transaction to
8007
+ * If this is set to 'true' the keys synthesized (or passed in as optional parameters via the
8008
+ * `proving_key` and `verifying_key` arguments) will be stored in the ProgramManager's memory
8009
+ * and used for subsequent transactions. If this is set to 'false' the proving and verifying
8010
+ * keys will be deallocated from memory after the transaction is executed.
8011
+ * @param imports (optional) Provide a list of imports to use for the function execution in the
8012
+ * form of a javascript object where the keys are a string of the program name and the values
8013
+ * are a string representing the program source code \{ "hello.aleo": "hello.aleo source code" \}
8014
+ * @param proving_key (optional) Provide a verifying key to use for the function execution
8015
+ * @param verifying_key (optional) Provide a verifying key to use for the function execution
8016
+ * @param fee_proving_key (optional) Provide a proving key to use for the fee execution
8017
+ * @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
8018
+ * @param offline_query An offline query object to use if building a transaction without an internet connection.
8019
+ * @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
8020
+ * @returns {Transaction}
8021
+ * @param {PrivateKey} private_key
8022
+ * @param {string} program
8023
+ * @param {string} _function
8024
+ * @param {Array<any>} inputs
8025
+ * @param {number} priority_fee_credits
8026
+ * @param {RecordPlaintext | null} [fee_record]
8027
+ * @param {string | null} [url]
8028
+ * @param {object | null} [imports]
8029
+ * @param {number | null} [edition]
8030
+ * @returns {Promise<Transaction>}
8031
+ */
8032
+ static buildDevnodeExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, edition) {
8033
+ _assertClass(private_key, PrivateKey);
8034
+ const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
8035
+ const len0 = WASM_VECTOR_LEN;
8036
+ const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
8037
+ const len1 = WASM_VECTOR_LEN;
8038
+ let ptr2 = 0;
8039
+ if (!isLikeNone(fee_record)) {
8040
+ _assertClass(fee_record, RecordPlaintext);
8041
+ ptr2 = fee_record.__destroy_into_raw();
8042
+ }
8043
+ var ptr3 = isLikeNone(url) ? 0 : passStringToWasm0(url, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
8044
+ var len3 = WASM_VECTOR_LEN;
8045
+ const ret = wasm.programmanager_buildDevnodeExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
8046
+ return takeObject(ret);
8047
+ }
7858
8048
  /**
7859
8049
  * Estimate the finalize fee component for executing a function. This fee is additional to the
7860
8050
  * size of the execution of the program in bytes. If the function does not have a finalize
@@ -13252,7 +13442,7 @@ function __wbg_get_imports() {
13252
13442
  const ret = getObject(arg0).length;
13253
13443
  return ret;
13254
13444
  };
13255
- imports.wbg.__wbg_log_56fc8378195f90bc = function(arg0, arg1) {
13445
+ imports.wbg.__wbg_log_044a3f26fd9262bb = function(arg0, arg1) {
13256
13446
  console.log(getStringFromWasm0(arg0, arg1));
13257
13447
  };
13258
13448
  imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
@@ -13270,7 +13460,7 @@ function __wbg_get_imports() {
13270
13460
  const a = state0.a;
13271
13461
  state0.a = 0;
13272
13462
  try {
13273
- return __wbg_adapter_870(a, state0.b, arg0, arg1);
13463
+ return __wbg_adapter_874(a, state0.b, arg0, arg1);
13274
13464
  } finally {
13275
13465
  state0.a = a;
13276
13466
  }
@@ -13457,7 +13647,7 @@ function __wbg_get_imports() {
13457
13647
  const ret = Signature.__wrap(arg0);
13458
13648
  return addHeapObject(ret);
13459
13649
  };
13460
- imports.wbg.__wbg_spawnWorker_b3b660eb297d8ef0 = function(arg0, arg1, arg2, arg3) {
13650
+ imports.wbg.__wbg_spawnWorker_d0638f4f528df5ed = function(arg0, arg1, arg2, arg3) {
13461
13651
  const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
13462
13652
  return addHeapObject(ret);
13463
13653
  };
@@ -13577,11 +13767,11 @@ function __wbg_get_imports() {
13577
13767
  const ret = false;
13578
13768
  return ret;
13579
13769
  };
13580
- imports.wbg.__wbindgen_closure_wrapper7378 = function(arg0, arg1, arg2) {
13770
+ imports.wbg.__wbindgen_closure_wrapper7434 = function(arg0, arg1, arg2) {
13581
13771
  const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
13582
13772
  return addHeapObject(ret);
13583
13773
  };
13584
- imports.wbg.__wbindgen_closure_wrapper7383 = function(arg0, arg1, arg2) {
13774
+ imports.wbg.__wbindgen_closure_wrapper7439 = function(arg0, arg1, arg2) {
13585
13775
  const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
13586
13776
  return addHeapObject(ret);
13587
13777
  };