@interest-protocol/vortex-sdk 7.5.0 → 7.6.0
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.js +33 -463
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -463
- package/dist/index.mjs.map +1 -1
- package/dist/utils/prove.d.ts +2 -2
- package/dist/utils/prove.d.ts.map +1 -1
- package/dist/vortex-B4vJEPJu.js +161 -0
- package/dist/vortex-B4vJEPJu.js.map +1 -0
- package/dist/vortex-CG5eotma.js +315 -0
- package/dist/vortex-CG5eotma.js.map +1 -0
- package/dist/vortex-CqFkd5YM.mjs +158 -0
- package/dist/vortex-CqFkd5YM.mjs.map +1 -0
- package/dist/vortex-pJNVBvjP.mjs +313 -0
- package/dist/vortex-pJNVBvjP.mjs.map +1 -0
- package/package.json +3 -3
- package/rollup.config.js +6 -2
- package/src/utils/deposit.ts +2 -2
- package/src/utils/prove.ts +32 -10
- package/src/utils/withdraw.ts +2 -2
package/dist/utils/prove.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const prove: (input: string) => string
|
|
2
|
-
export declare const verify: (proof: string) => boolean
|
|
1
|
+
export declare const prove: (input: string) => Promise<string>;
|
|
2
|
+
export declare const verify: (proof: string) => Promise<boolean>;
|
|
3
3
|
//# sourceMappingURL=prove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/utils/prove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/utils/prove.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,KAAK,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAGzD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAG3D,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
let wasm;
|
|
5
|
+
let WASM_VECTOR_LEN = 0;
|
|
6
|
+
let cachedUint8ArrayMemory0 = null;
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null ||
|
|
9
|
+
cachedUint8ArrayMemory0.byteLength === 0) {
|
|
10
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
11
|
+
}
|
|
12
|
+
return cachedUint8ArrayMemory0;
|
|
13
|
+
}
|
|
14
|
+
const cachedTextEncoder = new TextEncoder();
|
|
15
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
16
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
17
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
18
|
+
view.set(buf);
|
|
19
|
+
return {
|
|
20
|
+
read: arg.length,
|
|
21
|
+
written: buf.length,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
26
|
+
if (realloc === undefined) {
|
|
27
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
28
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
29
|
+
getUint8ArrayMemory0()
|
|
30
|
+
.subarray(ptr, ptr + buf.length)
|
|
31
|
+
.set(buf);
|
|
32
|
+
WASM_VECTOR_LEN = buf.length;
|
|
33
|
+
return ptr;
|
|
34
|
+
}
|
|
35
|
+
let len = arg.length;
|
|
36
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
37
|
+
const mem = getUint8ArrayMemory0();
|
|
38
|
+
let offset = 0;
|
|
39
|
+
for (; offset < len; offset++) {
|
|
40
|
+
const code = arg.charCodeAt(offset);
|
|
41
|
+
if (code > 0x7f)
|
|
42
|
+
break;
|
|
43
|
+
mem[ptr + offset] = code;
|
|
44
|
+
}
|
|
45
|
+
if (offset !== len) {
|
|
46
|
+
if (offset !== 0) {
|
|
47
|
+
arg = arg.slice(offset);
|
|
48
|
+
}
|
|
49
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
50
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
51
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
52
|
+
offset += ret.written;
|
|
53
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
54
|
+
}
|
|
55
|
+
WASM_VECTOR_LEN = offset;
|
|
56
|
+
return ptr;
|
|
57
|
+
}
|
|
58
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
59
|
+
ignoreBOM: true,
|
|
60
|
+
fatal: true,
|
|
61
|
+
});
|
|
62
|
+
cachedTextDecoder.decode();
|
|
63
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
64
|
+
let numBytesDecoded = 0;
|
|
65
|
+
function decodeText(ptr, len) {
|
|
66
|
+
numBytesDecoded += len;
|
|
67
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
68
|
+
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
69
|
+
ignoreBOM: true,
|
|
70
|
+
fatal: true,
|
|
71
|
+
});
|
|
72
|
+
cachedTextDecoder.decode();
|
|
73
|
+
numBytesDecoded = len;
|
|
74
|
+
}
|
|
75
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
76
|
+
}
|
|
77
|
+
function getStringFromWasm0(ptr, len) {
|
|
78
|
+
ptr = ptr >>> 0;
|
|
79
|
+
return decodeText(ptr, len);
|
|
80
|
+
}
|
|
81
|
+
function takeFromExternrefTable0(idx) {
|
|
82
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
83
|
+
wasm.__externref_table_dealloc(idx);
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generates a zero-knowledge proof for a privacy-preserving transaction
|
|
88
|
+
*
|
|
89
|
+
* # Arguments
|
|
90
|
+
* * `input_json` - JSON string containing all circuit inputs
|
|
91
|
+
* * `proving_key_hex` - Hex-encoded proving key (generated during setup)
|
|
92
|
+
*
|
|
93
|
+
* # Returns
|
|
94
|
+
* JSON string containing the proof and public inputs
|
|
95
|
+
*
|
|
96
|
+
* # Example
|
|
97
|
+
* ```javascript
|
|
98
|
+
* const input = {
|
|
99
|
+
* root: "12345...",
|
|
100
|
+
* publicAmount: "1000",
|
|
101
|
+
* // ... other inputs
|
|
102
|
+
* };
|
|
103
|
+
* const proof = prove(JSON.stringify(input), provingKeyHex);
|
|
104
|
+
* const { proofA, proofB, proofC, publicInputs } = JSON.parse(proof);
|
|
105
|
+
* ```
|
|
106
|
+
* @param {string} input_json
|
|
107
|
+
* @param {string} proving_key_hex
|
|
108
|
+
* @returns {string}
|
|
109
|
+
*/
|
|
110
|
+
function prove(input_json, proving_key_hex) {
|
|
111
|
+
let deferred4_0;
|
|
112
|
+
let deferred4_1;
|
|
113
|
+
try {
|
|
114
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
115
|
+
const len0 = WASM_VECTOR_LEN;
|
|
116
|
+
const ptr1 = passStringToWasm0(proving_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
117
|
+
const len1 = WASM_VECTOR_LEN;
|
|
118
|
+
const ret = wasm.prove(ptr0, len0, ptr1, len1);
|
|
119
|
+
var ptr3 = ret[0];
|
|
120
|
+
var len3 = ret[1];
|
|
121
|
+
if (ret[3]) {
|
|
122
|
+
ptr3 = 0;
|
|
123
|
+
len3 = 0;
|
|
124
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
125
|
+
}
|
|
126
|
+
deferred4_0 = ptr3;
|
|
127
|
+
deferred4_1 = len3;
|
|
128
|
+
return getStringFromWasm0(ptr3, len3);
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Verifies a proof (useful for testing before submitting to chain)
|
|
136
|
+
*
|
|
137
|
+
* # Arguments
|
|
138
|
+
* * `proof_json` - JSON string containing proof output from `prove()`
|
|
139
|
+
* * `verifying_key_hex` - Hex-encoded verifying key
|
|
140
|
+
*
|
|
141
|
+
* # Returns
|
|
142
|
+
* "true" if proof is valid, "false" otherwise
|
|
143
|
+
* @param {string} proof_json
|
|
144
|
+
* @param {string} verifying_key_hex
|
|
145
|
+
* @returns {boolean}
|
|
146
|
+
*/
|
|
147
|
+
function verify(proof_json, verifying_key_hex) {
|
|
148
|
+
const ptr0 = passStringToWasm0(proof_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
149
|
+
const len0 = WASM_VECTOR_LEN;
|
|
150
|
+
const ptr1 = passStringToWasm0(verifying_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
151
|
+
const len1 = WASM_VECTOR_LEN;
|
|
152
|
+
const ret = wasm.verify(ptr0, len0, ptr1, len1);
|
|
153
|
+
if (ret[2]) {
|
|
154
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
155
|
+
}
|
|
156
|
+
return ret[0] !== 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
exports.prove = prove;
|
|
160
|
+
exports.verify = verify;
|
|
161
|
+
//# sourceMappingURL=vortex-B4vJEPJu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vortex-B4vJEPJu.js","sources":["../src/pkg/web/vortex.js"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA,IAAI,IAAI;AAmER,IAAI,eAAe,GAAG,CAAC;AAEvB,IAAI,uBAAuB,GAAG,IAAI;AAElC,SAAS,oBAAoB,GAAA;IAC3B,IACE,uBAAuB,KAAK,IAAI;AAChC,QAAA,uBAAuB,CAAC,UAA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AG,CAAC,CAAC,CAAC;AACjB,QAAA,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;YACV,IAAI,GAAG,CAAC;YACR,IAAI,GAAG,CAAC;AACR,YAAA,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACvC;QACA,WAAW,GAAG,IAAI;QAClB,WAAW,GAAG,IAAI;AAClB,QAAA,OAAO,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC;IACvC;YAAU;QACR,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IACnD;AACF;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,MAAM,CAAC,UAAU,EAAE,iBAAiB,EAAA;AAClD,IAAA,MAAM,IAAI,GAAG,iBAAiB,CAC5B,UAAU,EACV,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,kBAAkB,CACxB;IACD,MAAM,IAAI,GAAG,eAAe;AAC5B,IAAA,MAAM,IAAI,GAAG,iBAAiB,CAC5B,iBAAiB,EACjB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,kBAAkB,CACxB;IACD,MAAM,IAAI,GAAG,eAAe;AAC5B,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC/C,IAAA,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;AACV,QAAA,MAAM,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACvC;AACA,IAAA,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;AACrB;;;;;"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var require$$0 = require('fs');
|
|
4
|
+
|
|
5
|
+
function _mergeNamespaces(n, m) {
|
|
6
|
+
m.forEach(function (e) {
|
|
7
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !(k in n)) {
|
|
9
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return e[k]; }
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return Object.freeze(n);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
var vortex$1 = {exports: {}};
|
|
21
|
+
|
|
22
|
+
var hasRequiredVortex;
|
|
23
|
+
|
|
24
|
+
function requireVortex () {
|
|
25
|
+
if (hasRequiredVortex) return vortex$1.exports;
|
|
26
|
+
hasRequiredVortex = 1;
|
|
27
|
+
(function (module, exports) {
|
|
28
|
+
/* eslint-disable */
|
|
29
|
+
let imports = {};
|
|
30
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
31
|
+
function debugString(val) {
|
|
32
|
+
// primitive types
|
|
33
|
+
const type = typeof val;
|
|
34
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
35
|
+
return `${val}`;
|
|
36
|
+
}
|
|
37
|
+
if (type == 'string') {
|
|
38
|
+
return `"${val}"`;
|
|
39
|
+
}
|
|
40
|
+
if (type == 'symbol') {
|
|
41
|
+
const description = val.description;
|
|
42
|
+
if (description == null) {
|
|
43
|
+
return 'Symbol';
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return `Symbol(${description})`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (type == 'function') {
|
|
50
|
+
const name = val.name;
|
|
51
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
52
|
+
return `Function(${name})`;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return 'Function';
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// objects
|
|
59
|
+
if (Array.isArray(val)) {
|
|
60
|
+
const length = val.length;
|
|
61
|
+
let debug = '[';
|
|
62
|
+
if (length > 0) {
|
|
63
|
+
debug += debugString(val[0]);
|
|
64
|
+
}
|
|
65
|
+
for (let i = 1; i < length; i++) {
|
|
66
|
+
debug += ', ' + debugString(val[i]);
|
|
67
|
+
}
|
|
68
|
+
debug += ']';
|
|
69
|
+
return debug;
|
|
70
|
+
}
|
|
71
|
+
// Test for built-in
|
|
72
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
73
|
+
let className;
|
|
74
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
75
|
+
className = builtInMatches[1];
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// Failed to match the standard '[object ClassName]'
|
|
79
|
+
return toString.call(val);
|
|
80
|
+
}
|
|
81
|
+
if (className == 'Object') {
|
|
82
|
+
// we're a user defined class or Object
|
|
83
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
84
|
+
// easier than looping through ownProperties of `val`.
|
|
85
|
+
try {
|
|
86
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
87
|
+
}
|
|
88
|
+
catch (_) {
|
|
89
|
+
return 'Object';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// errors
|
|
93
|
+
if (val instanceof Error) {
|
|
94
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
95
|
+
}
|
|
96
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
97
|
+
return className;
|
|
98
|
+
}
|
|
99
|
+
let WASM_VECTOR_LEN = 0;
|
|
100
|
+
let cachedUint8ArrayMemory0 = null;
|
|
101
|
+
function getUint8ArrayMemory0() {
|
|
102
|
+
if (cachedUint8ArrayMemory0 === null ||
|
|
103
|
+
cachedUint8ArrayMemory0.byteLength === 0) {
|
|
104
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
105
|
+
}
|
|
106
|
+
return cachedUint8ArrayMemory0;
|
|
107
|
+
}
|
|
108
|
+
const cachedTextEncoder = new TextEncoder();
|
|
109
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
110
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
111
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
112
|
+
view.set(buf);
|
|
113
|
+
return {
|
|
114
|
+
read: arg.length,
|
|
115
|
+
written: buf.length,
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
120
|
+
if (realloc === undefined) {
|
|
121
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
122
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
123
|
+
getUint8ArrayMemory0()
|
|
124
|
+
.subarray(ptr, ptr + buf.length)
|
|
125
|
+
.set(buf);
|
|
126
|
+
WASM_VECTOR_LEN = buf.length;
|
|
127
|
+
return ptr;
|
|
128
|
+
}
|
|
129
|
+
let len = arg.length;
|
|
130
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
131
|
+
const mem = getUint8ArrayMemory0();
|
|
132
|
+
let offset = 0;
|
|
133
|
+
for (; offset < len; offset++) {
|
|
134
|
+
const code = arg.charCodeAt(offset);
|
|
135
|
+
if (code > 0x7f)
|
|
136
|
+
break;
|
|
137
|
+
mem[ptr + offset] = code;
|
|
138
|
+
}
|
|
139
|
+
if (offset !== len) {
|
|
140
|
+
if (offset !== 0) {
|
|
141
|
+
arg = arg.slice(offset);
|
|
142
|
+
}
|
|
143
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
144
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
145
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
146
|
+
offset += ret.written;
|
|
147
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
148
|
+
}
|
|
149
|
+
WASM_VECTOR_LEN = offset;
|
|
150
|
+
return ptr;
|
|
151
|
+
}
|
|
152
|
+
let cachedDataViewMemory0 = null;
|
|
153
|
+
function getDataViewMemory0() {
|
|
154
|
+
if (cachedDataViewMemory0 === null ||
|
|
155
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
156
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
157
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
158
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
159
|
+
}
|
|
160
|
+
return cachedDataViewMemory0;
|
|
161
|
+
}
|
|
162
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
163
|
+
ignoreBOM: true,
|
|
164
|
+
fatal: true,
|
|
165
|
+
});
|
|
166
|
+
cachedTextDecoder.decode();
|
|
167
|
+
function decodeText(ptr, len) {
|
|
168
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
169
|
+
}
|
|
170
|
+
function getStringFromWasm0(ptr, len) {
|
|
171
|
+
ptr = ptr >>> 0;
|
|
172
|
+
return decodeText(ptr, len);
|
|
173
|
+
}
|
|
174
|
+
exports.main = function () {
|
|
175
|
+
wasm.main();
|
|
176
|
+
};
|
|
177
|
+
function takeFromExternrefTable0(idx) {
|
|
178
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
179
|
+
wasm.__externref_table_dealloc(idx);
|
|
180
|
+
return value;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Generates a zero-knowledge proof for a privacy-preserving transaction
|
|
184
|
+
*
|
|
185
|
+
* # Arguments
|
|
186
|
+
* * `input_json` - JSON string containing all circuit inputs
|
|
187
|
+
* * `proving_key_hex` - Hex-encoded proving key (generated during setup)
|
|
188
|
+
*
|
|
189
|
+
* # Returns
|
|
190
|
+
* JSON string containing the proof and public inputs
|
|
191
|
+
*
|
|
192
|
+
* # Example
|
|
193
|
+
* ```javascript
|
|
194
|
+
* const input = {
|
|
195
|
+
* root: "12345...",
|
|
196
|
+
* publicAmount: "1000",
|
|
197
|
+
* // ... other inputs
|
|
198
|
+
* };
|
|
199
|
+
* const proof = prove(JSON.stringify(input), provingKeyHex);
|
|
200
|
+
* const { proofA, proofB, proofC, publicInputs } = JSON.parse(proof);
|
|
201
|
+
* ```
|
|
202
|
+
* @param {string} input_json
|
|
203
|
+
* @param {string} proving_key_hex
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
exports.prove = function (input_json, proving_key_hex) {
|
|
207
|
+
let deferred4_0;
|
|
208
|
+
let deferred4_1;
|
|
209
|
+
try {
|
|
210
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
211
|
+
const len0 = WASM_VECTOR_LEN;
|
|
212
|
+
const ptr1 = passStringToWasm0(proving_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
213
|
+
const len1 = WASM_VECTOR_LEN;
|
|
214
|
+
const ret = wasm.prove(ptr0, len0, ptr1, len1);
|
|
215
|
+
var ptr3 = ret[0];
|
|
216
|
+
var len3 = ret[1];
|
|
217
|
+
if (ret[3]) {
|
|
218
|
+
ptr3 = 0;
|
|
219
|
+
len3 = 0;
|
|
220
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
221
|
+
}
|
|
222
|
+
deferred4_0 = ptr3;
|
|
223
|
+
deferred4_1 = len3;
|
|
224
|
+
return getStringFromWasm0(ptr3, len3);
|
|
225
|
+
}
|
|
226
|
+
finally {
|
|
227
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Verifies a proof (useful for testing before submitting to chain)
|
|
232
|
+
*
|
|
233
|
+
* # Arguments
|
|
234
|
+
* * `proof_json` - JSON string containing proof output from `prove()`
|
|
235
|
+
* * `verifying_key_hex` - Hex-encoded verifying key
|
|
236
|
+
*
|
|
237
|
+
* # Returns
|
|
238
|
+
* "true" if proof is valid, "false" otherwise
|
|
239
|
+
* @param {string} proof_json
|
|
240
|
+
* @param {string} verifying_key_hex
|
|
241
|
+
* @returns {boolean}
|
|
242
|
+
*/
|
|
243
|
+
exports.verify = function (proof_json, verifying_key_hex) {
|
|
244
|
+
const ptr0 = passStringToWasm0(proof_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
245
|
+
const len0 = WASM_VECTOR_LEN;
|
|
246
|
+
const ptr1 = passStringToWasm0(verifying_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
247
|
+
const len1 = WASM_VECTOR_LEN;
|
|
248
|
+
const ret = wasm.verify(ptr0, len0, ptr1, len1);
|
|
249
|
+
if (ret[2]) {
|
|
250
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
251
|
+
}
|
|
252
|
+
return ret[0] !== 0;
|
|
253
|
+
};
|
|
254
|
+
exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function (arg0, arg1) {
|
|
255
|
+
const ret = debugString(arg1);
|
|
256
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
|
+
const len1 = WASM_VECTOR_LEN;
|
|
258
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
259
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
260
|
+
};
|
|
261
|
+
exports.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
|
|
262
|
+
let deferred0_0;
|
|
263
|
+
let deferred0_1;
|
|
264
|
+
try {
|
|
265
|
+
deferred0_0 = arg0;
|
|
266
|
+
deferred0_1 = arg1;
|
|
267
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
268
|
+
}
|
|
269
|
+
finally {
|
|
270
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
exports.__wbg_new_8a6f238a6ece86ea = function () {
|
|
274
|
+
const ret = new Error();
|
|
275
|
+
return ret;
|
|
276
|
+
};
|
|
277
|
+
exports.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
|
|
278
|
+
const ret = arg1.stack;
|
|
279
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
|
+
const len1 = WASM_VECTOR_LEN;
|
|
281
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
282
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
283
|
+
};
|
|
284
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {
|
|
285
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
286
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
287
|
+
return ret;
|
|
288
|
+
};
|
|
289
|
+
exports.__wbindgen_init_externref_table = function () {
|
|
290
|
+
const table = wasm.__wbindgen_externrefs;
|
|
291
|
+
const offset = table.grow(4);
|
|
292
|
+
table.set(0, undefined);
|
|
293
|
+
table.set(offset + 0, undefined);
|
|
294
|
+
table.set(offset + 1, null);
|
|
295
|
+
table.set(offset + 2, true);
|
|
296
|
+
table.set(offset + 3, false);
|
|
297
|
+
};
|
|
298
|
+
const wasmPath = `${__dirname}/vortex_bg.nodejs.wasm`;
|
|
299
|
+
const wasmBytes = require$$0.readFileSync(wasmPath);
|
|
300
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
301
|
+
const wasm = (exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports);
|
|
302
|
+
wasm.__wbindgen_start();
|
|
303
|
+
|
|
304
|
+
} (vortex$1, vortex$1.exports));
|
|
305
|
+
return vortex$1.exports;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
var vortexExports = requireVortex();
|
|
309
|
+
|
|
310
|
+
var vortex = /*#__PURE__*/_mergeNamespaces({
|
|
311
|
+
__proto__: null
|
|
312
|
+
}, [vortexExports]);
|
|
313
|
+
|
|
314
|
+
exports.vortex = vortex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+
let wasm;
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
let cachedUint8ArrayMemory0 = null;
|
|
5
|
+
function getUint8ArrayMemory0() {
|
|
6
|
+
if (cachedUint8ArrayMemory0 === null ||
|
|
7
|
+
cachedUint8ArrayMemory0.byteLength === 0) {
|
|
8
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
9
|
+
}
|
|
10
|
+
return cachedUint8ArrayMemory0;
|
|
11
|
+
}
|
|
12
|
+
const cachedTextEncoder = new TextEncoder();
|
|
13
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
14
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
15
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
16
|
+
view.set(buf);
|
|
17
|
+
return {
|
|
18
|
+
read: arg.length,
|
|
19
|
+
written: buf.length,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
24
|
+
if (realloc === undefined) {
|
|
25
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
26
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
27
|
+
getUint8ArrayMemory0()
|
|
28
|
+
.subarray(ptr, ptr + buf.length)
|
|
29
|
+
.set(buf);
|
|
30
|
+
WASM_VECTOR_LEN = buf.length;
|
|
31
|
+
return ptr;
|
|
32
|
+
}
|
|
33
|
+
let len = arg.length;
|
|
34
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
35
|
+
const mem = getUint8ArrayMemory0();
|
|
36
|
+
let offset = 0;
|
|
37
|
+
for (; offset < len; offset++) {
|
|
38
|
+
const code = arg.charCodeAt(offset);
|
|
39
|
+
if (code > 0x7f)
|
|
40
|
+
break;
|
|
41
|
+
mem[ptr + offset] = code;
|
|
42
|
+
}
|
|
43
|
+
if (offset !== len) {
|
|
44
|
+
if (offset !== 0) {
|
|
45
|
+
arg = arg.slice(offset);
|
|
46
|
+
}
|
|
47
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
48
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
49
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
50
|
+
offset += ret.written;
|
|
51
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
52
|
+
}
|
|
53
|
+
WASM_VECTOR_LEN = offset;
|
|
54
|
+
return ptr;
|
|
55
|
+
}
|
|
56
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
57
|
+
ignoreBOM: true,
|
|
58
|
+
fatal: true,
|
|
59
|
+
});
|
|
60
|
+
cachedTextDecoder.decode();
|
|
61
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
62
|
+
let numBytesDecoded = 0;
|
|
63
|
+
function decodeText(ptr, len) {
|
|
64
|
+
numBytesDecoded += len;
|
|
65
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
66
|
+
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
67
|
+
ignoreBOM: true,
|
|
68
|
+
fatal: true,
|
|
69
|
+
});
|
|
70
|
+
cachedTextDecoder.decode();
|
|
71
|
+
numBytesDecoded = len;
|
|
72
|
+
}
|
|
73
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
74
|
+
}
|
|
75
|
+
function getStringFromWasm0(ptr, len) {
|
|
76
|
+
ptr = ptr >>> 0;
|
|
77
|
+
return decodeText(ptr, len);
|
|
78
|
+
}
|
|
79
|
+
function takeFromExternrefTable0(idx) {
|
|
80
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
81
|
+
wasm.__externref_table_dealloc(idx);
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Generates a zero-knowledge proof for a privacy-preserving transaction
|
|
86
|
+
*
|
|
87
|
+
* # Arguments
|
|
88
|
+
* * `input_json` - JSON string containing all circuit inputs
|
|
89
|
+
* * `proving_key_hex` - Hex-encoded proving key (generated during setup)
|
|
90
|
+
*
|
|
91
|
+
* # Returns
|
|
92
|
+
* JSON string containing the proof and public inputs
|
|
93
|
+
*
|
|
94
|
+
* # Example
|
|
95
|
+
* ```javascript
|
|
96
|
+
* const input = {
|
|
97
|
+
* root: "12345...",
|
|
98
|
+
* publicAmount: "1000",
|
|
99
|
+
* // ... other inputs
|
|
100
|
+
* };
|
|
101
|
+
* const proof = prove(JSON.stringify(input), provingKeyHex);
|
|
102
|
+
* const { proofA, proofB, proofC, publicInputs } = JSON.parse(proof);
|
|
103
|
+
* ```
|
|
104
|
+
* @param {string} input_json
|
|
105
|
+
* @param {string} proving_key_hex
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
108
|
+
function prove(input_json, proving_key_hex) {
|
|
109
|
+
let deferred4_0;
|
|
110
|
+
let deferred4_1;
|
|
111
|
+
try {
|
|
112
|
+
const ptr0 = passStringToWasm0(input_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
113
|
+
const len0 = WASM_VECTOR_LEN;
|
|
114
|
+
const ptr1 = passStringToWasm0(proving_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
115
|
+
const len1 = WASM_VECTOR_LEN;
|
|
116
|
+
const ret = wasm.prove(ptr0, len0, ptr1, len1);
|
|
117
|
+
var ptr3 = ret[0];
|
|
118
|
+
var len3 = ret[1];
|
|
119
|
+
if (ret[3]) {
|
|
120
|
+
ptr3 = 0;
|
|
121
|
+
len3 = 0;
|
|
122
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
123
|
+
}
|
|
124
|
+
deferred4_0 = ptr3;
|
|
125
|
+
deferred4_1 = len3;
|
|
126
|
+
return getStringFromWasm0(ptr3, len3);
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Verifies a proof (useful for testing before submitting to chain)
|
|
134
|
+
*
|
|
135
|
+
* # Arguments
|
|
136
|
+
* * `proof_json` - JSON string containing proof output from `prove()`
|
|
137
|
+
* * `verifying_key_hex` - Hex-encoded verifying key
|
|
138
|
+
*
|
|
139
|
+
* # Returns
|
|
140
|
+
* "true" if proof is valid, "false" otherwise
|
|
141
|
+
* @param {string} proof_json
|
|
142
|
+
* @param {string} verifying_key_hex
|
|
143
|
+
* @returns {boolean}
|
|
144
|
+
*/
|
|
145
|
+
function verify(proof_json, verifying_key_hex) {
|
|
146
|
+
const ptr0 = passStringToWasm0(proof_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
147
|
+
const len0 = WASM_VECTOR_LEN;
|
|
148
|
+
const ptr1 = passStringToWasm0(verifying_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
149
|
+
const len1 = WASM_VECTOR_LEN;
|
|
150
|
+
const ret = wasm.verify(ptr0, len0, ptr1, len1);
|
|
151
|
+
if (ret[2]) {
|
|
152
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
153
|
+
}
|
|
154
|
+
return ret[0] !== 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { prove, verify };
|
|
158
|
+
//# sourceMappingURL=vortex-CqFkd5YM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vortex-CqFkd5YM.mjs","sources":["../src/pkg/web/vortex.js"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,IAAI,IAAI;AAmER,IAAI,eAAe,GAAG,CAAC;AAEvB,IAAI,uBAAuB,GAAG,IAAI;AAElC,SAAS,oBAAoB,GAAA;IAC3B,IACE,uBAAuB,KAAK,IAAI;AAChC,QAAA,uBAAuB,CAAC,UAAU,KAAK,CAAC,EACxC;QACA,uBAAuB,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,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