kokio-sdk 1.1.0 → 2.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 (106) hide show
  1. package/README.md +68 -19
  2. package/dist/esm/abis/BeaconProxy.js +30 -46
  3. package/dist/esm/abis/DeviceWallet.js +546 -535
  4. package/dist/esm/abis/DeviceWalletFactory.js +537 -544
  5. package/dist/esm/abis/ESIMWallet.js +440 -299
  6. package/dist/esm/abis/ESIMWalletFactory.js +372 -289
  7. package/dist/esm/abis/LazyWalletRegistry.js +941 -421
  8. package/dist/esm/abis/P256Verifier.js +29 -29
  9. package/dist/esm/abis/ProtocolAdmin.js +1228 -0
  10. package/dist/esm/abis/Registry.js +1207 -466
  11. package/dist/esm/abis/RegistryHelper.js +414 -20
  12. package/dist/esm/abis/index.js +2 -1
  13. package/dist/esm/admin/config-admin.js +7 -0
  14. package/dist/esm/admin/interface/deviceWalletClass.js +27 -6
  15. package/dist/esm/admin/interface/deviceWalletFactoryClass.js +41 -19
  16. package/dist/esm/admin/interface/eSIMWalletClass.js +10 -1
  17. package/dist/esm/admin/interface/eSIMWalletFactoryClass.js +24 -2
  18. package/dist/esm/admin/interface/lazyWalletRegistryClass.js +83 -4
  19. package/dist/esm/admin/interface/protocolAdminClass.js +195 -0
  20. package/dist/esm/admin/interface/registryClass.js +93 -2
  21. package/dist/esm/config.js +42 -7
  22. package/dist/esm/interface/deviceWalletClass.js +45 -5
  23. package/dist/esm/interface/deviceWalletFactoryClass.js +20 -1
  24. package/dist/esm/interface/eSIMWalletClass.js +12 -3
  25. package/dist/esm/interface/registryClass.js +47 -0
  26. package/dist/esm/interface/smartAccountClass.js +2 -4
  27. package/dist/esm/logic/account-kit/createSmartAccount.js +156 -102
  28. package/dist/esm/logic/admin/deviceWallet.eoa.js +23 -12
  29. package/dist/esm/logic/admin/deviceWalletFactory.eoa.js +63 -42
  30. package/dist/esm/logic/admin/eSIMWallet.eoa.js +3 -5
  31. package/dist/esm/logic/admin/eSIMWalletFactory.eoa.js +76 -8
  32. package/dist/esm/logic/admin/lazyWalletRegistry.eoa.js +330 -19
  33. package/dist/esm/logic/admin/protocolAdmin.eoa.js +524 -0
  34. package/dist/esm/logic/admin/reads/deviceWallet.reads.js +82 -7
  35. package/dist/esm/logic/admin/reads/deviceWalletFactory.reads.js +82 -23
  36. package/dist/esm/logic/admin/reads/eSIMWallet.reads.js +50 -6
  37. package/dist/esm/logic/admin/reads/eSIMWalletFactory.reads.js +63 -5
  38. package/dist/esm/logic/admin/reads/lazyWalletRegistry.reads.js +171 -10
  39. package/dist/esm/logic/admin/reads/protocolAdmin.reads.js +154 -0
  40. package/dist/esm/logic/admin/reads/registry.reads.js +289 -9
  41. package/dist/esm/logic/admin/registry.eoa.js +274 -4
  42. package/dist/esm/logic/constants.js +53 -26
  43. package/dist/esm/logic/deviceWallet.js +224 -31
  44. package/dist/esm/logic/deviceWalletFactory.js +89 -0
  45. package/dist/esm/logic/eSIMWallet.js +113 -43
  46. package/dist/esm/logic/eSIMWalletFactory.js +8 -8
  47. package/dist/esm/logic/errors.js +64 -0
  48. package/dist/esm/logic/registry.js +236 -0
  49. package/dist/esm/logic/utils.js +2 -1
  50. package/dist/types/abis/BeaconProxy.d.ts +21 -33
  51. package/dist/types/abis/DeviceWallet.d.ts +372 -365
  52. package/dist/types/abis/DeviceWalletFactory.d.ts +438 -448
  53. package/dist/types/abis/ESIMWallet.d.ts +352 -245
  54. package/dist/types/abis/ESIMWalletFactory.d.ts +278 -216
  55. package/dist/types/abis/LazyWalletRegistry.d.ts +710 -317
  56. package/dist/types/abis/P256Verifier.d.ts +16 -16
  57. package/dist/types/abis/ProtocolAdmin.d.ts +947 -0
  58. package/dist/types/abis/Registry.d.ts +960 -393
  59. package/dist/types/abis/RegistryHelper.d.ts +317 -16
  60. package/dist/types/abis/index.d.ts +2 -1
  61. package/dist/types/admin/config-admin.d.ts +3 -0
  62. package/dist/types/admin/interface/deviceWalletClass.d.ts +10 -3
  63. package/dist/types/admin/interface/deviceWalletFactoryClass.d.ts +14 -7
  64. package/dist/types/admin/interface/eSIMWalletClass.d.ts +3 -0
  65. package/dist/types/admin/interface/eSIMWalletFactoryClass.d.ts +8 -1
  66. package/dist/types/admin/interface/lazyWalletRegistryClass.d.ts +38 -2
  67. package/dist/types/admin/interface/protocolAdminClass.d.ts +95 -0
  68. package/dist/types/admin/interface/registryClass.d.ts +30 -0
  69. package/dist/types/config.d.ts +26 -5
  70. package/dist/types/interface/P256VerifierClass.d.ts +3 -4
  71. package/dist/types/interface/deviceWalletClass.d.ts +22 -2569
  72. package/dist/types/interface/deviceWalletFactoryClass.d.ts +10 -2564
  73. package/dist/types/interface/eSIMWalletClass.d.ts +11 -8
  74. package/dist/types/interface/eSIMWalletFactoryClass.d.ts +5 -2565
  75. package/dist/types/interface/registryClass.d.ts +19 -0
  76. package/dist/types/interface/smartAccountClass.d.ts +6 -2568
  77. package/dist/types/logic/P256Verifier.d.ts +2 -2
  78. package/dist/types/logic/account-kit/createSmartAccount.d.ts +43 -19
  79. package/dist/types/logic/admin/deviceWallet.eoa.d.ts +15 -9
  80. package/dist/types/logic/admin/deviceWalletFactory.eoa.d.ts +34 -23
  81. package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +0 -5
  82. package/dist/types/logic/admin/eSIMWalletFactory.eoa.d.ts +27 -9
  83. package/dist/types/logic/admin/lazyWalletRegistry.eoa.d.ts +102 -10
  84. package/dist/types/logic/admin/protocolAdmin.eoa.d.ts +163 -0
  85. package/dist/types/logic/admin/reads/deviceWallet.reads.d.ts +28 -8
  86. package/dist/types/logic/admin/reads/deviceWalletFactory.reads.d.ts +45 -14
  87. package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +25 -6
  88. package/dist/types/logic/admin/reads/eSIMWalletFactory.reads.d.ts +21 -6
  89. package/dist/types/logic/admin/reads/lazyWalletRegistry.reads.d.ts +44 -11
  90. package/dist/types/logic/admin/reads/protocolAdmin.reads.d.ts +53 -0
  91. package/dist/types/logic/admin/reads/registry.reads.d.ts +105 -9
  92. package/dist/types/logic/admin/registry.eoa.d.ts +102 -5
  93. package/dist/types/logic/constants.d.ts +2 -0
  94. package/dist/types/logic/deviceWallet.d.ts +78 -6
  95. package/dist/types/logic/deviceWalletFactory.d.ts +32 -3
  96. package/dist/types/logic/eSIMWallet.d.ts +48 -7
  97. package/dist/types/logic/eSIMWalletFactory.d.ts +3 -3
  98. package/dist/types/logic/errors.d.ts +45 -0
  99. package/dist/types/logic/registry.d.ts +78 -0
  100. package/dist/types/types-export.d.ts +1 -1
  101. package/dist/types/types.d.ts +111 -1
  102. package/package.json +11 -13
  103. package/dist/esm/interface/lazyWalletRegistryClass.js +0 -10
  104. package/dist/esm/logic/lazyWalletRegistry.js +0 -19
  105. package/dist/types/interface/lazyWalletRegistryClass.d.ts +0 -6
  106. package/dist/types/logic/lazyWalletRegistry.d.ts +0 -2
@@ -1,4 +1,23 @@
1
1
  const RegistryHelper = [
2
+ {
3
+ "type": "function",
4
+ "name": "claimedESIMIdentifiers",
5
+ "inputs": [
6
+ {
7
+ "name": "hashOfESIMIdentifier",
8
+ "type": "bytes32",
9
+ "internalType": "bytes32"
10
+ }
11
+ ],
12
+ "outputs": [
13
+ {
14
+ "name": "eSIMWallet",
15
+ "type": "address",
16
+ "internalType": "address"
17
+ }
18
+ ],
19
+ "stateMutability": "view"
20
+ },
2
21
  {
3
22
  "type": "function",
4
23
  "name": "deployLazyWallet",
@@ -23,23 +42,6 @@ const RegistryHelper = [
23
42
  "type": "string[]",
24
43
  "internalType": "string[]"
25
44
  },
26
- {
27
- "name": "_dataBundleDetails",
28
- "type": "tuple[][]",
29
- "internalType": "struct DataBundleDetails[][]",
30
- "components": [
31
- {
32
- "name": "dataBundleID",
33
- "type": "string",
34
- "internalType": "string"
35
- },
36
- {
37
- "name": "dataBundlePrice",
38
- "type": "uint256",
39
- "internalType": "uint256"
40
- }
41
- ]
42
- },
43
45
  {
44
46
  "name": "_depositAmount",
45
47
  "type": "uint256",
@@ -60,6 +62,45 @@ const RegistryHelper = [
60
62
  ],
61
63
  "stateMutability": "payable"
62
64
  },
65
+ {
66
+ "type": "function",
67
+ "name": "deployMoreLazyESIMWallets",
68
+ "inputs": [
69
+ {
70
+ "name": "_deviceWallet",
71
+ "type": "address",
72
+ "internalType": "address"
73
+ },
74
+ {
75
+ "name": "_deviceUniqueIdentifier",
76
+ "type": "string",
77
+ "internalType": "string"
78
+ },
79
+ {
80
+ "name": "_baseSalt",
81
+ "type": "uint256",
82
+ "internalType": "uint256"
83
+ },
84
+ {
85
+ "name": "_startIndex",
86
+ "type": "uint256",
87
+ "internalType": "uint256"
88
+ },
89
+ {
90
+ "name": "_eSIMUniqueIdentifiers",
91
+ "type": "string[]",
92
+ "internalType": "string[]"
93
+ }
94
+ ],
95
+ "outputs": [
96
+ {
97
+ "name": "",
98
+ "type": "address[]",
99
+ "internalType": "address[]"
100
+ }
101
+ ],
102
+ "stateMutability": "nonpayable"
103
+ },
63
104
  {
64
105
  "type": "function",
65
106
  "name": "deviceWalletFactory",
@@ -110,6 +151,44 @@ const RegistryHelper = [
110
151
  ],
111
152
  "stateMutability": "view"
112
153
  },
154
+ {
155
+ "type": "function",
156
+ "name": "eSIMWalletForIdentifier",
157
+ "inputs": [
158
+ {
159
+ "name": "_eSIMUniqueIdentifier",
160
+ "type": "string",
161
+ "internalType": "string"
162
+ }
163
+ ],
164
+ "outputs": [
165
+ {
166
+ "name": "",
167
+ "type": "address",
168
+ "internalType": "address"
169
+ }
170
+ ],
171
+ "stateMutability": "view"
172
+ },
173
+ {
174
+ "type": "function",
175
+ "name": "isDeviceIdentifierAlreadyUsed",
176
+ "inputs": [
177
+ {
178
+ "name": "_deviceUniqueIdentifier",
179
+ "type": "string",
180
+ "internalType": "string"
181
+ }
182
+ ],
183
+ "outputs": [
184
+ {
185
+ "name": "",
186
+ "type": "bool",
187
+ "internalType": "bool"
188
+ }
189
+ ],
190
+ "stateMutability": "view"
191
+ },
113
192
  {
114
193
  "type": "function",
115
194
  "name": "isDeviceWalletValid",
@@ -129,6 +208,25 @@ const RegistryHelper = [
129
208
  ],
130
209
  "stateMutability": "view"
131
210
  },
211
+ {
212
+ "type": "function",
213
+ "name": "isESIMIdentifierClaimed",
214
+ "inputs": [
215
+ {
216
+ "name": "_eSIMUniqueIdentifier",
217
+ "type": "string",
218
+ "internalType": "string"
219
+ }
220
+ ],
221
+ "outputs": [
222
+ {
223
+ "name": "",
224
+ "type": "bool",
225
+ "internalType": "bool"
226
+ }
227
+ ],
228
+ "stateMutability": "view"
229
+ },
132
230
  {
133
231
  "type": "function",
134
232
  "name": "isESIMWalletOnStandby",
@@ -180,6 +278,36 @@ const RegistryHelper = [
180
278
  ],
181
279
  "stateMutability": "view"
182
280
  },
281
+ {
282
+ "type": "function",
283
+ "name": "populateLazyHistory",
284
+ "inputs": [
285
+ {
286
+ "name": "_eSIMWallet",
287
+ "type": "address",
288
+ "internalType": "address"
289
+ },
290
+ {
291
+ "name": "_dataBundleDetails",
292
+ "type": "tuple[]",
293
+ "internalType": "struct DataBundleDetails[]",
294
+ "components": [
295
+ {
296
+ "name": "dataBundleID",
297
+ "type": "string",
298
+ "internalType": "string"
299
+ },
300
+ {
301
+ "name": "dataBundlePrice",
302
+ "type": "uint256",
303
+ "internalType": "uint256"
304
+ }
305
+ ]
306
+ }
307
+ ],
308
+ "outputs": [],
309
+ "stateMutability": "nonpayable"
310
+ },
183
311
  {
184
312
  "type": "function",
185
313
  "name": "registeredP256Keys",
@@ -218,6 +346,108 @@ const RegistryHelper = [
218
346
  ],
219
347
  "stateMutability": "view"
220
348
  },
349
+ {
350
+ "type": "event",
351
+ "name": "AdminDisabled",
352
+ "inputs": [
353
+ {
354
+ "name": "_adminOfRecord",
355
+ "type": "address",
356
+ "indexed": true,
357
+ "internalType": "address"
358
+ },
359
+ {
360
+ "name": "_caller",
361
+ "type": "address",
362
+ "indexed": true,
363
+ "internalType": "address"
364
+ }
365
+ ],
366
+ "anonymous": false
367
+ },
368
+ {
369
+ "type": "event",
370
+ "name": "AdminEnabled",
371
+ "inputs": [
372
+ {
373
+ "name": "_adminOfRecord",
374
+ "type": "address",
375
+ "indexed": true,
376
+ "internalType": "address"
377
+ },
378
+ {
379
+ "name": "_caller",
380
+ "type": "address",
381
+ "indexed": true,
382
+ "internalType": "address"
383
+ }
384
+ ],
385
+ "anonymous": false
386
+ },
387
+ {
388
+ "type": "event",
389
+ "name": "AdminUpdateRequested",
390
+ "inputs": [
391
+ {
392
+ "name": "eSIMWalletAdmin",
393
+ "type": "address",
394
+ "indexed": true,
395
+ "internalType": "address"
396
+ },
397
+ {
398
+ "name": "_newAdmin",
399
+ "type": "address",
400
+ "indexed": true,
401
+ "internalType": "address"
402
+ }
403
+ ],
404
+ "anonymous": false
405
+ },
406
+ {
407
+ "type": "event",
408
+ "name": "AdminUpdateRevoked",
409
+ "inputs": [
410
+ {
411
+ "name": "_caller",
412
+ "type": "address",
413
+ "indexed": true,
414
+ "internalType": "address"
415
+ },
416
+ {
417
+ "name": "_revokedAddress",
418
+ "type": "address",
419
+ "indexed": true,
420
+ "internalType": "address"
421
+ }
422
+ ],
423
+ "anonymous": false
424
+ },
425
+ {
426
+ "type": "event",
427
+ "name": "AdminUpdated",
428
+ "inputs": [
429
+ {
430
+ "name": "_newAdmin",
431
+ "type": "address",
432
+ "indexed": true,
433
+ "internalType": "address"
434
+ }
435
+ ],
436
+ "anonymous": false
437
+ },
438
+ {
439
+ "type": "event",
440
+ "name": "DefaultDataBundlePriceCapUpdated",
441
+ "inputs": [
442
+ {
443
+ "name": "_cap",
444
+ "type": "uint256",
445
+ "indexed": false,
446
+ "internalType": "uint256"
447
+ }
448
+ ],
449
+ "anonymous": false
450
+ },
221
451
  {
222
452
  "type": "event",
223
453
  "name": "DeviceWalletInfoUpdated",
@@ -243,6 +473,56 @@ const RegistryHelper = [
243
473
  ],
244
474
  "anonymous": false
245
475
  },
476
+ {
477
+ "type": "event",
478
+ "name": "DeviceWalletOwnerKeyUpdated",
479
+ "inputs": [
480
+ {
481
+ "name": "_deviceWallet",
482
+ "type": "address",
483
+ "indexed": true,
484
+ "internalType": "address"
485
+ },
486
+ {
487
+ "name": "_oldOwnerKey",
488
+ "type": "bytes32[2]",
489
+ "indexed": false,
490
+ "internalType": "bytes32[2]"
491
+ },
492
+ {
493
+ "name": "_newOwnerKey",
494
+ "type": "bytes32[2]",
495
+ "indexed": false,
496
+ "internalType": "bytes32[2]"
497
+ }
498
+ ],
499
+ "anonymous": false
500
+ },
501
+ {
502
+ "type": "event",
503
+ "name": "ESIMIdentifierClaimed",
504
+ "inputs": [
505
+ {
506
+ "name": "_hashOfESIMIdentifier",
507
+ "type": "bytes32",
508
+ "indexed": true,
509
+ "internalType": "bytes32"
510
+ },
511
+ {
512
+ "name": "_eSIMUniqueIdentifier",
513
+ "type": "string",
514
+ "indexed": false,
515
+ "internalType": "string"
516
+ },
517
+ {
518
+ "name": "_eSIMWallet",
519
+ "type": "address",
520
+ "indexed": true,
521
+ "internalType": "address"
522
+ }
523
+ ],
524
+ "anonymous": false
525
+ },
246
526
  {
247
527
  "type": "event",
248
528
  "name": "ESIMWalletSetOnStandby",
@@ -299,6 +579,19 @@ const RegistryHelper = [
299
579
  ],
300
580
  "anonymous": false
301
581
  },
582
+ {
583
+ "type": "event",
584
+ "name": "Paused",
585
+ "inputs": [
586
+ {
587
+ "name": "_admin",
588
+ "type": "address",
589
+ "indexed": true,
590
+ "internalType": "address"
591
+ }
592
+ ],
593
+ "anonymous": false
594
+ },
302
595
  {
303
596
  "type": "event",
304
597
  "name": "RegistryInitialized",
@@ -332,11 +625,18 @@ const RegistryHelper = [
332
625
  "type": "address",
333
626
  "indexed": true,
334
627
  "internalType": "address"
335
- },
628
+ }
629
+ ],
630
+ "anonymous": false
631
+ },
632
+ {
633
+ "type": "event",
634
+ "name": "Unpaused",
635
+ "inputs": [
336
636
  {
337
- "name": "_verifier",
637
+ "name": "_owner",
338
638
  "type": "address",
339
- "indexed": false,
639
+ "indexed": true,
340
640
  "internalType": "address"
341
641
  }
342
642
  ],
@@ -374,10 +674,104 @@ const RegistryHelper = [
374
674
  ],
375
675
  "anonymous": false
376
676
  },
677
+ {
678
+ "type": "event",
679
+ "name": "VaultAddressUpdated",
680
+ "inputs": [
681
+ {
682
+ "name": "_updatedVaultAddress",
683
+ "type": "address",
684
+ "indexed": true,
685
+ "internalType": "address"
686
+ }
687
+ ],
688
+ "anonymous": false
689
+ },
690
+ {
691
+ "type": "error",
692
+ "name": "DeviceWalletAlreadyExists",
693
+ "inputs": [
694
+ {
695
+ "name": "deviceIdentifier",
696
+ "type": "string",
697
+ "internalType": "string"
698
+ },
699
+ {
700
+ "name": "deviceWallet",
701
+ "type": "address",
702
+ "internalType": "address"
703
+ }
704
+ ]
705
+ },
706
+ {
707
+ "type": "error",
708
+ "name": "ESIMIdentifierAlreadyClaimed",
709
+ "inputs": [
710
+ {
711
+ "name": "eSIMIdentifier",
712
+ "type": "string",
713
+ "internalType": "string"
714
+ },
715
+ {
716
+ "name": "eSIMWallet",
717
+ "type": "address",
718
+ "internalType": "address"
719
+ }
720
+ ]
721
+ },
722
+ {
723
+ "type": "error",
724
+ "name": "ESIMIdentifierReservedForLazyWallet",
725
+ "inputs": [
726
+ {
727
+ "name": "eSIMIdentifier",
728
+ "type": "string",
729
+ "internalType": "string"
730
+ }
731
+ ]
732
+ },
733
+ {
734
+ "type": "error",
735
+ "name": "EmptyESIMIdentifier",
736
+ "inputs": []
737
+ },
738
+ {
739
+ "type": "error",
740
+ "name": "NotADeviceWallet",
741
+ "inputs": [
742
+ {
743
+ "name": "account",
744
+ "type": "address",
745
+ "internalType": "address"
746
+ }
747
+ ]
748
+ },
749
+ {
750
+ "type": "error",
751
+ "name": "NotAProtocolESIMWallet",
752
+ "inputs": [
753
+ {
754
+ "name": "eSIMWallet",
755
+ "type": "address",
756
+ "internalType": "address"
757
+ }
758
+ ]
759
+ },
377
760
  {
378
761
  "type": "error",
379
762
  "name": "OnlyLazyWalletRegistry",
380
763
  "inputs": []
764
+ },
765
+ {
766
+ "type": "error",
767
+ "name": "UnknownESIMWallet",
768
+ "inputs": [
769
+ {
770
+ "name": "eSIMWallet",
771
+ "type": "address",
772
+ "internalType": "address"
773
+ }
774
+ ]
381
775
  }
382
776
  ];
383
777
  export default RegistryHelper;
@@ -7,4 +7,5 @@ import P256Verifier from './P256Verifier.js';
7
7
  import Registry from './Registry.js';
8
8
  import RegistryHelper from './RegistryHelper.js';
9
9
  import BeaconProxy from './BeaconProxy.js';
10
- export { DeviceWallet, DeviceWalletFactory, ESIMWallet, ESIMWalletFactory, LazyWalletRegistry, P256Verifier, Registry, RegistryHelper, BeaconProxy };
10
+ import ProtocolAdmin from './ProtocolAdmin.js';
11
+ export { DeviceWallet, DeviceWalletFactory, ESIMWallet, ESIMWalletFactory, LazyWalletRegistry, P256Verifier, Registry, RegistryHelper, BeaconProxy, ProtocolAdmin };
@@ -3,12 +3,16 @@ import { AdminDeviceWalletFactorySubPackage } from "./interface/deviceWalletFact
3
3
  import { AdminESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
4
4
  import { AdminRegistrySubPackage } from "./interface/registryClass.js";
5
5
  import { AdminLazyWalletRegistrySubPackage } from "./interface/lazyWalletRegistryClass.js";
6
+ import { AdminProtocolAdminSubPackage } from "./interface/protocolAdminClass.js";
6
7
  import { AdminDeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
7
8
  import { AdminESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
8
9
  // Re-export the typed error surface so backend consumers can `instanceof
9
10
  // KokioError` (or a subclass) and decode reverts without reaching into internal
10
11
  // module paths - mirroring `config.ts`.
11
12
  export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "../logic/errors.js";
13
+ // `getOperationState` answers with this, and comparing against it needs the enum
14
+ // at runtime rather than only in the types.
15
+ export { OperationState } from "../logic/admin/reads/protocolAdmin.reads.js";
12
16
  /**
13
17
  * EOA-only entry point for the NodeJS backend.
14
18
  *
@@ -35,6 +39,7 @@ export class KokioAdmin {
35
39
  eSIMWalletFactory;
36
40
  registry;
37
41
  lazyWalletRegistry;
42
+ protocolAdmin;
38
43
  // Instance-scoped surfaces - undefined until their address is known.
39
44
  deviceWallet;
40
45
  eSIMWallet;
@@ -47,6 +52,7 @@ export class KokioAdmin {
47
52
  this.eSIMWalletFactory = new AdminESIMWalletFactorySubPackage(walletClient);
48
53
  this.registry = new AdminRegistrySubPackage(walletClient);
49
54
  this.lazyWalletRegistry = new AdminLazyWalletRegistrySubPackage(walletClient);
55
+ this.protocolAdmin = new AdminProtocolAdminSubPackage(walletClient);
50
56
  this.deviceWallet = deviceWalletAddress ? new AdminDeviceWalletSubPackage(walletClient, deviceWalletAddress) : undefined;
51
57
  this.eSIMWallet = eSIMWalletAddress ? new AdminESIMWalletSubPackage(walletClient, eSIMWalletAddress) : undefined;
52
58
  }
@@ -95,6 +101,7 @@ export class KokioAdmin {
95
101
  this.eSIMWalletFactory = new AdminESIMWalletFactorySubPackage(walletClient);
96
102
  this.registry = new AdminRegistrySubPackage(walletClient);
97
103
  this.lazyWalletRegistry = new AdminLazyWalletRegistrySubPackage(walletClient);
104
+ this.protocolAdmin = new AdminProtocolAdminSubPackage(walletClient);
98
105
  this.deviceWallet = this.deviceWalletAddress ? new AdminDeviceWalletSubPackage(walletClient, this.deviceWalletAddress) : undefined;
99
106
  this.eSIMWallet = this.eSIMWalletAddress ? new AdminESIMWalletSubPackage(walletClient, this.eSIMWalletAddress) : undefined;
100
107
  return this;
@@ -1,5 +1,5 @@
1
- import { _deployESIMWallet, _setESIMUniqueIdentifierForAnESIMWallet, } from "../../logic/admin/deviceWallet.eoa.js";
2
- import { _deviceUniqueIdentifier, _isValidESIMWallet, _canPullETH, _getVaultAddress, } from "../../logic/admin/reads/deviceWallet.reads.js";
1
+ import { _addDeposit, _deployESIMWallet } from "../../logic/admin/deviceWallet.eoa.js";
2
+ import { _deviceUniqueIdentifier, _isValidESIMWallet, _canPullETH, _getVaultAddress, _getOwner, _getDeposit, _isValidSignature, _registry, _eSIMWalletFactory, _entryPoint, _verifier, } from "../../logic/admin/reads/deviceWallet.reads.js";
3
3
  /**
4
4
  * Thin EOA wrapper around a specific `DeviceWallet` instance. The instance
5
5
  * address is bound at construction; `KokioAdmin.setDeviceWalletAddress` swaps it
@@ -12,11 +12,11 @@ export class AdminDeviceWalletSubPackage {
12
12
  this.walletClient = walletClient;
13
13
  this.deviceWalletAddress = deviceWalletAddress;
14
14
  }
15
- deployESIMWallet(hasAccessToETH, salt) {
16
- return _deployESIMWallet(this.walletClient, this.deviceWalletAddress, hasAccessToETH, salt);
15
+ deployESIMWallet(salt) {
16
+ return _deployESIMWallet(this.walletClient, this.deviceWalletAddress, salt);
17
17
  }
18
- setESIMUniqueIdentifierForAnESIMWallet(eSIMWalletAddress, eSIMUniqueIdentifier) {
19
- return _setESIMUniqueIdentifierForAnESIMWallet(this.walletClient, this.deviceWalletAddress, eSIMWalletAddress, eSIMUniqueIdentifier);
18
+ addDeposit(amount) {
19
+ return _addDeposit(this.walletClient, this.deviceWalletAddress, amount);
20
20
  }
21
21
  // Reads: public storage getters and views
22
22
  deviceUniqueIdentifier() {
@@ -31,4 +31,25 @@ export class AdminDeviceWalletSubPackage {
31
31
  getVaultAddress() {
32
32
  return _getVaultAddress(this.walletClient, this.deviceWalletAddress);
33
33
  }
34
+ getOwner() {
35
+ return _getOwner(this.walletClient, this.deviceWalletAddress);
36
+ }
37
+ getDeposit() {
38
+ return _getDeposit(this.walletClient, this.deviceWalletAddress);
39
+ }
40
+ isValidSignature(messageHash, signature) {
41
+ return _isValidSignature(this.walletClient, this.deviceWalletAddress, messageHash, signature);
42
+ }
43
+ registry() {
44
+ return _registry(this.walletClient, this.deviceWalletAddress);
45
+ }
46
+ eSIMWalletFactory() {
47
+ return _eSIMWalletFactory(this.walletClient, this.deviceWalletAddress);
48
+ }
49
+ entryPoint() {
50
+ return _entryPoint(this.walletClient, this.deviceWalletAddress);
51
+ }
52
+ verifier() {
53
+ return _verifier(this.walletClient, this.deviceWalletAddress);
54
+ }
34
55
  }
@@ -1,6 +1,6 @@
1
1
  import { _createAccountWithEOA } from "../../logic/deviceWalletFactory.js";
2
- import { _deployDeviceWalletForUsers, _postCreateAccount, _addRegistryAddress, _updateVaultAddress, _requestAdminUpdate, _acceptAdminUpdate, _updateDeviceWalletImplementation, } from "../../logic/admin/deviceWalletFactory.eoa.js";
3
- import { _eSIMWalletAdmin, _vault, _newRequestedAdmin, _deviceWalletInfoAdded, _getCurrentDeviceWalletImplementation, _getCounterFactualAddress, } from "../../logic/admin/reads/deviceWalletFactory.reads.js";
2
+ import { _deployDeviceWalletForUsers, _postCreateAccount, _addRegistryAddress, _updateDeviceWalletImplementation, _acceptOwnership, _transferOwnershipCall, _upgradeCall, } from "../../logic/admin/deviceWalletFactory.eoa.js";
3
+ import { _eSIMWalletAdmin, _deviceWalletInfoAdded, _getCurrentDeviceWalletImplementation, _getCounterFactualAddress, _preCreateAccountValidation, _beacon, _registry, _entryPoint, _verifier, _owner, _pendingOwner, _proxiableUUID, _upgradeInterfaceVersion, } from "../../logic/admin/reads/deviceWalletFactory.reads.js";
4
4
  /**
5
5
  * Thin EOA wrapper around `DeviceWalletFactory`. Holds only the wallet client;
6
6
  * every method forwards to a logic function. `createAccountWithEOA` reuses the
@@ -17,21 +17,12 @@ export class AdminDeviceWalletFactorySubPackage {
17
17
  deployDeviceWalletForUsers(deviceUniqueIdentifiers, deviceWalletOwnersKey, salts, depositAmounts, value) {
18
18
  return _deployDeviceWalletForUsers(this.walletClient, deviceUniqueIdentifiers, deviceWalletOwnersKey, salts, depositAmounts, value);
19
19
  }
20
- postCreateAccount(deviceWallet, deviceUniqueIdentifier, deviceWalletOwnerKey) {
21
- return _postCreateAccount(this.walletClient, deviceWallet, deviceUniqueIdentifier, deviceWalletOwnerKey);
20
+ postCreateAccount(deviceWallet, deviceUniqueIdentifier, deviceWalletOwnerKey, salt) {
21
+ return _postCreateAccount(this.walletClient, deviceWallet, deviceUniqueIdentifier, deviceWalletOwnerKey, salt);
22
22
  }
23
23
  addRegistryAddress(registryContractAddress) {
24
24
  return _addRegistryAddress(this.walletClient, registryContractAddress);
25
25
  }
26
- updateVaultAddress(newVaultAddress) {
27
- return _updateVaultAddress(this.walletClient, newVaultAddress);
28
- }
29
- requestAdminUpdate(newAdmin) {
30
- return _requestAdminUpdate(this.walletClient, newAdmin);
31
- }
32
- acceptAdminUpdate() {
33
- return _acceptAdminUpdate(this.walletClient);
34
- }
35
26
  updateDeviceWalletImplementation(newDeviceImpl) {
36
27
  return _updateDeviceWalletImplementation(this.walletClient, newDeviceImpl);
37
28
  }
@@ -39,12 +30,6 @@ export class AdminDeviceWalletFactorySubPackage {
39
30
  eSIMWalletAdmin() {
40
31
  return _eSIMWalletAdmin(this.walletClient);
41
32
  }
42
- vault() {
43
- return _vault(this.walletClient);
44
- }
45
- newRequestedAdmin() {
46
- return _newRequestedAdmin(this.walletClient);
47
- }
48
33
  deviceWalletInfoAdded(deviceWallet) {
49
34
  return _deviceWalletInfoAdded(this.walletClient, deviceWallet);
50
35
  }
@@ -54,4 +39,41 @@ export class AdminDeviceWalletFactorySubPackage {
54
39
  getCounterFactualAddress(deviceWalletOwnerKey, deviceUniqueIdentifier, salt) {
55
40
  return _getCounterFactualAddress(this.walletClient, deviceWalletOwnerKey, deviceUniqueIdentifier, salt);
56
41
  }
42
+ preCreateAccountValidation(deviceUniqueIdentifier, deviceWalletOwnerKey) {
43
+ return _preCreateAccountValidation(this.walletClient, deviceUniqueIdentifier, deviceWalletOwnerKey);
44
+ }
45
+ beacon() {
46
+ return _beacon(this.walletClient);
47
+ }
48
+ registry() {
49
+ return _registry(this.walletClient);
50
+ }
51
+ entryPoint() {
52
+ return _entryPoint(this.walletClient);
53
+ }
54
+ verifier() {
55
+ return _verifier(this.walletClient);
56
+ }
57
+ owner() {
58
+ return _owner(this.walletClient);
59
+ }
60
+ pendingOwner() {
61
+ return _pendingOwner(this.walletClient);
62
+ }
63
+ proxiableUUID() {
64
+ return _proxiableUUID(this.walletClient);
65
+ }
66
+ upgradeInterfaceVersion() {
67
+ return _upgradeInterfaceVersion(this.walletClient);
68
+ }
69
+ acceptOwnership() {
70
+ return _acceptOwnership(this.walletClient);
71
+ }
72
+ // Owner payloads: hand the result to `protocolAdmin.schedule`
73
+ transferOwnershipCall(newOwner) {
74
+ return _transferOwnershipCall(this.walletClient, newOwner);
75
+ }
76
+ upgradeCall(newImplementation, data) {
77
+ return _upgradeCall(this.walletClient, newImplementation, data);
78
+ }
57
79
  }