@quilibrium/quilibrium-js-bulletproofs-sdk 2.1.0-1 → 2.1.0-3
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/index.d.ts +53 -1
- package/dist/index.esm.js +228 -2
- package/dist/index.js +230 -1
- package/dist/wasm/bulletproofswasm_bg.wasm +0 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,55 @@
|
|
1
|
+
type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
2
|
+
|
3
|
+
interface InitOutput {
|
4
|
+
readonly memory: WebAssembly.Memory;
|
5
|
+
readonly js_generate_range_proof: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
6
|
+
readonly js_verify_range_proof: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
7
|
+
readonly js_sum_check: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
8
|
+
readonly js_generate_input_commitments: (a: number, b: number, c: number, d: number, e: number) => void;
|
9
|
+
readonly js_keygen: (a: number) => void;
|
10
|
+
readonly js_scalar_to_point: (a: number, b: number, c: number) => void;
|
11
|
+
readonly js_alt_generator: (a: number) => void;
|
12
|
+
readonly js_scalar_addition: (a: number, b: number, c: number, d: number, e: number) => void;
|
13
|
+
readonly js_scalar_mult: (a: number, b: number, c: number, d: number, e: number) => void;
|
14
|
+
readonly js_scalar_mult_point: (a: number, b: number, c: number, d: number, e: number) => void;
|
15
|
+
readonly js_scalar_inverse: (a: number, b: number, c: number) => void;
|
16
|
+
readonly js_scalar_subtraction: (a: number, b: number, c: number, d: number, e: number) => void;
|
17
|
+
readonly js_scalar_mult_hash_to_scalar: (a: number, b: number, c: number, d: number, e: number) => void;
|
18
|
+
readonly js_hash_to_scalar: (a: number, b: number, c: number) => void;
|
19
|
+
readonly js_point_addition: (a: number, b: number, c: number, d: number, e: number) => void;
|
20
|
+
readonly js_point_subtraction: (a: number, b: number, c: number, d: number, e: number) => void;
|
21
|
+
readonly js_sign_hidden: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
22
|
+
readonly js_sign_simple: (a: number, b: number, c: number, d: number, e: number) => void;
|
23
|
+
readonly js_verify_simple: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
24
|
+
readonly js_verify_hidden: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number) => void;
|
25
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
26
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
27
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
28
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
29
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
30
|
+
}
|
31
|
+
|
32
|
+
type SyncInitInput = BufferSource | WebAssembly.Module;
|
33
|
+
/**
|
34
|
+
* Instantiates the given `module`, which can either be bytes or
|
35
|
+
* a precompiled `WebAssembly.Module`.
|
36
|
+
*
|
37
|
+
* @param {SyncInitInput} module
|
38
|
+
*
|
39
|
+
* @returns {InitOutput}
|
40
|
+
*/
|
41
|
+
declare function initSync(module: SyncInitInput): InitOutput;
|
42
|
+
|
43
|
+
/**
|
44
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
45
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
46
|
+
*
|
47
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
48
|
+
*
|
49
|
+
* @returns {Promise<InitOutput>}
|
50
|
+
*/
|
51
|
+
declare function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
52
|
+
|
1
53
|
declare function BulletproofsGenerateRangeProof(values: ArrayBuffer[], blinding: ArrayBuffer[], bitSize: number): {
|
2
54
|
proof: Buffer;
|
3
55
|
commitment: Buffer;
|
@@ -75,4 +127,4 @@ declare namespace bulletproofs {
|
|
75
127
|
};
|
76
128
|
}
|
77
129
|
|
78
|
-
export { bulletproofs };
|
130
|
+
export { bulletproofs, __wbg_init as init, initSync };
|
package/dist/index.esm.js
CHANGED
@@ -6,7 +6,30 @@ const heap = new Array(128).fill(undefined);
|
|
6
6
|
|
7
7
|
heap.push(undefined, null, true, false);
|
8
8
|
|
9
|
-
heap
|
9
|
+
function getObject(idx) { return heap[idx]; }
|
10
|
+
|
11
|
+
let heap_next = heap.length;
|
12
|
+
|
13
|
+
function addHeapObject(obj) {
|
14
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
15
|
+
const idx = heap_next;
|
16
|
+
heap_next = heap[idx];
|
17
|
+
|
18
|
+
heap[idx] = obj;
|
19
|
+
return idx;
|
20
|
+
}
|
21
|
+
|
22
|
+
function dropObject(idx) {
|
23
|
+
if (idx < 132) return;
|
24
|
+
heap[idx] = heap_next;
|
25
|
+
heap_next = idx;
|
26
|
+
}
|
27
|
+
|
28
|
+
function takeObject(idx) {
|
29
|
+
const ret = getObject(idx);
|
30
|
+
dropObject(idx);
|
31
|
+
return ret;
|
32
|
+
}
|
10
33
|
|
11
34
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
12
35
|
|
@@ -620,6 +643,209 @@ function js_verify_hidden(c, t, s1, s2, s3, p_point, c_point) {
|
|
620
643
|
}
|
621
644
|
}
|
622
645
|
|
646
|
+
function handleError(f, args) {
|
647
|
+
try {
|
648
|
+
return f.apply(this, args);
|
649
|
+
} catch (e) {
|
650
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
651
|
+
}
|
652
|
+
}
|
653
|
+
|
654
|
+
async function __wbg_load(module, imports) {
|
655
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
656
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
657
|
+
try {
|
658
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
659
|
+
|
660
|
+
} catch (e) {
|
661
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
662
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
663
|
+
|
664
|
+
} else {
|
665
|
+
throw e;
|
666
|
+
}
|
667
|
+
}
|
668
|
+
}
|
669
|
+
|
670
|
+
const bytes = await module.arrayBuffer();
|
671
|
+
return await WebAssembly.instantiate(bytes, imports);
|
672
|
+
|
673
|
+
} else {
|
674
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
675
|
+
|
676
|
+
if (instance instanceof WebAssembly.Instance) {
|
677
|
+
return { instance, module };
|
678
|
+
|
679
|
+
} else {
|
680
|
+
return instance;
|
681
|
+
}
|
682
|
+
}
|
683
|
+
}
|
684
|
+
|
685
|
+
function __wbg_get_imports() {
|
686
|
+
const imports = {};
|
687
|
+
imports.wbg = {};
|
688
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
689
|
+
const ret = getObject(arg0);
|
690
|
+
return addHeapObject(ret);
|
691
|
+
};
|
692
|
+
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
693
|
+
const ret = getObject(arg0).crypto;
|
694
|
+
return addHeapObject(ret);
|
695
|
+
};
|
696
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
697
|
+
const val = getObject(arg0);
|
698
|
+
const ret = typeof(val) === 'object' && val !== null;
|
699
|
+
return ret;
|
700
|
+
};
|
701
|
+
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
702
|
+
const ret = getObject(arg0).process;
|
703
|
+
return addHeapObject(ret);
|
704
|
+
};
|
705
|
+
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
706
|
+
const ret = getObject(arg0).versions;
|
707
|
+
return addHeapObject(ret);
|
708
|
+
};
|
709
|
+
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
710
|
+
const ret = getObject(arg0).node;
|
711
|
+
return addHeapObject(ret);
|
712
|
+
};
|
713
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
714
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
715
|
+
return ret;
|
716
|
+
};
|
717
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
718
|
+
takeObject(arg0);
|
719
|
+
};
|
720
|
+
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
721
|
+
const ret = module.require;
|
722
|
+
return addHeapObject(ret);
|
723
|
+
}, arguments) };
|
724
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
725
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
726
|
+
return ret;
|
727
|
+
};
|
728
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
729
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
730
|
+
return addHeapObject(ret);
|
731
|
+
};
|
732
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
733
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
734
|
+
return addHeapObject(ret);
|
735
|
+
}, arguments) };
|
736
|
+
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
737
|
+
const ret = getObject(arg0).msCrypto;
|
738
|
+
return addHeapObject(ret);
|
739
|
+
};
|
740
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
741
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
742
|
+
return addHeapObject(ret);
|
743
|
+
};
|
744
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
745
|
+
const ret = self.self;
|
746
|
+
return addHeapObject(ret);
|
747
|
+
}, arguments) };
|
748
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
749
|
+
const ret = window.window;
|
750
|
+
return addHeapObject(ret);
|
751
|
+
}, arguments) };
|
752
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
753
|
+
const ret = globalThis.globalThis;
|
754
|
+
return addHeapObject(ret);
|
755
|
+
}, arguments) };
|
756
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
757
|
+
const ret = global.global;
|
758
|
+
return addHeapObject(ret);
|
759
|
+
}, arguments) };
|
760
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
761
|
+
const ret = getObject(arg0) === undefined;
|
762
|
+
return ret;
|
763
|
+
};
|
764
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
765
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
766
|
+
return addHeapObject(ret);
|
767
|
+
};
|
768
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
769
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
770
|
+
return addHeapObject(ret);
|
771
|
+
}, arguments) };
|
772
|
+
imports.wbg.__wbindgen_memory = function() {
|
773
|
+
const ret = wasm.memory;
|
774
|
+
return addHeapObject(ret);
|
775
|
+
};
|
776
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
777
|
+
const ret = getObject(arg0).buffer;
|
778
|
+
return addHeapObject(ret);
|
779
|
+
};
|
780
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
781
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
782
|
+
return addHeapObject(ret);
|
783
|
+
};
|
784
|
+
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
785
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
786
|
+
}, arguments) };
|
787
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
788
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
789
|
+
return addHeapObject(ret);
|
790
|
+
};
|
791
|
+
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
792
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
793
|
+
}, arguments) };
|
794
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
795
|
+
const ret = new Uint8Array(getObject(arg0));
|
796
|
+
return addHeapObject(ret);
|
797
|
+
};
|
798
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
799
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
800
|
+
};
|
801
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
802
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
803
|
+
};
|
804
|
+
|
805
|
+
return imports;
|
806
|
+
}
|
807
|
+
|
808
|
+
function __wbg_finalize_init(instance, module) {
|
809
|
+
wasm = instance.exports;
|
810
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
811
|
+
cachedInt32Memory0 = null;
|
812
|
+
cachedUint8Memory0 = null;
|
813
|
+
|
814
|
+
|
815
|
+
return wasm;
|
816
|
+
}
|
817
|
+
|
818
|
+
function initSync(module) {
|
819
|
+
if (wasm !== undefined) return wasm;
|
820
|
+
|
821
|
+
const imports = __wbg_get_imports();
|
822
|
+
|
823
|
+
if (!(module instanceof WebAssembly.Module)) {
|
824
|
+
module = new WebAssembly.Module(module);
|
825
|
+
}
|
826
|
+
|
827
|
+
const instance = new WebAssembly.Instance(module, imports);
|
828
|
+
|
829
|
+
return __wbg_finalize_init(instance, module);
|
830
|
+
}
|
831
|
+
|
832
|
+
async function __wbg_init(input) {
|
833
|
+
if (wasm !== undefined) return wasm;
|
834
|
+
|
835
|
+
if (typeof input === 'undefined') {
|
836
|
+
input = new URL('bulletproofswasm_bg.wasm', import.meta.url);
|
837
|
+
}
|
838
|
+
const imports = __wbg_get_imports();
|
839
|
+
|
840
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
841
|
+
input = fetch(input);
|
842
|
+
}
|
843
|
+
|
844
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
845
|
+
|
846
|
+
return __wbg_finalize_init(instance, module);
|
847
|
+
}
|
848
|
+
|
623
849
|
class BulletproofsError extends Error {
|
624
850
|
}
|
625
851
|
function BulletproofsGenerateRangeProof(values, blinding, bitSize) {
|
@@ -840,4 +1066,4 @@ var bulletproofs = /*#__PURE__*/Object.freeze({
|
|
840
1066
|
|
841
1067
|
window.Buffer = Buffer$1;
|
842
1068
|
|
843
|
-
export { bulletproofs };
|
1069
|
+
export { bulletproofs, __wbg_init as init, initSync };
|
package/dist/index.js
CHANGED
@@ -2,13 +2,37 @@
|
|
2
2
|
|
3
3
|
var buffer = require('buffer');
|
4
4
|
|
5
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
5
6
|
let wasm;
|
6
7
|
|
7
8
|
const heap = new Array(128).fill(undefined);
|
8
9
|
|
9
10
|
heap.push(undefined, null, true, false);
|
10
11
|
|
11
|
-
heap
|
12
|
+
function getObject(idx) { return heap[idx]; }
|
13
|
+
|
14
|
+
let heap_next = heap.length;
|
15
|
+
|
16
|
+
function addHeapObject(obj) {
|
17
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
18
|
+
const idx = heap_next;
|
19
|
+
heap_next = heap[idx];
|
20
|
+
|
21
|
+
heap[idx] = obj;
|
22
|
+
return idx;
|
23
|
+
}
|
24
|
+
|
25
|
+
function dropObject(idx) {
|
26
|
+
if (idx < 132) return;
|
27
|
+
heap[idx] = heap_next;
|
28
|
+
heap_next = idx;
|
29
|
+
}
|
30
|
+
|
31
|
+
function takeObject(idx) {
|
32
|
+
const ret = getObject(idx);
|
33
|
+
dropObject(idx);
|
34
|
+
return ret;
|
35
|
+
}
|
12
36
|
|
13
37
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
14
38
|
|
@@ -622,6 +646,209 @@ function js_verify_hidden(c, t, s1, s2, s3, p_point, c_point) {
|
|
622
646
|
}
|
623
647
|
}
|
624
648
|
|
649
|
+
function handleError(f, args) {
|
650
|
+
try {
|
651
|
+
return f.apply(this, args);
|
652
|
+
} catch (e) {
|
653
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
654
|
+
}
|
655
|
+
}
|
656
|
+
|
657
|
+
async function __wbg_load(module, imports) {
|
658
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
659
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
660
|
+
try {
|
661
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
662
|
+
|
663
|
+
} catch (e) {
|
664
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
665
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
666
|
+
|
667
|
+
} else {
|
668
|
+
throw e;
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
672
|
+
|
673
|
+
const bytes = await module.arrayBuffer();
|
674
|
+
return await WebAssembly.instantiate(bytes, imports);
|
675
|
+
|
676
|
+
} else {
|
677
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
678
|
+
|
679
|
+
if (instance instanceof WebAssembly.Instance) {
|
680
|
+
return { instance, module };
|
681
|
+
|
682
|
+
} else {
|
683
|
+
return instance;
|
684
|
+
}
|
685
|
+
}
|
686
|
+
}
|
687
|
+
|
688
|
+
function __wbg_get_imports() {
|
689
|
+
const imports = {};
|
690
|
+
imports.wbg = {};
|
691
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
692
|
+
const ret = getObject(arg0);
|
693
|
+
return addHeapObject(ret);
|
694
|
+
};
|
695
|
+
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
696
|
+
const ret = getObject(arg0).crypto;
|
697
|
+
return addHeapObject(ret);
|
698
|
+
};
|
699
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
700
|
+
const val = getObject(arg0);
|
701
|
+
const ret = typeof(val) === 'object' && val !== null;
|
702
|
+
return ret;
|
703
|
+
};
|
704
|
+
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
705
|
+
const ret = getObject(arg0).process;
|
706
|
+
return addHeapObject(ret);
|
707
|
+
};
|
708
|
+
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
709
|
+
const ret = getObject(arg0).versions;
|
710
|
+
return addHeapObject(ret);
|
711
|
+
};
|
712
|
+
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
713
|
+
const ret = getObject(arg0).node;
|
714
|
+
return addHeapObject(ret);
|
715
|
+
};
|
716
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
717
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
718
|
+
return ret;
|
719
|
+
};
|
720
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
721
|
+
takeObject(arg0);
|
722
|
+
};
|
723
|
+
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
724
|
+
const ret = module.require;
|
725
|
+
return addHeapObject(ret);
|
726
|
+
}, arguments) };
|
727
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
728
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
729
|
+
return ret;
|
730
|
+
};
|
731
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
732
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
733
|
+
return addHeapObject(ret);
|
734
|
+
};
|
735
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
736
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
737
|
+
return addHeapObject(ret);
|
738
|
+
}, arguments) };
|
739
|
+
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
740
|
+
const ret = getObject(arg0).msCrypto;
|
741
|
+
return addHeapObject(ret);
|
742
|
+
};
|
743
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
744
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
745
|
+
return addHeapObject(ret);
|
746
|
+
};
|
747
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
748
|
+
const ret = self.self;
|
749
|
+
return addHeapObject(ret);
|
750
|
+
}, arguments) };
|
751
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
752
|
+
const ret = window.window;
|
753
|
+
return addHeapObject(ret);
|
754
|
+
}, arguments) };
|
755
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
756
|
+
const ret = globalThis.globalThis;
|
757
|
+
return addHeapObject(ret);
|
758
|
+
}, arguments) };
|
759
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
760
|
+
const ret = global.global;
|
761
|
+
return addHeapObject(ret);
|
762
|
+
}, arguments) };
|
763
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
764
|
+
const ret = getObject(arg0) === undefined;
|
765
|
+
return ret;
|
766
|
+
};
|
767
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
768
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
769
|
+
return addHeapObject(ret);
|
770
|
+
};
|
771
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
772
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
773
|
+
return addHeapObject(ret);
|
774
|
+
}, arguments) };
|
775
|
+
imports.wbg.__wbindgen_memory = function() {
|
776
|
+
const ret = wasm.memory;
|
777
|
+
return addHeapObject(ret);
|
778
|
+
};
|
779
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
780
|
+
const ret = getObject(arg0).buffer;
|
781
|
+
return addHeapObject(ret);
|
782
|
+
};
|
783
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
784
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
785
|
+
return addHeapObject(ret);
|
786
|
+
};
|
787
|
+
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
788
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
789
|
+
}, arguments) };
|
790
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
|
791
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
792
|
+
return addHeapObject(ret);
|
793
|
+
};
|
794
|
+
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
795
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
796
|
+
}, arguments) };
|
797
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
798
|
+
const ret = new Uint8Array(getObject(arg0));
|
799
|
+
return addHeapObject(ret);
|
800
|
+
};
|
801
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
802
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
803
|
+
};
|
804
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
805
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
806
|
+
};
|
807
|
+
|
808
|
+
return imports;
|
809
|
+
}
|
810
|
+
|
811
|
+
function __wbg_finalize_init(instance, module) {
|
812
|
+
wasm = instance.exports;
|
813
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
814
|
+
cachedInt32Memory0 = null;
|
815
|
+
cachedUint8Memory0 = null;
|
816
|
+
|
817
|
+
|
818
|
+
return wasm;
|
819
|
+
}
|
820
|
+
|
821
|
+
function initSync(module) {
|
822
|
+
if (wasm !== undefined) return wasm;
|
823
|
+
|
824
|
+
const imports = __wbg_get_imports();
|
825
|
+
|
826
|
+
if (!(module instanceof WebAssembly.Module)) {
|
827
|
+
module = new WebAssembly.Module(module);
|
828
|
+
}
|
829
|
+
|
830
|
+
const instance = new WebAssembly.Instance(module, imports);
|
831
|
+
|
832
|
+
return __wbg_finalize_init(instance, module);
|
833
|
+
}
|
834
|
+
|
835
|
+
async function __wbg_init(input) {
|
836
|
+
if (wasm !== undefined) return wasm;
|
837
|
+
|
838
|
+
if (typeof input === 'undefined') {
|
839
|
+
input = new URL('bulletproofswasm_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
|
840
|
+
}
|
841
|
+
const imports = __wbg_get_imports();
|
842
|
+
|
843
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
844
|
+
input = fetch(input);
|
845
|
+
}
|
846
|
+
|
847
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
848
|
+
|
849
|
+
return __wbg_finalize_init(instance, module);
|
850
|
+
}
|
851
|
+
|
625
852
|
class BulletproofsError extends Error {
|
626
853
|
}
|
627
854
|
function BulletproofsGenerateRangeProof(values, blinding, bitSize) {
|
@@ -843,3 +1070,5 @@ var bulletproofs = /*#__PURE__*/Object.freeze({
|
|
843
1070
|
window.Buffer = buffer.Buffer;
|
844
1071
|
|
845
1072
|
exports.bulletproofs = bulletproofs;
|
1073
|
+
exports.init = __wbg_init;
|
1074
|
+
exports.initSync = initSync;
|
Binary file
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@quilibrium/quilibrium-js-bulletproofs-sdk",
|
3
|
-
"version": "2.1.0-
|
3
|
+
"version": "2.1.0-3",
|
4
4
|
"license": "MIT",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.js",
|
@@ -10,7 +10,7 @@
|
|
10
10
|
"access": "public"
|
11
11
|
},
|
12
12
|
"scripts": {
|
13
|
-
"build": "rollup -c",
|
13
|
+
"build": "cp -r src/wasm dist/wasm && rollup -c",
|
14
14
|
"dev": "rollup -c -w",
|
15
15
|
"clean": "rimraf dist"
|
16
16
|
},
|