kokio-sdk 2.0.0 → 3.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 (81) hide show
  1. package/README.md +21 -7
  2. package/dist/esm/abis/DeviceWallet.js +60 -59
  3. package/dist/esm/abis/ESIMWallet.js +263 -58
  4. package/dist/esm/abis/ESIMWalletFactory.js +2 -2
  5. package/dist/esm/abis/LazyWalletRegistry.js +68 -24
  6. package/dist/esm/abis/PaymentAdapter.js +861 -0
  7. package/dist/esm/abis/Registry.js +294 -18
  8. package/dist/esm/abis/RegistryHelper.js +101 -9
  9. package/dist/esm/abis/index.js +2 -1
  10. package/dist/esm/admin/config-admin.js +4 -0
  11. package/dist/esm/admin/interface/deviceWalletClass.js +3 -3
  12. package/dist/esm/admin/interface/eSIMWalletClass.js +6 -6
  13. package/dist/esm/admin/interface/lazyWalletRegistryClass.js +4 -1
  14. package/dist/esm/admin/interface/paymentAdapterClass.js +54 -0
  15. package/dist/esm/admin/interface/protocolAdminClass.js +6 -3
  16. package/dist/esm/admin/interface/registryClass.js +15 -6
  17. package/dist/esm/config.js +3 -0
  18. package/dist/esm/interface/deviceWalletClass.js +5 -5
  19. package/dist/esm/interface/eSIMWalletClass.js +10 -7
  20. package/dist/esm/interface/paymentAdapterClass.js +28 -0
  21. package/dist/esm/interface/registryClass.js +12 -3
  22. package/dist/esm/logic/admin/deviceWallet.eoa.js +3 -3
  23. package/dist/esm/logic/admin/deviceWalletFactory.eoa.js +6 -6
  24. package/dist/esm/logic/admin/eSIMWallet.eoa.js +14 -12
  25. package/dist/esm/logic/admin/eSIMWalletFactory.eoa.js +4 -4
  26. package/dist/esm/logic/admin/lazyWalletRegistry.eoa.js +7 -7
  27. package/dist/esm/logic/admin/paymentAdapter.eoa.js +123 -0
  28. package/dist/esm/logic/admin/protocolAdmin.eoa.js +34 -16
  29. package/dist/esm/logic/admin/reads/deviceWallet.reads.js +2 -2
  30. package/dist/esm/logic/admin/reads/eSIMWallet.reads.js +8 -7
  31. package/dist/esm/logic/admin/reads/lazyWalletRegistry.reads.js +19 -2
  32. package/dist/esm/logic/admin/reads/paymentAdapter.reads.js +106 -0
  33. package/dist/esm/logic/admin/reads/registry.reads.js +34 -6
  34. package/dist/esm/logic/admin/registry.eoa.js +44 -20
  35. package/dist/esm/logic/constants.js +17 -87
  36. package/dist/esm/logic/deviceWallet.js +11 -11
  37. package/dist/esm/logic/eSIMWallet.js +51 -22
  38. package/dist/esm/logic/errors.js +30 -1
  39. package/dist/esm/logic/paymentAdapter.js +116 -0
  40. package/dist/esm/logic/registry.js +50 -5
  41. package/dist/esm/types-export.js +1 -1
  42. package/dist/esm/types.js +11 -1
  43. package/dist/types/abis/DeviceWallet.d.ts +50 -49
  44. package/dist/types/abis/ESIMWallet.d.ts +215 -55
  45. package/dist/types/abis/ESIMWalletFactory.d.ts +2 -2
  46. package/dist/types/abis/LazyWalletRegistry.d.ts +58 -24
  47. package/dist/types/abis/PaymentAdapter.d.ts +661 -0
  48. package/dist/types/abis/Registry.d.ts +233 -18
  49. package/dist/types/abis/RegistryHelper.d.ts +83 -9
  50. package/dist/types/abis/index.d.ts +2 -1
  51. package/dist/types/admin/config-admin.d.ts +2 -0
  52. package/dist/types/admin/interface/deviceWalletClass.d.ts +1 -1
  53. package/dist/types/admin/interface/eSIMWalletClass.d.ts +3 -3
  54. package/dist/types/admin/interface/lazyWalletRegistryClass.d.ts +1 -0
  55. package/dist/types/admin/interface/paymentAdapterClass.d.ts +20 -0
  56. package/dist/types/admin/interface/protocolAdminClass.d.ts +2 -1
  57. package/dist/types/admin/interface/registryClass.d.ts +6 -2
  58. package/dist/types/config.d.ts +2 -0
  59. package/dist/types/interface/constantsClass.d.ts +2 -2
  60. package/dist/types/interface/deviceWalletClass.d.ts +2 -2
  61. package/dist/types/interface/eSIMWalletClass.d.ts +5 -4
  62. package/dist/types/interface/paymentAdapterClass.d.ts +13 -0
  63. package/dist/types/interface/registryClass.d.ts +5 -2
  64. package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +9 -6
  65. package/dist/types/logic/admin/paymentAdapter.eoa.d.ts +28 -0
  66. package/dist/types/logic/admin/protocolAdmin.eoa.d.ts +12 -2
  67. package/dist/types/logic/admin/reads/deviceWallet.reads.d.ts +1 -1
  68. package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +5 -4
  69. package/dist/types/logic/admin/reads/lazyWalletRegistry.reads.d.ts +7 -0
  70. package/dist/types/logic/admin/reads/paymentAdapter.reads.d.ts +30 -0
  71. package/dist/types/logic/admin/reads/registry.reads.d.ts +13 -5
  72. package/dist/types/logic/admin/registry.eoa.d.ts +18 -8
  73. package/dist/types/logic/constants.d.ts +5 -17
  74. package/dist/types/logic/deviceWallet.d.ts +7 -7
  75. package/dist/types/logic/eSIMWallet.d.ts +29 -15
  76. package/dist/types/logic/errors.d.ts +16 -1
  77. package/dist/types/logic/paymentAdapter.d.ts +40 -0
  78. package/dist/types/logic/registry.d.ts +20 -5
  79. package/dist/types/types-export.d.ts +2 -1
  80. package/dist/types/types.d.ts +20 -2
  81. package/package.json +1 -1
@@ -106,12 +106,22 @@ declare const Registry: readonly [{
106
106
  readonly stateMutability: "view";
107
107
  }, {
108
108
  readonly type: "function";
109
- readonly name: "defaultDataBundlePriceCap";
109
+ readonly name: "consumePaymentReference";
110
+ readonly inputs: readonly [{
111
+ readonly name: "_paymentReference";
112
+ readonly type: "bytes32";
113
+ readonly internalType: "bytes32";
114
+ }];
115
+ readonly outputs: readonly [];
116
+ readonly stateMutability: "nonpayable";
117
+ }, {
118
+ readonly type: "function";
119
+ readonly name: "defaultPriceCapUSDCents";
110
120
  readonly inputs: readonly [];
111
121
  readonly outputs: readonly [{
112
122
  readonly name: "";
113
- readonly type: "uint256";
114
- readonly internalType: "uint256";
123
+ readonly type: "uint64";
124
+ readonly internalType: "uint64";
115
125
  }];
116
126
  readonly stateMutability: "view";
117
127
  }, {
@@ -290,9 +300,9 @@ declare const Registry: readonly [{
290
300
  readonly type: "address";
291
301
  readonly internalType: "contract IEntryPoint";
292
302
  }, {
293
- readonly name: "_defaultDataBundlePriceCap";
294
- readonly type: "uint256";
295
- readonly internalType: "uint256";
303
+ readonly name: "_defaultPriceCapUSDCents";
304
+ readonly type: "uint64";
305
+ readonly internalType: "uint64";
296
306
  }];
297
307
  readonly outputs: readonly [];
298
308
  readonly stateMutability: "nonpayable";
@@ -412,6 +422,16 @@ declare const Registry: readonly [{
412
422
  readonly internalType: "bool";
413
423
  }];
414
424
  readonly stateMutability: "view";
425
+ }, {
426
+ readonly type: "function";
427
+ readonly name: "paymentAdapter";
428
+ readonly inputs: readonly [];
429
+ readonly outputs: readonly [{
430
+ readonly name: "";
431
+ readonly type: "address";
432
+ readonly internalType: "address";
433
+ }];
434
+ readonly stateMutability: "view";
415
435
  }, {
416
436
  readonly type: "function";
417
437
  readonly name: "pendingOwner";
@@ -434,13 +454,17 @@ declare const Registry: readonly [{
434
454
  readonly type: "tuple[]";
435
455
  readonly internalType: "struct DataBundleDetails[]";
436
456
  readonly components: readonly [{
437
- readonly name: "dataBundleID";
438
- readonly type: "string";
439
- readonly internalType: "string";
457
+ readonly name: "id";
458
+ readonly type: "bytes32";
459
+ readonly internalType: "bytes32";
440
460
  }, {
441
- readonly name: "dataBundlePrice";
442
- readonly type: "uint256";
443
- readonly internalType: "uint256";
461
+ readonly name: "priceUSDCents";
462
+ readonly type: "uint64";
463
+ readonly internalType: "uint64";
464
+ }, {
465
+ readonly name: "settlement";
466
+ readonly type: "uint8";
467
+ readonly internalType: "enum Settlement";
444
468
  }];
445
469
  }];
446
470
  readonly outputs: readonly [];
@@ -455,6 +479,45 @@ declare const Registry: readonly [{
455
479
  readonly internalType: "bytes32";
456
480
  }];
457
481
  readonly stateMutability: "view";
482
+ }, {
483
+ readonly type: "function";
484
+ readonly name: "recordSettledPurchase";
485
+ readonly inputs: readonly [{
486
+ readonly name: "_eSIMWallet";
487
+ readonly type: "address";
488
+ readonly internalType: "address";
489
+ }, {
490
+ readonly name: "_dataBundleDetail";
491
+ readonly type: "tuple";
492
+ readonly internalType: "struct DataBundleDetails";
493
+ readonly components: readonly [{
494
+ readonly name: "id";
495
+ readonly type: "bytes32";
496
+ readonly internalType: "bytes32";
497
+ }, {
498
+ readonly name: "priceUSDCents";
499
+ readonly type: "uint64";
500
+ readonly internalType: "uint64";
501
+ }, {
502
+ readonly name: "settlement";
503
+ readonly type: "uint8";
504
+ readonly internalType: "enum Settlement";
505
+ }];
506
+ }, {
507
+ readonly name: "_asset";
508
+ readonly type: "bytes32";
509
+ readonly internalType: "bytes32";
510
+ }, {
511
+ readonly name: "_tokenAmount";
512
+ readonly type: "uint256";
513
+ readonly internalType: "uint256";
514
+ }, {
515
+ readonly name: "_paymentReference";
516
+ readonly type: "bytes32";
517
+ readonly internalType: "bytes32";
518
+ }];
519
+ readonly outputs: readonly [];
520
+ readonly stateMutability: "nonpayable";
458
521
  }, {
459
522
  readonly type: "function";
460
523
  readonly name: "registeredP256Keys";
@@ -495,6 +558,16 @@ declare const Registry: readonly [{
495
558
  }];
496
559
  readonly outputs: readonly [];
497
560
  readonly stateMutability: "view";
561
+ }, {
562
+ readonly type: "function";
563
+ readonly name: "requireLazyHistoryCopied";
564
+ readonly inputs: readonly [{
565
+ readonly name: "_eSIMWallet";
566
+ readonly type: "address";
567
+ readonly internalType: "address";
568
+ }];
569
+ readonly outputs: readonly [];
570
+ readonly stateMutability: "view";
498
571
  }, {
499
572
  readonly type: "function";
500
573
  readonly name: "requireNotPaused";
@@ -503,11 +576,21 @@ declare const Registry: readonly [{
503
576
  readonly stateMutability: "view";
504
577
  }, {
505
578
  readonly type: "function";
506
- readonly name: "setDefaultDataBundlePriceCap";
579
+ readonly name: "setDefaultPriceCapUSDCents";
507
580
  readonly inputs: readonly [{
508
581
  readonly name: "_cap";
509
- readonly type: "uint256";
510
- readonly internalType: "uint256";
582
+ readonly type: "uint64";
583
+ readonly internalType: "uint64";
584
+ }];
585
+ readonly outputs: readonly [];
586
+ readonly stateMutability: "nonpayable";
587
+ }, {
588
+ readonly type: "function";
589
+ readonly name: "setPaymentAdapter";
590
+ readonly inputs: readonly [{
591
+ readonly name: "_paymentAdapter";
592
+ readonly type: "address";
593
+ readonly internalType: "address";
511
594
  }];
512
595
  readonly outputs: readonly [];
513
596
  readonly stateMutability: "nonpayable";
@@ -621,6 +704,20 @@ declare const Registry: readonly [{
621
704
  }];
622
705
  readonly outputs: readonly [];
623
706
  readonly stateMutability: "payable";
707
+ }, {
708
+ readonly type: "function";
709
+ readonly name: "usedPaymentReferences";
710
+ readonly inputs: readonly [{
711
+ readonly name: "scopedReference";
712
+ readonly type: "bytes32";
713
+ readonly internalType: "bytes32";
714
+ }];
715
+ readonly outputs: readonly [{
716
+ readonly name: "used";
717
+ readonly type: "bool";
718
+ readonly internalType: "bool";
719
+ }];
720
+ readonly stateMutability: "view";
624
721
  }, {
625
722
  readonly type: "function";
626
723
  readonly name: "vault";
@@ -703,12 +800,57 @@ declare const Registry: readonly [{
703
800
  readonly anonymous: false;
704
801
  }, {
705
802
  readonly type: "event";
706
- readonly name: "DefaultDataBundlePriceCapUpdated";
803
+ readonly name: "DataBundleSettled";
707
804
  readonly inputs: readonly [{
708
- readonly name: "_cap";
805
+ readonly name: "_eSIMWallet";
806
+ readonly type: "address";
807
+ readonly indexed: true;
808
+ readonly internalType: "address";
809
+ }, {
810
+ readonly name: "_dataBundleID";
811
+ readonly type: "bytes32";
812
+ readonly indexed: false;
813
+ readonly internalType: "bytes32";
814
+ }, {
815
+ readonly name: "_priceUSDCents";
816
+ readonly type: "uint64";
817
+ readonly indexed: false;
818
+ readonly internalType: "uint64";
819
+ }, {
820
+ readonly name: "_settlement";
821
+ readonly type: "uint8";
822
+ readonly indexed: false;
823
+ readonly internalType: "enum Settlement";
824
+ }, {
825
+ readonly name: "_asset";
826
+ readonly type: "bytes32";
827
+ readonly indexed: true;
828
+ readonly internalType: "bytes32";
829
+ }, {
830
+ readonly name: "_token";
831
+ readonly type: "address";
832
+ readonly indexed: false;
833
+ readonly internalType: "address";
834
+ }, {
835
+ readonly name: "_tokenAmount";
709
836
  readonly type: "uint256";
710
837
  readonly indexed: false;
711
838
  readonly internalType: "uint256";
839
+ }, {
840
+ readonly name: "_paymentReference";
841
+ readonly type: "bytes32";
842
+ readonly indexed: true;
843
+ readonly internalType: "bytes32";
844
+ }];
845
+ readonly anonymous: false;
846
+ }, {
847
+ readonly type: "event";
848
+ readonly name: "DefaultPriceCapUSDCentsUpdated";
849
+ readonly inputs: readonly [{
850
+ readonly name: "_cap";
851
+ readonly type: "uint64";
852
+ readonly indexed: false;
853
+ readonly internalType: "uint64";
712
854
  }];
713
855
  readonly anonymous: false;
714
856
  }, {
@@ -866,6 +1008,31 @@ declare const Registry: readonly [{
866
1008
  readonly internalType: "address";
867
1009
  }];
868
1010
  readonly anonymous: false;
1011
+ }, {
1012
+ readonly type: "event";
1013
+ readonly name: "PaymentAdapterUpdated";
1014
+ readonly inputs: readonly [{
1015
+ readonly name: "_paymentAdapter";
1016
+ readonly type: "address";
1017
+ readonly indexed: true;
1018
+ readonly internalType: "address";
1019
+ }];
1020
+ readonly anonymous: false;
1021
+ }, {
1022
+ readonly type: "event";
1023
+ readonly name: "PaymentReferenceConsumed";
1024
+ readonly inputs: readonly [{
1025
+ readonly name: "_eSIMWallet";
1026
+ readonly type: "address";
1027
+ readonly indexed: true;
1028
+ readonly internalType: "address";
1029
+ }, {
1030
+ readonly name: "_paymentReference";
1031
+ readonly type: "bytes32";
1032
+ readonly indexed: true;
1033
+ readonly internalType: "bytes32";
1034
+ }];
1035
+ readonly anonymous: false;
869
1036
  }, {
870
1037
  readonly type: "event";
871
1038
  readonly name: "RegistryInitialized";
@@ -908,7 +1075,7 @@ declare const Registry: readonly [{
908
1075
  readonly anonymous: false;
909
1076
  }, {
910
1077
  readonly type: "event";
911
- readonly name: "UpdatedDeviceWalletassociatedWithESIMWallet";
1078
+ readonly name: "UpdatedDeviceWalletAssociatedWithESIMWallet";
912
1079
  readonly inputs: readonly [{
913
1080
  readonly name: "_eSIMWalletAddress";
914
1081
  readonly type: "address";
@@ -1039,14 +1206,34 @@ declare const Registry: readonly [{
1039
1206
  readonly type: "address";
1040
1207
  readonly internalType: "address";
1041
1208
  }];
1209
+ }, {
1210
+ readonly type: "error";
1211
+ readonly name: "EmptyDataBundleID";
1212
+ readonly inputs: readonly [];
1042
1213
  }, {
1043
1214
  readonly type: "error";
1044
1215
  readonly name: "EmptyESIMIdentifier";
1045
1216
  readonly inputs: readonly [];
1217
+ }, {
1218
+ readonly type: "error";
1219
+ readonly name: "EmptyPaymentReference";
1220
+ readonly inputs: readonly [];
1046
1221
  }, {
1047
1222
  readonly type: "error";
1048
1223
  readonly name: "FailedCall";
1049
1224
  readonly inputs: readonly [];
1225
+ }, {
1226
+ readonly type: "error";
1227
+ readonly name: "HistoryNotFullyCopied";
1228
+ readonly inputs: readonly [{
1229
+ readonly name: "eSIMIdentifier";
1230
+ readonly type: "string";
1231
+ readonly internalType: "string";
1232
+ }, {
1233
+ readonly name: "outstanding";
1234
+ readonly type: "uint256";
1235
+ readonly internalType: "uint256";
1236
+ }];
1050
1237
  }, {
1051
1238
  readonly type: "error";
1052
1239
  readonly name: "InvalidInitialization";
@@ -1143,10 +1330,34 @@ declare const Registry: readonly [{
1143
1330
  readonly type: "error";
1144
1331
  readonly name: "OwnershipCannotBeRenounced";
1145
1332
  readonly inputs: readonly [];
1333
+ }, {
1334
+ readonly type: "error";
1335
+ readonly name: "PaymentAdapterNotSet";
1336
+ readonly inputs: readonly [];
1337
+ }, {
1338
+ readonly type: "error";
1339
+ readonly name: "PaymentAdapterUnchanged";
1340
+ readonly inputs: readonly [{
1341
+ readonly name: "paymentAdapter";
1342
+ readonly type: "address";
1343
+ readonly internalType: "address";
1344
+ }];
1345
+ }, {
1346
+ readonly type: "error";
1347
+ readonly name: "PaymentReferenceAlreadyUsed";
1348
+ readonly inputs: readonly [{
1349
+ readonly name: "paymentReference";
1350
+ readonly type: "bytes32";
1351
+ readonly internalType: "bytes32";
1352
+ }];
1146
1353
  }, {
1147
1354
  readonly type: "error";
1148
1355
  readonly name: "ProtocolPaused";
1149
1356
  readonly inputs: readonly [];
1357
+ }, {
1358
+ readonly type: "error";
1359
+ readonly name: "SettlementNotAsserted";
1360
+ readonly inputs: readonly [];
1150
1361
  }, {
1151
1362
  readonly type: "error";
1152
1363
  readonly name: "UUPSUnauthorizedCallContext";
@@ -1183,6 +1394,10 @@ declare const Registry: readonly [{
1183
1394
  readonly type: "string";
1184
1395
  readonly internalType: "string";
1185
1396
  }];
1397
+ }, {
1398
+ readonly type: "error";
1399
+ readonly name: "ZeroDataBundlePrice";
1400
+ readonly inputs: readonly [];
1186
1401
  }, {
1187
1402
  readonly type: "error";
1188
1403
  readonly name: "ZeroDataBundlePriceCap";
@@ -220,13 +220,17 @@ declare const RegistryHelper: readonly [{
220
220
  readonly type: "tuple[]";
221
221
  readonly internalType: "struct DataBundleDetails[]";
222
222
  readonly components: readonly [{
223
- readonly name: "dataBundleID";
224
- readonly type: "string";
225
- readonly internalType: "string";
223
+ readonly name: "id";
224
+ readonly type: "bytes32";
225
+ readonly internalType: "bytes32";
226
226
  }, {
227
- readonly name: "dataBundlePrice";
228
- readonly type: "uint256";
229
- readonly internalType: "uint256";
227
+ readonly name: "priceUSDCents";
228
+ readonly type: "uint64";
229
+ readonly internalType: "uint64";
230
+ }, {
231
+ readonly name: "settlement";
232
+ readonly type: "uint8";
233
+ readonly internalType: "enum Settlement";
230
234
  }];
231
235
  }];
232
236
  readonly outputs: readonly [];
@@ -331,12 +335,57 @@ declare const RegistryHelper: readonly [{
331
335
  readonly anonymous: false;
332
336
  }, {
333
337
  readonly type: "event";
334
- readonly name: "DefaultDataBundlePriceCapUpdated";
338
+ readonly name: "DataBundleSettled";
335
339
  readonly inputs: readonly [{
336
- readonly name: "_cap";
340
+ readonly name: "_eSIMWallet";
341
+ readonly type: "address";
342
+ readonly indexed: true;
343
+ readonly internalType: "address";
344
+ }, {
345
+ readonly name: "_dataBundleID";
346
+ readonly type: "bytes32";
347
+ readonly indexed: false;
348
+ readonly internalType: "bytes32";
349
+ }, {
350
+ readonly name: "_priceUSDCents";
351
+ readonly type: "uint64";
352
+ readonly indexed: false;
353
+ readonly internalType: "uint64";
354
+ }, {
355
+ readonly name: "_settlement";
356
+ readonly type: "uint8";
357
+ readonly indexed: false;
358
+ readonly internalType: "enum Settlement";
359
+ }, {
360
+ readonly name: "_asset";
361
+ readonly type: "bytes32";
362
+ readonly indexed: true;
363
+ readonly internalType: "bytes32";
364
+ }, {
365
+ readonly name: "_token";
366
+ readonly type: "address";
367
+ readonly indexed: false;
368
+ readonly internalType: "address";
369
+ }, {
370
+ readonly name: "_tokenAmount";
337
371
  readonly type: "uint256";
338
372
  readonly indexed: false;
339
373
  readonly internalType: "uint256";
374
+ }, {
375
+ readonly name: "_paymentReference";
376
+ readonly type: "bytes32";
377
+ readonly indexed: true;
378
+ readonly internalType: "bytes32";
379
+ }];
380
+ readonly anonymous: false;
381
+ }, {
382
+ readonly type: "event";
383
+ readonly name: "DefaultPriceCapUSDCentsUpdated";
384
+ readonly inputs: readonly [{
385
+ readonly name: "_cap";
386
+ readonly type: "uint64";
387
+ readonly indexed: false;
388
+ readonly internalType: "uint64";
340
389
  }];
341
390
  readonly anonymous: false;
342
391
  }, {
@@ -454,6 +503,31 @@ declare const RegistryHelper: readonly [{
454
503
  readonly internalType: "address";
455
504
  }];
456
505
  readonly anonymous: false;
506
+ }, {
507
+ readonly type: "event";
508
+ readonly name: "PaymentAdapterUpdated";
509
+ readonly inputs: readonly [{
510
+ readonly name: "_paymentAdapter";
511
+ readonly type: "address";
512
+ readonly indexed: true;
513
+ readonly internalType: "address";
514
+ }];
515
+ readonly anonymous: false;
516
+ }, {
517
+ readonly type: "event";
518
+ readonly name: "PaymentReferenceConsumed";
519
+ readonly inputs: readonly [{
520
+ readonly name: "_eSIMWallet";
521
+ readonly type: "address";
522
+ readonly indexed: true;
523
+ readonly internalType: "address";
524
+ }, {
525
+ readonly name: "_paymentReference";
526
+ readonly type: "bytes32";
527
+ readonly indexed: true;
528
+ readonly internalType: "bytes32";
529
+ }];
530
+ readonly anonymous: false;
457
531
  }, {
458
532
  readonly type: "event";
459
533
  readonly name: "RegistryInitialized";
@@ -496,7 +570,7 @@ declare const RegistryHelper: readonly [{
496
570
  readonly anonymous: false;
497
571
  }, {
498
572
  readonly type: "event";
499
- readonly name: "UpdatedDeviceWalletassociatedWithESIMWallet";
573
+ readonly name: "UpdatedDeviceWalletAssociatedWithESIMWallet";
500
574
  readonly inputs: readonly [{
501
575
  readonly name: "_eSIMWalletAddress";
502
576
  readonly type: "address";
@@ -8,4 +8,5 @@ import Registry from './Registry.js';
8
8
  import RegistryHelper from './RegistryHelper.js';
9
9
  import BeaconProxy from './BeaconProxy.js';
10
10
  import ProtocolAdmin from './ProtocolAdmin.js';
11
- export { DeviceWallet, DeviceWalletFactory, ESIMWallet, ESIMWalletFactory, LazyWalletRegistry, P256Verifier, Registry, RegistryHelper, BeaconProxy, ProtocolAdmin };
11
+ import PaymentAdapter from './PaymentAdapter.js';
12
+ export { DeviceWallet, DeviceWalletFactory, ESIMWallet, ESIMWalletFactory, LazyWalletRegistry, P256Verifier, Registry, RegistryHelper, BeaconProxy, ProtocolAdmin, PaymentAdapter };
@@ -7,6 +7,7 @@ import { AdminLazyWalletRegistrySubPackage } from "./interface/lazyWalletRegistr
7
7
  import { AdminProtocolAdminSubPackage } from "./interface/protocolAdminClass.js";
8
8
  import { AdminDeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
9
9
  import { AdminESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
10
+ import { AdminPaymentAdapterSubPackage } from "./interface/paymentAdapterClass.js";
10
11
  export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "../logic/errors.js";
11
12
  export type { DecodedRevert } from "../logic/errors.js";
12
13
  export { OperationState } from "../logic/admin/reads/protocolAdmin.reads.js";
@@ -36,6 +37,7 @@ export declare class KokioAdmin {
36
37
  registry: AdminRegistrySubPackage;
37
38
  lazyWalletRegistry: AdminLazyWalletRegistrySubPackage;
38
39
  protocolAdmin: AdminProtocolAdminSubPackage;
40
+ paymentAdapter: AdminPaymentAdapterSubPackage;
39
41
  deviceWallet?: AdminDeviceWalletSubPackage;
40
42
  eSIMWallet?: AdminESIMWalletSubPackage;
41
43
  constructor(walletClient: WalletClient, deviceWalletAddress?: Address, eSIMWalletAddress?: Address);
@@ -12,7 +12,7 @@ export declare class AdminDeviceWalletSubPackage {
12
12
  addDeposit(amount: bigint): Promise<`0x${string}`>;
13
13
  deviceUniqueIdentifier(): Promise<string>;
14
14
  isValidESIMWallet(eSIMWallet: Address): Promise<boolean>;
15
- canPullETH(eSIMWallet: Address): Promise<boolean>;
15
+ canPullFunds(eSIMWallet: Address): Promise<boolean>;
16
16
  getVaultAddress(): Promise<`0x${string}`>;
17
17
  getOwner(): Promise<import("../../types.js").P256Key>;
18
18
  getDeposit(): Promise<bigint>;
@@ -1,4 +1,4 @@
1
- import { Address, WalletClient } from "viem";
1
+ import { Address, Hex, WalletClient } from "viem";
2
2
  import { DataBundleDetails } from "../../types.js";
3
3
  /**
4
4
  * Thin EOA wrapper around a specific `ESIMWallet` instance. The instance address
@@ -9,12 +9,12 @@ export declare class AdminESIMWalletSubPackage {
9
9
  walletClient: WalletClient;
10
10
  eSIMWalletAddress: Address;
11
11
  constructor(walletClient: WalletClient, eSIMWalletAddress: Address);
12
- buyDataBundle(dataBundleDetails: DataBundleDetails, value?: bigint): Promise<`0x${string}`>;
12
+ buyDataBundleWithToken(dataBundleDetails: DataBundleDetails, asset: Hex, maxAmountIn: bigint, paymentReference: Hex): Promise<`0x${string}`>;
13
13
  eSIMWalletFactory(): Promise<`0x${string}`>;
14
14
  eSIMUniqueIdentifier(): Promise<string>;
15
15
  newRequestedOwner(): Promise<`0x${string}`>;
16
16
  owner(): Promise<`0x${string}`>;
17
- dataBundlePriceCap(): Promise<bigint>;
17
+ priceCapUSDCents(): Promise<bigint>;
18
18
  deviceWallet(): Promise<`0x${string}`>;
19
19
  transactionHistory(index: bigint): Promise<DataBundleDetails>;
20
20
  }
@@ -35,6 +35,7 @@ export declare class AdminLazyWalletRegistrySubPackage {
35
35
  lazyDeploymentSalt(deviceIdentifier: string): Promise<bigint>;
36
36
  lazyDeployedESIMWallet(eSIMIdentifier: string): Promise<`0x${string}`>;
37
37
  /** History cursor, per eSIM. */
38
+ outstandingHistoryEntries(eSIMIdentifier: string): Promise<bigint>;
38
39
  historyEntriesCopied(eSIMIdentifier: string): Promise<bigint>;
39
40
  isDeviceIdentifierReserved(deviceIdentifier: string): Promise<boolean>;
40
41
  isESIMIdentifierReserved(eSIMIdentifier: string): Promise<boolean>;
@@ -0,0 +1,20 @@
1
+ import { Address, Hex, WalletClient } from "viem";
2
+ import { Asset } from "../../types.js";
3
+ export declare class AdminPaymentAdapterSubPackage {
4
+ walletClient: WalletClient;
5
+ constructor(walletClient: WalletClient);
6
+ registry(): Promise<`0x${string}`>;
7
+ settlementToken(): Promise<`0x${string}`>;
8
+ assets(symbol: Hex): Promise<Asset>;
9
+ resolveAsset(symbol: Hex): Promise<Asset>;
10
+ quote(symbol: Hex, priceUSDCents: bigint): Promise<bigint>;
11
+ usedReferences(paymentReference: Hex): Promise<boolean>;
12
+ upgradeManager(): Promise<`0x${string}`>;
13
+ registerAsset(symbol: Hex, asset: Asset): Promise<`0x${string}`>;
14
+ updateAsset(symbol: Hex, asset: Asset): Promise<`0x${string}`>;
15
+ acceptOwnership(): Promise<`0x${string}`>;
16
+ registerAssetCall(symbol: Hex, asset: Asset): Promise<import("../../types.js").OwnerCall>;
17
+ updateAssetCall(symbol: Hex, asset: Asset): Promise<import("../../types.js").OwnerCall>;
18
+ transferOwnershipCall(newOwner: Address): Promise<import("../../types.js").OwnerCall>;
19
+ upgradeCall(newImplementation: Address, data?: Hex): Promise<import("../../types.js").OwnerCall>;
20
+ }
@@ -72,7 +72,8 @@ export declare class AdminProtocolAdminSubPackage {
72
72
  disableAdminCall(target?: Address): Promise<OwnerCall>;
73
73
  enableAdminCall(target?: Address): Promise<OwnerCall>;
74
74
  unpauseCall(target?: Address): Promise<OwnerCall>;
75
- setDefaultDataBundlePriceCapCall(cap: bigint, target?: Address): Promise<OwnerCall>;
75
+ setDefaultPriceCapUSDCentsCall(cap: bigint, target?: Address): Promise<OwnerCall>;
76
+ setPaymentAdapterCall(paymentAdapter: Address, target?: Address): Promise<OwnerCall>;
76
77
  operationId(call: OwnerCall, opts?: OperationOptions): Promise<`0x${string}`>;
77
78
  operationIdBatch(calls: readonly OwnerCall[], opts?: OperationOptions): Promise<`0x${string}`>;
78
79
  operationIdRaw(target: Address, value: bigint, payload: Hex, predecessor: Hex, salt: Hex): Promise<`0x${string}`>;
@@ -1,4 +1,5 @@
1
1
  import { Address, Hex, WalletClient } from "viem";
2
+ import { DataBundleDetails } from "../../types.js";
2
3
  /** Thin EOA (owner) wrapper around `Registry`. */
3
4
  export declare class AdminRegistrySubPackage {
4
5
  walletClient: WalletClient;
@@ -9,10 +10,11 @@ export declare class AdminRegistrySubPackage {
9
10
  disableAdmin(): Promise<`0x${string}`>;
10
11
  enableAdmin(): Promise<`0x${string}`>;
11
12
  acceptAdminUpdate(): Promise<`0x${string}`>;
13
+ recordSettledPurchase(eSIMWalletAddress: Address, dataBundleDetail: DataBundleDetails, asset: Hex, tokenAmount: bigint, paymentReference: Hex): Promise<`0x${string}`>;
12
14
  assignESIMIdentifier(eSIMWalletAddress: Address, eSIMUniqueIdentifier: string): Promise<`0x${string}`>;
13
15
  pause(): Promise<`0x${string}`>;
14
16
  unpause(): Promise<`0x${string}`>;
15
- setDefaultDataBundlePriceCap(cap: bigint): Promise<`0x${string}`>;
17
+ setDefaultPriceCapUSDCents(cap: bigint): Promise<`0x${string}`>;
16
18
  acceptOwnership(): Promise<`0x${string}`>;
17
19
  transferOwnershipCall(newOwner: Address): Promise<import("../../types.js").OwnerCall>;
18
20
  upgradeCall(newImplementation: Address, data?: Hex): Promise<import("../../types.js").OwnerCall>;
@@ -31,7 +33,9 @@ export declare class AdminRegistrySubPackage {
31
33
  isESIMWalletValid(eSIMWallet: Address): Promise<`0x${string}`>;
32
34
  isESIMWalletOnStandby(eSIMWallet: Address): Promise<boolean>;
33
35
  paused(): Promise<boolean>;
34
- defaultDataBundlePriceCap(): Promise<bigint>;
36
+ defaultPriceCapUSDCents(): Promise<bigint>;
37
+ paymentAdapter(): Promise<`0x${string}`>;
38
+ usedPaymentReferences(scopedReference: Hex): Promise<boolean>;
35
39
  isDeviceIdentifierAlreadyUsed(deviceUniqueIdentifier: string): Promise<boolean>;
36
40
  isESIMIdentifierClaimed(eSIMUniqueIdentifier: string): Promise<boolean>;
37
41
  eSIMWalletForIdentifier(eSIMUniqueIdentifier: string): Promise<`0x${string}`>;
@@ -7,6 +7,7 @@ import { RegistrySubPackage } from "./interface/registryClass.js";
7
7
  import { DeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
8
8
  import { ESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
9
9
  import { ESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
10
+ import { PaymentAdapterSubPackage } from "./interface/paymentAdapterClass.js";
10
11
  import { KokioSmartAccountClient } from "./types.js";
11
12
  export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "./logic/errors.js";
12
13
  export type { DecodedRevert } from "./logic/errors.js";
@@ -27,6 +28,7 @@ export declare class Kokio {
27
28
  deviceWallet?: DeviceWalletSubPackage;
28
29
  eSIMWallet?: ESIMWalletSubPackage;
29
30
  P256Verifier?: P256VerifierSubPackage;
31
+ paymentAdapter?: PaymentAdapterSubPackage;
30
32
  constructor(viemWalletClient: WalletClient, credentialId: string, rpId: string, pimlicoAPIKey: string, gasPolicyId: string, smartAccountClient?: KokioSmartAccountClient, deviceWalletAddress?: Address, eSIMWalletAddress?: Address);
31
33
  /**
32
34
  * Chain-specific constants (factory addresses, chain, RPC URLs, custom errors)
@@ -1,7 +1,7 @@
1
1
  import { WalletClient } from "viem";
2
- import { mainnetFactoryAddresses, sepoliaFactoryAddresses, optimismMainnetFactoryAddresses, optimismSepoliaFactoryAddresses, baseMainnetFactoryAddresses, baseSepoliaFactoryAddresses, arbitrumOneFactoryAddresses, arbitrumSepoliaFactoryAddresses, customErrors, chainSpecifcConstants } from "../logic/constants.js";
2
+ import { baseMainnetFactoryAddresses, baseSepoliaFactoryAddresses, customErrors, chainSpecifcConstants } from "../logic/constants.js";
3
3
  export interface KokioConstants {
4
- factoryAddresses: typeof sepoliaFactoryAddresses | typeof mainnetFactoryAddresses | typeof optimismMainnetFactoryAddresses | typeof optimismSepoliaFactoryAddresses | typeof baseMainnetFactoryAddresses | typeof baseSepoliaFactoryAddresses | typeof arbitrumOneFactoryAddresses | typeof arbitrumSepoliaFactoryAddresses;
4
+ factoryAddresses: typeof baseMainnetFactoryAddresses | typeof baseSepoliaFactoryAddresses;
5
5
  chain: chainSpecifcConstants["chain"];
6
6
  rpcURL: string;
7
7
  pimlicoRpcURL: string;
@@ -10,10 +10,10 @@ export declare class DeviceWalletSubPackage {
10
10
  addESIMWallet(eSIMWalletAddress: Address): Promise<`0x${string}`>;
11
11
  getVaultAddress(): Promise<`0x${string}`>;
12
12
  removeESIMWallet(eSIMWalletAddress: Address, callBackETH: boolean): Promise<`0x${string}`>;
13
- toggleAccessToETH(eSIMWalletAddress: Address, hasAccessToETH: boolean): Promise<`0x${string}`>;
13
+ toggleAccessToFunds(eSIMWalletAddress: Address, hasAccessToFunds: boolean): Promise<`0x${string}`>;
14
14
  transferOwnership(newOwner: P256Key): Promise<`0x${string}`>;
15
15
  withdrawDepositTo(withdrawAddress: Address, amount: bigint): Promise<`0x${string}`>;
16
- canPullETH(eSIMWalletAddress: Address): Promise<boolean>;
16
+ canPullFunds(eSIMWalletAddress: Address): Promise<boolean>;
17
17
  deviceUniqueIdentifier(): Promise<string>;
18
18
  entryPoint(): Promise<`0x${string}`>;
19
19
  eSIMWalletFactory(): Promise<`0x${string}`>;