@provablehq/wasm 0.9.9 → 0.9.10-testnet-rc
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 +57 -10
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +142 -20
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +142 -19
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +57 -10
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +142 -20
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +142 -19
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/testnet/worker.js
CHANGED
|
@@ -264,6 +264,26 @@ function verifyFunctionExecution(execution, verifying_key, program, function_id,
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Set test consensus version heights for testing.
|
|
269
|
+
*
|
|
270
|
+
* @params {string | undefined} heights The block heights at which each consensus version applies. This input should be a simple csv list of block heights and there should be one number for each consensus version. If left undefined, the default test heights will be applied.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* import { getOrInitConsensusVersionHeights } from @provablehq/sdk;
|
|
274
|
+
*
|
|
275
|
+
* Set the consensus version heights.
|
|
276
|
+
* getOrInitConsensusVersionTestHeights("0,1,2,3,4,5,6,7,8,9");
|
|
277
|
+
* @param {string | null} [heights]
|
|
278
|
+
* @returns {Array<any>}
|
|
279
|
+
*/
|
|
280
|
+
function getOrInitConsensusVersionTestHeights(heights) {
|
|
281
|
+
var ptr0 = isLikeNone(heights) ? 0 : passStringToWasm0(heights, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
282
|
+
var len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ret = wasm.getOrInitConsensusVersionTestHeights(ptr0, len0);
|
|
284
|
+
return takeObject(ret);
|
|
285
|
+
}
|
|
286
|
+
|
|
267
287
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
268
288
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
269
289
|
const mem = getDataViewMemory0();
|
|
@@ -287,7 +307,7 @@ function __wbg_adapter_40(arg0, arg1, arg2) {
|
|
|
287
307
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
288
308
|
}
|
|
289
309
|
|
|
290
|
-
function
|
|
310
|
+
function __wbg_adapter_867(arg0, arg1, arg2, arg3) {
|
|
291
311
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
292
312
|
}
|
|
293
313
|
|
|
@@ -2996,6 +3016,17 @@ class Field {
|
|
|
2996
3016
|
heap[stack_pointer++] = undefined;
|
|
2997
3017
|
}
|
|
2998
3018
|
}
|
|
3019
|
+
/**
|
|
3020
|
+
* Initializes a new field as a domain separator.
|
|
3021
|
+
* @param {string} domain
|
|
3022
|
+
* @returns {Field}
|
|
3023
|
+
*/
|
|
3024
|
+
static newDomainSeparator(domain) {
|
|
3025
|
+
const ptr0 = passStringToWasm0(domain, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
3026
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3027
|
+
const ret = wasm.field_newDomainSeparator(ptr0, len0);
|
|
3028
|
+
return Field.__wrap(ret);
|
|
3029
|
+
}
|
|
2999
3030
|
/**
|
|
3000
3031
|
* Add two field elements.
|
|
3001
3032
|
* @param {Field} other
|
|
@@ -5895,9 +5926,9 @@ class Plaintext {
|
|
|
5895
5926
|
wasm.__wbg_plaintext_free(ptr, 0);
|
|
5896
5927
|
}
|
|
5897
5928
|
/**
|
|
5898
|
-
* Get the
|
|
5929
|
+
* Get the little endian boolean array representation of the bits of the plaintext.
|
|
5899
5930
|
*
|
|
5900
|
-
* @returns {Array} The
|
|
5931
|
+
* @returns {Array} The little endian boolean array representation of the bits of the plaintext.
|
|
5901
5932
|
* @returns {Array<any>}
|
|
5902
5933
|
*/
|
|
5903
5934
|
toBitsLe() {
|
|
@@ -5955,9 +5986,9 @@ class Plaintext {
|
|
|
5955
5986
|
}
|
|
5956
5987
|
}
|
|
5957
5988
|
/**
|
|
5958
|
-
* Get the
|
|
5989
|
+
* Get the little endian byte array representation of the plaintext.
|
|
5959
5990
|
*
|
|
5960
|
-
* @returns {Uint8Array} The
|
|
5991
|
+
* @returns {Uint8Array} The little endian byte array representation of the plaintext.
|
|
5961
5992
|
* @returns {Uint8Array}
|
|
5962
5993
|
*/
|
|
5963
5994
|
toBytesLe() {
|
|
@@ -5978,7 +6009,7 @@ class Plaintext {
|
|
|
5978
6009
|
/**
|
|
5979
6010
|
* Get a plaintext object from a series of bits represented as a boolean array.
|
|
5980
6011
|
*
|
|
5981
|
-
* @param {Array} bits A
|
|
6012
|
+
* @param {Array} bits A little endian boolean array representing the bits plaintext.
|
|
5982
6013
|
*
|
|
5983
6014
|
* @returns {Plaintext} The plaintext object.
|
|
5984
6015
|
* @param {Array<any>} bits
|
|
@@ -6002,7 +6033,7 @@ class Plaintext {
|
|
|
6002
6033
|
/**
|
|
6003
6034
|
* Get a plaintext object from a series of bytes.
|
|
6004
6035
|
*
|
|
6005
|
-
* @param {Uint8Array} bytes A
|
|
6036
|
+
* @param {Uint8Array} bytes A little endian byte array representing the plaintext.
|
|
6006
6037
|
*
|
|
6007
6038
|
* @returns {Plaintext} The plaintext object.
|
|
6008
6039
|
* @param {Uint8Array} bytes
|
|
@@ -6023,6 +6054,27 @@ class Plaintext {
|
|
|
6023
6054
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6024
6055
|
}
|
|
6025
6056
|
}
|
|
6057
|
+
/**
|
|
6058
|
+
* Get the raw field array representation of the plaintext.
|
|
6059
|
+
*
|
|
6060
|
+
* @returns {Array} The raw field array representation of the plaintext.
|
|
6061
|
+
* @returns {Array<any>}
|
|
6062
|
+
*/
|
|
6063
|
+
toFieldsRaw() {
|
|
6064
|
+
try {
|
|
6065
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6066
|
+
wasm.plaintext_toFieldsRaw(retptr, this.__wbg_ptr);
|
|
6067
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6068
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6069
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6070
|
+
if (r2) {
|
|
6071
|
+
throw takeObject(r1);
|
|
6072
|
+
}
|
|
6073
|
+
return takeObject(r0);
|
|
6074
|
+
} finally {
|
|
6075
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6026
6078
|
/**
|
|
6027
6079
|
* Gives the type of the plaintext.
|
|
6028
6080
|
*
|
|
@@ -6045,6 +6097,68 @@ class Plaintext {
|
|
|
6045
6097
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
6046
6098
|
}
|
|
6047
6099
|
}
|
|
6100
|
+
/**
|
|
6101
|
+
* Get the raw big endian boolean array representation of the bits of the plaintext.
|
|
6102
|
+
*
|
|
6103
|
+
* @returns {Array} The raw big endian boolean array representation of the bits of the plaintext.
|
|
6104
|
+
* @returns {Array<any>}
|
|
6105
|
+
*/
|
|
6106
|
+
toBitsRawBe() {
|
|
6107
|
+
const ret = wasm.plaintext_toBitsRawBe(this.__wbg_ptr);
|
|
6108
|
+
return takeObject(ret);
|
|
6109
|
+
}
|
|
6110
|
+
/**
|
|
6111
|
+
* Get the raw little endian boolean array representation of the bits of the plaintext.
|
|
6112
|
+
*
|
|
6113
|
+
* @returns {Array} The raw little endian boolean array representation of the bits of the plaintext.
|
|
6114
|
+
* @returns {Array<any>}
|
|
6115
|
+
*/
|
|
6116
|
+
toBitsRawLe() {
|
|
6117
|
+
const ret = wasm.plaintext_toBitsRawLe(this.__wbg_ptr);
|
|
6118
|
+
return takeObject(ret);
|
|
6119
|
+
}
|
|
6120
|
+
/**
|
|
6121
|
+
* Get the raw big endian byte array representation of the plaintext.
|
|
6122
|
+
*
|
|
6123
|
+
* @returns {Uint8Array} The raw big endian byte array representation of the plaintext.
|
|
6124
|
+
* @returns {Uint8Array}
|
|
6125
|
+
*/
|
|
6126
|
+
toBytesRawBe() {
|
|
6127
|
+
try {
|
|
6128
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6129
|
+
wasm.plaintext_toBytesRawBe(retptr, this.__wbg_ptr);
|
|
6130
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6131
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6132
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6133
|
+
if (r2) {
|
|
6134
|
+
throw takeObject(r1);
|
|
6135
|
+
}
|
|
6136
|
+
return takeObject(r0);
|
|
6137
|
+
} finally {
|
|
6138
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6139
|
+
}
|
|
6140
|
+
}
|
|
6141
|
+
/**
|
|
6142
|
+
* Get the raw little endian byte array representation of the plaintext.
|
|
6143
|
+
*
|
|
6144
|
+
* @returns {Uint8Array} The raw little endian byte array representation of the plaintext.
|
|
6145
|
+
* @returns {Uint8Array}
|
|
6146
|
+
*/
|
|
6147
|
+
toBytesRawLe() {
|
|
6148
|
+
try {
|
|
6149
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6150
|
+
wasm.plaintext_toBytesRawLe(retptr, this.__wbg_ptr);
|
|
6151
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6152
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6153
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6154
|
+
if (r2) {
|
|
6155
|
+
throw takeObject(r1);
|
|
6156
|
+
}
|
|
6157
|
+
return takeObject(r0);
|
|
6158
|
+
} finally {
|
|
6159
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6160
|
+
}
|
|
6161
|
+
}
|
|
6048
6162
|
/**
|
|
6049
6163
|
* Encrypt a plaintext with a transition view key.
|
|
6050
6164
|
*
|
|
@@ -7419,10 +7533,10 @@ class ProgramManager {
|
|
|
7419
7533
|
/**
|
|
7420
7534
|
* Synthesize proving and verifying keys for a program
|
|
7421
7535
|
*
|
|
7422
|
-
* @param
|
|
7423
|
-
* @param
|
|
7424
|
-
* @param
|
|
7425
|
-
* @param
|
|
7536
|
+
* @param {string} program The program source code of the program to synthesize keys for
|
|
7537
|
+
* @param {string} function_id The function to synthesize keys for
|
|
7538
|
+
* @param {Array} inputs The inputs to the function
|
|
7539
|
+
* @param {Object | undefined} imports The imports for the program
|
|
7426
7540
|
* @param {PrivateKey} private_key
|
|
7427
7541
|
* @param {string} program
|
|
7428
7542
|
* @param {string} function_id
|
|
@@ -7440,6 +7554,14 @@ class ProgramManager {
|
|
|
7440
7554
|
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7441
7555
|
return takeObject(ret);
|
|
7442
7556
|
}
|
|
7557
|
+
/**
|
|
7558
|
+
* @param {ProvingKey} proving_key
|
|
7559
|
+
*/
|
|
7560
|
+
static loadInclusionProver(proving_key) {
|
|
7561
|
+
_assertClass(proving_key, ProvingKey);
|
|
7562
|
+
var ptr0 = proving_key.__destroy_into_raw();
|
|
7563
|
+
wasm.programmanager_loadInclusionProver(ptr0);
|
|
7564
|
+
}
|
|
7443
7565
|
/**
|
|
7444
7566
|
* Create a `ProvingRequest` object. This object creates authorizations for the top level
|
|
7445
7567
|
* function and associated fee function. This object can be sent directly to a remote prover
|
|
@@ -13022,7 +13144,7 @@ function __wbg_get_imports() {
|
|
|
13022
13144
|
const ret = getObject(arg0).length;
|
|
13023
13145
|
return ret;
|
|
13024
13146
|
};
|
|
13025
|
-
imports.wbg.
|
|
13147
|
+
imports.wbg.__wbg_log_bac25b70f2db29a3 = function(arg0, arg1) {
|
|
13026
13148
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
13027
13149
|
};
|
|
13028
13150
|
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
@@ -13040,7 +13162,7 @@ function __wbg_get_imports() {
|
|
|
13040
13162
|
const a = state0.a;
|
|
13041
13163
|
state0.a = 0;
|
|
13042
13164
|
try {
|
|
13043
|
-
return
|
|
13165
|
+
return __wbg_adapter_867(a, state0.b, arg0, arg1);
|
|
13044
13166
|
} finally {
|
|
13045
13167
|
state0.a = a;
|
|
13046
13168
|
}
|
|
@@ -13227,7 +13349,7 @@ function __wbg_get_imports() {
|
|
|
13227
13349
|
const ret = Signature.__wrap(arg0);
|
|
13228
13350
|
return addHeapObject(ret);
|
|
13229
13351
|
};
|
|
13230
|
-
imports.wbg.
|
|
13352
|
+
imports.wbg.__wbg_spawnWorker_231c975bbb3598af = function(arg0, arg1, arg2, arg3) {
|
|
13231
13353
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
13232
13354
|
return addHeapObject(ret);
|
|
13233
13355
|
};
|
|
@@ -13347,12 +13469,12 @@ function __wbg_get_imports() {
|
|
|
13347
13469
|
const ret = false;
|
|
13348
13470
|
return ret;
|
|
13349
13471
|
};
|
|
13350
|
-
imports.wbg.
|
|
13351
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13472
|
+
imports.wbg.__wbindgen_closure_wrapper7347 = function(arg0, arg1, arg2) {
|
|
13473
|
+
const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
|
|
13352
13474
|
return addHeapObject(ret);
|
|
13353
13475
|
};
|
|
13354
|
-
imports.wbg.
|
|
13355
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13476
|
+
imports.wbg.__wbindgen_closure_wrapper7352 = function(arg0, arg1, arg2) {
|
|
13477
|
+
const ret = makeMutClosure(arg0, arg1, 548, __wbg_adapter_40);
|
|
13356
13478
|
return addHeapObject(ret);
|
|
13357
13479
|
};
|
|
13358
13480
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
@@ -13428,7 +13550,7 @@ function __wbg_get_imports() {
|
|
|
13428
13550
|
}
|
|
13429
13551
|
|
|
13430
13552
|
function __wbg_init_memory(imports, memory) {
|
|
13431
|
-
imports.wbg.memory = memory || new WebAssembly.Memory({initial:
|
|
13553
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({initial:167,maximum:65536,shared:true});
|
|
13432
13554
|
}
|
|
13433
13555
|
|
|
13434
13556
|
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
@@ -13545,6 +13667,7 @@ var exports = /*#__PURE__*/Object.freeze({
|
|
|
13545
13667
|
VerifyingKey: VerifyingKey,
|
|
13546
13668
|
ViewKey: ViewKey,
|
|
13547
13669
|
default: __wbg_init,
|
|
13670
|
+
getOrInitConsensusVersionTestHeights: getOrInitConsensusVersionTestHeights,
|
|
13548
13671
|
initSync: initSync,
|
|
13549
13672
|
initThreadPool: initThreadPool,
|
|
13550
13673
|
runRayonThread: runRayonThread,
|