@provablehq/wasm 0.9.14 → 0.9.15-enc
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 +22 -0
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +100 -10
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +100 -10
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +22 -0
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +100 -10
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +100 -10
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
|
@@ -120,6 +120,14 @@ export class Address {
|
|
|
120
120
|
* @returns {boolean} Boolean representing whether or not the signature is valid
|
|
121
121
|
*/
|
|
122
122
|
verify(message: Uint8Array, signature: Signature): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Check if the input is a valid Aleo address.
|
|
125
|
+
*
|
|
126
|
+
* @param {string | Uint8Array} address - Either a string representation of an address
|
|
127
|
+
* or a Uint8Array of bytes in little-endian format.
|
|
128
|
+
* @returns {boolean} True if the input is a valid address, false otherwise.
|
|
129
|
+
*/
|
|
130
|
+
static isValid(address: any): boolean;
|
|
123
131
|
/**
|
|
124
132
|
* Get the group representation of the address object.
|
|
125
133
|
*/
|
|
@@ -4342,6 +4350,20 @@ export class ViewKey {
|
|
|
4342
4350
|
* @returns {ViewKey} View key
|
|
4343
4351
|
*/
|
|
4344
4352
|
static from_string(view_key: string): ViewKey;
|
|
4353
|
+
/**
|
|
4354
|
+
* Get the underlying bytes of a view key.
|
|
4355
|
+
*
|
|
4356
|
+
* @returns {Uint8Array} Left endian byte array representation of the view key.
|
|
4357
|
+
*/
|
|
4358
|
+
toBytesLe(): Uint8Array;
|
|
4359
|
+
/**
|
|
4360
|
+
* Get a ViewKey from a series of bytes.
|
|
4361
|
+
*
|
|
4362
|
+
* @param {Uint8Array} bytes A left endian byte array representing the view key.
|
|
4363
|
+
*
|
|
4364
|
+
* @returns {ViewKey} The view key object.
|
|
4365
|
+
*/
|
|
4366
|
+
static fromBytesLe(bytes: Uint8Array): ViewKey;
|
|
4345
4367
|
/**
|
|
4346
4368
|
* Create a new view key from a private key
|
|
4347
4369
|
*
|
|
Binary file
|
package/dist/mainnet/index.js
CHANGED
|
@@ -384,12 +384,16 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
384
384
|
}
|
|
385
385
|
return result;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
wasm.
|
|
387
|
+
function __wasm_bindgen_func_elem_6533(arg0, arg1) {
|
|
388
|
+
wasm.__wasm_bindgen_func_elem_6533(arg0, arg1);
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
function
|
|
392
|
-
wasm.
|
|
391
|
+
function __wasm_bindgen_func_elem_7853(arg0, arg1, arg2) {
|
|
392
|
+
wasm.__wasm_bindgen_func_elem_7853(arg0, arg1, addHeapObject(arg2));
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function __wasm_bindgen_func_elem_6806(arg0, arg1, arg2, arg3) {
|
|
396
|
+
wasm.__wasm_bindgen_func_elem_6806(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
393
397
|
}
|
|
394
398
|
|
|
395
399
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -638,6 +642,19 @@ class Address {
|
|
|
638
642
|
const ret = wasm.address_verify(this.__wbg_ptr, ptr0, len0, signature.__wbg_ptr);
|
|
639
643
|
return ret !== 0;
|
|
640
644
|
}
|
|
645
|
+
/**
|
|
646
|
+
* Check if the input is a valid Aleo address.
|
|
647
|
+
*
|
|
648
|
+
* @param {string | Uint8Array} address - Either a string representation of an address
|
|
649
|
+
* or a Uint8Array of bytes in little-endian format.
|
|
650
|
+
* @returns {boolean} True if the input is a valid address, false otherwise.
|
|
651
|
+
* @param {any} address
|
|
652
|
+
* @returns {boolean}
|
|
653
|
+
*/
|
|
654
|
+
static isValid(address) {
|
|
655
|
+
const ret = wasm.address_isValid(addHeapObject(address));
|
|
656
|
+
return ret !== 0;
|
|
657
|
+
}
|
|
641
658
|
/**
|
|
642
659
|
* Get the group representation of the address object.
|
|
643
660
|
* @returns {Group}
|
|
@@ -13330,6 +13347,56 @@ class ViewKey {
|
|
|
13330
13347
|
const ret = wasm.viewkey_from_string(ptr0, len0);
|
|
13331
13348
|
return ViewKey.__wrap(ret);
|
|
13332
13349
|
}
|
|
13350
|
+
/**
|
|
13351
|
+
* Get the underlying bytes of a view key.
|
|
13352
|
+
*
|
|
13353
|
+
* @returns {Uint8Array} Left endian byte array representation of the view key.
|
|
13354
|
+
* @returns {Uint8Array}
|
|
13355
|
+
*/
|
|
13356
|
+
toBytesLe() {
|
|
13357
|
+
try {
|
|
13358
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
13359
|
+
wasm.viewkey_toBytesLe(retptr, this.__wbg_ptr);
|
|
13360
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
13361
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
13362
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
13363
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
13364
|
+
if (r3) {
|
|
13365
|
+
throw takeObject(r2);
|
|
13366
|
+
}
|
|
13367
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
13368
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
13369
|
+
return v1;
|
|
13370
|
+
} finally {
|
|
13371
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
13372
|
+
}
|
|
13373
|
+
}
|
|
13374
|
+
/**
|
|
13375
|
+
* Get a ViewKey from a series of bytes.
|
|
13376
|
+
*
|
|
13377
|
+
* @param {Uint8Array} bytes A left endian byte array representing the view key.
|
|
13378
|
+
*
|
|
13379
|
+
* @returns {ViewKey} The view key object.
|
|
13380
|
+
* @param {Uint8Array} bytes
|
|
13381
|
+
* @returns {ViewKey}
|
|
13382
|
+
*/
|
|
13383
|
+
static fromBytesLe(bytes) {
|
|
13384
|
+
try {
|
|
13385
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
13386
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
13387
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13388
|
+
wasm.viewkey_fromBytesLe(retptr, ptr0, len0);
|
|
13389
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
13390
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
13391
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
13392
|
+
if (r2) {
|
|
13393
|
+
throw takeObject(r1);
|
|
13394
|
+
}
|
|
13395
|
+
return ViewKey.__wrap(r0);
|
|
13396
|
+
} finally {
|
|
13397
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
13398
|
+
}
|
|
13399
|
+
}
|
|
13333
13400
|
/**
|
|
13334
13401
|
* Create a new view key from a private key
|
|
13335
13402
|
*
|
|
@@ -13559,6 +13626,10 @@ function __wbg_get_imports(memory) {
|
|
|
13559
13626
|
const ret = Ciphertext.__wrap(arg0);
|
|
13560
13627
|
return addHeapObject(ret);
|
|
13561
13628
|
};
|
|
13629
|
+
imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
|
|
13630
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
13631
|
+
return addHeapObject(ret);
|
|
13632
|
+
};
|
|
13562
13633
|
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
13563
13634
|
const ret = getObject(arg0).crypto;
|
|
13564
13635
|
return addHeapObject(ret);
|
|
@@ -13635,6 +13706,16 @@ function __wbg_get_imports(memory) {
|
|
|
13635
13706
|
const ret = result;
|
|
13636
13707
|
return ret;
|
|
13637
13708
|
};
|
|
13709
|
+
imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
|
|
13710
|
+
let result;
|
|
13711
|
+
try {
|
|
13712
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
13713
|
+
} catch (_) {
|
|
13714
|
+
result = false;
|
|
13715
|
+
}
|
|
13716
|
+
const ret = result;
|
|
13717
|
+
return ret;
|
|
13718
|
+
};
|
|
13638
13719
|
imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
|
|
13639
13720
|
const ret = Symbol.iterator;
|
|
13640
13721
|
return addHeapObject(ret);
|
|
@@ -13655,7 +13736,7 @@ function __wbg_get_imports(memory) {
|
|
|
13655
13736
|
const ret = getObject(arg0).length;
|
|
13656
13737
|
return ret;
|
|
13657
13738
|
};
|
|
13658
|
-
imports.wbg.
|
|
13739
|
+
imports.wbg.__wbg_log_387db517f7628e41 = function(arg0, arg1) {
|
|
13659
13740
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
13660
13741
|
};
|
|
13661
13742
|
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
@@ -13677,7 +13758,7 @@ function __wbg_get_imports(memory) {
|
|
|
13677
13758
|
const a = state0.a;
|
|
13678
13759
|
state0.a = 0;
|
|
13679
13760
|
try {
|
|
13680
|
-
return
|
|
13761
|
+
return __wasm_bindgen_func_elem_6806(a, state0.b, arg0, arg1);
|
|
13681
13762
|
} finally {
|
|
13682
13763
|
state0.a = a;
|
|
13683
13764
|
}
|
|
@@ -13824,6 +13905,10 @@ function __wbg_get_imports(memory) {
|
|
|
13824
13905
|
imports.wbg.__wbg_send_2e90b7c1fa1cdaf6 = function() { return handleError(function (arg0) {
|
|
13825
13906
|
getObject(arg0).send();
|
|
13826
13907
|
}, arguments) };
|
|
13908
|
+
imports.wbg.__wbg_setTimeout_db2dbaeefb6f39c7 = function() { return handleError(function (arg0, arg1) {
|
|
13909
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
13910
|
+
return addHeapObject(ret);
|
|
13911
|
+
}, arguments) };
|
|
13827
13912
|
imports.wbg.__wbg_set_body_3c365989753d61f4 = function(arg0, arg1) {
|
|
13828
13913
|
getObject(arg0).body = getObject(arg1);
|
|
13829
13914
|
};
|
|
@@ -13860,7 +13945,7 @@ function __wbg_get_imports(memory) {
|
|
|
13860
13945
|
const ret = Signature.__wrap(arg0);
|
|
13861
13946
|
return addHeapObject(ret);
|
|
13862
13947
|
};
|
|
13863
|
-
imports.wbg.
|
|
13948
|
+
imports.wbg.__wbg_spawnWorker_5840ef60c6d1ea5b = function(arg0, arg1, arg2, arg3) {
|
|
13864
13949
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
13865
13950
|
return addHeapObject(ret);
|
|
13866
13951
|
};
|
|
@@ -13950,9 +14035,14 @@ function __wbg_get_imports(memory) {
|
|
|
13950
14035
|
const ret = Atomics.waitAsync(getObject(arg0), arg1 >>> 0, arg2);
|
|
13951
14036
|
return addHeapObject(ret);
|
|
13952
14037
|
};
|
|
14038
|
+
imports.wbg.__wbindgen_cast_06d105bd9273956e = function(arg0, arg1) {
|
|
14039
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 418, function: Function { arguments: [], shim_idx: 507, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
14040
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_6532, __wasm_bindgen_func_elem_6533);
|
|
14041
|
+
return addHeapObject(ret);
|
|
14042
|
+
};
|
|
13953
14043
|
imports.wbg.__wbindgen_cast_07555e2579ff3863 = function(arg0, arg1) {
|
|
13954
14044
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 418, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 419, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
13955
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
14045
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_6532, __wasm_bindgen_func_elem_7853);
|
|
13956
14046
|
return addHeapObject(ret);
|
|
13957
14047
|
};
|
|
13958
14048
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
@@ -13972,7 +14062,7 @@ function __wbg_get_imports(memory) {
|
|
|
13972
14062
|
};
|
|
13973
14063
|
imports.wbg.__wbindgen_cast_72bd42f236eeae61 = function(arg0, arg1) {
|
|
13974
14064
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 418, function: Function { arguments: [Externref], shim_idx: 419, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
13975
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
14065
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_6532, __wasm_bindgen_func_elem_7853);
|
|
13976
14066
|
return addHeapObject(ret);
|
|
13977
14067
|
};
|
|
13978
14068
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
@@ -14016,7 +14106,7 @@ function __wbg_get_imports(memory) {
|
|
|
14016
14106
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
14017
14107
|
takeObject(arg0);
|
|
14018
14108
|
};
|
|
14019
|
-
imports.wbg.memory = memory || new WebAssembly.Memory({initial:167,maximum:
|
|
14109
|
+
imports.wbg.memory = memory || new WebAssembly.Memory({initial:167,maximum:65536,shared:true});
|
|
14020
14110
|
|
|
14021
14111
|
return imports;
|
|
14022
14112
|
}
|