kokio-sdk 1.0.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 (107) 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 +24 -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 +16 -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/constantsClass.d.ts +2 -2
  72. package/dist/types/interface/deviceWalletClass.d.ts +22 -2569
  73. package/dist/types/interface/deviceWalletFactoryClass.d.ts +10 -2564
  74. package/dist/types/interface/eSIMWalletClass.d.ts +11 -8
  75. package/dist/types/interface/eSIMWalletFactoryClass.d.ts +5 -2565
  76. package/dist/types/interface/registryClass.d.ts +19 -0
  77. package/dist/types/interface/smartAccountClass.d.ts +6 -2568
  78. package/dist/types/logic/P256Verifier.d.ts +2 -2
  79. package/dist/types/logic/account-kit/createSmartAccount.d.ts +43 -19
  80. package/dist/types/logic/admin/deviceWallet.eoa.d.ts +15 -9
  81. package/dist/types/logic/admin/deviceWalletFactory.eoa.d.ts +34 -23
  82. package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +0 -5
  83. package/dist/types/logic/admin/eSIMWalletFactory.eoa.d.ts +27 -9
  84. package/dist/types/logic/admin/lazyWalletRegistry.eoa.d.ts +102 -10
  85. package/dist/types/logic/admin/protocolAdmin.eoa.d.ts +163 -0
  86. package/dist/types/logic/admin/reads/deviceWallet.reads.d.ts +28 -8
  87. package/dist/types/logic/admin/reads/deviceWalletFactory.reads.d.ts +45 -14
  88. package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +25 -6
  89. package/dist/types/logic/admin/reads/eSIMWalletFactory.reads.d.ts +21 -6
  90. package/dist/types/logic/admin/reads/lazyWalletRegistry.reads.d.ts +44 -11
  91. package/dist/types/logic/admin/reads/protocolAdmin.reads.d.ts +53 -0
  92. package/dist/types/logic/admin/reads/registry.reads.d.ts +105 -9
  93. package/dist/types/logic/admin/registry.eoa.d.ts +102 -5
  94. package/dist/types/logic/constants.d.ts +2 -0
  95. package/dist/types/logic/deviceWallet.d.ts +78 -6
  96. package/dist/types/logic/deviceWalletFactory.d.ts +32 -3
  97. package/dist/types/logic/eSIMWallet.d.ts +48 -7
  98. package/dist/types/logic/eSIMWalletFactory.d.ts +3 -3
  99. package/dist/types/logic/errors.d.ts +45 -0
  100. package/dist/types/logic/registry.d.ts +78 -0
  101. package/dist/types/types-export.d.ts +1 -1
  102. package/dist/types/types.d.ts +111 -1
  103. package/package.json +11 -13
  104. package/dist/esm/interface/lazyWalletRegistryClass.js +0 -10
  105. package/dist/esm/logic/lazyWalletRegistry.js +0 -19
  106. package/dist/types/interface/lazyWalletRegistryClass.d.ts +0 -6
  107. package/dist/types/logic/lazyWalletRegistry.d.ts +0 -2
@@ -1,4 +1,18 @@
1
1
  declare const RegistryHelper: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "claimedESIMIdentifiers";
4
+ readonly inputs: readonly [{
5
+ readonly name: "hashOfESIMIdentifier";
6
+ readonly type: "bytes32";
7
+ readonly internalType: "bytes32";
8
+ }];
9
+ readonly outputs: readonly [{
10
+ readonly name: "eSIMWallet";
11
+ readonly type: "address";
12
+ readonly internalType: "address";
13
+ }];
14
+ readonly stateMutability: "view";
15
+ }, {
2
16
  readonly type: "function";
3
17
  readonly name: "deployLazyWallet";
4
18
  readonly inputs: readonly [{
@@ -17,19 +31,6 @@ declare const RegistryHelper: readonly [{
17
31
  readonly name: "_eSIMUniqueIdentifiers";
18
32
  readonly type: "string[]";
19
33
  readonly internalType: "string[]";
20
- }, {
21
- readonly name: "_dataBundleDetails";
22
- readonly type: "tuple[][]";
23
- readonly internalType: "struct DataBundleDetails[][]";
24
- readonly components: readonly [{
25
- readonly name: "dataBundleID";
26
- readonly type: "string";
27
- readonly internalType: "string";
28
- }, {
29
- readonly name: "dataBundlePrice";
30
- readonly type: "uint256";
31
- readonly internalType: "uint256";
32
- }];
33
34
  }, {
34
35
  readonly name: "_depositAmount";
35
36
  readonly type: "uint256";
@@ -45,6 +46,36 @@ declare const RegistryHelper: readonly [{
45
46
  readonly internalType: "address[]";
46
47
  }];
47
48
  readonly stateMutability: "payable";
49
+ }, {
50
+ readonly type: "function";
51
+ readonly name: "deployMoreLazyESIMWallets";
52
+ readonly inputs: readonly [{
53
+ readonly name: "_deviceWallet";
54
+ readonly type: "address";
55
+ readonly internalType: "address";
56
+ }, {
57
+ readonly name: "_deviceUniqueIdentifier";
58
+ readonly type: "string";
59
+ readonly internalType: "string";
60
+ }, {
61
+ readonly name: "_baseSalt";
62
+ readonly type: "uint256";
63
+ readonly internalType: "uint256";
64
+ }, {
65
+ readonly name: "_startIndex";
66
+ readonly type: "uint256";
67
+ readonly internalType: "uint256";
68
+ }, {
69
+ readonly name: "_eSIMUniqueIdentifiers";
70
+ readonly type: "string[]";
71
+ readonly internalType: "string[]";
72
+ }];
73
+ readonly outputs: readonly [{
74
+ readonly name: "";
75
+ readonly type: "address[]";
76
+ readonly internalType: "address[]";
77
+ }];
78
+ readonly stateMutability: "nonpayable";
48
79
  }, {
49
80
  readonly type: "function";
50
81
  readonly name: "deviceWalletFactory";
@@ -83,6 +114,34 @@ declare const RegistryHelper: readonly [{
83
114
  readonly internalType: "contract ESIMWalletFactory";
84
115
  }];
85
116
  readonly stateMutability: "view";
117
+ }, {
118
+ readonly type: "function";
119
+ readonly name: "eSIMWalletForIdentifier";
120
+ readonly inputs: readonly [{
121
+ readonly name: "_eSIMUniqueIdentifier";
122
+ readonly type: "string";
123
+ readonly internalType: "string";
124
+ }];
125
+ readonly outputs: readonly [{
126
+ readonly name: "";
127
+ readonly type: "address";
128
+ readonly internalType: "address";
129
+ }];
130
+ readonly stateMutability: "view";
131
+ }, {
132
+ readonly type: "function";
133
+ readonly name: "isDeviceIdentifierAlreadyUsed";
134
+ readonly inputs: readonly [{
135
+ readonly name: "_deviceUniqueIdentifier";
136
+ readonly type: "string";
137
+ readonly internalType: "string";
138
+ }];
139
+ readonly outputs: readonly [{
140
+ readonly name: "";
141
+ readonly type: "bool";
142
+ readonly internalType: "bool";
143
+ }];
144
+ readonly stateMutability: "view";
86
145
  }, {
87
146
  readonly type: "function";
88
147
  readonly name: "isDeviceWalletValid";
@@ -97,6 +156,20 @@ declare const RegistryHelper: readonly [{
97
156
  readonly internalType: "bool";
98
157
  }];
99
158
  readonly stateMutability: "view";
159
+ }, {
160
+ readonly type: "function";
161
+ readonly name: "isESIMIdentifierClaimed";
162
+ readonly inputs: readonly [{
163
+ readonly name: "_eSIMUniqueIdentifier";
164
+ readonly type: "string";
165
+ readonly internalType: "string";
166
+ }];
167
+ readonly outputs: readonly [{
168
+ readonly name: "";
169
+ readonly type: "bool";
170
+ readonly internalType: "bool";
171
+ }];
172
+ readonly stateMutability: "view";
100
173
  }, {
101
174
  readonly type: "function";
102
175
  readonly name: "isESIMWalletOnStandby";
@@ -135,6 +208,29 @@ declare const RegistryHelper: readonly [{
135
208
  readonly internalType: "address";
136
209
  }];
137
210
  readonly stateMutability: "view";
211
+ }, {
212
+ readonly type: "function";
213
+ readonly name: "populateLazyHistory";
214
+ readonly inputs: readonly [{
215
+ readonly name: "_eSIMWallet";
216
+ readonly type: "address";
217
+ readonly internalType: "address";
218
+ }, {
219
+ readonly name: "_dataBundleDetails";
220
+ readonly type: "tuple[]";
221
+ readonly internalType: "struct DataBundleDetails[]";
222
+ readonly components: readonly [{
223
+ readonly name: "dataBundleID";
224
+ readonly type: "string";
225
+ readonly internalType: "string";
226
+ }, {
227
+ readonly name: "dataBundlePrice";
228
+ readonly type: "uint256";
229
+ readonly internalType: "uint256";
230
+ }];
231
+ }];
232
+ readonly outputs: readonly [];
233
+ readonly stateMutability: "nonpayable";
138
234
  }, {
139
235
  readonly type: "function";
140
236
  readonly name: "registeredP256Keys";
@@ -163,6 +259,86 @@ declare const RegistryHelper: readonly [{
163
259
  readonly internalType: "address";
164
260
  }];
165
261
  readonly stateMutability: "view";
262
+ }, {
263
+ readonly type: "event";
264
+ readonly name: "AdminDisabled";
265
+ readonly inputs: readonly [{
266
+ readonly name: "_adminOfRecord";
267
+ readonly type: "address";
268
+ readonly indexed: true;
269
+ readonly internalType: "address";
270
+ }, {
271
+ readonly name: "_caller";
272
+ readonly type: "address";
273
+ readonly indexed: true;
274
+ readonly internalType: "address";
275
+ }];
276
+ readonly anonymous: false;
277
+ }, {
278
+ readonly type: "event";
279
+ readonly name: "AdminEnabled";
280
+ readonly inputs: readonly [{
281
+ readonly name: "_adminOfRecord";
282
+ readonly type: "address";
283
+ readonly indexed: true;
284
+ readonly internalType: "address";
285
+ }, {
286
+ readonly name: "_caller";
287
+ readonly type: "address";
288
+ readonly indexed: true;
289
+ readonly internalType: "address";
290
+ }];
291
+ readonly anonymous: false;
292
+ }, {
293
+ readonly type: "event";
294
+ readonly name: "AdminUpdateRequested";
295
+ readonly inputs: readonly [{
296
+ readonly name: "eSIMWalletAdmin";
297
+ readonly type: "address";
298
+ readonly indexed: true;
299
+ readonly internalType: "address";
300
+ }, {
301
+ readonly name: "_newAdmin";
302
+ readonly type: "address";
303
+ readonly indexed: true;
304
+ readonly internalType: "address";
305
+ }];
306
+ readonly anonymous: false;
307
+ }, {
308
+ readonly type: "event";
309
+ readonly name: "AdminUpdateRevoked";
310
+ readonly inputs: readonly [{
311
+ readonly name: "_caller";
312
+ readonly type: "address";
313
+ readonly indexed: true;
314
+ readonly internalType: "address";
315
+ }, {
316
+ readonly name: "_revokedAddress";
317
+ readonly type: "address";
318
+ readonly indexed: true;
319
+ readonly internalType: "address";
320
+ }];
321
+ readonly anonymous: false;
322
+ }, {
323
+ readonly type: "event";
324
+ readonly name: "AdminUpdated";
325
+ readonly inputs: readonly [{
326
+ readonly name: "_newAdmin";
327
+ readonly type: "address";
328
+ readonly indexed: true;
329
+ readonly internalType: "address";
330
+ }];
331
+ readonly anonymous: false;
332
+ }, {
333
+ readonly type: "event";
334
+ readonly name: "DefaultDataBundlePriceCapUpdated";
335
+ readonly inputs: readonly [{
336
+ readonly name: "_cap";
337
+ readonly type: "uint256";
338
+ readonly indexed: false;
339
+ readonly internalType: "uint256";
340
+ }];
341
+ readonly anonymous: false;
166
342
  }, {
167
343
  readonly type: "event";
168
344
  readonly name: "DeviceWalletInfoUpdated";
@@ -183,6 +359,46 @@ declare const RegistryHelper: readonly [{
183
359
  readonly internalType: "bytes32[2]";
184
360
  }];
185
361
  readonly anonymous: false;
362
+ }, {
363
+ readonly type: "event";
364
+ readonly name: "DeviceWalletOwnerKeyUpdated";
365
+ readonly inputs: readonly [{
366
+ readonly name: "_deviceWallet";
367
+ readonly type: "address";
368
+ readonly indexed: true;
369
+ readonly internalType: "address";
370
+ }, {
371
+ readonly name: "_oldOwnerKey";
372
+ readonly type: "bytes32[2]";
373
+ readonly indexed: false;
374
+ readonly internalType: "bytes32[2]";
375
+ }, {
376
+ readonly name: "_newOwnerKey";
377
+ readonly type: "bytes32[2]";
378
+ readonly indexed: false;
379
+ readonly internalType: "bytes32[2]";
380
+ }];
381
+ readonly anonymous: false;
382
+ }, {
383
+ readonly type: "event";
384
+ readonly name: "ESIMIdentifierClaimed";
385
+ readonly inputs: readonly [{
386
+ readonly name: "_hashOfESIMIdentifier";
387
+ readonly type: "bytes32";
388
+ readonly indexed: true;
389
+ readonly internalType: "bytes32";
390
+ }, {
391
+ readonly name: "_eSIMUniqueIdentifier";
392
+ readonly type: "string";
393
+ readonly indexed: false;
394
+ readonly internalType: "string";
395
+ }, {
396
+ readonly name: "_eSIMWallet";
397
+ readonly type: "address";
398
+ readonly indexed: true;
399
+ readonly internalType: "address";
400
+ }];
401
+ readonly anonymous: false;
186
402
  }, {
187
403
  readonly type: "event";
188
404
  readonly name: "ESIMWalletSetOnStandby";
@@ -228,6 +444,16 @@ declare const RegistryHelper: readonly [{
228
444
  readonly internalType: "string";
229
445
  }];
230
446
  readonly anonymous: false;
447
+ }, {
448
+ readonly type: "event";
449
+ readonly name: "Paused";
450
+ readonly inputs: readonly [{
451
+ readonly name: "_admin";
452
+ readonly type: "address";
453
+ readonly indexed: true;
454
+ readonly internalType: "address";
455
+ }];
456
+ readonly anonymous: false;
231
457
  }, {
232
458
  readonly type: "event";
233
459
  readonly name: "RegistryInitialized";
@@ -256,10 +482,15 @@ declare const RegistryHelper: readonly [{
256
482
  readonly type: "address";
257
483
  readonly indexed: true;
258
484
  readonly internalType: "address";
259
- }, {
260
- readonly name: "_verifier";
485
+ }];
486
+ readonly anonymous: false;
487
+ }, {
488
+ readonly type: "event";
489
+ readonly name: "Unpaused";
490
+ readonly inputs: readonly [{
491
+ readonly name: "_owner";
261
492
  readonly type: "address";
262
- readonly indexed: false;
493
+ readonly indexed: true;
263
494
  readonly internalType: "address";
264
495
  }];
265
496
  readonly anonymous: false;
@@ -288,9 +519,79 @@ declare const RegistryHelper: readonly [{
288
519
  readonly internalType: "address";
289
520
  }];
290
521
  readonly anonymous: false;
522
+ }, {
523
+ readonly type: "event";
524
+ readonly name: "VaultAddressUpdated";
525
+ readonly inputs: readonly [{
526
+ readonly name: "_updatedVaultAddress";
527
+ readonly type: "address";
528
+ readonly indexed: true;
529
+ readonly internalType: "address";
530
+ }];
531
+ readonly anonymous: false;
532
+ }, {
533
+ readonly type: "error";
534
+ readonly name: "DeviceWalletAlreadyExists";
535
+ readonly inputs: readonly [{
536
+ readonly name: "deviceIdentifier";
537
+ readonly type: "string";
538
+ readonly internalType: "string";
539
+ }, {
540
+ readonly name: "deviceWallet";
541
+ readonly type: "address";
542
+ readonly internalType: "address";
543
+ }];
544
+ }, {
545
+ readonly type: "error";
546
+ readonly name: "ESIMIdentifierAlreadyClaimed";
547
+ readonly inputs: readonly [{
548
+ readonly name: "eSIMIdentifier";
549
+ readonly type: "string";
550
+ readonly internalType: "string";
551
+ }, {
552
+ readonly name: "eSIMWallet";
553
+ readonly type: "address";
554
+ readonly internalType: "address";
555
+ }];
556
+ }, {
557
+ readonly type: "error";
558
+ readonly name: "ESIMIdentifierReservedForLazyWallet";
559
+ readonly inputs: readonly [{
560
+ readonly name: "eSIMIdentifier";
561
+ readonly type: "string";
562
+ readonly internalType: "string";
563
+ }];
564
+ }, {
565
+ readonly type: "error";
566
+ readonly name: "EmptyESIMIdentifier";
567
+ readonly inputs: readonly [];
568
+ }, {
569
+ readonly type: "error";
570
+ readonly name: "NotADeviceWallet";
571
+ readonly inputs: readonly [{
572
+ readonly name: "account";
573
+ readonly type: "address";
574
+ readonly internalType: "address";
575
+ }];
576
+ }, {
577
+ readonly type: "error";
578
+ readonly name: "NotAProtocolESIMWallet";
579
+ readonly inputs: readonly [{
580
+ readonly name: "eSIMWallet";
581
+ readonly type: "address";
582
+ readonly internalType: "address";
583
+ }];
291
584
  }, {
292
585
  readonly type: "error";
293
586
  readonly name: "OnlyLazyWalletRegistry";
294
587
  readonly inputs: readonly [];
588
+ }, {
589
+ readonly type: "error";
590
+ readonly name: "UnknownESIMWallet";
591
+ readonly inputs: readonly [{
592
+ readonly name: "eSIMWallet";
593
+ readonly type: "address";
594
+ readonly internalType: "address";
595
+ }];
295
596
  }];
296
597
  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 };
@@ -1,12 +1,15 @@
1
1
  import { Address, WalletClient } from "viem";
2
+ import { KokioConstants } from "../interface/constantsClass.js";
2
3
  import { AdminDeviceWalletFactorySubPackage } from "./interface/deviceWalletFactoryClass.js";
3
4
  import { AdminESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
4
5
  import { AdminRegistrySubPackage } from "./interface/registryClass.js";
5
6
  import { AdminLazyWalletRegistrySubPackage } from "./interface/lazyWalletRegistryClass.js";
7
+ import { AdminProtocolAdminSubPackage } from "./interface/protocolAdminClass.js";
6
8
  import { AdminDeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
7
9
  import { AdminESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
8
10
  export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "../logic/errors.js";
9
11
  export type { DecodedRevert } from "../logic/errors.js";
12
+ export { OperationState } from "../logic/admin/reads/protocolAdmin.reads.js";
10
13
  /**
11
14
  * EOA-only entry point for the NodeJS backend.
12
15
  *
@@ -27,13 +30,26 @@ export declare class KokioAdmin {
27
30
  walletClient: WalletClient;
28
31
  deviceWalletAddress?: Address;
29
32
  eSIMWalletAddress?: Address;
33
+ private _constants;
30
34
  deviceWalletFactory: AdminDeviceWalletFactorySubPackage;
31
35
  eSIMWalletFactory: AdminESIMWalletFactorySubPackage;
32
36
  registry: AdminRegistrySubPackage;
33
37
  lazyWalletRegistry: AdminLazyWalletRegistrySubPackage;
38
+ protocolAdmin: AdminProtocolAdminSubPackage;
34
39
  deviceWallet?: AdminDeviceWalletSubPackage;
35
40
  eSIMWallet?: AdminESIMWalletSubPackage;
36
41
  constructor(walletClient: WalletClient, deviceWalletAddress?: Address, eSIMWalletAddress?: Address);
42
+ /**
43
+ * Chain-specific constants (factory addresses, chain, RPC URLs, custom errors)
44
+ * for the wallet client's connected chain. Resolution is asynchronous because
45
+ * the chain id is read from the client, so this getter returns a promise:
46
+ *
47
+ * const { factoryAddresses } = await admin.constants;
48
+ *
49
+ * The underlying value is memoized, so repeated awaits do not re-fetch.
50
+ * There is no Pimlico key on this surface, so `pimlicoRpcURL` is always `""`.
51
+ */
52
+ get constants(): Promise<KokioConstants>;
37
53
  /**
38
54
  * Bind a `DeviceWallet` instance address after construction and (re)wire the
39
55
  * `deviceWallet` surface to it. Returns `this` for chaining. This is the
@@ -1,4 +1,4 @@
1
- import { Address, WalletClient } from "viem";
1
+ import { Address, Hex, WalletClient } from "viem";
2
2
  /**
3
3
  * Thin EOA wrapper around a specific `DeviceWallet` instance. The instance
4
4
  * address is bound at construction; `KokioAdmin.setDeviceWalletAddress` swaps it
@@ -8,10 +8,17 @@ export declare class AdminDeviceWalletSubPackage {
8
8
  walletClient: WalletClient;
9
9
  deviceWalletAddress: Address;
10
10
  constructor(walletClient: WalletClient, deviceWalletAddress: Address);
11
- deployESIMWallet(hasAccessToETH: boolean, salt: bigint): Promise<`0x${string}`>;
12
- setESIMUniqueIdentifierForAnESIMWallet(eSIMWalletAddress: Address, eSIMUniqueIdentifier: string): Promise<`0x${string}`>;
11
+ deployESIMWallet(salt: bigint): Promise<`0x${string}`>;
12
+ addDeposit(amount: bigint): Promise<`0x${string}`>;
13
13
  deviceUniqueIdentifier(): Promise<string>;
14
14
  isValidESIMWallet(eSIMWallet: Address): Promise<boolean>;
15
15
  canPullETH(eSIMWallet: Address): Promise<boolean>;
16
16
  getVaultAddress(): Promise<`0x${string}`>;
17
+ getOwner(): Promise<import("../../types.js").P256Key>;
18
+ getDeposit(): Promise<bigint>;
19
+ isValidSignature(messageHash: Hex, signature: Hex): Promise<`0x${string}`>;
20
+ registry(): Promise<`0x${string}`>;
21
+ eSIMWalletFactory(): Promise<`0x${string}`>;
22
+ entryPoint(): Promise<`0x${string}`>;
23
+ verifier(): Promise<`0x${string}`>;
17
24
  }
@@ -1,4 +1,4 @@
1
- import { Address, WalletClient } from "viem";
1
+ import { Address, Hex, WalletClient } from "viem";
2
2
  import { P256Key } from "../../types.js";
3
3
  /**
4
4
  * Thin EOA wrapper around `DeviceWalletFactory`. Holds only the wallet client;
@@ -10,16 +10,23 @@ export declare class AdminDeviceWalletFactorySubPackage {
10
10
  constructor(walletClient: WalletClient);
11
11
  createAccount(deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key, salt: bigint, depositAmount: bigint): Promise<`0x${string}`>;
12
12
  deployDeviceWalletForUsers(deviceUniqueIdentifiers: Array<string>, deviceWalletOwnersKey: Array<P256Key>, salts: Array<bigint>, depositAmounts: Array<bigint>, value: bigint): Promise<`0x${string}`>;
13
- postCreateAccount(deviceWallet: Address, deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key): Promise<`0x${string}`>;
13
+ postCreateAccount(deviceWallet: Address, deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key, salt: bigint): Promise<`0x${string}`>;
14
14
  addRegistryAddress(registryContractAddress: Address): Promise<`0x${string}`>;
15
- updateVaultAddress(newVaultAddress: Address): Promise<`0x${string}`>;
16
- requestAdminUpdate(newAdmin: Address): Promise<`0x${string}`>;
17
- acceptAdminUpdate(): Promise<`0x${string}`>;
18
15
  updateDeviceWalletImplementation(newDeviceImpl: Address): Promise<`0x${string}`>;
19
16
  eSIMWalletAdmin(): Promise<`0x${string}`>;
20
- vault(): Promise<`0x${string}`>;
21
- newRequestedAdmin(): Promise<`0x${string}`>;
22
17
  deviceWalletInfoAdded(deviceWallet: Address): Promise<boolean>;
23
18
  getCurrentDeviceWalletImplementation(): Promise<`0x${string}`>;
24
19
  getCounterFactualAddress(deviceWalletOwnerKey: P256Key, deviceUniqueIdentifier: string, salt: bigint): Promise<`0x${string}`>;
20
+ preCreateAccountValidation(deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key): Promise<`0x${string}`>;
21
+ beacon(): Promise<`0x${string}`>;
22
+ registry(): Promise<`0x${string}`>;
23
+ entryPoint(): Promise<`0x${string}`>;
24
+ verifier(): Promise<`0x${string}`>;
25
+ owner(): Promise<`0x${string}`>;
26
+ pendingOwner(): Promise<`0x${string}`>;
27
+ proxiableUUID(): Promise<`0x${string}`>;
28
+ upgradeInterfaceVersion(): Promise<string>;
29
+ acceptOwnership(): Promise<`0x${string}`>;
30
+ transferOwnershipCall(newOwner: Address): Promise<import("../../types.js").OwnerCall>;
31
+ upgradeCall(newImplementation: Address, data?: Hex): Promise<import("../../types.js").OwnerCall>;
25
32
  }
@@ -14,4 +14,7 @@ export declare class AdminESIMWalletSubPackage {
14
14
  eSIMUniqueIdentifier(): Promise<string>;
15
15
  newRequestedOwner(): Promise<`0x${string}`>;
16
16
  owner(): Promise<`0x${string}`>;
17
+ dataBundlePriceCap(): Promise<bigint>;
18
+ deviceWallet(): Promise<`0x${string}`>;
19
+ transactionHistory(index: bigint): Promise<DataBundleDetails>;
17
20
  }
@@ -1,10 +1,17 @@
1
- import { Address, WalletClient } from "viem";
1
+ import { Address, Hex, WalletClient } from "viem";
2
2
  /** Thin EOA (owner) wrapper around `ESIMWalletFactory`. */
3
3
  export declare class AdminESIMWalletFactorySubPackage {
4
4
  walletClient: WalletClient;
5
5
  constructor(walletClient: WalletClient);
6
6
  addRegistryAddress(registryContractAddress: Address): Promise<`0x${string}`>;
7
7
  updateESIMWalletImplementation(eSIMWalletImpl: Address): Promise<`0x${string}`>;
8
+ acceptOwnership(): Promise<`0x${string}`>;
9
+ transferOwnershipCall(newOwner: Address): Promise<import("../../types.js").OwnerCall>;
10
+ upgradeCall(newImplementation: Address, data?: Hex): Promise<import("../../types.js").OwnerCall>;
8
11
  isESIMWalletDeployed(eSIMWallet: Address): Promise<boolean>;
9
12
  getCurrentESIMWalletImplementation(): Promise<`0x${string}`>;
13
+ owner(): Promise<`0x${string}`>;
14
+ pendingOwner(): Promise<`0x${string}`>;
15
+ proxiableUUID(): Promise<`0x${string}`>;
16
+ upgradeInterfaceVersion(): Promise<string>;
10
17
  }
@@ -1,14 +1,50 @@
1
- import { WalletClient } from "viem";
1
+ import { Address, Hex, WalletClient } from "viem";
2
2
  import { DataBundleDetails, P256Key } from "../../types.js";
3
3
  /** Thin EOA (eSIMWalletAdmin) wrapper around `LazyWalletRegistry`. */
4
4
  export declare class AdminLazyWalletRegistrySubPackage {
5
5
  walletClient: WalletClient;
6
6
  constructor(walletClient: WalletClient);
7
7
  batchPopulateHistory(deviceUniqueIdentifiers: Array<string>, eSIMUniqueIdentifiers: Array<Array<string>>, dataBundleDetails: Array<Array<DataBundleDetails>>): Promise<`0x${string}`>;
8
- deployLazyWalletAndSetESIMIdentifier(deviceOwnerPublicKey: P256Key, deviceUniqueIdentifier: string, salt: bigint, depositAmount: bigint): Promise<`0x${string}`>;
8
+ /**
9
+ * Deploy a lazy device and all of its eSIM wallets. Sends as many transactions
10
+ * as the device needs and resolves once every wallet exists, so the caller
11
+ * does not deal with the on-chain batching at all.
12
+ *
13
+ * Resumable: call it again with the same arguments (and a deposit of 0) to
14
+ * pick a part-deployed device up from where it stopped.
15
+ *
16
+ * Record all of the device's purchase history before this runs.
17
+ */
18
+ deployLazyWalletAndSetESIMIdentifier(deviceOwnerPublicKey: P256Key, deviceUniqueIdentifier: string, salt: bigint, depositAmount: bigint, maxWallets?: bigint): Promise<import("../../types.js").LazyDeployment>;
19
+ /**
20
+ * Copy an eSIM's whole purchase history onto its wallet, over as many
21
+ * transactions as it takes. Resumable, and safe to run while the device's
22
+ * other eSIM wallets are still being deployed.
23
+ */
24
+ setHistoryForLazyWallet(eSIMIdentifier: string, maxEntries?: bigint): Promise<import("../../types.js").LazyHistoryCopy>;
9
25
  switchESIMIdentifierToNewDeviceIdentifier(eSIMIdentifier: string, oldDeviceIdentifier: string, newDeviceIdentifier: string): Promise<`0x${string}`>;
26
+ deployLazyWalletFirstBatch(deviceOwnerPublicKey: P256Key, deviceUniqueIdentifier: string, salt: bigint, depositAmount: bigint, maxWallets: bigint): Promise<`0x${string}`>;
27
+ deployMoreESIMWalletsForLazyDevice(deviceUniqueIdentifier: string, maxWallets: bigint): Promise<`0x${string}`>;
28
+ setHistoryForLazyWalletBatch(eSIMIdentifier: string, maxEntries: bigint): Promise<`0x${string}`>;
10
29
  upgradeManager(): Promise<`0x${string}`>;
11
30
  eSIMIdentifierToDeviceIdentifier(eSIMIdentifier: string): Promise<string>;
31
+ MAX_ESIM_WALLETS_PER_CALL(): Promise<bigint>;
32
+ MAX_HISTORY_ENTRIES_PER_CALL(): Promise<bigint>;
33
+ /** Deploy cursor. Non-zero exactly when the lazy route ran this device's first batch. */
34
+ eSIMWalletsDeployed(deviceIdentifier: string): Promise<bigint>;
35
+ lazyDeploymentSalt(deviceIdentifier: string): Promise<bigint>;
36
+ lazyDeployedESIMWallet(eSIMIdentifier: string): Promise<`0x${string}`>;
37
+ /** History cursor, per eSIM. */
38
+ historyEntriesCopied(eSIMIdentifier: string): Promise<bigint>;
39
+ isDeviceIdentifierReserved(deviceIdentifier: string): Promise<boolean>;
40
+ isESIMIdentifierReserved(eSIMIdentifier: string): Promise<boolean>;
12
41
  deviceIdentifierToESIMDetails(deviceIdentifier: string, eSIMIdentifier: string, index: bigint): Promise<DataBundleDetails>;
13
42
  eSIMIdentifiersAssociatedWithDeviceIdentifier(deviceIdentifier: string, index: bigint): Promise<string>;
43
+ owner(): Promise<`0x${string}`>;
44
+ pendingOwner(): Promise<`0x${string}`>;
45
+ proxiableUUID(): Promise<`0x${string}`>;
46
+ upgradeInterfaceVersion(): Promise<string>;
47
+ acceptOwnership(): Promise<`0x${string}`>;
48
+ transferOwnershipCall(newOwner: Address): Promise<import("../../types.js").OwnerCall>;
49
+ upgradeCall(newImplementation: Address, data?: Hex): Promise<import("../../types.js").OwnerCall>;
14
50
  }