@red-isbe/isbe-service-did-registry 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +129 -0
  3. package/dist/index.d.ts +26 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +26 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/ServiceDidRegistryContext.d.ts +40 -0
  8. package/dist/src/ServiceDidRegistryContext.d.ts.map +1 -0
  9. package/dist/src/ServiceDidRegistryContext.js +42 -0
  10. package/dist/src/ServiceDidRegistryContext.js.map +1 -0
  11. package/dist/src/ServiceDidRegistryQueries.d.ts +127 -0
  12. package/dist/src/ServiceDidRegistryQueries.d.ts.map +1 -0
  13. package/dist/src/ServiceDidRegistryQueries.js +226 -0
  14. package/dist/src/ServiceDidRegistryQueries.js.map +1 -0
  15. package/dist/src/ServiceDidRegistryTransactions.d.ts +90 -0
  16. package/dist/src/ServiceDidRegistryTransactions.d.ts.map +1 -0
  17. package/dist/src/ServiceDidRegistryTransactions.js +134 -0
  18. package/dist/src/ServiceDidRegistryTransactions.js.map +1 -0
  19. package/dist/src/ServiceDidTransactionExecutor.d.ts +31 -0
  20. package/dist/src/ServiceDidTransactionExecutor.d.ts.map +1 -0
  21. package/dist/src/ServiceDidTransactionExecutor.js +37 -0
  22. package/dist/src/ServiceDidTransactionExecutor.js.map +1 -0
  23. package/dist/src/abi/IServiceDidRegistry.abi.d.ts +578 -0
  24. package/dist/src/abi/IServiceDidRegistry.abi.d.ts.map +1 -0
  25. package/dist/src/abi/IServiceDidRegistry.abi.js +741 -0
  26. package/dist/src/abi/IServiceDidRegistry.abi.js.map +1 -0
  27. package/dist/src/serviceDid.types.d.ts +78 -0
  28. package/dist/src/serviceDid.types.d.ts.map +1 -0
  29. package/dist/src/serviceDid.types.js +16 -0
  30. package/dist/src/serviceDid.types.js.map +1 -0
  31. package/dist/src/types.d.ts +35 -0
  32. package/dist/src/types.d.ts.map +1 -0
  33. package/dist/src/types.js +16 -0
  34. package/dist/src/types.js.map +1 -0
  35. package/dist/src/utils/blockchain.utils.d.ts +49 -0
  36. package/dist/src/utils/blockchain.utils.d.ts.map +1 -0
  37. package/dist/src/utils/blockchain.utils.js +102 -0
  38. package/dist/src/utils/blockchain.utils.js.map +1 -0
  39. package/dist/src/utils/did.utils.d.ts +20 -0
  40. package/dist/src/utils/did.utils.d.ts.map +1 -0
  41. package/dist/src/utils/did.utils.js +57 -0
  42. package/dist/src/utils/did.utils.js.map +1 -0
  43. package/dist/src/utils/serviceDid.utils.d.ts +71 -0
  44. package/dist/src/utils/serviceDid.utils.d.ts.map +1 -0
  45. package/dist/src/utils/serviceDid.utils.js +142 -0
  46. package/dist/src/utils/serviceDid.utils.js.map +1 -0
  47. package/dist/src/utils/serviceDocument.utils.d.ts +61 -0
  48. package/dist/src/utils/serviceDocument.utils.d.ts.map +1 -0
  49. package/dist/src/utils/serviceDocument.utils.js +101 -0
  50. package/dist/src/utils/serviceDocument.utils.js.map +1 -0
  51. package/package.json +45 -0
@@ -0,0 +1,741 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * ABI of IServiceDidRegistry, generated from the isbe-contracts artifact.
18
+ *
19
+ * Embedded as a module rather than read from disk at runtime: the package ships
20
+ * only `dist`, and a JSON read would tie the library to a build step that copies
21
+ * it there and to a filesystem that bundlers do not always provide.
22
+ *
23
+ * Regenerate with:
24
+ * node -e "..." (see CHANGELOG) after compiling isbe-contracts.
25
+ */
26
+ export const IServiceDidRegistryAbi = [
27
+ {
28
+ "inputs": [
29
+ {
30
+ "internalType": "uint256",
31
+ "name": "expiresAt",
32
+ "type": "uint256"
33
+ }
34
+ ],
35
+ "name": "InvalidExpiry",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "bytes32",
42
+ "name": "serviceDid",
43
+ "type": "bytes32"
44
+ }
45
+ ],
46
+ "name": "ServiceDidAlreadyExists",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "inputs": [
51
+ {
52
+ "internalType": "bytes32",
53
+ "name": "serviceDid",
54
+ "type": "bytes32"
55
+ }
56
+ ],
57
+ "name": "ServiceDidIsDeactivated",
58
+ "type": "error"
59
+ },
60
+ {
61
+ "inputs": [
62
+ {
63
+ "internalType": "bytes32",
64
+ "name": "serviceDid",
65
+ "type": "bytes32"
66
+ }
67
+ ],
68
+ "name": "ServiceDidNotFound",
69
+ "type": "error"
70
+ },
71
+ {
72
+ "inputs": [
73
+ {
74
+ "internalType": "uint256",
75
+ "name": "length",
76
+ "type": "uint256"
77
+ },
78
+ {
79
+ "internalType": "uint256",
80
+ "name": "maxLength",
81
+ "type": "uint256"
82
+ }
83
+ ],
84
+ "name": "ServiceDocumentTooLarge",
85
+ "type": "error"
86
+ },
87
+ {
88
+ "inputs": [
89
+ {
90
+ "internalType": "bytes32",
91
+ "name": "pubKeyX",
92
+ "type": "bytes32"
93
+ },
94
+ {
95
+ "internalType": "bytes32",
96
+ "name": "pubKeyY",
97
+ "type": "bytes32"
98
+ }
99
+ ],
100
+ "name": "SigningKeyAlreadyInUse",
101
+ "type": "error"
102
+ },
103
+ {
104
+ "inputs": [
105
+ {
106
+ "internalType": "bytes32",
107
+ "name": "pubKeyX",
108
+ "type": "bytes32"
109
+ },
110
+ {
111
+ "internalType": "bytes32",
112
+ "name": "pubKeyY",
113
+ "type": "bytes32"
114
+ },
115
+ {
116
+ "internalType": "bytes32",
117
+ "name": "did",
118
+ "type": "bytes32"
119
+ }
120
+ ],
121
+ "name": "SigningKeyBoundToDid",
122
+ "type": "error"
123
+ },
124
+ {
125
+ "anonymous": false,
126
+ "inputs": [
127
+ {
128
+ "indexed": true,
129
+ "internalType": "bytes32",
130
+ "name": "serviceDid",
131
+ "type": "bytes32"
132
+ },
133
+ {
134
+ "indexed": true,
135
+ "internalType": "bytes32",
136
+ "name": "controllerDid",
137
+ "type": "bytes32"
138
+ }
139
+ ],
140
+ "name": "ServiceDidDeactivated",
141
+ "type": "event"
142
+ },
143
+ {
144
+ "anonymous": false,
145
+ "inputs": [
146
+ {
147
+ "indexed": true,
148
+ "internalType": "bytes32",
149
+ "name": "serviceDid",
150
+ "type": "bytes32"
151
+ },
152
+ {
153
+ "indexed": false,
154
+ "internalType": "bytes32",
155
+ "name": "documentHash",
156
+ "type": "bytes32"
157
+ }
158
+ ],
159
+ "name": "ServiceDidDocumentUpdated",
160
+ "type": "event"
161
+ },
162
+ {
163
+ "anonymous": false,
164
+ "inputs": [
165
+ {
166
+ "indexed": true,
167
+ "internalType": "bytes32",
168
+ "name": "serviceDid",
169
+ "type": "bytes32"
170
+ },
171
+ {
172
+ "indexed": false,
173
+ "internalType": "uint256",
174
+ "name": "oldExpiresAt",
175
+ "type": "uint256"
176
+ },
177
+ {
178
+ "indexed": false,
179
+ "internalType": "uint256",
180
+ "name": "newExpiresAt",
181
+ "type": "uint256"
182
+ }
183
+ ],
184
+ "name": "ServiceDidExpiryUpdated",
185
+ "type": "event"
186
+ },
187
+ {
188
+ "anonymous": false,
189
+ "inputs": [
190
+ {
191
+ "indexed": true,
192
+ "internalType": "bytes32",
193
+ "name": "serviceDid",
194
+ "type": "bytes32"
195
+ },
196
+ {
197
+ "indexed": false,
198
+ "internalType": "bytes32",
199
+ "name": "oldPubKeyX",
200
+ "type": "bytes32"
201
+ },
202
+ {
203
+ "indexed": false,
204
+ "internalType": "bytes32",
205
+ "name": "oldPubKeyY",
206
+ "type": "bytes32"
207
+ },
208
+ {
209
+ "indexed": false,
210
+ "internalType": "bytes32",
211
+ "name": "newPubKeyX",
212
+ "type": "bytes32"
213
+ },
214
+ {
215
+ "indexed": false,
216
+ "internalType": "bytes32",
217
+ "name": "newPubKeyY",
218
+ "type": "bytes32"
219
+ },
220
+ {
221
+ "indexed": false,
222
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
223
+ "name": "ellipticType",
224
+ "type": "uint8"
225
+ }
226
+ ],
227
+ "name": "ServiceDidKeyRotated",
228
+ "type": "event"
229
+ },
230
+ {
231
+ "anonymous": false,
232
+ "inputs": [
233
+ {
234
+ "indexed": true,
235
+ "internalType": "bytes32",
236
+ "name": "serviceDid",
237
+ "type": "bytes32"
238
+ },
239
+ {
240
+ "indexed": true,
241
+ "internalType": "bytes32",
242
+ "name": "controllerDid",
243
+ "type": "bytes32"
244
+ },
245
+ {
246
+ "indexed": false,
247
+ "internalType": "bytes32",
248
+ "name": "pubKeyX",
249
+ "type": "bytes32"
250
+ },
251
+ {
252
+ "indexed": false,
253
+ "internalType": "bytes32",
254
+ "name": "pubKeyY",
255
+ "type": "bytes32"
256
+ },
257
+ {
258
+ "indexed": false,
259
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
260
+ "name": "ellipticType",
261
+ "type": "uint8"
262
+ },
263
+ {
264
+ "indexed": false,
265
+ "internalType": "bytes32",
266
+ "name": "labelHash",
267
+ "type": "bytes32"
268
+ },
269
+ {
270
+ "indexed": false,
271
+ "internalType": "uint256",
272
+ "name": "expiresAt",
273
+ "type": "uint256"
274
+ },
275
+ {
276
+ "indexed": false,
277
+ "internalType": "uint64",
278
+ "name": "nonce",
279
+ "type": "uint64"
280
+ }
281
+ ],
282
+ "name": "ServiceDidRegistered",
283
+ "type": "event"
284
+ },
285
+ {
286
+ "anonymous": false,
287
+ "inputs": [],
288
+ "name": "ServiceDidRegistryInitialized",
289
+ "type": "event"
290
+ },
291
+ {
292
+ "inputs": [
293
+ {
294
+ "internalType": "bytes32",
295
+ "name": "controllerDid",
296
+ "type": "bytes32"
297
+ },
298
+ {
299
+ "internalType": "uint64",
300
+ "name": "nonce",
301
+ "type": "uint64"
302
+ }
303
+ ],
304
+ "name": "computeServiceDid",
305
+ "outputs": [
306
+ {
307
+ "internalType": "bytes32",
308
+ "name": "serviceDid",
309
+ "type": "bytes32"
310
+ }
311
+ ],
312
+ "stateMutability": "pure",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [
317
+ {
318
+ "internalType": "bytes32",
319
+ "name": "serviceDid",
320
+ "type": "bytes32"
321
+ }
322
+ ],
323
+ "name": "deactivateServiceDid",
324
+ "outputs": [
325
+ {
326
+ "internalType": "bool",
327
+ "name": "success",
328
+ "type": "bool"
329
+ }
330
+ ],
331
+ "stateMutability": "nonpayable",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [
336
+ {
337
+ "internalType": "bytes32",
338
+ "name": "serviceDid",
339
+ "type": "bytes32"
340
+ }
341
+ ],
342
+ "name": "getServiceDid",
343
+ "outputs": [
344
+ {
345
+ "components": [
346
+ {
347
+ "internalType": "bytes32",
348
+ "name": "controllerDid",
349
+ "type": "bytes32"
350
+ },
351
+ {
352
+ "internalType": "bytes32",
353
+ "name": "labelHash",
354
+ "type": "bytes32"
355
+ },
356
+ {
357
+ "internalType": "bytes32",
358
+ "name": "pubKeyX",
359
+ "type": "bytes32"
360
+ },
361
+ {
362
+ "internalType": "bytes32",
363
+ "name": "pubKeyY",
364
+ "type": "bytes32"
365
+ },
366
+ {
367
+ "internalType": "uint64",
368
+ "name": "expiresAt",
369
+ "type": "uint64"
370
+ },
371
+ {
372
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
373
+ "name": "ellipticType",
374
+ "type": "uint8"
375
+ },
376
+ {
377
+ "internalType": "uint64",
378
+ "name": "nonce",
379
+ "type": "uint64"
380
+ },
381
+ {
382
+ "internalType": "bool",
383
+ "name": "deactivated",
384
+ "type": "bool"
385
+ },
386
+ {
387
+ "internalType": "bool",
388
+ "name": "exists",
389
+ "type": "bool"
390
+ },
391
+ {
392
+ "internalType": "uint64",
393
+ "name": "registeredAt",
394
+ "type": "uint64"
395
+ },
396
+ {
397
+ "internalType": "uint64",
398
+ "name": "updatedAt",
399
+ "type": "uint64"
400
+ }
401
+ ],
402
+ "internalType": "struct IServiceDidRegistry.ServiceDidRecord",
403
+ "name": "record",
404
+ "type": "tuple"
405
+ }
406
+ ],
407
+ "stateMutability": "view",
408
+ "type": "function"
409
+ },
410
+ {
411
+ "inputs": [
412
+ {
413
+ "internalType": "bytes32",
414
+ "name": "controllerDid",
415
+ "type": "bytes32"
416
+ },
417
+ {
418
+ "internalType": "uint256",
419
+ "name": "page",
420
+ "type": "uint256"
421
+ },
422
+ {
423
+ "internalType": "uint256",
424
+ "name": "pageSize",
425
+ "type": "uint256"
426
+ }
427
+ ],
428
+ "name": "getServiceDidsByController",
429
+ "outputs": [
430
+ {
431
+ "components": [
432
+ {
433
+ "internalType": "bytes32",
434
+ "name": "controllerDid",
435
+ "type": "bytes32"
436
+ },
437
+ {
438
+ "internalType": "bytes32",
439
+ "name": "labelHash",
440
+ "type": "bytes32"
441
+ },
442
+ {
443
+ "internalType": "bytes32",
444
+ "name": "pubKeyX",
445
+ "type": "bytes32"
446
+ },
447
+ {
448
+ "internalType": "bytes32",
449
+ "name": "pubKeyY",
450
+ "type": "bytes32"
451
+ },
452
+ {
453
+ "internalType": "uint64",
454
+ "name": "expiresAt",
455
+ "type": "uint64"
456
+ },
457
+ {
458
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
459
+ "name": "ellipticType",
460
+ "type": "uint8"
461
+ },
462
+ {
463
+ "internalType": "uint64",
464
+ "name": "nonce",
465
+ "type": "uint64"
466
+ },
467
+ {
468
+ "internalType": "bool",
469
+ "name": "deactivated",
470
+ "type": "bool"
471
+ },
472
+ {
473
+ "internalType": "bool",
474
+ "name": "exists",
475
+ "type": "bool"
476
+ },
477
+ {
478
+ "internalType": "uint64",
479
+ "name": "registeredAt",
480
+ "type": "uint64"
481
+ },
482
+ {
483
+ "internalType": "uint64",
484
+ "name": "updatedAt",
485
+ "type": "uint64"
486
+ }
487
+ ],
488
+ "internalType": "struct IServiceDidRegistry.ServiceDidRecord[]",
489
+ "name": "items",
490
+ "type": "tuple[]"
491
+ },
492
+ {
493
+ "internalType": "uint256",
494
+ "name": "total",
495
+ "type": "uint256"
496
+ },
497
+ {
498
+ "internalType": "uint256",
499
+ "name": "howMany",
500
+ "type": "uint256"
501
+ },
502
+ {
503
+ "internalType": "uint256",
504
+ "name": "prev",
505
+ "type": "uint256"
506
+ },
507
+ {
508
+ "internalType": "uint256",
509
+ "name": "next",
510
+ "type": "uint256"
511
+ }
512
+ ],
513
+ "stateMutability": "view",
514
+ "type": "function"
515
+ },
516
+ {
517
+ "inputs": [
518
+ {
519
+ "internalType": "bytes32",
520
+ "name": "serviceDid",
521
+ "type": "bytes32"
522
+ }
523
+ ],
524
+ "name": "getServiceDocument",
525
+ "outputs": [
526
+ {
527
+ "internalType": "string",
528
+ "name": "document",
529
+ "type": "string"
530
+ }
531
+ ],
532
+ "stateMutability": "view",
533
+ "type": "function"
534
+ },
535
+ {
536
+ "inputs": [],
537
+ "name": "initializeServiceDidRegistry",
538
+ "outputs": [],
539
+ "stateMutability": "nonpayable",
540
+ "type": "function"
541
+ },
542
+ {
543
+ "inputs": [
544
+ {
545
+ "internalType": "bytes32",
546
+ "name": "serviceDid",
547
+ "type": "bytes32"
548
+ }
549
+ ],
550
+ "name": "isServiceDidActive",
551
+ "outputs": [
552
+ {
553
+ "internalType": "bool",
554
+ "name": "active",
555
+ "type": "bool"
556
+ }
557
+ ],
558
+ "stateMutability": "view",
559
+ "type": "function"
560
+ },
561
+ {
562
+ "inputs": [
563
+ {
564
+ "internalType": "bytes32",
565
+ "name": "controllerDid",
566
+ "type": "bytes32"
567
+ },
568
+ {
569
+ "internalType": "bytes",
570
+ "name": "publicKey",
571
+ "type": "bytes"
572
+ },
573
+ {
574
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
575
+ "name": "ellipticType",
576
+ "type": "uint8"
577
+ },
578
+ {
579
+ "internalType": "bytes32",
580
+ "name": "labelHash",
581
+ "type": "bytes32"
582
+ },
583
+ {
584
+ "internalType": "uint256",
585
+ "name": "expiresAt",
586
+ "type": "uint256"
587
+ }
588
+ ],
589
+ "name": "registerServiceDid",
590
+ "outputs": [
591
+ {
592
+ "internalType": "bytes32",
593
+ "name": "serviceDid",
594
+ "type": "bytes32"
595
+ }
596
+ ],
597
+ "stateMutability": "nonpayable",
598
+ "type": "function"
599
+ },
600
+ {
601
+ "inputs": [
602
+ {
603
+ "internalType": "bytes32",
604
+ "name": "controllerDid",
605
+ "type": "bytes32"
606
+ },
607
+ {
608
+ "internalType": "bytes",
609
+ "name": "publicKey",
610
+ "type": "bytes"
611
+ },
612
+ {
613
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
614
+ "name": "ellipticType",
615
+ "type": "uint8"
616
+ },
617
+ {
618
+ "internalType": "bytes32",
619
+ "name": "labelHash",
620
+ "type": "bytes32"
621
+ },
622
+ {
623
+ "internalType": "uint256",
624
+ "name": "expiresAt",
625
+ "type": "uint256"
626
+ },
627
+ {
628
+ "internalType": "string",
629
+ "name": "document",
630
+ "type": "string"
631
+ }
632
+ ],
633
+ "name": "registerServiceDidWithDocument",
634
+ "outputs": [
635
+ {
636
+ "internalType": "bytes32",
637
+ "name": "serviceDid",
638
+ "type": "bytes32"
639
+ }
640
+ ],
641
+ "stateMutability": "nonpayable",
642
+ "type": "function"
643
+ },
644
+ {
645
+ "inputs": [
646
+ {
647
+ "internalType": "bytes32",
648
+ "name": "serviceDid",
649
+ "type": "bytes32"
650
+ },
651
+ {
652
+ "internalType": "bytes",
653
+ "name": "newPublicKey",
654
+ "type": "bytes"
655
+ },
656
+ {
657
+ "internalType": "enum IDidDocumentDetailed.EllipticType",
658
+ "name": "newEllipticType",
659
+ "type": "uint8"
660
+ }
661
+ ],
662
+ "name": "rotateSigningKey",
663
+ "outputs": [
664
+ {
665
+ "internalType": "bool",
666
+ "name": "success",
667
+ "type": "bool"
668
+ }
669
+ ],
670
+ "stateMutability": "nonpayable",
671
+ "type": "function"
672
+ },
673
+ {
674
+ "inputs": [
675
+ {
676
+ "internalType": "bytes32",
677
+ "name": "serviceDid",
678
+ "type": "bytes32"
679
+ }
680
+ ],
681
+ "name": "signingKeyAddressOf",
682
+ "outputs": [
683
+ {
684
+ "internalType": "address",
685
+ "name": "signingKeyAddress",
686
+ "type": "address"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
692
+ {
693
+ "inputs": [
694
+ {
695
+ "internalType": "bytes32",
696
+ "name": "serviceDid",
697
+ "type": "bytes32"
698
+ },
699
+ {
700
+ "internalType": "uint256",
701
+ "name": "newExpiresAt",
702
+ "type": "uint256"
703
+ }
704
+ ],
705
+ "name": "updateExpiry",
706
+ "outputs": [
707
+ {
708
+ "internalType": "bool",
709
+ "name": "success",
710
+ "type": "bool"
711
+ }
712
+ ],
713
+ "stateMutability": "nonpayable",
714
+ "type": "function"
715
+ },
716
+ {
717
+ "inputs": [
718
+ {
719
+ "internalType": "bytes32",
720
+ "name": "serviceDid",
721
+ "type": "bytes32"
722
+ },
723
+ {
724
+ "internalType": "string",
725
+ "name": "document",
726
+ "type": "string"
727
+ }
728
+ ],
729
+ "name": "updateServiceDocument",
730
+ "outputs": [
731
+ {
732
+ "internalType": "bool",
733
+ "name": "success",
734
+ "type": "bool"
735
+ }
736
+ ],
737
+ "stateMutability": "nonpayable",
738
+ "type": "function"
739
+ }
740
+ ];
741
+ //# sourceMappingURL=IServiceDidRegistry.abi.js.map