@0xpolygonid/js-sdk 1.17.8 → 1.18.1

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 (36) hide show
  1. package/dist/browser/esm/index.js +976 -64
  2. package/dist/browser/esm/index.js.map +1 -1
  3. package/dist/browser/umd/index.js +976 -63
  4. package/dist/browser/umd/index.js.map +1 -1
  5. package/dist/node/cjs/circuits/atomic-query-mtp-v2-on-chain.js +10 -0
  6. package/dist/node/cjs/circuits/atomic-query-sig-v2-on-chain.js +10 -0
  7. package/dist/node/cjs/circuits/atomic-query-v3-on-chain.js +10 -0
  8. package/dist/node/cjs/iden3comm/constants.js +2 -0
  9. package/dist/node/cjs/iden3comm/handlers/contract-request.js +73 -10
  10. package/dist/node/cjs/storage/blockchain/abi/ZkpVerifier.json +530 -9
  11. package/dist/node/cjs/storage/blockchain/onchain-zkp-verifier.js +293 -42
  12. package/dist/node/cjs/utils/did-helper.js +37 -1
  13. package/dist/node/esm/circuits/atomic-query-mtp-v2-on-chain.js +10 -0
  14. package/dist/node/esm/circuits/atomic-query-sig-v2-on-chain.js +10 -0
  15. package/dist/node/esm/circuits/atomic-query-v3-on-chain.js +10 -0
  16. package/dist/node/esm/iden3comm/constants.js +2 -0
  17. package/dist/node/esm/iden3comm/handlers/contract-request.js +73 -10
  18. package/dist/node/esm/storage/blockchain/abi/ZkpVerifier.json +530 -9
  19. package/dist/node/esm/storage/blockchain/onchain-zkp-verifier.js +293 -42
  20. package/dist/node/esm/utils/did-helper.js +35 -0
  21. package/dist/types/circuits/atomic-query-mtp-v2-on-chain.d.ts +4 -2
  22. package/dist/types/circuits/atomic-query-sig-v2-on-chain.d.ts +4 -2
  23. package/dist/types/circuits/atomic-query-v3-on-chain.d.ts +4 -2
  24. package/dist/types/circuits/common.d.ts +31 -0
  25. package/dist/types/iden3comm/constants.d.ts +1 -0
  26. package/dist/types/iden3comm/handlers/contract-request.d.ts +14 -3
  27. package/dist/types/iden3comm/types/protocol/auth.d.ts +11 -1
  28. package/dist/types/iden3comm/types/protocol/contract-request.d.ts +16 -1
  29. package/dist/types/proof/verifiers/pub-signals-verifier.d.ts +2 -2
  30. package/dist/types/proof/verifiers/query.d.ts +4 -3
  31. package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts +44 -12
  32. package/dist/types/storage/entities/state.d.ts +44 -0
  33. package/dist/types/storage/interfaces/onchain-zkp-verifier.d.ts +22 -1
  34. package/dist/types/utils/did-helper.d.ts +12 -1
  35. package/dist/types/verifiable/presentation.d.ts +2 -2
  36. package/package.json +1 -1
@@ -1,4 +1,99 @@
1
1
  [
2
+ {
3
+ "inputs": [],
4
+ "name": "InvalidInitialization",
5
+ "type": "error"
6
+ },
7
+ {
8
+ "inputs": [
9
+ {
10
+ "internalType": "string",
11
+ "name": "message",
12
+ "type": "string"
13
+ },
14
+ {
15
+ "internalType": "uint64",
16
+ "name": "requestId",
17
+ "type": "uint64"
18
+ },
19
+ {
20
+ "internalType": "uint256",
21
+ "name": "linkID",
22
+ "type": "uint256"
23
+ },
24
+ {
25
+ "internalType": "uint64",
26
+ "name": "requestIdToCompare",
27
+ "type": "uint64"
28
+ },
29
+ {
30
+ "internalType": "uint256",
31
+ "name": "linkIdToCompare",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "name": "LinkedProofError",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [],
40
+ "name": "NotInitializing",
41
+ "type": "error"
42
+ },
43
+ {
44
+ "inputs": [
45
+ {
46
+ "internalType": "address",
47
+ "name": "owner",
48
+ "type": "address"
49
+ }
50
+ ],
51
+ "name": "OwnableInvalidOwner",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [
56
+ {
57
+ "internalType": "address",
58
+ "name": "account",
59
+ "type": "address"
60
+ }
61
+ ],
62
+ "name": "OwnableUnauthorizedAccount",
63
+ "type": "error"
64
+ },
65
+ {
66
+ "anonymous": false,
67
+ "inputs": [
68
+ {
69
+ "indexed": false,
70
+ "internalType": "uint64",
71
+ "name": "version",
72
+ "type": "uint64"
73
+ }
74
+ ],
75
+ "name": "Initialized",
76
+ "type": "event"
77
+ },
78
+ {
79
+ "anonymous": false,
80
+ "inputs": [
81
+ {
82
+ "indexed": true,
83
+ "internalType": "address",
84
+ "name": "previousOwner",
85
+ "type": "address"
86
+ },
87
+ {
88
+ "indexed": true,
89
+ "internalType": "address",
90
+ "name": "newOwner",
91
+ "type": "address"
92
+ }
93
+ ],
94
+ "name": "OwnershipTransferStarted",
95
+ "type": "event"
96
+ },
2
97
  {
3
98
  "anonymous": false,
4
99
  "inputs": [
@@ -18,6 +113,62 @@
18
113
  "name": "OwnershipTransferred",
19
114
  "type": "event"
20
115
  },
116
+ {
117
+ "anonymous": false,
118
+ "inputs": [
119
+ {
120
+ "indexed": true,
121
+ "internalType": "uint64",
122
+ "name": "requestId",
123
+ "type": "uint64"
124
+ },
125
+ {
126
+ "indexed": true,
127
+ "internalType": "address",
128
+ "name": "requestOwner",
129
+ "type": "address"
130
+ },
131
+ {
132
+ "indexed": false,
133
+ "internalType": "string",
134
+ "name": "metadata",
135
+ "type": "string"
136
+ },
137
+ {
138
+ "indexed": false,
139
+ "internalType": "address",
140
+ "name": "validator",
141
+ "type": "address"
142
+ },
143
+ {
144
+ "indexed": false,
145
+ "internalType": "bytes",
146
+ "name": "data",
147
+ "type": "bytes"
148
+ }
149
+ ],
150
+ "name": "ZKPRequestSet",
151
+ "type": "event"
152
+ },
153
+ {
154
+ "anonymous": false,
155
+ "inputs": [
156
+ {
157
+ "indexed": true,
158
+ "internalType": "uint64",
159
+ "name": "requestId",
160
+ "type": "uint64"
161
+ },
162
+ {
163
+ "indexed": true,
164
+ "internalType": "address",
165
+ "name": "caller",
166
+ "type": "address"
167
+ }
168
+ ],
169
+ "name": "ZKPResponseSubmitted",
170
+ "type": "event"
171
+ },
21
172
  {
22
173
  "inputs": [],
23
174
  "name": "REQUESTS_RETURN_LIMIT",
@@ -31,6 +182,159 @@
31
182
  "stateMutability": "view",
32
183
  "type": "function"
33
184
  },
185
+ {
186
+ "inputs": [],
187
+ "name": "VERSION",
188
+ "outputs": [
189
+ {
190
+ "internalType": "string",
191
+ "name": "",
192
+ "type": "string"
193
+ }
194
+ ],
195
+ "stateMutability": "view",
196
+ "type": "function"
197
+ },
198
+ {
199
+ "inputs": [],
200
+ "name": "acceptOwnership",
201
+ "outputs": [],
202
+ "stateMutability": "nonpayable",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "inputs": [
207
+ {
208
+ "internalType": "contract ICircuitValidator",
209
+ "name": "validator",
210
+ "type": "address"
211
+ }
212
+ ],
213
+ "name": "addValidatorToWhitelist",
214
+ "outputs": [],
215
+ "stateMutability": "nonpayable",
216
+ "type": "function"
217
+ },
218
+ {
219
+ "inputs": [
220
+ {
221
+ "internalType": "uint64",
222
+ "name": "requestId",
223
+ "type": "uint64"
224
+ }
225
+ ],
226
+ "name": "disableZKPRequest",
227
+ "outputs": [],
228
+ "stateMutability": "nonpayable",
229
+ "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ {
234
+ "internalType": "uint64",
235
+ "name": "requestId",
236
+ "type": "uint64"
237
+ }
238
+ ],
239
+ "name": "enableZKPRequest",
240
+ "outputs": [],
241
+ "stateMutability": "nonpayable",
242
+ "type": "function"
243
+ },
244
+ {
245
+ "inputs": [
246
+ {
247
+ "internalType": "address",
248
+ "name": "sender",
249
+ "type": "address"
250
+ },
251
+ {
252
+ "internalType": "uint64",
253
+ "name": "requestId",
254
+ "type": "uint64"
255
+ }
256
+ ],
257
+ "name": "getProofStatus",
258
+ "outputs": [
259
+ {
260
+ "components": [
261
+ {
262
+ "internalType": "bool",
263
+ "name": "isVerified",
264
+ "type": "bool"
265
+ },
266
+ {
267
+ "internalType": "string",
268
+ "name": "validatorVersion",
269
+ "type": "string"
270
+ },
271
+ {
272
+ "internalType": "uint256",
273
+ "name": "blockNumber",
274
+ "type": "uint256"
275
+ },
276
+ {
277
+ "internalType": "uint256",
278
+ "name": "blockTimestamp",
279
+ "type": "uint256"
280
+ }
281
+ ],
282
+ "internalType": "struct IZKPVerifier.ProofStatus",
283
+ "name": "",
284
+ "type": "tuple"
285
+ }
286
+ ],
287
+ "stateMutability": "view",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [
292
+ {
293
+ "internalType": "address",
294
+ "name": "user",
295
+ "type": "address"
296
+ },
297
+ {
298
+ "internalType": "uint64",
299
+ "name": "requestId",
300
+ "type": "uint64"
301
+ },
302
+ {
303
+ "internalType": "string",
304
+ "name": "key",
305
+ "type": "string"
306
+ }
307
+ ],
308
+ "name": "getProofStorageField",
309
+ "outputs": [
310
+ {
311
+ "internalType": "uint256",
312
+ "name": "",
313
+ "type": "uint256"
314
+ }
315
+ ],
316
+ "stateMutability": "view",
317
+ "type": "function"
318
+ },
319
+ {
320
+ "inputs": [
321
+ {
322
+ "internalType": "uint64",
323
+ "name": "requestId",
324
+ "type": "uint64"
325
+ }
326
+ ],
327
+ "name": "getRequestOwner",
328
+ "outputs": [
329
+ {
330
+ "internalType": "address",
331
+ "name": "",
332
+ "type": "address"
333
+ }
334
+ ],
335
+ "stateMutability": "view",
336
+ "type": "function"
337
+ },
34
338
  {
35
339
  "inputs": [
36
340
  {
@@ -60,7 +364,7 @@
60
364
  }
61
365
  ],
62
366
  "internalType": "struct IZKPVerifier.ZKPRequest",
63
- "name": "",
367
+ "name": "zkpRequest",
64
368
  "type": "tuple"
65
369
  }
66
370
  ],
@@ -122,32 +426,70 @@
122
426
  "type": "function"
123
427
  },
124
428
  {
125
- "inputs": [],
126
- "name": "owner",
127
- "outputs": [
429
+ "inputs": [
128
430
  {
129
- "internalType": "address",
130
- "name": "",
431
+ "internalType": "contract IStateCrossChain",
432
+ "name": "stateCrossChain",
131
433
  "type": "address"
132
434
  }
133
435
  ],
134
- "stateMutability": "view",
436
+ "name": "initialize",
437
+ "outputs": [],
438
+ "stateMutability": "nonpayable",
135
439
  "type": "function"
136
440
  },
137
441
  {
138
442
  "inputs": [
139
443
  {
140
444
  "internalType": "address",
141
- "name": "",
445
+ "name": "sender",
142
446
  "type": "address"
143
447
  },
144
448
  {
145
449
  "internalType": "uint64",
450
+ "name": "requestId",
451
+ "type": "uint64"
452
+ }
453
+ ],
454
+ "name": "isProofVerified",
455
+ "outputs": [
456
+ {
457
+ "internalType": "bool",
458
+ "name": "",
459
+ "type": "bool"
460
+ }
461
+ ],
462
+ "stateMutability": "view",
463
+ "type": "function"
464
+ },
465
+ {
466
+ "inputs": [
467
+ {
468
+ "internalType": "contract ICircuitValidator",
469
+ "name": "validator",
470
+ "type": "address"
471
+ }
472
+ ],
473
+ "name": "isWhitelistedValidator",
474
+ "outputs": [
475
+ {
476
+ "internalType": "bool",
146
477
  "name": "",
478
+ "type": "bool"
479
+ }
480
+ ],
481
+ "stateMutability": "view",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [
486
+ {
487
+ "internalType": "uint64",
488
+ "name": "requestId",
147
489
  "type": "uint64"
148
490
  }
149
491
  ],
150
- "name": "proofs",
492
+ "name": "isZKPRequestEnabled",
151
493
  "outputs": [
152
494
  {
153
495
  "internalType": "bool",
@@ -158,6 +500,45 @@
158
500
  "stateMutability": "view",
159
501
  "type": "function"
160
502
  },
503
+ {
504
+ "inputs": [],
505
+ "name": "owner",
506
+ "outputs": [
507
+ {
508
+ "internalType": "address",
509
+ "name": "",
510
+ "type": "address"
511
+ }
512
+ ],
513
+ "stateMutability": "view",
514
+ "type": "function"
515
+ },
516
+ {
517
+ "inputs": [],
518
+ "name": "pendingOwner",
519
+ "outputs": [
520
+ {
521
+ "internalType": "address",
522
+ "name": "",
523
+ "type": "address"
524
+ }
525
+ ],
526
+ "stateMutability": "view",
527
+ "type": "function"
528
+ },
529
+ {
530
+ "inputs": [
531
+ {
532
+ "internalType": "contract ICircuitValidator",
533
+ "name": "validator",
534
+ "type": "address"
535
+ }
536
+ ],
537
+ "name": "removeValidatorFromWhitelist",
538
+ "outputs": [],
539
+ "stateMutability": "nonpayable",
540
+ "type": "function"
541
+ },
161
542
  {
162
543
  "inputs": [],
163
544
  "name": "renounceOwnership",
@@ -184,6 +565,24 @@
184
565
  "stateMutability": "view",
185
566
  "type": "function"
186
567
  },
568
+ {
569
+ "inputs": [
570
+ {
571
+ "internalType": "uint64",
572
+ "name": "requestId",
573
+ "type": "uint64"
574
+ },
575
+ {
576
+ "internalType": "address",
577
+ "name": "requestOwner",
578
+ "type": "address"
579
+ }
580
+ ],
581
+ "name": "setRequestOwner",
582
+ "outputs": [],
583
+ "stateMutability": "nonpayable",
584
+ "type": "function"
585
+ },
187
586
  {
188
587
  "inputs": [
189
588
  {
@@ -252,6 +651,41 @@
252
651
  "stateMutability": "nonpayable",
253
652
  "type": "function"
254
653
  },
654
+ {
655
+ "inputs": [
656
+ {
657
+ "components": [
658
+ {
659
+ "internalType": "uint64",
660
+ "name": "requestId",
661
+ "type": "uint64"
662
+ },
663
+ {
664
+ "internalType": "bytes",
665
+ "name": "zkProof",
666
+ "type": "bytes"
667
+ },
668
+ {
669
+ "internalType": "bytes",
670
+ "name": "data",
671
+ "type": "bytes"
672
+ }
673
+ ],
674
+ "internalType": "struct ZKPResponse[]",
675
+ "name": "responses",
676
+ "type": "tuple[]"
677
+ },
678
+ {
679
+ "internalType": "bytes",
680
+ "name": "crossChainProof",
681
+ "type": "bytes"
682
+ }
683
+ ],
684
+ "name": "submitZKPResponseV2",
685
+ "outputs": [],
686
+ "stateMutability": "nonpayable",
687
+ "type": "function"
688
+ },
255
689
  {
256
690
  "inputs": [
257
691
  {
@@ -264,5 +698,92 @@
264
698
  "outputs": [],
265
699
  "stateMutability": "nonpayable",
266
700
  "type": "function"
701
+ },
702
+ {
703
+ "inputs": [
704
+ {
705
+ "internalType": "address",
706
+ "name": "sender",
707
+ "type": "address"
708
+ },
709
+ {
710
+ "internalType": "uint64[]",
711
+ "name": "requestIds",
712
+ "type": "uint64[]"
713
+ }
714
+ ],
715
+ "name": "verifyLinkedProofs",
716
+ "outputs": [],
717
+ "stateMutability": "view",
718
+ "type": "function"
719
+ },
720
+ {
721
+ "inputs": [
722
+ {
723
+ "internalType": "uint64",
724
+ "name": "requestId",
725
+ "type": "uint64"
726
+ },
727
+ {
728
+ "internalType": "uint256[]",
729
+ "name": "inputs",
730
+ "type": "uint256[]"
731
+ },
732
+ {
733
+ "internalType": "uint256[2]",
734
+ "name": "a",
735
+ "type": "uint256[2]"
736
+ },
737
+ {
738
+ "internalType": "uint256[2][2]",
739
+ "name": "b",
740
+ "type": "uint256[2][2]"
741
+ },
742
+ {
743
+ "internalType": "uint256[2]",
744
+ "name": "c",
745
+ "type": "uint256[2]"
746
+ },
747
+ {
748
+ "internalType": "address",
749
+ "name": "sender",
750
+ "type": "address"
751
+ }
752
+ ],
753
+ "name": "verifyZKPResponse",
754
+ "outputs": [
755
+ {
756
+ "components": [
757
+ {
758
+ "internalType": "string",
759
+ "name": "key",
760
+ "type": "string"
761
+ },
762
+ {
763
+ "internalType": "uint256",
764
+ "name": "inputValue",
765
+ "type": "uint256"
766
+ }
767
+ ],
768
+ "internalType": "struct ICircuitValidator.KeyToInputValue[]",
769
+ "name": "",
770
+ "type": "tuple[]"
771
+ }
772
+ ],
773
+ "stateMutability": "nonpayable",
774
+ "type": "function"
775
+ },
776
+ {
777
+ "inputs": [],
778
+ "name": "version",
779
+ "outputs": [
780
+ {
781
+ "internalType": "string",
782
+ "name": "",
783
+ "type": "string"
784
+ }
785
+ ],
786
+ "stateMutability": "pure",
787
+ "type": "function"
267
788
  }
268
789
  ]