@provablehq/wasm 0.9.5 → 0.9.6
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.
- package/dist/mainnet/aleo_wasm.d.ts +19 -9
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +91 -28
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +91 -28
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +19 -9
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +91 -28
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +91 -28
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -700,14 +700,14 @@ export class ExecutionRequest {
|
|
|
700
700
|
* @param {Field | undefined} root_tvk The tvk of the function at the top of the call graph. This is undefined if this request is built for the top-level call or if there is only one function in the call graph.
|
|
701
701
|
* @param {boolean} is_root Flag to indicate if this is the top level function in the call graph.
|
|
702
702
|
*/
|
|
703
|
-
static sign(private_key: PrivateKey, program_id: string, function_name: string, inputs: Array<any>, input_types: Array<any>, root_tvk: Field | null | undefined, is_root: boolean): ExecutionRequest;
|
|
703
|
+
static sign(private_key: PrivateKey, program_id: string, function_name: string, inputs: Array<any>, input_types: Array<any>, root_tvk: Field | null | undefined, program_checksum: Field | null | undefined, is_root: boolean): ExecutionRequest;
|
|
704
704
|
/**
|
|
705
705
|
* Verify the input types within a request.
|
|
706
706
|
*
|
|
707
707
|
* @param {string[]} The input_types within the request.
|
|
708
708
|
* @param {boolean} Flag to indicate whether this request is the first function in the call graph.
|
|
709
709
|
*/
|
|
710
|
-
verify(input_types: Array<any>, is_root: boolean): boolean;
|
|
710
|
+
verify(input_types: Array<any>, is_root: boolean, program_checksum?: Field | null): boolean;
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
713
713
|
* Webassembly Representation of an Aleo function execution response
|
|
@@ -2152,7 +2152,7 @@ export class ProgramManager {
|
|
|
2152
2152
|
* @param inputs A javascript array of inputs to the function.
|
|
2153
2153
|
* @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
|
|
2154
2154
|
*/
|
|
2155
|
-
static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null): Promise<Authorization>;
|
|
2155
|
+
static authorize(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
|
|
2156
2156
|
/**
|
|
2157
2157
|
* Create an execution `Authorization` without generating a circuit. Use this function when
|
|
2158
2158
|
* fast delegated proving is needed.
|
|
@@ -2163,7 +2163,7 @@ export class ProgramManager {
|
|
|
2163
2163
|
* @param inputs A javascript array of inputs to the function.
|
|
2164
2164
|
* @param imports The imports to the program in the format {"programname.aleo":"aleo instructions source code"}.
|
|
2165
2165
|
*/
|
|
2166
|
-
static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null): Promise<Authorization>;
|
|
2166
|
+
static buildAuthorizationUnchecked(private_key: PrivateKey, program: string, function_name: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<Authorization>;
|
|
2167
2167
|
/**
|
|
2168
2168
|
* Create an `Authorization` for `credits.aleo/fee_public` or `credits.aleo/fee_private`.
|
|
2169
2169
|
* This object requires an associated execution or deployment ID. This can be gained from
|
|
@@ -2240,7 +2240,7 @@ export class ProgramManager {
|
|
|
2240
2240
|
* @param {ProvingKey | undefined} proving_key (optional) Provide a verifying key to use for the function execution
|
|
2241
2241
|
* @param {VerifyingKey | undefined} verifying_key (optional) Provide a verifying key to use for the function execution
|
|
2242
2242
|
*/
|
|
2243
|
-
static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, offline_query?: OfflineQuery | null): Promise<ExecutionResponse>;
|
|
2243
|
+
static executeFunctionOffline(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, prove_execution: boolean, cache: boolean, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, url?: string | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<ExecutionResponse>;
|
|
2244
2244
|
/**
|
|
2245
2245
|
* Execute Aleo function and create an Aleo execution transaction
|
|
2246
2246
|
*
|
|
@@ -2262,9 +2262,11 @@ export class ProgramManager {
|
|
|
2262
2262
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
2263
2263
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
2264
2264
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
2265
|
+
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
2266
|
+
* @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.
|
|
2265
2267
|
* @returns {Transaction}
|
|
2266
2268
|
*/
|
|
2267
|
-
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<Transaction>;
|
|
2269
|
+
static buildExecutionTransaction(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, priority_fee_credits: number, fee_record?: RecordPlaintext | null, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, fee_proving_key?: ProvingKey | null, fee_verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<Transaction>;
|
|
2268
2270
|
/**
|
|
2269
2271
|
* Estimate Fee for Aleo function execution. Note if "cache" is set to true, the proving and
|
|
2270
2272
|
* verifying keys will be stored in the ProgramManager's memory and used for subsequent
|
|
@@ -2284,7 +2286,7 @@ export class ProgramManager {
|
|
|
2284
2286
|
* @param verifying_key (optional) Provide a verifying key to use for the fee estimation
|
|
2285
2287
|
* @returns {u64} Fee in microcredits
|
|
2286
2288
|
*/
|
|
2287
|
-
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null): Promise<bigint>;
|
|
2289
|
+
static estimateExecutionFee(private_key: PrivateKey, program: string, _function: string, inputs: Array<any>, url?: string | null, imports?: object | null, proving_key?: ProvingKey | null, verifying_key?: VerifyingKey | null, offline_query?: OfflineQuery | null, edition?: number | null): Promise<bigint>;
|
|
2288
2290
|
/**
|
|
2289
2291
|
* Estimate the finalize fee component for executing a function. This fee is additional to the
|
|
2290
2292
|
* size of the execution of the program in bytes. If the function does not have a finalize
|
|
@@ -2331,7 +2333,7 @@ export class ProgramManager {
|
|
|
2331
2333
|
* @param broadcast (optional) Flag to indicate if the transaction should be broadcast
|
|
2332
2334
|
* @returns {Authorization}
|
|
2333
2335
|
*/
|
|
2334
|
-
static buildProvingRequest(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): Promise<ProvingRequest>;
|
|
2336
|
+
static buildProvingRequest(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): Promise<ProvingRequest>;
|
|
2335
2337
|
/**
|
|
2336
2338
|
* Split an Aleo credits record into two separate records. This function does not require a fee.
|
|
2337
2339
|
*
|
|
@@ -2371,7 +2373,7 @@ export class ProgramManager {
|
|
|
2371
2373
|
* @param inputs {Array} The inputs to the function
|
|
2372
2374
|
* @param imports {Object | undefined} The imports for the program
|
|
2373
2375
|
*/
|
|
2374
|
-
static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null): Promise<KeyPair>;
|
|
2376
|
+
static synthesizeKeyPair(private_key: PrivateKey, program: string, function_id: string, inputs: Array<any>, imports?: object | null, edition?: number | null): Promise<KeyPair>;
|
|
2375
2377
|
}
|
|
2376
2378
|
/**
|
|
2377
2379
|
* Proving key for a function within an Aleo program
|
|
@@ -2905,6 +2907,10 @@ export class Scalar {
|
|
|
2905
2907
|
* Create a plaintext element from a scalar element.
|
|
2906
2908
|
*/
|
|
2907
2909
|
toPlaintext(): Plaintext;
|
|
2910
|
+
/**
|
|
2911
|
+
* Cast the scalar element to a field element.
|
|
2912
|
+
*/
|
|
2913
|
+
toField(): Field;
|
|
2908
2914
|
/**
|
|
2909
2915
|
* Clone the scalar element.
|
|
2910
2916
|
*/
|
|
@@ -4078,6 +4084,10 @@ export class ViewKey {
|
|
|
4078
4084
|
* Get the underlying scalar of a view key.
|
|
4079
4085
|
*/
|
|
4080
4086
|
to_scalar(): Scalar;
|
|
4087
|
+
/**
|
|
4088
|
+
* Cast the view key to a field.
|
|
4089
|
+
*/
|
|
4090
|
+
toField(): Field;
|
|
4081
4091
|
/**
|
|
4082
4092
|
* Decrypt a record ciphertext with a view key
|
|
4083
4093
|
*
|
|
Binary file
|
package/dist/mainnet/index.js
CHANGED
|
@@ -291,7 +291,7 @@ function __wbg_adapter_43(arg0, arg1, arg2) {
|
|
|
291
291
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
function
|
|
294
|
+
function __wbg_adapter_853(arg0, arg1, arg2, arg3) {
|
|
295
295
|
wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -2629,10 +2629,11 @@ class ExecutionRequest {
|
|
|
2629
2629
|
* @param {Array<any>} inputs
|
|
2630
2630
|
* @param {Array<any>} input_types
|
|
2631
2631
|
* @param {Field | null | undefined} root_tvk
|
|
2632
|
+
* @param {Field | null | undefined} program_checksum
|
|
2632
2633
|
* @param {boolean} is_root
|
|
2633
2634
|
* @returns {ExecutionRequest}
|
|
2634
2635
|
*/
|
|
2635
|
-
static sign(private_key, program_id, function_name, inputs, input_types, root_tvk, is_root) {
|
|
2636
|
+
static sign(private_key, program_id, function_name, inputs, input_types, root_tvk, program_checksum, is_root) {
|
|
2636
2637
|
try {
|
|
2637
2638
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2638
2639
|
_assertClass(private_key, PrivateKey);
|
|
@@ -2646,7 +2647,12 @@ class ExecutionRequest {
|
|
|
2646
2647
|
_assertClass(root_tvk, Field);
|
|
2647
2648
|
ptr3 = root_tvk.__destroy_into_raw();
|
|
2648
2649
|
}
|
|
2649
|
-
|
|
2650
|
+
let ptr4 = 0;
|
|
2651
|
+
if (!isLikeNone(program_checksum)) {
|
|
2652
|
+
_assertClass(program_checksum, Field);
|
|
2653
|
+
ptr4 = program_checksum.__destroy_into_raw();
|
|
2654
|
+
}
|
|
2655
|
+
wasm.executionrequest_sign(retptr, ptr0, ptr1, len1, ptr2, len2, addHeapObject(inputs), addHeapObject(input_types), ptr3, ptr4, is_root);
|
|
2650
2656
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2651
2657
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2652
2658
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2665,10 +2671,16 @@ class ExecutionRequest {
|
|
|
2665
2671
|
* @param {boolean} Flag to indicate whether this request is the first function in the call graph.
|
|
2666
2672
|
* @param {Array<any>} input_types
|
|
2667
2673
|
* @param {boolean} is_root
|
|
2674
|
+
* @param {Field | null} [program_checksum]
|
|
2668
2675
|
* @returns {boolean}
|
|
2669
2676
|
*/
|
|
2670
|
-
verify(input_types, is_root) {
|
|
2671
|
-
|
|
2677
|
+
verify(input_types, is_root, program_checksum) {
|
|
2678
|
+
let ptr0 = 0;
|
|
2679
|
+
if (!isLikeNone(program_checksum)) {
|
|
2680
|
+
_assertClass(program_checksum, Field);
|
|
2681
|
+
ptr0 = program_checksum.__destroy_into_raw();
|
|
2682
|
+
}
|
|
2683
|
+
const ret = wasm.executionrequest_verify(this.__wbg_ptr, addHeapObject(input_types), is_root, ptr0);
|
|
2672
2684
|
return ret !== 0;
|
|
2673
2685
|
}
|
|
2674
2686
|
}
|
|
@@ -7335,15 +7347,16 @@ class ProgramManager {
|
|
|
7335
7347
|
* @param {string} function_name
|
|
7336
7348
|
* @param {Array<any>} inputs
|
|
7337
7349
|
* @param {object | null} [imports]
|
|
7350
|
+
* @param {number | null} [edition]
|
|
7338
7351
|
* @returns {Promise<Authorization>}
|
|
7339
7352
|
*/
|
|
7340
|
-
static authorize(private_key, program, function_name, inputs, imports) {
|
|
7353
|
+
static authorize(private_key, program, function_name, inputs, imports, edition) {
|
|
7341
7354
|
_assertClass(private_key, PrivateKey);
|
|
7342
7355
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7343
7356
|
const len0 = WASM_VECTOR_LEN;
|
|
7344
7357
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7345
7358
|
const len1 = WASM_VECTOR_LEN;
|
|
7346
|
-
const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
7359
|
+
const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7347
7360
|
return takeObject(ret);
|
|
7348
7361
|
}
|
|
7349
7362
|
/**
|
|
@@ -7360,15 +7373,16 @@ class ProgramManager {
|
|
|
7360
7373
|
* @param {string} function_name
|
|
7361
7374
|
* @param {Array<any>} inputs
|
|
7362
7375
|
* @param {object | null} [imports]
|
|
7376
|
+
* @param {number | null} [edition]
|
|
7363
7377
|
* @returns {Promise<Authorization>}
|
|
7364
7378
|
*/
|
|
7365
|
-
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports) {
|
|
7379
|
+
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition) {
|
|
7366
7380
|
_assertClass(private_key, PrivateKey);
|
|
7367
7381
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7368
7382
|
const len0 = WASM_VECTOR_LEN;
|
|
7369
7383
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7370
7384
|
const len1 = WASM_VECTOR_LEN;
|
|
7371
|
-
const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
7385
|
+
const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7372
7386
|
return takeObject(ret);
|
|
7373
7387
|
}
|
|
7374
7388
|
/**
|
|
@@ -7538,9 +7552,10 @@ class ProgramManager {
|
|
|
7538
7552
|
* @param {VerifyingKey | null} [verifying_key]
|
|
7539
7553
|
* @param {string | null} [url]
|
|
7540
7554
|
* @param {OfflineQuery | null} [offline_query]
|
|
7555
|
+
* @param {number | null} [edition]
|
|
7541
7556
|
* @returns {Promise<ExecutionResponse>}
|
|
7542
7557
|
*/
|
|
7543
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, offline_query) {
|
|
7558
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, offline_query, edition) {
|
|
7544
7559
|
_assertClass(private_key, PrivateKey);
|
|
7545
7560
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7546
7561
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7563,7 +7578,7 @@ class ProgramManager {
|
|
|
7563
7578
|
_assertClass(offline_query, OfflineQuery);
|
|
7564
7579
|
ptr5 = offline_query.__destroy_into_raw();
|
|
7565
7580
|
}
|
|
7566
|
-
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5);
|
|
7581
|
+
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7567
7582
|
return takeObject(ret);
|
|
7568
7583
|
}
|
|
7569
7584
|
/**
|
|
@@ -7587,6 +7602,8 @@ class ProgramManager {
|
|
|
7587
7602
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
7588
7603
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
7589
7604
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
7605
|
+
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
7606
|
+
* @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.
|
|
7590
7607
|
* @returns {Transaction}
|
|
7591
7608
|
* @param {PrivateKey} private_key
|
|
7592
7609
|
* @param {string} program
|
|
@@ -7601,9 +7618,10 @@ class ProgramManager {
|
|
|
7601
7618
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
7602
7619
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
7603
7620
|
* @param {OfflineQuery | null} [offline_query]
|
|
7621
|
+
* @param {number | null} [edition]
|
|
7604
7622
|
* @returns {Promise<Transaction>}
|
|
7605
7623
|
*/
|
|
7606
|
-
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
|
|
7624
|
+
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query, edition) {
|
|
7607
7625
|
_assertClass(private_key, PrivateKey);
|
|
7608
7626
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7609
7627
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7641,7 +7659,7 @@ class ProgramManager {
|
|
|
7641
7659
|
_assertClass(offline_query, OfflineQuery);
|
|
7642
7660
|
ptr8 = offline_query.__destroy_into_raw();
|
|
7643
7661
|
}
|
|
7644
|
-
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8);
|
|
7662
|
+
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7645
7663
|
return takeObject(ret);
|
|
7646
7664
|
}
|
|
7647
7665
|
/**
|
|
@@ -7671,9 +7689,10 @@ class ProgramManager {
|
|
|
7671
7689
|
* @param {ProvingKey | null} [proving_key]
|
|
7672
7690
|
* @param {VerifyingKey | null} [verifying_key]
|
|
7673
7691
|
* @param {OfflineQuery | null} [offline_query]
|
|
7692
|
+
* @param {number | null} [edition]
|
|
7674
7693
|
* @returns {Promise<bigint>}
|
|
7675
7694
|
*/
|
|
7676
|
-
static estimateExecutionFee(private_key, program, _function, inputs, url, imports, proving_key, verifying_key, offline_query) {
|
|
7695
|
+
static estimateExecutionFee(private_key, program, _function, inputs, url, imports, proving_key, verifying_key, offline_query, edition) {
|
|
7677
7696
|
_assertClass(private_key, PrivateKey);
|
|
7678
7697
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7679
7698
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7696,7 +7715,7 @@ class ProgramManager {
|
|
|
7696
7715
|
_assertClass(offline_query, OfflineQuery);
|
|
7697
7716
|
ptr5 = offline_query.__destroy_into_raw();
|
|
7698
7717
|
}
|
|
7699
|
-
const ret = wasm.programmanager_estimateExecutionFee(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
|
|
7718
|
+
const ret = wasm.programmanager_estimateExecutionFee(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7700
7719
|
return takeObject(ret);
|
|
7701
7720
|
}
|
|
7702
7721
|
/**
|
|
@@ -7827,9 +7846,10 @@ class ProgramManager {
|
|
|
7827
7846
|
* @param {object | null | undefined} imports
|
|
7828
7847
|
* @param {boolean} broadcast
|
|
7829
7848
|
* @param {boolean} unchecked
|
|
7849
|
+
* @param {number | null} [edition]
|
|
7830
7850
|
* @returns {Promise<ProvingRequest>}
|
|
7831
7851
|
*/
|
|
7832
|
-
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked) {
|
|
7852
|
+
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition) {
|
|
7833
7853
|
_assertClass(private_key, PrivateKey);
|
|
7834
7854
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7835
7855
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7840,7 +7860,7 @@ class ProgramManager {
|
|
|
7840
7860
|
_assertClass(fee_record, RecordPlaintext);
|
|
7841
7861
|
ptr2 = fee_record.__destroy_into_raw();
|
|
7842
7862
|
}
|
|
7843
|
-
const ret = wasm.programmanager_buildProvingRequest(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), base_fee_credits, priority_fee_credits, ptr2, isLikeNone(imports) ? 0 : addHeapObject(imports), broadcast, unchecked);
|
|
7863
|
+
const ret = wasm.programmanager_buildProvingRequest(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);
|
|
7844
7864
|
return takeObject(ret);
|
|
7845
7865
|
}
|
|
7846
7866
|
/**
|
|
@@ -7976,15 +7996,16 @@ class ProgramManager {
|
|
|
7976
7996
|
* @param {string} function_id
|
|
7977
7997
|
* @param {Array<any>} inputs
|
|
7978
7998
|
* @param {object | null} [imports]
|
|
7999
|
+
* @param {number | null} [edition]
|
|
7979
8000
|
* @returns {Promise<KeyPair>}
|
|
7980
8001
|
*/
|
|
7981
|
-
static synthesizeKeyPair(private_key, program, function_id, inputs, imports) {
|
|
8002
|
+
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition) {
|
|
7982
8003
|
_assertClass(private_key, PrivateKey);
|
|
7983
8004
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7984
8005
|
const len0 = WASM_VECTOR_LEN;
|
|
7985
8006
|
const ptr1 = passStringToWasm0(function_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7986
8007
|
const len1 = WASM_VECTOR_LEN;
|
|
7987
|
-
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
8008
|
+
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7988
8009
|
return takeObject(ret);
|
|
7989
8010
|
}
|
|
7990
8011
|
}
|
|
@@ -9377,6 +9398,25 @@ class Scalar {
|
|
|
9377
9398
|
const ret = wasm.scalar_toPlaintext(this.__wbg_ptr);
|
|
9378
9399
|
return Plaintext.__wrap(ret);
|
|
9379
9400
|
}
|
|
9401
|
+
/**
|
|
9402
|
+
* Cast the scalar element to a field element.
|
|
9403
|
+
* @returns {Field}
|
|
9404
|
+
*/
|
|
9405
|
+
toField() {
|
|
9406
|
+
try {
|
|
9407
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
9408
|
+
wasm.scalar_toField(retptr, this.__wbg_ptr);
|
|
9409
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
9410
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
9411
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
9412
|
+
if (r2) {
|
|
9413
|
+
throw takeObject(r1);
|
|
9414
|
+
}
|
|
9415
|
+
return Field.__wrap(r0);
|
|
9416
|
+
} finally {
|
|
9417
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
9418
|
+
}
|
|
9419
|
+
}
|
|
9380
9420
|
/**
|
|
9381
9421
|
* Clone the scalar element.
|
|
9382
9422
|
* @returns {Scalar}
|
|
@@ -12583,6 +12623,25 @@ class ViewKey {
|
|
|
12583
12623
|
const ret = wasm.field_clone(this.__wbg_ptr);
|
|
12584
12624
|
return Scalar.__wrap(ret);
|
|
12585
12625
|
}
|
|
12626
|
+
/**
|
|
12627
|
+
* Cast the view key to a field.
|
|
12628
|
+
* @returns {Field}
|
|
12629
|
+
*/
|
|
12630
|
+
toField() {
|
|
12631
|
+
try {
|
|
12632
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
12633
|
+
wasm.scalar_toField(retptr, this.__wbg_ptr);
|
|
12634
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
12635
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
12636
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
12637
|
+
if (r2) {
|
|
12638
|
+
throw takeObject(r1);
|
|
12639
|
+
}
|
|
12640
|
+
return Field.__wrap(r0);
|
|
12641
|
+
} finally {
|
|
12642
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
12643
|
+
}
|
|
12644
|
+
}
|
|
12586
12645
|
/**
|
|
12587
12646
|
* Decrypt a record ciphertext with a view key
|
|
12588
12647
|
*
|
|
@@ -12733,6 +12792,10 @@ function __wbg_get_imports() {
|
|
|
12733
12792
|
const ret = fetch(getObject(arg0));
|
|
12734
12793
|
return addHeapObject(ret);
|
|
12735
12794
|
};
|
|
12795
|
+
imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
|
|
12796
|
+
const ret = fetch(getObject(arg0));
|
|
12797
|
+
return addHeapObject(ret);
|
|
12798
|
+
};
|
|
12736
12799
|
imports.wbg.__wbg_field_new = function(arg0) {
|
|
12737
12800
|
const ret = Field.__wrap(arg0);
|
|
12738
12801
|
return addHeapObject(ret);
|
|
@@ -12794,7 +12857,7 @@ function __wbg_get_imports() {
|
|
|
12794
12857
|
const ret = getObject(arg0).length;
|
|
12795
12858
|
return ret;
|
|
12796
12859
|
};
|
|
12797
|
-
imports.wbg.
|
|
12860
|
+
imports.wbg.__wbg_log_d77c7cb22d553166 = function(arg0, arg1) {
|
|
12798
12861
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
12799
12862
|
};
|
|
12800
12863
|
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
@@ -12812,7 +12875,7 @@ function __wbg_get_imports() {
|
|
|
12812
12875
|
const a = state0.a;
|
|
12813
12876
|
state0.a = 0;
|
|
12814
12877
|
try {
|
|
12815
|
-
return
|
|
12878
|
+
return __wbg_adapter_853(a, state0.b, arg0, arg1);
|
|
12816
12879
|
} finally {
|
|
12817
12880
|
state0.a = a;
|
|
12818
12881
|
}
|
|
@@ -13003,7 +13066,7 @@ function __wbg_get_imports() {
|
|
|
13003
13066
|
const ret = Signature.__wrap(arg0);
|
|
13004
13067
|
return addHeapObject(ret);
|
|
13005
13068
|
};
|
|
13006
|
-
imports.wbg.
|
|
13069
|
+
imports.wbg.__wbg_spawnWorker_d71cf6dd66485b00 = function(arg0, arg1, arg2, arg3) {
|
|
13007
13070
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
13008
13071
|
return addHeapObject(ret);
|
|
13009
13072
|
};
|
|
@@ -13123,16 +13186,16 @@ function __wbg_get_imports() {
|
|
|
13123
13186
|
const ret = false;
|
|
13124
13187
|
return ret;
|
|
13125
13188
|
};
|
|
13126
|
-
imports.wbg.
|
|
13127
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13189
|
+
imports.wbg.__wbindgen_closure_wrapper6646 = function(arg0, arg1, arg2) {
|
|
13190
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_40);
|
|
13128
13191
|
return addHeapObject(ret);
|
|
13129
13192
|
};
|
|
13130
|
-
imports.wbg.
|
|
13131
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13193
|
+
imports.wbg.__wbindgen_closure_wrapper7240 = function(arg0, arg1, arg2) {
|
|
13194
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_43);
|
|
13132
13195
|
return addHeapObject(ret);
|
|
13133
13196
|
};
|
|
13134
|
-
imports.wbg.
|
|
13135
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13197
|
+
imports.wbg.__wbindgen_closure_wrapper7244 = function(arg0, arg1, arg2) {
|
|
13198
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_43);
|
|
13136
13199
|
return addHeapObject(ret);
|
|
13137
13200
|
};
|
|
13138
13201
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|