@0xbow/privacy-pools-core-sdk 0.0.0-c084059

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.
Files changed (97) hide show
  1. package/README.md +73 -0
  2. package/dist/esm/ccip-nJye9Itm.js +166 -0
  3. package/dist/esm/ccip-nJye9Itm.js.map +1 -0
  4. package/dist/esm/index-DAWUECi8.js +84043 -0
  5. package/dist/esm/index-DAWUECi8.js.map +1 -0
  6. package/dist/esm/index.mjs +4 -0
  7. package/dist/esm/index.mjs.map +1 -0
  8. package/dist/index.d.mts +666 -0
  9. package/dist/node/ccip-lPhPeJab.js +183 -0
  10. package/dist/node/ccip-lPhPeJab.js.map +1 -0
  11. package/dist/node/index-BiU5Ef8Z.js +90625 -0
  12. package/dist/node/index-BiU5Ef8Z.js.map +1 -0
  13. package/dist/node/index.mjs +21 -0
  14. package/dist/node/index.mjs.map +1 -0
  15. package/dist/types/abi/ERC20.d.ts +38 -0
  16. package/dist/types/abi/IEntrypoint.d.ts +794 -0
  17. package/dist/types/abi/IPrivacyPool.d.ts +51 -0
  18. package/dist/types/ccip-BZzz1Y5w.js +182 -0
  19. package/dist/types/circuits/circuits.impl.d.ts +108 -0
  20. package/dist/types/circuits/circuits.interface.d.ts +127 -0
  21. package/dist/types/circuits/index.d.ts +2 -0
  22. package/dist/types/constants.d.ts +2 -0
  23. package/dist/types/core/bruteForce.service.d.ts +61 -0
  24. package/dist/types/core/commitment.service.d.ts +30 -0
  25. package/dist/types/core/contracts.service.d.ts +106 -0
  26. package/dist/types/core/sdk.d.ts +44 -0
  27. package/dist/types/core/withdrawal.service.d.ts +32 -0
  28. package/dist/types/crypto.d.ts +45 -0
  29. package/dist/types/dirname.helper.d.ts +2 -0
  30. package/dist/types/errors/base.error.d.ts +52 -0
  31. package/dist/types/exceptions/circuitInitialization.exception.d.ts +3 -0
  32. package/dist/types/exceptions/fetchArtifacts.exception.d.ts +3 -0
  33. package/dist/types/exceptions/index.d.ts +4 -0
  34. package/dist/types/exceptions/invalidRpcUrl.exception.d.ts +3 -0
  35. package/dist/types/exceptions/privacyPool.exception.d.ts +13 -0
  36. package/dist/types/external.d.ts +7 -0
  37. package/dist/types/filename.helper.d.ts +2 -0
  38. package/dist/types/index-D-_1h8-n.js +90638 -0
  39. package/dist/types/index.d.ts +10 -0
  40. package/dist/types/index.js +20 -0
  41. package/dist/types/interfaces/blockchainProvider.interface.d.ts +12 -0
  42. package/dist/types/interfaces/circuits.interface.d.ts +30 -0
  43. package/dist/types/interfaces/contracts.interface.d.ts +28 -0
  44. package/dist/types/interfaces/index.d.ts +1 -0
  45. package/dist/types/internal.d.ts +6 -0
  46. package/dist/types/providers/blockchainProvider.d.ts +8 -0
  47. package/dist/types/providers/index.d.ts +1 -0
  48. package/dist/types/types/commitment.d.ts +48 -0
  49. package/dist/types/types/index.d.ts +2 -0
  50. package/dist/types/types/withdrawal.d.ts +30 -0
  51. package/package.json +81 -0
  52. package/src/abi/ERC20.ts +222 -0
  53. package/src/abi/IEntrypoint.ts +1059 -0
  54. package/src/abi/IPrivacyPool.ts +576 -0
  55. package/src/circuits/circuits.impl.ts +232 -0
  56. package/src/circuits/circuits.interface.ts +166 -0
  57. package/src/circuits/fetchArtifacts.esm.ts +12 -0
  58. package/src/circuits/fetchArtifacts.node.ts +23 -0
  59. package/src/circuits/fetchArtifacts.ts +7 -0
  60. package/src/circuits/index.ts +2 -0
  61. package/src/constants.ts +3 -0
  62. package/src/core/account.service.ts +1077 -0
  63. package/src/core/bruteForce.service.ts +120 -0
  64. package/src/core/commitment.service.ts +84 -0
  65. package/src/core/contracts.service.ts +442 -0
  66. package/src/core/data.service.ts +272 -0
  67. package/src/core/sdk.ts +92 -0
  68. package/src/core/withdrawal.service.ts +126 -0
  69. package/src/crypto.ts +226 -0
  70. package/src/dirname.helper.ts +4 -0
  71. package/src/errors/account.error.ts +49 -0
  72. package/src/errors/base.error.ts +125 -0
  73. package/src/errors/data.error.ts +34 -0
  74. package/src/errors/events.error.ts +38 -0
  75. package/src/exceptions/circuitInitialization.exception.ts +6 -0
  76. package/src/exceptions/fetchArtifacts.exception.ts +7 -0
  77. package/src/exceptions/index.ts +4 -0
  78. package/src/exceptions/invalidRpcUrl.exception.ts +6 -0
  79. package/src/exceptions/privacyPool.exception.ts +19 -0
  80. package/src/external.ts +13 -0
  81. package/src/filename.helper.ts +4 -0
  82. package/src/index.ts +21 -0
  83. package/src/interfaces/blockchainProvider.interface.ts +13 -0
  84. package/src/interfaces/circuits.interface.ts +34 -0
  85. package/src/interfaces/contracts.interface.ts +66 -0
  86. package/src/interfaces/index.ts +1 -0
  87. package/src/internal.ts +6 -0
  88. package/src/keys.ts +42 -0
  89. package/src/providers/blockchainProvider.ts +26 -0
  90. package/src/providers/index.ts +1 -0
  91. package/src/types/account.ts +35 -0
  92. package/src/types/commitment.ts +50 -0
  93. package/src/types/events.ts +82 -0
  94. package/src/types/index.ts +3 -0
  95. package/src/types/keys.ts +6 -0
  96. package/src/types/withdrawal.ts +33 -0
  97. package/src/utils/logger.ts +56 -0
@@ -0,0 +1,576 @@
1
+ export const IPrivacyPoolABI = [
2
+ {
3
+ "type": "function",
4
+ "name": "ASSET",
5
+ "inputs": [],
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "address",
10
+ "internalType": "address"
11
+ }
12
+ ],
13
+ "stateMutability": "view"
14
+ },
15
+ {
16
+ "type": "function",
17
+ "name": "ENTRYPOINT",
18
+ "inputs": [],
19
+ "outputs": [
20
+ {
21
+ "name": "",
22
+ "type": "address",
23
+ "internalType": "contract IEntrypoint"
24
+ }
25
+ ],
26
+ "stateMutability": "view"
27
+ },
28
+ {
29
+ "type": "function",
30
+ "name": "MAX_TREE_DEPTH",
31
+ "inputs": [],
32
+ "outputs": [
33
+ {
34
+ "name": "",
35
+ "type": "uint32",
36
+ "internalType": "uint32"
37
+ }
38
+ ],
39
+ "stateMutability": "view"
40
+ },
41
+ {
42
+ "type": "function",
43
+ "name": "RAGEQUIT_VERIFIER",
44
+ "inputs": [],
45
+ "outputs": [
46
+ {
47
+ "name": "",
48
+ "type": "address",
49
+ "internalType": "contract IVerifier"
50
+ }
51
+ ],
52
+ "stateMutability": "view"
53
+ },
54
+ {
55
+ "type": "function",
56
+ "name": "ROOT_HISTORY_SIZE",
57
+ "inputs": [],
58
+ "outputs": [
59
+ {
60
+ "name": "",
61
+ "type": "uint32",
62
+ "internalType": "uint32"
63
+ }
64
+ ],
65
+ "stateMutability": "view"
66
+ },
67
+ {
68
+ "type": "function",
69
+ "name": "SCOPE",
70
+ "inputs": [],
71
+ "outputs": [
72
+ {
73
+ "name": "",
74
+ "type": "uint256",
75
+ "internalType": "uint256"
76
+ }
77
+ ],
78
+ "stateMutability": "view"
79
+ },
80
+ {
81
+ "type": "function",
82
+ "name": "WITHDRAWAL_VERIFIER",
83
+ "inputs": [],
84
+ "outputs": [
85
+ {
86
+ "name": "",
87
+ "type": "address",
88
+ "internalType": "contract IVerifier"
89
+ }
90
+ ],
91
+ "stateMutability": "view"
92
+ },
93
+ {
94
+ "type": "function",
95
+ "name": "currentRoot",
96
+ "inputs": [],
97
+ "outputs": [
98
+ {
99
+ "name": "_root",
100
+ "type": "uint256",
101
+ "internalType": "uint256"
102
+ }
103
+ ],
104
+ "stateMutability": "view"
105
+ },
106
+ {
107
+ "type": "function",
108
+ "name": "currentRootIndex",
109
+ "inputs": [],
110
+ "outputs": [
111
+ {
112
+ "name": "",
113
+ "type": "uint32",
114
+ "internalType": "uint32"
115
+ }
116
+ ],
117
+ "stateMutability": "view"
118
+ },
119
+ {
120
+ "type": "function",
121
+ "name": "currentTreeDepth",
122
+ "inputs": [],
123
+ "outputs": [
124
+ {
125
+ "name": "_depth",
126
+ "type": "uint256",
127
+ "internalType": "uint256"
128
+ }
129
+ ],
130
+ "stateMutability": "view"
131
+ },
132
+ {
133
+ "type": "function",
134
+ "name": "currentTreeSize",
135
+ "inputs": [],
136
+ "outputs": [
137
+ {
138
+ "name": "_size",
139
+ "type": "uint256",
140
+ "internalType": "uint256"
141
+ }
142
+ ],
143
+ "stateMutability": "view"
144
+ },
145
+ {
146
+ "type": "function",
147
+ "name": "dead",
148
+ "inputs": [],
149
+ "outputs": [
150
+ {
151
+ "name": "",
152
+ "type": "bool",
153
+ "internalType": "bool"
154
+ }
155
+ ],
156
+ "stateMutability": "view"
157
+ },
158
+ {
159
+ "type": "function",
160
+ "name": "deposit",
161
+ "inputs": [
162
+ {
163
+ "name": "_depositor",
164
+ "type": "address",
165
+ "internalType": "address"
166
+ },
167
+ {
168
+ "name": "_value",
169
+ "type": "uint256",
170
+ "internalType": "uint256"
171
+ },
172
+ {
173
+ "name": "_precommitmentHash",
174
+ "type": "uint256",
175
+ "internalType": "uint256"
176
+ }
177
+ ],
178
+ "outputs": [
179
+ {
180
+ "name": "_commitment",
181
+ "type": "uint256",
182
+ "internalType": "uint256"
183
+ }
184
+ ],
185
+ "stateMutability": "payable"
186
+ },
187
+ {
188
+ "type": "function",
189
+ "name": "depositors",
190
+ "inputs": [
191
+ {
192
+ "name": "_label",
193
+ "type": "uint256",
194
+ "internalType": "uint256"
195
+ }
196
+ ],
197
+ "outputs": [
198
+ {
199
+ "name": "_depositooor",
200
+ "type": "address",
201
+ "internalType": "address"
202
+ }
203
+ ],
204
+ "stateMutability": "view"
205
+ },
206
+ {
207
+ "type": "function",
208
+ "name": "nonce",
209
+ "inputs": [],
210
+ "outputs": [
211
+ {
212
+ "name": "",
213
+ "type": "uint256",
214
+ "internalType": "uint256"
215
+ }
216
+ ],
217
+ "stateMutability": "view"
218
+ },
219
+ {
220
+ "type": "function",
221
+ "name": "nullifierHashes",
222
+ "inputs": [
223
+ {
224
+ "name": "_nullifierHash",
225
+ "type": "uint256",
226
+ "internalType": "uint256"
227
+ }
228
+ ],
229
+ "outputs": [
230
+ {
231
+ "name": "_spent",
232
+ "type": "bool",
233
+ "internalType": "bool"
234
+ }
235
+ ],
236
+ "stateMutability": "view"
237
+ },
238
+ {
239
+ "type": "function",
240
+ "name": "ragequit",
241
+ "inputs": [
242
+ {
243
+ "name": "_proof",
244
+ "type": "tuple",
245
+ "internalType": "struct ProofLib.RagequitProof",
246
+ "components": [
247
+ {
248
+ "name": "pA",
249
+ "type": "uint256[2]",
250
+ "internalType": "uint256[2]"
251
+ },
252
+ {
253
+ "name": "pB",
254
+ "type": "uint256[2][2]",
255
+ "internalType": "uint256[2][2]"
256
+ },
257
+ {
258
+ "name": "pC",
259
+ "type": "uint256[2]",
260
+ "internalType": "uint256[2]"
261
+ },
262
+ {
263
+ "name": "pubSignals",
264
+ "type": "uint256[4]",
265
+ "internalType": "uint256[4]"
266
+ }
267
+ ]
268
+ }
269
+ ],
270
+ "outputs": [],
271
+ "stateMutability": "nonpayable"
272
+ },
273
+ {
274
+ "type": "function",
275
+ "name": "roots",
276
+ "inputs": [
277
+ {
278
+ "name": "_index",
279
+ "type": "uint256",
280
+ "internalType": "uint256"
281
+ }
282
+ ],
283
+ "outputs": [
284
+ {
285
+ "name": "_root",
286
+ "type": "uint256",
287
+ "internalType": "uint256"
288
+ }
289
+ ],
290
+ "stateMutability": "view"
291
+ },
292
+ {
293
+ "type": "function",
294
+ "name": "windDown",
295
+ "inputs": [],
296
+ "outputs": [],
297
+ "stateMutability": "nonpayable"
298
+ },
299
+ {
300
+ "type": "function",
301
+ "name": "withdraw",
302
+ "inputs": [
303
+ {
304
+ "name": "_withdrawal",
305
+ "type": "tuple",
306
+ "internalType": "struct IPrivacyPool.Withdrawal",
307
+ "components": [
308
+ {
309
+ "name": "processooor",
310
+ "type": "address",
311
+ "internalType": "address"
312
+ },
313
+ {
314
+ "name": "data",
315
+ "type": "bytes",
316
+ "internalType": "bytes"
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "name": "_proof",
322
+ "type": "tuple",
323
+ "internalType": "struct ProofLib.WithdrawProof",
324
+ "components": [
325
+ {
326
+ "name": "pA",
327
+ "type": "uint256[2]",
328
+ "internalType": "uint256[2]"
329
+ },
330
+ {
331
+ "name": "pB",
332
+ "type": "uint256[2][2]",
333
+ "internalType": "uint256[2][2]"
334
+ },
335
+ {
336
+ "name": "pC",
337
+ "type": "uint256[2]",
338
+ "internalType": "uint256[2]"
339
+ },
340
+ {
341
+ "name": "pubSignals",
342
+ "type": "uint256[8]",
343
+ "internalType": "uint256[8]"
344
+ }
345
+ ]
346
+ }
347
+ ],
348
+ "outputs": [],
349
+ "stateMutability": "nonpayable"
350
+ },
351
+ {
352
+ "type": "event",
353
+ "name": "Deposited",
354
+ "inputs": [
355
+ {
356
+ "name": "_depositor",
357
+ "type": "address",
358
+ "indexed": true,
359
+ "internalType": "address"
360
+ },
361
+ {
362
+ "name": "_commitment",
363
+ "type": "uint256",
364
+ "indexed": false,
365
+ "internalType": "uint256"
366
+ },
367
+ {
368
+ "name": "_label",
369
+ "type": "uint256",
370
+ "indexed": false,
371
+ "internalType": "uint256"
372
+ },
373
+ {
374
+ "name": "_value",
375
+ "type": "uint256",
376
+ "indexed": false,
377
+ "internalType": "uint256"
378
+ },
379
+ {
380
+ "name": "_precommitmentHash",
381
+ "type": "uint256",
382
+ "indexed": false,
383
+ "internalType": "uint256"
384
+ }
385
+ ],
386
+ "anonymous": false
387
+ },
388
+ {
389
+ "type": "event",
390
+ "name": "LeafInserted",
391
+ "inputs": [
392
+ {
393
+ "name": "_index",
394
+ "type": "uint256",
395
+ "indexed": false,
396
+ "internalType": "uint256"
397
+ },
398
+ {
399
+ "name": "_leaf",
400
+ "type": "uint256",
401
+ "indexed": false,
402
+ "internalType": "uint256"
403
+ },
404
+ {
405
+ "name": "_root",
406
+ "type": "uint256",
407
+ "indexed": false,
408
+ "internalType": "uint256"
409
+ }
410
+ ],
411
+ "anonymous": false
412
+ },
413
+ {
414
+ "type": "event",
415
+ "name": "PoolDied",
416
+ "inputs": [],
417
+ "anonymous": false
418
+ },
419
+ {
420
+ "type": "event",
421
+ "name": "Ragequit",
422
+ "inputs": [
423
+ {
424
+ "name": "_ragequitter",
425
+ "type": "address",
426
+ "indexed": true,
427
+ "internalType": "address"
428
+ },
429
+ {
430
+ "name": "_commitment",
431
+ "type": "uint256",
432
+ "indexed": false,
433
+ "internalType": "uint256"
434
+ },
435
+ {
436
+ "name": "_label",
437
+ "type": "uint256",
438
+ "indexed": false,
439
+ "internalType": "uint256"
440
+ },
441
+ {
442
+ "name": "_value",
443
+ "type": "uint256",
444
+ "indexed": false,
445
+ "internalType": "uint256"
446
+ }
447
+ ],
448
+ "anonymous": false
449
+ },
450
+ {
451
+ "type": "event",
452
+ "name": "Withdrawn",
453
+ "inputs": [
454
+ {
455
+ "name": "_processooor",
456
+ "type": "address",
457
+ "indexed": true,
458
+ "internalType": "address"
459
+ },
460
+ {
461
+ "name": "_value",
462
+ "type": "uint256",
463
+ "indexed": false,
464
+ "internalType": "uint256"
465
+ },
466
+ {
467
+ "name": "_spentNullifier",
468
+ "type": "uint256",
469
+ "indexed": false,
470
+ "internalType": "uint256"
471
+ },
472
+ {
473
+ "name": "_newCommitment",
474
+ "type": "uint256",
475
+ "indexed": false,
476
+ "internalType": "uint256"
477
+ }
478
+ ],
479
+ "anonymous": false
480
+ },
481
+ {
482
+ "type": "error",
483
+ "name": "ContextMismatch",
484
+ "inputs": []
485
+ },
486
+ {
487
+ "type": "error",
488
+ "name": "IncorrectASPRoot",
489
+ "inputs": []
490
+ },
491
+ {
492
+ "type": "error",
493
+ "name": "InvalidCommitment",
494
+ "inputs": []
495
+ },
496
+ {
497
+ "type": "error",
498
+ "name": "InvalidDepositValue",
499
+ "inputs": []
500
+ },
501
+ {
502
+ "type": "error",
503
+ "name": "InvalidProcessooor",
504
+ "inputs": []
505
+ },
506
+ {
507
+ "type": "error",
508
+ "name": "InvalidProof",
509
+ "inputs": []
510
+ },
511
+ {
512
+ "type": "error",
513
+ "name": "InvalidTreeDepth",
514
+ "inputs": []
515
+ },
516
+ {
517
+ "type": "error",
518
+ "name": "LeafAlreadyExists",
519
+ "inputs": []
520
+ },
521
+ {
522
+ "type": "error",
523
+ "name": "LeafCannotBeZero",
524
+ "inputs": []
525
+ },
526
+ {
527
+ "type": "error",
528
+ "name": "LeafGreaterThanSnarkScalarField",
529
+ "inputs": []
530
+ },
531
+ {
532
+ "type": "error",
533
+ "name": "MaxTreeDepthReached",
534
+ "inputs": []
535
+ },
536
+ {
537
+ "type": "error",
538
+ "name": "NotYetRagequitteable",
539
+ "inputs": []
540
+ },
541
+ {
542
+ "type": "error",
543
+ "name": "NullifierAlreadySpent",
544
+ "inputs": []
545
+ },
546
+ {
547
+ "type": "error",
548
+ "name": "OnlyEntrypoint",
549
+ "inputs": []
550
+ },
551
+ {
552
+ "type": "error",
553
+ "name": "OnlyOriginalDepositor",
554
+ "inputs": []
555
+ },
556
+ {
557
+ "type": "error",
558
+ "name": "PoolIsDead",
559
+ "inputs": []
560
+ },
561
+ {
562
+ "type": "error",
563
+ "name": "ScopeMismatch",
564
+ "inputs": []
565
+ },
566
+ {
567
+ "type": "error",
568
+ "name": "UnknownStateRoot",
569
+ "inputs": []
570
+ },
571
+ {
572
+ "type": "error",
573
+ "name": "ZeroAddress",
574
+ "inputs": []
575
+ }
576
+ ];