kokio-sdk 0.1.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +185 -1
  2. package/dist/esm/admin/config-admin.js +85 -0
  3. package/dist/esm/admin/interface/deviceWalletClass.js +34 -0
  4. package/dist/esm/admin/interface/deviceWalletFactoryClass.js +57 -0
  5. package/dist/esm/admin/interface/eSIMWalletClass.js +31 -0
  6. package/dist/esm/admin/interface/eSIMWalletFactoryClass.js +22 -0
  7. package/dist/esm/admin/interface/lazyWalletRegistryClass.js +33 -0
  8. package/dist/esm/admin/interface/registryClass.js +43 -0
  9. package/dist/esm/config.js +4 -0
  10. package/dist/esm/interface/deviceWalletClass.js +1 -13
  11. package/dist/esm/interface/eSIMWalletClass.js +2 -8
  12. package/dist/esm/interface/eSIMWalletFactoryClass.js +2 -8
  13. package/dist/esm/interface/lazyWalletRegistryClass.js +2 -11
  14. package/dist/esm/logic/P256Verifier.js +8 -15
  15. package/dist/esm/logic/account-kit/createSmartAccount.js +76 -24
  16. package/dist/esm/logic/admin/deviceWallet.eoa.js +42 -0
  17. package/dist/esm/logic/admin/deviceWalletFactory.eoa.js +133 -0
  18. package/dist/esm/logic/admin/eSIMWallet.eoa.js +30 -0
  19. package/dist/esm/logic/admin/eSIMWalletFactory.eoa.js +43 -0
  20. package/dist/esm/logic/admin/lazyWalletRegistry.eoa.js +62 -0
  21. package/dist/esm/logic/admin/reads/deviceWallet.reads.js +45 -0
  22. package/dist/esm/logic/admin/reads/deviceWalletFactory.reads.js +87 -0
  23. package/dist/esm/logic/admin/reads/eSIMWallet.reads.js +44 -0
  24. package/dist/esm/logic/admin/reads/eSIMWalletFactory.reads.js +32 -0
  25. package/dist/esm/logic/admin/reads/lazyWalletRegistry.reads.js +62 -0
  26. package/dist/esm/logic/admin/reads/registry.reads.js +136 -0
  27. package/dist/esm/logic/admin/registry.eoa.js +23 -0
  28. package/dist/esm/logic/constants.js +31 -71
  29. package/dist/esm/logic/deviceWallet.js +28 -91
  30. package/dist/esm/logic/deviceWalletFactory.js +21 -30
  31. package/dist/esm/logic/eSIMWallet.js +25 -57
  32. package/dist/esm/logic/eSIMWalletFactory.js +17 -50
  33. package/dist/esm/logic/errors.js +118 -0
  34. package/dist/esm/logic/lazyWalletRegistry.js +12 -72
  35. package/dist/esm/logic/utils.js +3 -3
  36. package/dist/types/abis/BeaconProxy.d.ts +58 -2
  37. package/dist/types/abis/DeviceWallet.d.ts +702 -2
  38. package/dist/types/abis/DeviceWalletFactory.d.ts +634 -2
  39. package/dist/types/abis/ESIMWallet.d.ts +375 -2
  40. package/dist/types/abis/ESIMWalletFactory.d.ts +355 -2
  41. package/dist/types/abis/LazyWalletRegistry.d.ts +565 -2
  42. package/dist/types/abis/P256Verifier.d.ts +56 -2
  43. package/dist/types/abis/Registry.d.ts +623 -2
  44. package/dist/types/abis/RegistryHelper.d.ts +295 -2
  45. package/dist/types/admin/config-admin.d.ts +55 -0
  46. package/dist/types/admin/interface/deviceWalletClass.d.ts +17 -0
  47. package/dist/types/admin/interface/deviceWalletFactoryClass.d.ts +25 -0
  48. package/dist/types/admin/interface/eSIMWalletClass.d.ts +17 -0
  49. package/dist/types/admin/interface/eSIMWalletFactoryClass.d.ts +10 -0
  50. package/dist/types/admin/interface/lazyWalletRegistryClass.d.ts +14 -0
  51. package/dist/types/admin/interface/registryClass.d.ts +17 -0
  52. package/dist/types/config.d.ts +2 -0
  53. package/dist/types/interface/P256VerifierClass.d.ts +2 -1
  54. package/dist/types/interface/deviceWalletClass.d.ts +24 -28
  55. package/dist/types/interface/deviceWalletFactoryClass.d.ts +27 -26
  56. package/dist/types/interface/eSIMWalletClass.d.ts +2 -4
  57. package/dist/types/interface/eSIMWalletFactoryClass.d.ts +24 -26
  58. package/dist/types/interface/lazyWalletRegistryClass.d.ts +1 -6
  59. package/dist/types/interface/smartAccountClass.d.ts +23 -23
  60. package/dist/types/logic/P256Verifier.d.ts +2 -1
  61. package/dist/types/logic/account-kit/createSmartAccount.d.ts +38 -1
  62. package/dist/types/logic/admin/deviceWallet.eoa.d.ts +12 -0
  63. package/dist/types/logic/admin/deviceWalletFactory.eoa.d.ts +33 -0
  64. package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +14 -0
  65. package/dist/types/logic/admin/eSIMWalletFactory.eoa.d.ts +13 -0
  66. package/dist/types/logic/admin/lazyWalletRegistry.eoa.d.ts +18 -0
  67. package/dist/types/logic/admin/reads/deviceWallet.reads.d.ts +16 -0
  68. package/dist/types/logic/admin/reads/deviceWalletFactory.reads.d.ts +26 -0
  69. package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +15 -0
  70. package/dist/types/logic/admin/reads/eSIMWalletFactory.reads.d.ts +10 -0
  71. package/dist/types/logic/admin/reads/lazyWalletRegistry.reads.d.ts +20 -0
  72. package/dist/types/logic/admin/reads/registry.reads.d.ts +34 -0
  73. package/dist/types/logic/admin/registry.eoa.d.ts +7 -0
  74. package/dist/types/logic/deviceWallet.d.ts +1 -5
  75. package/dist/types/logic/deviceWalletFactory.d.ts +5 -4
  76. package/dist/types/logic/eSIMWallet.d.ts +1 -3
  77. package/dist/types/logic/eSIMWalletFactory.d.ts +2 -4
  78. package/dist/types/logic/errors.d.ts +63 -0
  79. package/dist/types/logic/lazyWalletRegistry.d.ts +1 -6
  80. package/dist/types/logic/utils.d.ts +8 -1
  81. package/dist/types/types.d.ts +1 -1
  82. package/package.json +12 -3
  83. package/dist/esm/interface/utilsClass.js +0 -13
  84. package/dist/types/interface/utilsClass.d.ts +0 -2567
@@ -1,3 +1,296 @@
1
- import type { Abi } from "viem";
2
- declare const RegistryHelper: Abi;
1
+ declare const RegistryHelper: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "deployLazyWallet";
4
+ readonly inputs: readonly [{
5
+ readonly name: "_deviceWalletOwnerKey";
6
+ readonly type: "bytes32[2]";
7
+ readonly internalType: "bytes32[2]";
8
+ }, {
9
+ readonly name: "_deviceUniqueIdentifier";
10
+ readonly type: "string";
11
+ readonly internalType: "string";
12
+ }, {
13
+ readonly name: "_salt";
14
+ readonly type: "uint256";
15
+ readonly internalType: "uint256";
16
+ }, {
17
+ readonly name: "_eSIMUniqueIdentifiers";
18
+ readonly type: "string[]";
19
+ 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
+ readonly name: "_depositAmount";
35
+ readonly type: "uint256";
36
+ readonly internalType: "uint256";
37
+ }];
38
+ readonly outputs: readonly [{
39
+ readonly name: "";
40
+ readonly type: "address";
41
+ readonly internalType: "address";
42
+ }, {
43
+ readonly name: "";
44
+ readonly type: "address[]";
45
+ readonly internalType: "address[]";
46
+ }];
47
+ readonly stateMutability: "payable";
48
+ }, {
49
+ readonly type: "function";
50
+ readonly name: "deviceWalletFactory";
51
+ readonly inputs: readonly [];
52
+ readonly outputs: readonly [{
53
+ readonly name: "";
54
+ readonly type: "address";
55
+ readonly internalType: "contract DeviceWalletFactory";
56
+ }];
57
+ readonly stateMutability: "view";
58
+ }, {
59
+ readonly type: "function";
60
+ readonly name: "deviceWalletToOwner";
61
+ readonly inputs: readonly [{
62
+ readonly name: "deviceWalletAddress";
63
+ readonly type: "address";
64
+ readonly internalType: "address";
65
+ }, {
66
+ readonly name: "";
67
+ readonly type: "uint256";
68
+ readonly internalType: "uint256";
69
+ }];
70
+ readonly outputs: readonly [{
71
+ readonly name: "ownerP256Keys";
72
+ readonly type: "bytes32";
73
+ readonly internalType: "bytes32";
74
+ }];
75
+ readonly stateMutability: "view";
76
+ }, {
77
+ readonly type: "function";
78
+ readonly name: "eSIMWalletFactory";
79
+ readonly inputs: readonly [];
80
+ readonly outputs: readonly [{
81
+ readonly name: "";
82
+ readonly type: "address";
83
+ readonly internalType: "contract ESIMWalletFactory";
84
+ }];
85
+ readonly stateMutability: "view";
86
+ }, {
87
+ readonly type: "function";
88
+ readonly name: "isDeviceWalletValid";
89
+ readonly inputs: readonly [{
90
+ readonly name: "deviceWalletAddress";
91
+ readonly type: "address";
92
+ readonly internalType: "address";
93
+ }];
94
+ readonly outputs: readonly [{
95
+ readonly name: "valid";
96
+ readonly type: "bool";
97
+ readonly internalType: "bool";
98
+ }];
99
+ readonly stateMutability: "view";
100
+ }, {
101
+ readonly type: "function";
102
+ readonly name: "isESIMWalletOnStandby";
103
+ readonly inputs: readonly [{
104
+ readonly name: "eSIMWalletAddress";
105
+ readonly type: "address";
106
+ readonly internalType: "address";
107
+ }];
108
+ readonly outputs: readonly [{
109
+ readonly name: "isOnStandby";
110
+ readonly type: "bool";
111
+ readonly internalType: "bool";
112
+ }];
113
+ readonly stateMutability: "view";
114
+ }, {
115
+ readonly type: "function";
116
+ readonly name: "isESIMWalletValid";
117
+ readonly inputs: readonly [{
118
+ readonly name: "eSIMWalletAddress";
119
+ readonly type: "address";
120
+ readonly internalType: "address";
121
+ }];
122
+ readonly outputs: readonly [{
123
+ readonly name: "deviceWalletAddress";
124
+ readonly type: "address";
125
+ readonly internalType: "address";
126
+ }];
127
+ readonly stateMutability: "view";
128
+ }, {
129
+ readonly type: "function";
130
+ readonly name: "lazyWalletRegistry";
131
+ readonly inputs: readonly [];
132
+ readonly outputs: readonly [{
133
+ readonly name: "";
134
+ readonly type: "address";
135
+ readonly internalType: "address";
136
+ }];
137
+ readonly stateMutability: "view";
138
+ }, {
139
+ readonly type: "function";
140
+ readonly name: "registeredP256Keys";
141
+ readonly inputs: readonly [{
142
+ readonly name: "hashOfOwnerP256Keys";
143
+ readonly type: "bytes32";
144
+ readonly internalType: "bytes32";
145
+ }];
146
+ readonly outputs: readonly [{
147
+ readonly name: "deviceWalletAddress";
148
+ readonly type: "address";
149
+ readonly internalType: "address";
150
+ }];
151
+ readonly stateMutability: "view";
152
+ }, {
153
+ readonly type: "function";
154
+ readonly name: "uniqueIdentifierToDeviceWallet";
155
+ readonly inputs: readonly [{
156
+ readonly name: "deviceIdentifier";
157
+ readonly type: "string";
158
+ readonly internalType: "string";
159
+ }];
160
+ readonly outputs: readonly [{
161
+ readonly name: "deviceWalletAddress";
162
+ readonly type: "address";
163
+ readonly internalType: "address";
164
+ }];
165
+ readonly stateMutability: "view";
166
+ }, {
167
+ readonly type: "event";
168
+ readonly name: "DeviceWalletInfoUpdated";
169
+ readonly inputs: readonly [{
170
+ readonly name: "_deviceWallet";
171
+ readonly type: "address";
172
+ readonly indexed: true;
173
+ readonly internalType: "address";
174
+ }, {
175
+ readonly name: "_deviceUniqueIdentifier";
176
+ readonly type: "string";
177
+ readonly indexed: false;
178
+ readonly internalType: "string";
179
+ }, {
180
+ readonly name: "_deviceWalletOwnerKey";
181
+ readonly type: "bytes32[2]";
182
+ readonly indexed: false;
183
+ readonly internalType: "bytes32[2]";
184
+ }];
185
+ readonly anonymous: false;
186
+ }, {
187
+ readonly type: "event";
188
+ readonly name: "ESIMWalletSetOnStandby";
189
+ readonly inputs: readonly [{
190
+ readonly name: "_eSIMWalletAddress";
191
+ readonly type: "address";
192
+ readonly indexed: true;
193
+ readonly internalType: "address";
194
+ }, {
195
+ readonly name: "_isOnStandby";
196
+ readonly type: "bool";
197
+ readonly indexed: false;
198
+ readonly internalType: "bool";
199
+ }, {
200
+ readonly name: "_deviceWalletAddress";
201
+ readonly type: "address";
202
+ readonly indexed: true;
203
+ readonly internalType: "address";
204
+ }];
205
+ readonly anonymous: false;
206
+ }, {
207
+ readonly type: "event";
208
+ readonly name: "LazyWalletDeployed";
209
+ readonly inputs: readonly [{
210
+ readonly name: "_deviceWallet";
211
+ readonly type: "address";
212
+ readonly indexed: true;
213
+ readonly internalType: "address";
214
+ }, {
215
+ readonly name: "_deviceUniqueIdentifier";
216
+ readonly type: "string";
217
+ readonly indexed: false;
218
+ readonly internalType: "string";
219
+ }, {
220
+ readonly name: "_eSIMWallet";
221
+ readonly type: "address";
222
+ readonly indexed: true;
223
+ readonly internalType: "address";
224
+ }, {
225
+ readonly name: "_eSIMUniqueIdentifier";
226
+ readonly type: "string";
227
+ readonly indexed: false;
228
+ readonly internalType: "string";
229
+ }];
230
+ readonly anonymous: false;
231
+ }, {
232
+ readonly type: "event";
233
+ readonly name: "RegistryInitialized";
234
+ readonly inputs: readonly [{
235
+ readonly name: "_eSIMWalletAdmin";
236
+ readonly type: "address";
237
+ readonly indexed: false;
238
+ readonly internalType: "address";
239
+ }, {
240
+ readonly name: "_vault";
241
+ readonly type: "address";
242
+ readonly indexed: false;
243
+ readonly internalType: "address";
244
+ }, {
245
+ readonly name: "_upgradeManager";
246
+ readonly type: "address";
247
+ readonly indexed: true;
248
+ readonly internalType: "address";
249
+ }, {
250
+ readonly name: "_deviceWalletFactory";
251
+ readonly type: "address";
252
+ readonly indexed: true;
253
+ readonly internalType: "address";
254
+ }, {
255
+ readonly name: "_eSIMWalletFactory";
256
+ readonly type: "address";
257
+ readonly indexed: true;
258
+ readonly internalType: "address";
259
+ }, {
260
+ readonly name: "_verifier";
261
+ readonly type: "address";
262
+ readonly indexed: false;
263
+ readonly internalType: "address";
264
+ }];
265
+ readonly anonymous: false;
266
+ }, {
267
+ readonly type: "event";
268
+ readonly name: "UpdatedDeviceWalletassociatedWithESIMWallet";
269
+ readonly inputs: readonly [{
270
+ readonly name: "_eSIMWalletAddress";
271
+ readonly type: "address";
272
+ readonly indexed: true;
273
+ readonly internalType: "address";
274
+ }, {
275
+ readonly name: "_deviceWalletAddress";
276
+ readonly type: "address";
277
+ readonly indexed: true;
278
+ readonly internalType: "address";
279
+ }];
280
+ readonly anonymous: false;
281
+ }, {
282
+ readonly type: "event";
283
+ readonly name: "UpdatedLazyWalletRegistryAddress";
284
+ readonly inputs: readonly [{
285
+ readonly name: "_lazyWalletRegistry";
286
+ readonly type: "address";
287
+ readonly indexed: true;
288
+ readonly internalType: "address";
289
+ }];
290
+ readonly anonymous: false;
291
+ }, {
292
+ readonly type: "error";
293
+ readonly name: "OnlyLazyWalletRegistry";
294
+ readonly inputs: readonly [];
295
+ }];
3
296
  export default RegistryHelper;
@@ -0,0 +1,55 @@
1
+ import { Address, WalletClient } from "viem";
2
+ import { AdminDeviceWalletFactorySubPackage } from "./interface/deviceWalletFactoryClass.js";
3
+ import { AdminESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
4
+ import { AdminRegistrySubPackage } from "./interface/registryClass.js";
5
+ import { AdminLazyWalletRegistrySubPackage } from "./interface/lazyWalletRegistryClass.js";
6
+ import { AdminDeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
7
+ import { AdminESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
8
+ export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "../logic/errors.js";
9
+ export type { DecodedRevert } from "../logic/errors.js";
10
+ /**
11
+ * EOA-only entry point for the NodeJS backend.
12
+ *
13
+ * Unlike {@link Kokio} (the mobile/passkey surface), `KokioAdmin` needs no
14
+ * bundler, paymaster, or WebAuthn params - only a viem `WalletClient` carrying
15
+ * the admin/owner EOA. It exposes exactly the contract functions that are
16
+ * `onlyAdmin`/`onlyOwner`/`onlyESIMWalletAdmin(OrRegistry)` on chain and thus
17
+ * callable directly by an EOA (never via a device-wallet userOp).
18
+ *
19
+ * Contract-instance surfaces (`deviceWallet`, `eSIMWallet`) target a specific
20
+ * deployed address. The backend often does not know that address at construction
21
+ * time - e.g. it deploys a device wallet, then acts on it - so those addresses
22
+ * can be supplied later via {@link setDeviceWalletAddress}/{@link setESIMWalletAddress}
23
+ * on the *same* instance, without re-constructing. The accessors stay `undefined`
24
+ * until their address is set.
25
+ */
26
+ export declare class KokioAdmin {
27
+ walletClient: WalletClient;
28
+ deviceWalletAddress?: Address;
29
+ eSIMWalletAddress?: Address;
30
+ deviceWalletFactory: AdminDeviceWalletFactorySubPackage;
31
+ eSIMWalletFactory: AdminESIMWalletFactorySubPackage;
32
+ registry: AdminRegistrySubPackage;
33
+ lazyWalletRegistry: AdminLazyWalletRegistrySubPackage;
34
+ deviceWallet?: AdminDeviceWalletSubPackage;
35
+ eSIMWallet?: AdminESIMWalletSubPackage;
36
+ constructor(walletClient: WalletClient, deviceWalletAddress?: Address, eSIMWalletAddress?: Address);
37
+ /**
38
+ * Bind a `DeviceWallet` instance address after construction and (re)wire the
39
+ * `deviceWallet` surface to it. Returns `this` for chaining. This is the
40
+ * backend's primary flow: deploy a wallet, resolve its address, then keep
41
+ * using the same `KokioAdmin` reference.
42
+ */
43
+ setDeviceWalletAddress(deviceWalletAddress: Address): this;
44
+ /**
45
+ * Bind an `ESIMWallet` instance address after construction and (re)wire the
46
+ * `eSIMWallet` surface to it. Returns `this` for chaining.
47
+ */
48
+ setESIMWalletAddress(eSIMWalletAddress: Address): this;
49
+ /**
50
+ * Swap the underlying wallet client (e.g. to change the acting EOA) and
51
+ * re-instantiate every surface against it, preserving any bound instance
52
+ * addresses. Returns `this` for chaining.
53
+ */
54
+ setWalletClient(walletClient: WalletClient): this;
55
+ }
@@ -0,0 +1,17 @@
1
+ import { Address, WalletClient } from "viem";
2
+ /**
3
+ * Thin EOA wrapper around a specific `DeviceWallet` instance. The instance
4
+ * address is bound at construction; `KokioAdmin.setDeviceWalletAddress` swaps it
5
+ * by re-instantiating this SubPackage.
6
+ */
7
+ export declare class AdminDeviceWalletSubPackage {
8
+ walletClient: WalletClient;
9
+ deviceWalletAddress: Address;
10
+ constructor(walletClient: WalletClient, deviceWalletAddress: Address);
11
+ deployESIMWallet(hasAccessToETH: boolean, salt: bigint): Promise<`0x${string}`>;
12
+ setESIMUniqueIdentifierForAnESIMWallet(eSIMWalletAddress: Address, eSIMUniqueIdentifier: string): Promise<`0x${string}`>;
13
+ deviceUniqueIdentifier(): Promise<string>;
14
+ isValidESIMWallet(eSIMWallet: Address): Promise<boolean>;
15
+ canPullETH(eSIMWallet: Address): Promise<boolean>;
16
+ getVaultAddress(): Promise<`0x${string}`>;
17
+ }
@@ -0,0 +1,25 @@
1
+ import { Address, WalletClient } from "viem";
2
+ import { P256Key } from "../../types.js";
3
+ /**
4
+ * Thin EOA wrapper around `DeviceWalletFactory`. Holds only the wallet client;
5
+ * every method forwards to a logic function. `createAccountWithEOA` reuses the
6
+ * existing shared logic (the same call the mobile surface exposes).
7
+ */
8
+ export declare class AdminDeviceWalletFactorySubPackage {
9
+ walletClient: WalletClient;
10
+ constructor(walletClient: WalletClient);
11
+ createAccount(deviceUniqueIdentifier: string, deviceWalletOwnerKey: P256Key, salt: bigint, depositAmount: bigint): Promise<`0x${string}`>;
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}`>;
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
+ updateDeviceWalletImplementation(newDeviceImpl: Address): Promise<`0x${string}`>;
19
+ eSIMWalletAdmin(): Promise<`0x${string}`>;
20
+ vault(): Promise<`0x${string}`>;
21
+ newRequestedAdmin(): Promise<`0x${string}`>;
22
+ deviceWalletInfoAdded(deviceWallet: Address): Promise<boolean>;
23
+ getCurrentDeviceWalletImplementation(): Promise<`0x${string}`>;
24
+ getCounterFactualAddress(deviceWalletOwnerKey: P256Key, deviceUniqueIdentifier: string, salt: bigint): Promise<`0x${string}`>;
25
+ }
@@ -0,0 +1,17 @@
1
+ import { Address, WalletClient } from "viem";
2
+ import { DataBundleDetails } from "../../types.js";
3
+ /**
4
+ * Thin EOA wrapper around a specific `ESIMWallet` instance. The instance address
5
+ * is bound at construction; `KokioAdmin.setESIMWalletAddress` swaps it by
6
+ * re-instantiating this SubPackage.
7
+ */
8
+ export declare class AdminESIMWalletSubPackage {
9
+ walletClient: WalletClient;
10
+ eSIMWalletAddress: Address;
11
+ constructor(walletClient: WalletClient, eSIMWalletAddress: Address);
12
+ buyDataBundle(dataBundleDetails: DataBundleDetails, value?: bigint): Promise<`0x${string}`>;
13
+ eSIMWalletFactory(): Promise<`0x${string}`>;
14
+ eSIMUniqueIdentifier(): Promise<string>;
15
+ newRequestedOwner(): Promise<`0x${string}`>;
16
+ owner(): Promise<`0x${string}`>;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { Address, WalletClient } from "viem";
2
+ /** Thin EOA (owner) wrapper around `ESIMWalletFactory`. */
3
+ export declare class AdminESIMWalletFactorySubPackage {
4
+ walletClient: WalletClient;
5
+ constructor(walletClient: WalletClient);
6
+ addRegistryAddress(registryContractAddress: Address): Promise<`0x${string}`>;
7
+ updateESIMWalletImplementation(eSIMWalletImpl: Address): Promise<`0x${string}`>;
8
+ isESIMWalletDeployed(eSIMWallet: Address): Promise<boolean>;
9
+ getCurrentESIMWalletImplementation(): Promise<`0x${string}`>;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { WalletClient } from "viem";
2
+ import { DataBundleDetails, P256Key } from "../../types.js";
3
+ /** Thin EOA (eSIMWalletAdmin) wrapper around `LazyWalletRegistry`. */
4
+ export declare class AdminLazyWalletRegistrySubPackage {
5
+ walletClient: WalletClient;
6
+ constructor(walletClient: WalletClient);
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}`>;
9
+ switchESIMIdentifierToNewDeviceIdentifier(eSIMIdentifier: string, oldDeviceIdentifier: string, newDeviceIdentifier: string): Promise<`0x${string}`>;
10
+ upgradeManager(): Promise<`0x${string}`>;
11
+ eSIMIdentifierToDeviceIdentifier(eSIMIdentifier: string): Promise<string>;
12
+ deviceIdentifierToESIMDetails(deviceIdentifier: string, eSIMIdentifier: string, index: bigint): Promise<DataBundleDetails>;
13
+ eSIMIdentifiersAssociatedWithDeviceIdentifier(deviceIdentifier: string, index: bigint): Promise<string>;
14
+ }
@@ -0,0 +1,17 @@
1
+ import { Address, Hex, WalletClient } from "viem";
2
+ /** Thin EOA (owner) wrapper around `Registry`. */
3
+ export declare class AdminRegistrySubPackage {
4
+ walletClient: WalletClient;
5
+ constructor(walletClient: WalletClient);
6
+ addOrUpdateLazyWalletRegistryAddress(lazyWalletRegistry: Address): Promise<`0x${string}`>;
7
+ eSIMWalletAdmin(): Promise<`0x${string}`>;
8
+ vault(): Promise<`0x${string}`>;
9
+ upgradeManager(): Promise<`0x${string}`>;
10
+ lazyWalletRegistry(): Promise<`0x${string}`>;
11
+ uniqueIdentifierToDeviceWallet(deviceIdentifier: string): Promise<`0x${string}`>;
12
+ deviceWalletToOwner(deviceWallet: Address, index: bigint): Promise<`0x${string}`>;
13
+ registeredP256Keys(hashOfOwnerP256Keys: Hex): Promise<`0x${string}`>;
14
+ isDeviceWalletValid(deviceWallet: Address): Promise<boolean>;
15
+ isESIMWalletValid(eSIMWallet: Address): Promise<`0x${string}`>;
16
+ isESIMWalletOnStandby(eSIMWallet: Address): Promise<boolean>;
17
+ }
@@ -8,6 +8,8 @@ import { DeviceWalletSubPackage } from "./interface/deviceWalletClass.js";
8
8
  import { ESIMWalletSubPackage } from "./interface/eSIMWalletClass.js";
9
9
  import { ESIMWalletFactorySubPackage } from "./interface/eSIMWalletFactoryClass.js";
10
10
  import { SmartAccountClient } from "@aa-sdk/core";
11
+ export { KokioError, NullOrUndefinedValueError, MissingSmartWalletError, MissingEOAWalletError, InvalidClientError, UnsupportedChainError, UnconfiguredChainError, CounterfactualMismatchError, ContractRevertError, decodeContractRevert, } from "./logic/errors.js";
12
+ export type { DecodedRevert } from "./logic/errors.js";
11
13
  export declare class Kokio {
12
14
  viemWalletClient: WalletClient;
13
15
  credentialId: string;
@@ -1,7 +1,8 @@
1
+ import { Hex } from "viem";
1
2
  import { WebAuthnSignature } from "../types";
2
3
  import { SmartAccountClient } from "@aa-sdk/core";
3
4
  export declare class P256VerifierSubPackage {
4
5
  client: SmartAccountClient;
5
6
  constructor(client: SmartAccountClient);
6
- verifySignature(message: string, requireMessageVerification: boolean, webAuthnSignature: WebAuthnSignature, x: bigint, y: bigint): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
7
+ verifySignature(message: Hex, requireMessageVerification: boolean, webAuthnSignature: WebAuthnSignature, x: bigint, y: bigint): Promise<boolean>;
7
8
  }
@@ -1406,7 +1406,7 @@ export declare class DeviceWalletSubPackage {
1406
1406
  authorizationList: import("viem").TransactionSerializableEIP7702["authorizationList"];
1407
1407
  } ? "eip7702" : never) | (request["type"] extends string | undefined ? Extract<request["type"], string> : never)>) ? T_34 extends string ? T_34 : undefined : never : never) | undefined>>> & {
1408
1408
  chainId?: number | undefined;
1409
- }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "type" | "chainId" | "nonce" | "gas" | "blobVersionedHashes" | "fees") extends infer T_39 ? T_39 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "type" | "chainId" | "nonce" | "gas" | "blobVersionedHashes" | "fees") ? T_39 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_39 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">) & {
1409
+ }, (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "nonce" | "type" | "chainId" | "gas" | "blobVersionedHashes" | "fees") extends infer T_39 ? T_39 extends (request["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? request["parameters"][number] : "nonce" | "type" | "chainId" | "gas" | "blobVersionedHashes" | "fees") ? T_39 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_39 : never : never> & (unknown extends request["kzg"] ? {} : Pick<request, "kzg">) & {
1410
1410
  _capabilities?: {
1411
1411
  [x: string]: any;
1412
1412
  } | undefined;
@@ -1420,6 +1420,7 @@ export declare class DeviceWalletSubPackage {
1420
1420
  id: string;
1421
1421
  }>;
1422
1422
  sendCallsSync: <const calls extends readonly unknown[], chainOverride extends import("viem").Chain | undefined = undefined>(parameters: import("viem").SendCallsSyncParameters<import("viem").Chain | undefined, import("viem").Account | undefined, chainOverride, calls>) => Promise<{
1423
+ version: string;
1423
1424
  atomic: boolean;
1424
1425
  capabilities?: {
1425
1426
  [key: string]: any;
@@ -1429,7 +1430,6 @@ export declare class DeviceWalletSubPackage {
1429
1430
  chainId: number;
1430
1431
  id: string;
1431
1432
  receipts?: import("viem").WalletCallReceipt<bigint, "success" | "reverted">[] | undefined;
1432
- version: string;
1433
1433
  statusCode: number;
1434
1434
  status: "pending" | "success" | "failure" | undefined;
1435
1435
  }>;
@@ -2338,24 +2338,27 @@ export declare class DeviceWalletSubPackage {
2338
2338
  [x: `function[${string}]`]: undefined;
2339
2339
  [x: `address[${string}]`]: undefined;
2340
2340
  [x: `bool[${string}]`]: undefined;
2341
+ [x: `uint256[${string}]`]: undefined;
2342
+ [x: `uint64[${string}]`]: undefined;
2341
2343
  [x: `bytes[${string}]`]: undefined;
2342
- [x: `bytes1[${string}]`]: undefined;
2343
- [x: `bytes10[${string}]`]: undefined;
2344
+ [x: `bytes32[${string}]`]: undefined;
2345
+ [x: `bytes4[${string}]`]: undefined;
2344
2346
  [x: `bytes2[${string}]`]: undefined;
2347
+ [x: `bytes1[${string}]`]: undefined;
2345
2348
  [x: `bytes3[${string}]`]: undefined;
2346
- [x: `bytes4[${string}]`]: undefined;
2347
2349
  [x: `bytes5[${string}]`]: undefined;
2348
- [x: `bytes6[${string}]`]: undefined;
2350
+ [x: `bytes9[${string}]`]: undefined;
2349
2351
  [x: `bytes7[${string}]`]: undefined;
2352
+ [x: `bytes6[${string}]`]: undefined;
2353
+ [x: `bytes17[${string}]`]: undefined;
2350
2354
  [x: `bytes8[${string}]`]: undefined;
2351
- [x: `bytes9[${string}]`]: undefined;
2355
+ [x: `bytes10[${string}]`]: undefined;
2356
+ [x: `bytes15[${string}]`]: undefined;
2352
2357
  [x: `bytes11[${string}]`]: undefined;
2353
2358
  [x: `bytes12[${string}]`]: undefined;
2354
2359
  [x: `bytes13[${string}]`]: undefined;
2355
2360
  [x: `bytes14[${string}]`]: undefined;
2356
- [x: `bytes15[${string}]`]: undefined;
2357
2361
  [x: `bytes16[${string}]`]: undefined;
2358
- [x: `bytes17[${string}]`]: undefined;
2359
2362
  [x: `bytes18[${string}]`]: undefined;
2360
2363
  [x: `bytes19[${string}]`]: undefined;
2361
2364
  [x: `bytes20[${string}]`]: undefined;
@@ -2370,7 +2373,6 @@ export declare class DeviceWalletSubPackage {
2370
2373
  [x: `bytes29[${string}]`]: undefined;
2371
2374
  [x: `bytes30[${string}]`]: undefined;
2372
2375
  [x: `bytes31[${string}]`]: undefined;
2373
- [x: `bytes32[${string}]`]: undefined;
2374
2376
  [x: `int[${string}]`]: undefined;
2375
2377
  [x: `int8[${string}]`]: undefined;
2376
2378
  [x: `int16[${string}]`]: undefined;
@@ -2412,7 +2414,6 @@ export declare class DeviceWalletSubPackage {
2412
2414
  [x: `uint40[${string}]`]: undefined;
2413
2415
  [x: `uint48[${string}]`]: undefined;
2414
2416
  [x: `uint56[${string}]`]: undefined;
2415
- [x: `uint64[${string}]`]: undefined;
2416
2417
  [x: `uint72[${string}]`]: undefined;
2417
2418
  [x: `uint80[${string}]`]: undefined;
2418
2419
  [x: `uint88[${string}]`]: undefined;
@@ -2436,28 +2437,30 @@ export declare class DeviceWalletSubPackage {
2436
2437
  [x: `uint232[${string}]`]: undefined;
2437
2438
  [x: `uint240[${string}]`]: undefined;
2438
2439
  [x: `uint248[${string}]`]: undefined;
2439
- [x: `uint256[${string}]`]: undefined;
2440
2440
  string?: undefined;
2441
2441
  address?: undefined;
2442
2442
  bool?: undefined;
2443
+ uint256?: undefined;
2444
+ uint64?: undefined;
2443
2445
  bytes?: undefined;
2444
- bytes1?: undefined;
2445
- bytes10?: undefined;
2446
+ bytes32?: undefined;
2447
+ bytes4?: undefined;
2446
2448
  bytes2?: undefined;
2449
+ bytes1?: undefined;
2447
2450
  bytes3?: undefined;
2448
- bytes4?: undefined;
2449
2451
  bytes5?: undefined;
2450
- bytes6?: undefined;
2452
+ bytes9?: undefined;
2451
2453
  bytes7?: undefined;
2454
+ bytes6?: undefined;
2455
+ bytes17?: undefined;
2452
2456
  bytes8?: undefined;
2453
- bytes9?: undefined;
2457
+ bytes10?: undefined;
2458
+ bytes15?: undefined;
2454
2459
  bytes11?: undefined;
2455
2460
  bytes12?: undefined;
2456
2461
  bytes13?: undefined;
2457
2462
  bytes14?: undefined;
2458
- bytes15?: undefined;
2459
2463
  bytes16?: undefined;
2460
- bytes17?: undefined;
2461
2464
  bytes18?: undefined;
2462
2465
  bytes19?: undefined;
2463
2466
  bytes20?: undefined;
@@ -2472,7 +2475,6 @@ export declare class DeviceWalletSubPackage {
2472
2475
  bytes29?: undefined;
2473
2476
  bytes30?: undefined;
2474
2477
  bytes31?: undefined;
2475
- bytes32?: undefined;
2476
2478
  int8?: undefined;
2477
2479
  int16?: undefined;
2478
2480
  int24?: undefined;
@@ -2512,7 +2514,6 @@ export declare class DeviceWalletSubPackage {
2512
2514
  uint40?: undefined;
2513
2515
  uint48?: undefined;
2514
2516
  uint56?: undefined;
2515
- uint64?: undefined;
2516
2517
  uint72?: undefined;
2517
2518
  uint80?: undefined;
2518
2519
  uint88?: undefined;
@@ -2536,7 +2537,6 @@ export declare class DeviceWalletSubPackage {
2536
2537
  uint232?: undefined;
2537
2538
  uint240?: undefined;
2538
2539
  uint248?: undefined;
2539
- uint256?: undefined;
2540
2540
  } | {
2541
2541
  [key: string]: unknown;
2542
2542
  }, primaryType extends string>(args: import("viem").SignTypedDataParameters<typedData, primaryType, import("viem").Account | undefined>) => Promise<import("viem").SignTypedDataReturnType>;
@@ -2561,17 +2561,13 @@ export declare class DeviceWalletSubPackage {
2561
2561
  transport?: undefined;
2562
2562
  type?: undefined;
2563
2563
  uid?: undefined;
2564
- } & import("viem").ExactPartial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
2564
+ } & import("viem").ExactPartial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined>, "call" | "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
2565
2565
  };
2566
2566
  address: `0x${string}`;
2567
2567
  constructor(walletClient: WalletClient, smartAccountClient: SmartAccountClient, address: Address);
2568
2568
  addESIMWallet(eSIMWalletAddress: Address, hasAccessToETH: boolean): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2569
- deployESIMWallet(hasAccessToETH: boolean, salt: bigint): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2570
- getVaultAddress(): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2571
- payETHForDataBundles(amount: bigint): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2572
- pullETH(amount: bigint): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2569
+ getVaultAddress(): Promise<`0x${string}`>;
2573
2570
  removeESIMWallet(eSIMWalletAddress: Address, hasAccessToETH: boolean): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2574
- setESIMUniqueIdentifierForAnESIMWallet(eSIMWalletAddress: Address, eSIMUniqueIdentifier: string): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2575
2571
  toggleAccessToETH(eSIMWalletAddress: Address, hasAccessToETH: boolean): Promise<import("@aa-sdk/core").SendUserOperationResult<keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>;
2576
2572
  getOwner(): Promise<import("../types.js").P256Key>;
2577
2573
  }