@permissionless-technologies/upp-sdk 0.4.12 → 0.4.14
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/{chunk-O6ALW7DB.js → chunk-5WLAZA3M.js} +3 -3
- package/dist/{chunk-O6ALW7DB.js.map → chunk-5WLAZA3M.js.map} +1 -1
- package/dist/{chunk-ONNWKSAZ.cjs → chunk-7Y6O4P2P.cjs} +16 -16
- package/dist/{chunk-ONNWKSAZ.cjs.map → chunk-7Y6O4P2P.cjs.map} +1 -1
- package/dist/{chunk-OPBS3OMJ.cjs → chunk-CTBLNYYB.cjs} +2 -2
- package/dist/{chunk-OPBS3OMJ.cjs.map → chunk-CTBLNYYB.cjs.map} +1 -1
- package/dist/{chunk-23B5XSS4.cjs → chunk-CZLMCMYE.cjs} +90 -2
- package/dist/chunk-CZLMCMYE.cjs.map +1 -0
- package/dist/{chunk-JD3KMRWN.js → chunk-GQ6JMNJI.js} +16 -16
- package/dist/{chunk-JD3KMRWN.js.map → chunk-GQ6JMNJI.js.map} +1 -1
- package/dist/{chunk-RNUG3EFC.js → chunk-NIGEAKQP.js} +89 -3
- package/dist/chunk-NIGEAKQP.js.map +1 -0
- package/dist/{chunk-5BLMSTFQ.cjs → chunk-TBGDQM33.cjs} +4 -4
- package/dist/{chunk-5BLMSTFQ.cjs.map → chunk-TBGDQM33.cjs.map} +1 -1
- package/dist/{chunk-S2OM2NHS.js → chunk-YMZM2ABJ.js} +2 -2
- package/dist/{chunk-S2OM2NHS.js.map → chunk-YMZM2ABJ.js.map} +1 -1
- package/dist/core/index.cjs +101 -93
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +5 -5
- package/dist/core/proof-worker-entry.cjs +60 -0
- package/dist/core/proof-worker-entry.cjs.map +1 -0
- package/dist/core/proof-worker-entry.d.cts +2 -0
- package/dist/core/proof-worker-entry.d.ts +2 -0
- package/dist/core/proof-worker-entry.js +58 -0
- package/dist/core/proof-worker-entry.js.map +1 -0
- package/dist/{index-CKCDqv2e.d.cts → index-DKFupAA8.d.cts} +8 -3
- package/dist/{index-DLczKlnM.d.ts → index-M91G-og3.d.ts} +8 -3
- package/dist/{index--eNkOLiP.d.ts → index-S2fzWmLW.d.ts} +1 -1
- package/dist/{index-CRaFsQD3.d.cts → index-qTwnREeK.d.cts} +1 -1
- package/dist/index.cjs +250 -242
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/indexer/index.cjs +6 -6
- package/dist/indexer/index.d.cts +5 -5
- package/dist/indexer/index.d.ts +5 -5
- package/dist/indexer/index.js +1 -1
- package/dist/react/index.cjs +70 -22
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +20 -3
- package/dist/react/index.d.ts +20 -3
- package/dist/react/index.js +53 -13
- package/dist/react/index.js.map +1 -1
- package/dist/{transfer-CwwsNdGL.d.cts → transfer-BDYID3Hn.d.cts} +75 -1
- package/dist/{transfer-Crvdq4VN.d.ts → transfer-DLukr6ed.d.ts} +75 -1
- package/dist/{transfer-Y5QKVEYS.js → transfer-LT2VGGPZ.js} +5 -5
- package/dist/{transfer-Y5QKVEYS.js.map → transfer-LT2VGGPZ.js.map} +1 -1
- package/dist/{transfer-DZFXSJAU.cjs → transfer-OPGKWWX2.cjs} +11 -11
- package/dist/{transfer-DZFXSJAU.cjs.map → transfer-OPGKWWX2.cjs.map} +1 -1
- package/package.json +5 -1
- package/src/deployments/11155111.json +12 -12
- package/dist/chunk-23B5XSS4.cjs.map +0 -1
- package/dist/chunk-RNUG3EFC.js.map +0 -1
package/dist/core/index.cjs
CHANGED
|
@@ -1,230 +1,270 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTBGDQM33_cjs = require('../chunk-TBGDQM33.cjs');
|
|
4
|
+
var chunk7Y6O4P2P_cjs = require('../chunk-7Y6O4P2P.cjs');
|
|
5
|
+
var chunkRYEYGGE7_cjs = require('../chunk-RYEYGGE7.cjs');
|
|
6
|
+
var chunkCZLMCMYE_cjs = require('../chunk-CZLMCMYE.cjs');
|
|
7
|
+
var chunkXVIICZKW_cjs = require('../chunk-XVIICZKW.cjs');
|
|
5
8
|
var chunkSWTNJPK5_cjs = require('../chunk-SWTNJPK5.cjs');
|
|
6
9
|
require('../chunk-IIUKM5VE.cjs');
|
|
7
10
|
require('../chunk-U3YFYMWF.cjs');
|
|
8
|
-
var chunk23B5XSS4_cjs = require('../chunk-23B5XSS4.cjs');
|
|
9
|
-
var chunkXVIICZKW_cjs = require('../chunk-XVIICZKW.cjs');
|
|
10
11
|
require('../chunk-UFEDJJSH.cjs');
|
|
11
12
|
require('../chunk-HEHXSV47.cjs');
|
|
12
|
-
var chunkRYEYGGE7_cjs = require('../chunk-RYEYGGE7.cjs');
|
|
13
13
|
require('../chunk-G7VZBCD6.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "NOTE_VERSION", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkTBGDQM33_cjs.NOTE_VERSION; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "createNote", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkTBGDQM33_cjs.createNote; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "createUPPClient", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkTBGDQM33_cjs.createUPPClient; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "decryptNote", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkTBGDQM33_cjs.decryptNote; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "encryptNote", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkTBGDQM33_cjs.encryptNote; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "buildTransfer", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk7Y6O4P2P_cjs.buildTransfer; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "buildUPPTransferCircuitInputs", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk7Y6O4P2P_cjs.buildUPPTransferCircuitInputs; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "computeNullifier", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk7Y6O4P2P_cjs.computeNullifier; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "formatOutputForContract", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk7Y6O4P2P_cjs.formatOutputForContract; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "getMerkleProofsForNotes", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk7Y6O4P2P_cjs.getMerkleProofsForNotes; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "syncMerkleTree", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk7Y6O4P2P_cjs.syncMerkleTree; }
|
|
60
60
|
});
|
|
61
|
-
Object.defineProperty(exports, "
|
|
61
|
+
Object.defineProperty(exports, "ASP_TREE_DEPTH", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkRYEYGGE7_cjs.ASP_TREE_DEPTH; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "STATE_TREE_DEPTH", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunkRYEYGGE7_cjs.STATE_TREE_DEPTH; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "formatProofForContract", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunkRYEYGGE7_cjs.formatProofForContract; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "generateProof", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunkRYEYGGE7_cjs.generateProof; }
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "generateStealthProof", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return chunkRYEYGGE7_cjs.generateStealthProof; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "generateUPPProof", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return chunkRYEYGGE7_cjs.generateUPPProof; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "getStealthCircuitArtifacts", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return chunkRYEYGGE7_cjs.getStealthCircuitArtifacts; }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "getUPPCircuitArtifacts", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function () { return chunkRYEYGGE7_cjs.getUPPCircuitArtifacts; }
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "verifyProof", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () { return chunkRYEYGGE7_cjs.verifyProof; }
|
|
64
96
|
});
|
|
65
97
|
Object.defineProperty(exports, "ADDRESS_VERSION", {
|
|
66
98
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkCZLMCMYE_cjs.ADDRESS_VERSION; }
|
|
68
100
|
});
|
|
69
101
|
Object.defineProperty(exports, "DirectAccountAdapter", {
|
|
70
102
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkCZLMCMYE_cjs.DirectAccountAdapter; }
|
|
72
104
|
});
|
|
73
105
|
Object.defineProperty(exports, "NoteStore", {
|
|
74
106
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkCZLMCMYE_cjs.NoteStore; }
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "ProofWorkerManager", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () { return chunkCZLMCMYE_cjs.ProofWorkerManager; }
|
|
76
112
|
});
|
|
77
113
|
Object.defineProperty(exports, "RATE_PRECISION", {
|
|
78
114
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkCZLMCMYE_cjs.RATE_PRECISION; }
|
|
80
116
|
});
|
|
81
117
|
Object.defineProperty(exports, "STARK_ADDRESS_VERSION", {
|
|
82
118
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkCZLMCMYE_cjs.STARK_ADDRESS_VERSION; }
|
|
84
120
|
});
|
|
85
121
|
Object.defineProperty(exports, "STARK_STEALTH_ADDRESS_PREFIX", {
|
|
86
122
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkCZLMCMYE_cjs.STARK_STEALTH_ADDRESS_PREFIX; }
|
|
88
124
|
});
|
|
89
125
|
Object.defineProperty(exports, "STEALTH_ADDRESS_PREFIX", {
|
|
90
126
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkCZLMCMYE_cjs.STEALTH_ADDRESS_PREFIX; }
|
|
92
128
|
});
|
|
93
129
|
Object.defineProperty(exports, "SWAP_EVENTS_ABI", {
|
|
94
130
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkCZLMCMYE_cjs.SWAP_EVENTS_ABI; }
|
|
96
132
|
});
|
|
97
133
|
Object.defineProperty(exports, "SWAP_ORDER_CANCELLED_EVENT", {
|
|
98
134
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkCZLMCMYE_cjs.SWAP_ORDER_CANCELLED_EVENT; }
|
|
100
136
|
});
|
|
101
137
|
Object.defineProperty(exports, "SWAP_ORDER_CLAIMED_EVENT", {
|
|
102
138
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkCZLMCMYE_cjs.SWAP_ORDER_CLAIMED_EVENT; }
|
|
104
140
|
});
|
|
105
141
|
Object.defineProperty(exports, "SWAP_ORDER_FILLED_EVENT", {
|
|
106
142
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkCZLMCMYE_cjs.SWAP_ORDER_FILLED_EVENT; }
|
|
108
144
|
});
|
|
109
145
|
Object.defineProperty(exports, "SWAP_ORDER_PLACED_EVENT", {
|
|
110
146
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkCZLMCMYE_cjs.SWAP_ORDER_PLACED_EVENT; }
|
|
112
148
|
});
|
|
113
149
|
Object.defineProperty(exports, "StorableAccountAdapter", {
|
|
114
150
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkCZLMCMYE_cjs.StorableAccountAdapter; }
|
|
116
152
|
});
|
|
117
153
|
Object.defineProperty(exports, "computeCancelKeyHash", {
|
|
118
154
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkCZLMCMYE_cjs.computeCancelKeyHash; }
|
|
120
156
|
});
|
|
121
157
|
Object.defineProperty(exports, "computeFillPercentage", {
|
|
122
158
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkCZLMCMYE_cjs.computeFillPercentage; }
|
|
124
160
|
});
|
|
125
161
|
Object.defineProperty(exports, "computeGiveAmount", {
|
|
126
162
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkCZLMCMYE_cjs.computeGiveAmount; }
|
|
128
164
|
});
|
|
129
165
|
Object.defineProperty(exports, "computeNoteEncryptionKey", {
|
|
130
166
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkCZLMCMYE_cjs.computeNoteEncryptionKey; }
|
|
132
168
|
});
|
|
133
169
|
Object.defineProperty(exports, "computeRate", {
|
|
134
170
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkCZLMCMYE_cjs.computeRate; }
|
|
136
172
|
});
|
|
137
173
|
Object.defineProperty(exports, "computeTakeAmount", {
|
|
138
174
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
175
|
+
get: function () { return chunkCZLMCMYE_cjs.computeTakeAmount; }
|
|
140
176
|
});
|
|
141
177
|
Object.defineProperty(exports, "computeTotalBuyAmount", {
|
|
142
178
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkCZLMCMYE_cjs.computeTotalBuyAmount; }
|
|
144
180
|
});
|
|
145
181
|
Object.defineProperty(exports, "createOneTimeKeys", {
|
|
146
182
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkCZLMCMYE_cjs.createOneTimeKeys; }
|
|
148
184
|
});
|
|
149
185
|
Object.defineProperty(exports, "decodeStarkStealthAddress", {
|
|
150
186
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkCZLMCMYE_cjs.decodeStarkStealthAddress; }
|
|
152
188
|
});
|
|
153
189
|
Object.defineProperty(exports, "decodeStealthAddress", {
|
|
154
190
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkCZLMCMYE_cjs.decodeStealthAddress; }
|
|
156
192
|
});
|
|
157
193
|
Object.defineProperty(exports, "detectAddressType", {
|
|
158
194
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkCZLMCMYE_cjs.detectAddressType; }
|
|
160
196
|
});
|
|
161
197
|
Object.defineProperty(exports, "encodeStarkStealthAddress", {
|
|
162
198
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunkCZLMCMYE_cjs.encodeStarkStealthAddress; }
|
|
164
200
|
});
|
|
165
201
|
Object.defineProperty(exports, "encodeStealthAddress", {
|
|
166
202
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
203
|
+
get: function () { return chunkCZLMCMYE_cjs.encodeStealthAddress; }
|
|
168
204
|
});
|
|
169
205
|
Object.defineProperty(exports, "filterOrdersByASP", {
|
|
170
206
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunkCZLMCMYE_cjs.filterOrdersByASP; }
|
|
172
208
|
});
|
|
173
209
|
Object.defineProperty(exports, "filterOrdersByTokenPair", {
|
|
174
210
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunkCZLMCMYE_cjs.filterOrdersByTokenPair; }
|
|
176
212
|
});
|
|
177
213
|
Object.defineProperty(exports, "formatRate", {
|
|
178
214
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunkCZLMCMYE_cjs.formatRate; }
|
|
180
216
|
});
|
|
181
217
|
Object.defineProperty(exports, "generateCancelSecret", {
|
|
182
218
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunkCZLMCMYE_cjs.generateCancelSecret; }
|
|
184
220
|
});
|
|
185
221
|
Object.defineProperty(exports, "generateStarkStealthAddress", {
|
|
186
222
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
223
|
+
get: function () { return chunkCZLMCMYE_cjs.generateStarkStealthAddress; }
|
|
188
224
|
});
|
|
189
225
|
Object.defineProperty(exports, "generateStealthAddress", {
|
|
190
226
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
227
|
+
get: function () { return chunkCZLMCMYE_cjs.generateStealthAddress; }
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(exports, "generateUPPProofAsync", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () { return chunkCZLMCMYE_cjs.generateUPPProofAsync; }
|
|
192
232
|
});
|
|
193
233
|
Object.defineProperty(exports, "getCancelSecret", {
|
|
194
234
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
235
|
+
get: function () { return chunkCZLMCMYE_cjs.getCancelSecret; }
|
|
196
236
|
});
|
|
197
237
|
Object.defineProperty(exports, "getOwnOrderIds", {
|
|
198
238
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
239
|
+
get: function () { return chunkCZLMCMYE_cjs.getOwnOrderIds; }
|
|
200
240
|
});
|
|
201
241
|
Object.defineProperty(exports, "isFillerASPAccepted", {
|
|
202
242
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
243
|
+
get: function () { return chunkCZLMCMYE_cjs.isFillerASPAccepted; }
|
|
204
244
|
});
|
|
205
245
|
Object.defineProperty(exports, "isOrderActive", {
|
|
206
246
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
247
|
+
get: function () { return chunkCZLMCMYE_cjs.isOrderActive; }
|
|
208
248
|
});
|
|
209
249
|
Object.defineProperty(exports, "isValidStarkStealthAddress", {
|
|
210
250
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
251
|
+
get: function () { return chunkCZLMCMYE_cjs.isValidStarkStealthAddress; }
|
|
212
252
|
});
|
|
213
253
|
Object.defineProperty(exports, "isValidStealthAddress", {
|
|
214
254
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
255
|
+
get: function () { return chunkCZLMCMYE_cjs.isValidStealthAddress; }
|
|
216
256
|
});
|
|
217
257
|
Object.defineProperty(exports, "removeCancelSecret", {
|
|
218
258
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
259
|
+
get: function () { return chunkCZLMCMYE_cjs.removeCancelSecret; }
|
|
220
260
|
});
|
|
221
261
|
Object.defineProperty(exports, "storeCancelSecret", {
|
|
222
262
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
263
|
+
get: function () { return chunkCZLMCMYE_cjs.storeCancelSecret; }
|
|
224
264
|
});
|
|
225
265
|
Object.defineProperty(exports, "verifyOwnership", {
|
|
226
266
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
267
|
+
get: function () { return chunkCZLMCMYE_cjs.verifyOwnership; }
|
|
228
268
|
});
|
|
229
269
|
Object.defineProperty(exports, "DEMO_ASP_ID", {
|
|
230
270
|
enumerable: true,
|
|
@@ -266,41 +306,9 @@ Object.defineProperty(exports, "verifyASPProof", {
|
|
|
266
306
|
enumerable: true,
|
|
267
307
|
get: function () { return chunkXVIICZKW_cjs.verifyASPProof; }
|
|
268
308
|
});
|
|
269
|
-
Object.defineProperty(exports, "
|
|
270
|
-
enumerable: true,
|
|
271
|
-
get: function () { return chunkRYEYGGE7_cjs.ASP_TREE_DEPTH; }
|
|
272
|
-
});
|
|
273
|
-
Object.defineProperty(exports, "STATE_TREE_DEPTH", {
|
|
274
|
-
enumerable: true,
|
|
275
|
-
get: function () { return chunkRYEYGGE7_cjs.STATE_TREE_DEPTH; }
|
|
276
|
-
});
|
|
277
|
-
Object.defineProperty(exports, "formatProofForContract", {
|
|
278
|
-
enumerable: true,
|
|
279
|
-
get: function () { return chunkRYEYGGE7_cjs.formatProofForContract; }
|
|
280
|
-
});
|
|
281
|
-
Object.defineProperty(exports, "generateProof", {
|
|
282
|
-
enumerable: true,
|
|
283
|
-
get: function () { return chunkRYEYGGE7_cjs.generateProof; }
|
|
284
|
-
});
|
|
285
|
-
Object.defineProperty(exports, "generateStealthProof", {
|
|
286
|
-
enumerable: true,
|
|
287
|
-
get: function () { return chunkRYEYGGE7_cjs.generateStealthProof; }
|
|
288
|
-
});
|
|
289
|
-
Object.defineProperty(exports, "generateUPPProof", {
|
|
290
|
-
enumerable: true,
|
|
291
|
-
get: function () { return chunkRYEYGGE7_cjs.generateUPPProof; }
|
|
292
|
-
});
|
|
293
|
-
Object.defineProperty(exports, "getStealthCircuitArtifacts", {
|
|
294
|
-
enumerable: true,
|
|
295
|
-
get: function () { return chunkRYEYGGE7_cjs.getStealthCircuitArtifacts; }
|
|
296
|
-
});
|
|
297
|
-
Object.defineProperty(exports, "getUPPCircuitArtifacts", {
|
|
298
|
-
enumerable: true,
|
|
299
|
-
get: function () { return chunkRYEYGGE7_cjs.getUPPCircuitArtifacts; }
|
|
300
|
-
});
|
|
301
|
-
Object.defineProperty(exports, "verifyProof", {
|
|
309
|
+
Object.defineProperty(exports, "STARK_AMOUNT_SCALE", {
|
|
302
310
|
enumerable: true,
|
|
303
|
-
get: function () { return
|
|
311
|
+
get: function () { return chunkSWTNJPK5_cjs.STARK_AMOUNT_SCALE; }
|
|
304
312
|
});
|
|
305
313
|
//# sourceMappingURL=index.cjs.map
|
|
306
314
|
//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ADDRESS_VERSION, k as ASPMembershipProof, D as DirectAccountAdapter, l as IASPProvider, m as IAccountAdapter, n as INoteStore, V as NoteStatus, o as NoteStore, P as ProofSystem, p as STARK_ADDRESS_VERSION, q as STARK_STEALTH_ADDRESS_PREFIX, r as STEALTH_ADDRESS_PREFIX, s as ShieldedNote, t as StorableAccountAdapter, U as UPPClient, u as UPPClientConfig, v as computeNoteEncryptionKey, w as createNote, x as createOneTimeKeys, y as createUPPClient, z as decodeStarkStealthAddress, B as decodeStealthAddress, E as decryptNote, F as detectAddressType, G as encodeStarkStealthAddress, H as encodeStealthAddress, J as encryptNote, K as generateStarkStealthAddress, M as generateStealthAddress, O as isValidStarkStealthAddress, Q as isValidStealthAddress, T as verifyOwnership } from '../index-
|
|
2
|
-
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CircuitArtifacts, c as CircuitType, d as Commitment, D as DEMO_ASP_ID, e as DEMO_ASP_NAME, E as EncryptedNote, M as MergeParams, f as MergeRecord, g as MerkleProofWithNote, N as NOTE_VERSION, h as Note, i as NoteWithAmount, j as Nullifier, P as
|
|
1
|
+
export { A as ADDRESS_VERSION, k as ASPMembershipProof, D as DirectAccountAdapter, l as IASPProvider, m as IAccountAdapter, n as INoteStore, V as NoteStatus, o as NoteStore, P as ProofSystem, p as STARK_ADDRESS_VERSION, q as STARK_STEALTH_ADDRESS_PREFIX, r as STEALTH_ADDRESS_PREFIX, s as ShieldedNote, t as StorableAccountAdapter, U as UPPClient, u as UPPClientConfig, v as computeNoteEncryptionKey, w as createNote, x as createOneTimeKeys, y as createUPPClient, z as decodeStarkStealthAddress, B as decodeStealthAddress, E as decryptNote, F as detectAddressType, G as encodeStarkStealthAddress, H as encodeStealthAddress, J as encryptNote, K as generateStarkStealthAddress, M as generateStealthAddress, O as isValidStarkStealthAddress, Q as isValidStealthAddress, T as verifyOwnership } from '../index-qTwnREeK.cjs';
|
|
2
|
+
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CircuitArtifacts, c as CircuitType, d as Commitment, D as DEMO_ASP_ID, e as DEMO_ASP_NAME, E as EncryptedNote, M as MergeParams, f as MergeRecord, g as MerkleProofWithNote, N as NOTE_VERSION, h as Note, i as NoteWithAmount, j as Nullifier, P as PlonkProvingStage, k as Proof, l as ProofResult, m as ProofWorkerManager, n as ProofWorkerRequest, o as ProofWorkerResponse, R as RATE_PRECISION, S as STATE_TREE_DEPTH, p as SWAP_EVENTS_ABI, q as SWAP_ORDER_CANCELLED_EVENT, r as SWAP_ORDER_CLAIMED_EVENT, s as SWAP_ORDER_FILLED_EVENT, t as SWAP_ORDER_PLACED_EVENT, u as ShieldParams, v as SpendableNote, w as StarkNote, x as StarkProof, y as StarkStealthMetaAddress, z as Stealth1x2CircuitInputs, B as Stealth2x2CircuitInputs, F as StealthAddress, G as StealthCircuitInputs, H as StealthCircuitType, I as StealthMetaAddress, J as SwapFillEvent, K as SwapFillParams, L as SwapOrder, O as SwapOrderEvent, Q as SwapOrderParams, T as TransferBuildResult, U as TransferContext, V as TransferParams, W as TransferStage, X as UPPCircuitInputs, Y as UPPCircuitType, Z as UPPTransferCircuitInputs, _ as UPPWithdrawCircuitInputs, $ as WithdrawParams, a0 as buildASPTree, a1 as buildTransfer, a2 as buildUPPTransferCircuitInputs, a3 as computeCancelKeyHash, a4 as computeFillPercentage, a5 as computeGiveAmount, a6 as computeMultiOriginASPRoot, a7 as computeNullifier, a8 as computeRate, a9 as computeSingleOriginASPRoot, aa as computeTakeAmount, ab as computeTotalBuyAmount, ac as createDemoASPRoot, ad as filterOrdersByASP, ae as filterOrdersByTokenPair, af as formatOutputForContract, ag as formatProofForContract, ah as formatRate, ai as generateASPProof, aj as generateCancelSecret, ak as generateMultiOriginASPProof, al as generateProof, am as generateSingleOriginASPProof, an as generateStealthProof, ao as generateUPPProof, ap as generateUPPProofAsync, aq as getCancelSecret, ar as getMerkleProofsForNotes, as as getOwnOrderIds, at as getStealthCircuitArtifacts, au as getUPPCircuitArtifacts, av as isFillerASPAccepted, aw as isOrderActive, ax as removeCancelSecret, ay as storeCancelSecret, az as syncMerkleTree, aA as verifyASPProof, aB as verifyProof } from '../transfer-BDYID3Hn.cjs';
|
|
3
3
|
export { S as STARK_AMOUNT_SCALE } from '../stark-BcTD1OaJ.cjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../types-CJSbxv4q.cjs';
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ADDRESS_VERSION, k as ASPMembershipProof, D as DirectAccountAdapter, l as IASPProvider, m as IAccountAdapter, n as INoteStore, V as NoteStatus, o as NoteStore, P as ProofSystem, p as STARK_ADDRESS_VERSION, q as STARK_STEALTH_ADDRESS_PREFIX, r as STEALTH_ADDRESS_PREFIX, s as ShieldedNote, t as StorableAccountAdapter, U as UPPClient, u as UPPClientConfig, v as computeNoteEncryptionKey, w as createNote, x as createOneTimeKeys, y as createUPPClient, z as decodeStarkStealthAddress, B as decodeStealthAddress, E as decryptNote, F as detectAddressType, G as encodeStarkStealthAddress, H as encodeStealthAddress, J as encryptNote, K as generateStarkStealthAddress, M as generateStealthAddress, O as isValidStarkStealthAddress, Q as isValidStealthAddress, T as verifyOwnership } from '../index
|
|
2
|
-
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CircuitArtifacts, c as CircuitType, d as Commitment, D as DEMO_ASP_ID, e as DEMO_ASP_NAME, E as EncryptedNote, M as MergeParams, f as MergeRecord, g as MerkleProofWithNote, N as NOTE_VERSION, h as Note, i as NoteWithAmount, j as Nullifier, P as
|
|
1
|
+
export { A as ADDRESS_VERSION, k as ASPMembershipProof, D as DirectAccountAdapter, l as IASPProvider, m as IAccountAdapter, n as INoteStore, V as NoteStatus, o as NoteStore, P as ProofSystem, p as STARK_ADDRESS_VERSION, q as STARK_STEALTH_ADDRESS_PREFIX, r as STEALTH_ADDRESS_PREFIX, s as ShieldedNote, t as StorableAccountAdapter, U as UPPClient, u as UPPClientConfig, v as computeNoteEncryptionKey, w as createNote, x as createOneTimeKeys, y as createUPPClient, z as decodeStarkStealthAddress, B as decodeStealthAddress, E as decryptNote, F as detectAddressType, G as encodeStarkStealthAddress, H as encodeStealthAddress, J as encryptNote, K as generateStarkStealthAddress, M as generateStealthAddress, O as isValidStarkStealthAddress, Q as isValidStealthAddress, T as verifyOwnership } from '../index-S2fzWmLW.js';
|
|
2
|
+
export { A as ASPProof, a as ASPRoot, b as ASP_TREE_DEPTH, C as CircuitArtifacts, c as CircuitType, d as Commitment, D as DEMO_ASP_ID, e as DEMO_ASP_NAME, E as EncryptedNote, M as MergeParams, f as MergeRecord, g as MerkleProofWithNote, N as NOTE_VERSION, h as Note, i as NoteWithAmount, j as Nullifier, P as PlonkProvingStage, k as Proof, l as ProofResult, m as ProofWorkerManager, n as ProofWorkerRequest, o as ProofWorkerResponse, R as RATE_PRECISION, S as STATE_TREE_DEPTH, p as SWAP_EVENTS_ABI, q as SWAP_ORDER_CANCELLED_EVENT, r as SWAP_ORDER_CLAIMED_EVENT, s as SWAP_ORDER_FILLED_EVENT, t as SWAP_ORDER_PLACED_EVENT, u as ShieldParams, v as SpendableNote, w as StarkNote, x as StarkProof, y as StarkStealthMetaAddress, z as Stealth1x2CircuitInputs, B as Stealth2x2CircuitInputs, F as StealthAddress, G as StealthCircuitInputs, H as StealthCircuitType, I as StealthMetaAddress, J as SwapFillEvent, K as SwapFillParams, L as SwapOrder, O as SwapOrderEvent, Q as SwapOrderParams, T as TransferBuildResult, U as TransferContext, V as TransferParams, W as TransferStage, X as UPPCircuitInputs, Y as UPPCircuitType, Z as UPPTransferCircuitInputs, _ as UPPWithdrawCircuitInputs, $ as WithdrawParams, a0 as buildASPTree, a1 as buildTransfer, a2 as buildUPPTransferCircuitInputs, a3 as computeCancelKeyHash, a4 as computeFillPercentage, a5 as computeGiveAmount, a6 as computeMultiOriginASPRoot, a7 as computeNullifier, a8 as computeRate, a9 as computeSingleOriginASPRoot, aa as computeTakeAmount, ab as computeTotalBuyAmount, ac as createDemoASPRoot, ad as filterOrdersByASP, ae as filterOrdersByTokenPair, af as formatOutputForContract, ag as formatProofForContract, ah as formatRate, ai as generateASPProof, aj as generateCancelSecret, ak as generateMultiOriginASPProof, al as generateProof, am as generateSingleOriginASPProof, an as generateStealthProof, ao as generateUPPProof, ap as generateUPPProofAsync, aq as getCancelSecret, ar as getMerkleProofsForNotes, as as getOwnOrderIds, at as getStealthCircuitArtifacts, au as getUPPCircuitArtifacts, av as isFillerASPAccepted, aw as isOrderActive, ax as removeCancelSecret, ay as storeCancelSecret, az as syncMerkleTree, aA as verifyASPProof, aB as verifyProof } from '../transfer-DLukr6ed.js';
|
|
3
3
|
export { S as STARK_AMOUNT_SCALE } from '../stark-BcTD1OaJ.js';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../types-mLybMxNR.js';
|
package/dist/core/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { NOTE_VERSION, createNote, createUPPClient, decryptNote, encryptNote } from '../chunk-
|
|
2
|
-
export { buildTransfer, buildUPPTransferCircuitInputs, computeNullifier, formatOutputForContract, getMerkleProofsForNotes, syncMerkleTree } from '../chunk-
|
|
1
|
+
export { NOTE_VERSION, createNote, createUPPClient, decryptNote, encryptNote } from '../chunk-5WLAZA3M.js';
|
|
2
|
+
export { buildTransfer, buildUPPTransferCircuitInputs, computeNullifier, formatOutputForContract, getMerkleProofsForNotes, syncMerkleTree } from '../chunk-GQ6JMNJI.js';
|
|
3
|
+
export { ASP_TREE_DEPTH, STATE_TREE_DEPTH, formatProofForContract, generateProof, generateStealthProof, generateUPPProof, getStealthCircuitArtifacts, getUPPCircuitArtifacts, verifyProof } from '../chunk-KRLRJ3HN.js';
|
|
4
|
+
export { ADDRESS_VERSION, DirectAccountAdapter, NoteStore, ProofWorkerManager, RATE_PRECISION, STARK_ADDRESS_VERSION, STARK_STEALTH_ADDRESS_PREFIX, STEALTH_ADDRESS_PREFIX, SWAP_EVENTS_ABI, SWAP_ORDER_CANCELLED_EVENT, SWAP_ORDER_CLAIMED_EVENT, SWAP_ORDER_FILLED_EVENT, SWAP_ORDER_PLACED_EVENT, StorableAccountAdapter, computeCancelKeyHash, computeFillPercentage, computeGiveAmount, computeNoteEncryptionKey, computeRate, computeTakeAmount, computeTotalBuyAmount, createOneTimeKeys, decodeStarkStealthAddress, decodeStealthAddress, detectAddressType, encodeStarkStealthAddress, encodeStealthAddress, filterOrdersByASP, filterOrdersByTokenPair, formatRate, generateCancelSecret, generateStarkStealthAddress, generateStealthAddress, generateUPPProofAsync, getCancelSecret, getOwnOrderIds, isFillerASPAccepted, isOrderActive, isValidStarkStealthAddress, isValidStealthAddress, removeCancelSecret, storeCancelSecret, verifyOwnership } from '../chunk-NIGEAKQP.js';
|
|
5
|
+
export { DEMO_ASP_ID, DEMO_ASP_NAME, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, createDemoASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof, verifyASPProof } from '../chunk-6IEYWJVS.js';
|
|
3
6
|
export { STARK_AMOUNT_SCALE } from '../chunk-7T4CUE6E.js';
|
|
4
7
|
import '../chunk-GPF72JFR.js';
|
|
5
8
|
import '../chunk-6TFDBBAQ.js';
|
|
6
|
-
export { ADDRESS_VERSION, DirectAccountAdapter, NoteStore, RATE_PRECISION, STARK_ADDRESS_VERSION, STARK_STEALTH_ADDRESS_PREFIX, STEALTH_ADDRESS_PREFIX, SWAP_EVENTS_ABI, SWAP_ORDER_CANCELLED_EVENT, SWAP_ORDER_CLAIMED_EVENT, SWAP_ORDER_FILLED_EVENT, SWAP_ORDER_PLACED_EVENT, StorableAccountAdapter, computeCancelKeyHash, computeFillPercentage, computeGiveAmount, computeNoteEncryptionKey, computeRate, computeTakeAmount, computeTotalBuyAmount, createOneTimeKeys, decodeStarkStealthAddress, decodeStealthAddress, detectAddressType, encodeStarkStealthAddress, encodeStealthAddress, filterOrdersByASP, filterOrdersByTokenPair, formatRate, generateCancelSecret, generateStarkStealthAddress, generateStealthAddress, getCancelSecret, getOwnOrderIds, isFillerASPAccepted, isOrderActive, isValidStarkStealthAddress, isValidStealthAddress, removeCancelSecret, storeCancelSecret, verifyOwnership } from '../chunk-RNUG3EFC.js';
|
|
7
|
-
export { DEMO_ASP_ID, DEMO_ASP_NAME, buildASPTree, computeMultiOriginASPRoot, computeSingleOriginASPRoot, createDemoASPRoot, generateASPProof, generateMultiOriginASPProof, generateSingleOriginASPProof, verifyASPProof } from '../chunk-6IEYWJVS.js';
|
|
8
9
|
import '../chunk-UQIM2KT3.js';
|
|
9
10
|
import '../chunk-5QSSX3KR.js';
|
|
10
|
-
export { ASP_TREE_DEPTH, STATE_TREE_DEPTH, formatProofForContract, generateProof, generateStealthProof, generateUPPProof, getStealthCircuitArtifacts, getUPPCircuitArtifacts, verifyProof } from '../chunk-KRLRJ3HN.js';
|
|
11
11
|
import '../chunk-Z6ZWNWWR.js';
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/core/proof-worker-entry.ts
|
|
4
|
+
var ctx = globalThis;
|
|
5
|
+
var snarkjsModule = null;
|
|
6
|
+
async function loadSnarkjs() {
|
|
7
|
+
if (snarkjsModule) return snarkjsModule;
|
|
8
|
+
snarkjsModule = await import('snarkjs');
|
|
9
|
+
return snarkjsModule;
|
|
10
|
+
}
|
|
11
|
+
function getArtifactUrls(circuitType, baseUrl) {
|
|
12
|
+
const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
|
|
13
|
+
return {
|
|
14
|
+
wasm: `${base}${circuitType}.wasm`,
|
|
15
|
+
zkey: `${base}${circuitType}.zkey`
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
ctx.onmessage = async (e) => {
|
|
19
|
+
const { type, id, circuitType, inputs, baseUrl } = e.data;
|
|
20
|
+
if (type !== "prove") return;
|
|
21
|
+
try {
|
|
22
|
+
ctx.postMessage({ type: "progress", id, stage: "loading", message: "Loading circuit artifacts..." });
|
|
23
|
+
const snarkjs = await loadSnarkjs();
|
|
24
|
+
const artifacts = getArtifactUrls(circuitType, baseUrl);
|
|
25
|
+
const logger = {
|
|
26
|
+
debug: (msg) => {
|
|
27
|
+
if (msg.includes("ROUND 1")) ctx.postMessage({ type: "progress", id, stage: "round1", message: "Computing wire polynomials..." });
|
|
28
|
+
else if (msg.includes("ROUND 2")) ctx.postMessage({ type: "progress", id, stage: "round2", message: "Computing permutation polynomial..." });
|
|
29
|
+
else if (msg.includes("ROUND 3")) ctx.postMessage({ type: "progress", id, stage: "round3", message: "Computing quotient polynomial..." });
|
|
30
|
+
else if (msg.includes("ROUND 4")) ctx.postMessage({ type: "progress", id, stage: "round4", message: "Computing evaluations..." });
|
|
31
|
+
else if (msg.includes("ROUND 5")) ctx.postMessage({ type: "progress", id, stage: "round5", message: "Computing opening proofs..." });
|
|
32
|
+
else if (msg.includes("PROVER FINISHED")) ctx.postMessage({ type: "progress", id, stage: "done", message: "Proof complete" });
|
|
33
|
+
},
|
|
34
|
+
info: () => {
|
|
35
|
+
},
|
|
36
|
+
warn: () => {
|
|
37
|
+
},
|
|
38
|
+
error: () => {
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
ctx.postMessage({ type: "progress", id, stage: "witness", message: "Computing witness..." });
|
|
42
|
+
const result = await snarkjs.plonk.fullProve(inputs, artifacts.wasm, artifacts.zkey, logger);
|
|
43
|
+
ctx.postMessage({
|
|
44
|
+
type: "result",
|
|
45
|
+
id,
|
|
46
|
+
proof: {
|
|
47
|
+
proof: { proof: result.proof, publicSignals: result.publicSignals },
|
|
48
|
+
publicSignals: result.publicSignals
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} catch (err) {
|
|
52
|
+
ctx.postMessage({
|
|
53
|
+
type: "error",
|
|
54
|
+
id,
|
|
55
|
+
message: err?.message || String(err)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=proof-worker-entry.cjs.map
|
|
60
|
+
//# sourceMappingURL=proof-worker-entry.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/proof-worker-entry.ts"],"names":[],"mappings":";;;AAWA,IAAM,GAAA,GAAM,UAAA;AAEZ,IAAI,aAAA,GAAqB,IAAA;AAEzB,eAAe,WAAA,GAAc;AAC3B,EAAA,IAAI,eAAe,OAAO,aAAA;AAC1B,EAAA,aAAA,GAAgB,MAAM,OAAO,SAAS,CAAA;AACtC,EAAA,OAAO,aAAA;AACT;AAGA,SAAS,eAAA,CAAgB,aAAqB,OAAA,EAAiB;AAC7D,EAAA,MAAM,OAAO,OAAA,CAAQ,QAAA,CAAS,GAAG,CAAA,GAAI,UAAU,OAAA,GAAU,GAAA;AACzD,EAAA,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A,MACA,OAAA,EAAS,GAAA,EAAK,OAAA,IAAW,MAAA,CAAO,GAAG;AAAA,KACpC,CAAA;AAAA,EACH;AACF,CAAA","file":"proof-worker-entry.cjs","sourcesContent":["/**\n * Web Worker entry point for PLONK proof generation.\n *\n * This file runs inside a Web Worker context. It dynamically imports snarkjs\n * and handles proof generation requests from the main thread.\n *\n * Usage (from consumer):\n * new Worker(new URL('@permissionless-technologies/upp-sdk/worker', import.meta.url))\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst ctx = globalThis as any\n\nlet snarkjsModule: any = null\n\nasync function loadSnarkjs() {\n if (snarkjsModule) return snarkjsModule\n snarkjsModule = await import('snarkjs')\n return snarkjsModule\n}\n\n// Circuit type → artifact filenames (must match proof.ts getUPPCircuitArtifacts)\nfunction getArtifactUrls(circuitType: string, baseUrl: string) {\n const base = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/'\n return {\n wasm: `${base}${circuitType}.wasm`,\n zkey: `${base}${circuitType}.zkey`,\n }\n}\n\nctx.onmessage = async (e: MessageEvent) => {\n const { type, id, circuitType, inputs, baseUrl } = e.data\n if (type !== 'prove') return\n\n try {\n ctx.postMessage({ type: 'progress', id, stage: 'loading', message: 'Loading circuit artifacts...' })\n\n const snarkjs = await loadSnarkjs()\n const artifacts = getArtifactUrls(circuitType, baseUrl)\n\n const logger = {\n debug: (msg: string) => {\n if (msg.includes('ROUND 1')) ctx.postMessage({ type: 'progress', id, stage: 'round1', message: 'Computing wire polynomials...' })\n else if (msg.includes('ROUND 2')) ctx.postMessage({ type: 'progress', id, stage: 'round2', message: 'Computing permutation polynomial...' })\n else if (msg.includes('ROUND 3')) ctx.postMessage({ type: 'progress', id, stage: 'round3', message: 'Computing quotient polynomial...' })\n else if (msg.includes('ROUND 4')) ctx.postMessage({ type: 'progress', id, stage: 'round4', message: 'Computing evaluations...' })\n else if (msg.includes('ROUND 5')) ctx.postMessage({ type: 'progress', id, stage: 'round5', message: 'Computing opening proofs...' })\n else if (msg.includes('PROVER FINISHED')) ctx.postMessage({ type: 'progress', id, stage: 'done', message: 'Proof complete' })\n },\n info: () => {},\n warn: () => {},\n error: () => {},\n }\n\n ctx.postMessage({ type: 'progress', id, stage: 'witness', message: 'Computing witness...' })\n\n const result = await snarkjs.plonk.fullProve(inputs, artifacts.wasm, artifacts.zkey, logger)\n\n ctx.postMessage({\n type: 'result',\n id,\n proof: {\n proof: { proof: result.proof, publicSignals: result.publicSignals },\n publicSignals: result.publicSignals,\n },\n })\n } catch (err: any) {\n ctx.postMessage({\n type: 'error',\n id,\n message: err?.message || String(err),\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/core/proof-worker-entry.ts
|
|
2
|
+
var ctx = globalThis;
|
|
3
|
+
var snarkjsModule = null;
|
|
4
|
+
async function loadSnarkjs() {
|
|
5
|
+
if (snarkjsModule) return snarkjsModule;
|
|
6
|
+
snarkjsModule = await import('snarkjs');
|
|
7
|
+
return snarkjsModule;
|
|
8
|
+
}
|
|
9
|
+
function getArtifactUrls(circuitType, baseUrl) {
|
|
10
|
+
const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
|
|
11
|
+
return {
|
|
12
|
+
wasm: `${base}${circuitType}.wasm`,
|
|
13
|
+
zkey: `${base}${circuitType}.zkey`
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
ctx.onmessage = async (e) => {
|
|
17
|
+
const { type, id, circuitType, inputs, baseUrl } = e.data;
|
|
18
|
+
if (type !== "prove") return;
|
|
19
|
+
try {
|
|
20
|
+
ctx.postMessage({ type: "progress", id, stage: "loading", message: "Loading circuit artifacts..." });
|
|
21
|
+
const snarkjs = await loadSnarkjs();
|
|
22
|
+
const artifacts = getArtifactUrls(circuitType, baseUrl);
|
|
23
|
+
const logger = {
|
|
24
|
+
debug: (msg) => {
|
|
25
|
+
if (msg.includes("ROUND 1")) ctx.postMessage({ type: "progress", id, stage: "round1", message: "Computing wire polynomials..." });
|
|
26
|
+
else if (msg.includes("ROUND 2")) ctx.postMessage({ type: "progress", id, stage: "round2", message: "Computing permutation polynomial..." });
|
|
27
|
+
else if (msg.includes("ROUND 3")) ctx.postMessage({ type: "progress", id, stage: "round3", message: "Computing quotient polynomial..." });
|
|
28
|
+
else if (msg.includes("ROUND 4")) ctx.postMessage({ type: "progress", id, stage: "round4", message: "Computing evaluations..." });
|
|
29
|
+
else if (msg.includes("ROUND 5")) ctx.postMessage({ type: "progress", id, stage: "round5", message: "Computing opening proofs..." });
|
|
30
|
+
else if (msg.includes("PROVER FINISHED")) ctx.postMessage({ type: "progress", id, stage: "done", message: "Proof complete" });
|
|
31
|
+
},
|
|
32
|
+
info: () => {
|
|
33
|
+
},
|
|
34
|
+
warn: () => {
|
|
35
|
+
},
|
|
36
|
+
error: () => {
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
ctx.postMessage({ type: "progress", id, stage: "witness", message: "Computing witness..." });
|
|
40
|
+
const result = await snarkjs.plonk.fullProve(inputs, artifacts.wasm, artifacts.zkey, logger);
|
|
41
|
+
ctx.postMessage({
|
|
42
|
+
type: "result",
|
|
43
|
+
id,
|
|
44
|
+
proof: {
|
|
45
|
+
proof: { proof: result.proof, publicSignals: result.publicSignals },
|
|
46
|
+
publicSignals: result.publicSignals
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
} catch (err) {
|
|
50
|
+
ctx.postMessage({
|
|
51
|
+
type: "error",
|
|
52
|
+
id,
|
|
53
|
+
message: err?.message || String(err)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=proof-worker-entry.js.map
|
|
58
|
+
//# sourceMappingURL=proof-worker-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/proof-worker-entry.ts"],"names":[],"mappings":";AAWA,IAAM,GAAA,GAAM,UAAA;AAEZ,IAAI,aAAA,GAAqB,IAAA;AAEzB,eAAe,WAAA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;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAO,EAAE,KAAA,EAAO,OAAO,KAAA,EAAO,aAAA,EAAe,OAAO,aAAA,EAAc;AAAA,QAClE,eAAe,MAAA,CAAO;AAAA;AACxB,KACD,CAAA;AAAA,EACH,SAAS,GAAA,EAAU;AACjB,IAAA,GAAA,CAAI,WAAA,CAAY;AAAA,MACd,IAAA,EAAM,OAAA;AAAA,MACN,EAAA;AAAA,MACA,OAAA,EAAS,GAAA,EAAK,OAAA,IAAW,MAAA,CAAO,GAAG;AAAA,KACpC,CAAA;AAAA,EACH;AACF,CAAA","file":"proof-worker-entry.js","sourcesContent":["/**\n * Web Worker entry point for PLONK proof generation.\n *\n * This file runs inside a Web Worker context. It dynamically imports snarkjs\n * and handles proof generation requests from the main thread.\n *\n * Usage (from consumer):\n * new Worker(new URL('@permissionless-technologies/upp-sdk/worker', import.meta.url))\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst ctx = globalThis as any\n\nlet snarkjsModule: any = null\n\nasync function loadSnarkjs() {\n if (snarkjsModule) return snarkjsModule\n snarkjsModule = await import('snarkjs')\n return snarkjsModule\n}\n\n// Circuit type → artifact filenames (must match proof.ts getUPPCircuitArtifacts)\nfunction getArtifactUrls(circuitType: string, baseUrl: string) {\n const base = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/'\n return {\n wasm: `${base}${circuitType}.wasm`,\n zkey: `${base}${circuitType}.zkey`,\n }\n}\n\nctx.onmessage = async (e: MessageEvent) => {\n const { type, id, circuitType, inputs, baseUrl } = e.data\n if (type !== 'prove') return\n\n try {\n ctx.postMessage({ type: 'progress', id, stage: 'loading', message: 'Loading circuit artifacts...' })\n\n const snarkjs = await loadSnarkjs()\n const artifacts = getArtifactUrls(circuitType, baseUrl)\n\n const logger = {\n debug: (msg: string) => {\n if (msg.includes('ROUND 1')) ctx.postMessage({ type: 'progress', id, stage: 'round1', message: 'Computing wire polynomials...' })\n else if (msg.includes('ROUND 2')) ctx.postMessage({ type: 'progress', id, stage: 'round2', message: 'Computing permutation polynomial...' })\n else if (msg.includes('ROUND 3')) ctx.postMessage({ type: 'progress', id, stage: 'round3', message: 'Computing quotient polynomial...' })\n else if (msg.includes('ROUND 4')) ctx.postMessage({ type: 'progress', id, stage: 'round4', message: 'Computing evaluations...' })\n else if (msg.includes('ROUND 5')) ctx.postMessage({ type: 'progress', id, stage: 'round5', message: 'Computing opening proofs...' })\n else if (msg.includes('PROVER FINISHED')) ctx.postMessage({ type: 'progress', id, stage: 'done', message: 'Proof complete' })\n },\n info: () => {},\n warn: () => {},\n error: () => {},\n }\n\n ctx.postMessage({ type: 'progress', id, stage: 'witness', message: 'Computing witness...' })\n\n const result = await snarkjs.plonk.fullProve(inputs, artifacts.wasm, artifacts.zkey, logger)\n\n ctx.postMessage({\n type: 'result',\n id,\n proof: {\n proof: { proof: result.proof, publicSignals: result.publicSignals },\n publicSignals: result.publicSignals,\n },\n })\n } catch (err: any) {\n ctx.postMessage({\n type: 'error',\n id,\n message: err?.message || String(err),\n })\n }\n}\n"]}
|