kokio-sdk 3.4.0 → 3.5.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.
- package/README.md +8 -4
- package/dist/esm/abis/DeviceWallet.js +29 -0
- package/dist/esm/abis/ESIMWallet.js +55 -0
- package/dist/esm/abis/PaymentAdapter.js +53 -0
- package/dist/esm/abis/ProtocolAdmin.js +48 -0
- package/dist/esm/abis/Registry.js +55 -0
- package/dist/esm/abis/RegistryHelper.js +13 -0
- package/dist/esm/admin/config-admin.js +1 -1
- package/dist/esm/admin/interface/eSIMWalletClass.js +4 -1
- package/dist/esm/admin/interface/paymentAdapterClass.js +4 -1
- package/dist/esm/admin/interface/protocolAdminClass.js +7 -1
- package/dist/esm/admin/interface/registryClass.js +4 -1
- package/dist/esm/interface/deviceWalletClass.js +6 -3
- package/dist/esm/interface/eSIMWalletClass.js +7 -1
- package/dist/esm/interface/registryClass.js +4 -1
- package/dist/esm/logic/admin/eSIMWallet.eoa.js +9 -1
- package/dist/esm/logic/admin/paymentAdapter.eoa.js +16 -0
- package/dist/esm/logic/admin/protocolAdmin.eoa.js +34 -0
- package/dist/esm/logic/admin/reads/eSIMWallet.reads.js +12 -0
- package/dist/esm/logic/admin/reads/registry.reads.js +12 -0
- package/dist/esm/logic/constants.js +11 -14
- package/dist/esm/logic/deviceWallet.js +19 -6
- package/dist/esm/logic/eSIMWallet.js +36 -0
- package/dist/esm/logic/errors.js +14 -0
- package/dist/esm/logic/registry.js +12 -0
- package/dist/types/abis/DeviceWallet.d.ts +22 -0
- package/dist/types/abis/ESIMWallet.d.ts +42 -0
- package/dist/types/abis/PaymentAdapter.d.ts +42 -0
- package/dist/types/abis/ProtocolAdmin.d.ts +37 -0
- package/dist/types/abis/Registry.d.ts +42 -0
- package/dist/types/abis/RegistryHelper.d.ts +10 -0
- package/dist/types/admin/config-admin.d.ts +1 -1
- package/dist/types/admin/interface/eSIMWalletClass.d.ts +1 -0
- package/dist/types/admin/interface/paymentAdapterClass.d.ts +1 -0
- package/dist/types/admin/interface/protocolAdminClass.d.ts +2 -0
- package/dist/types/admin/interface/registryClass.d.ts +1 -0
- package/dist/types/interface/deviceWalletClass.d.ts +2 -1
- package/dist/types/interface/eSIMWalletClass.d.ts +2 -0
- package/dist/types/interface/registryClass.d.ts +1 -0
- package/dist/types/logic/admin/eSIMWallet.eoa.d.ts +3 -0
- package/dist/types/logic/admin/paymentAdapter.eoa.d.ts +6 -0
- package/dist/types/logic/admin/protocolAdmin.eoa.d.ts +14 -0
- package/dist/types/logic/admin/reads/eSIMWallet.reads.d.ts +5 -0
- package/dist/types/logic/admin/reads/registry.reads.d.ts +2 -0
- package/dist/types/logic/deviceWallet.d.ts +11 -5
- package/dist/types/logic/eSIMWallet.d.ts +14 -0
- package/dist/types/logic/errors.d.ts +10 -0
- package/dist/types/logic/registry.d.ts +2 -0
- package/package.json +1 -1
|
@@ -57,6 +57,13 @@ export declare const _executeRaw: (client: WalletClient, target: Address, value:
|
|
|
57
57
|
* proposer also holds.
|
|
58
58
|
*/
|
|
59
59
|
export declare const _cancel: (client: WalletClient, id: Hex) => Promise<`0x${string}`>;
|
|
60
|
+
/**
|
|
61
|
+
* Pause a protocol contract straight away. `GUARDIAN_ROLE`.
|
|
62
|
+
*
|
|
63
|
+
* Only stops the contract, which the admin key could already do, and a guardian
|
|
64
|
+
* can release it at once with `_unpauseInstantly`.
|
|
65
|
+
*/
|
|
66
|
+
export declare const _pauseInstantly: (client: WalletClient, target: Address) => Promise<`0x${string}`>;
|
|
60
67
|
/**
|
|
61
68
|
* Release a pause on a protocol contract straight away. `GUARDIAN_ROLE`.
|
|
62
69
|
*
|
|
@@ -138,6 +145,13 @@ export declare const _unpauseCall: (client: WalletClient, target?: Address) => P
|
|
|
138
145
|
* `target` defaults to the registry.
|
|
139
146
|
*/
|
|
140
147
|
export declare const _setDefaultPriceCapUSDCentsCall: (client: WalletClient, cap: bigint, target?: Address) => Promise<OwnerCall>;
|
|
148
|
+
/**
|
|
149
|
+
* Set what the admin key may charge each newly created eSIM wallet, in USD
|
|
150
|
+
* cents. Pass the result to `schedule`. Existing wallets keep their own figure.
|
|
151
|
+
*
|
|
152
|
+
* `target` defaults to the registry.
|
|
153
|
+
*/
|
|
154
|
+
export declare const _setDefaultAdminAllowanceUSDCentsCall: (client: WalletClient, allowance: bigint, target?: Address) => Promise<OwnerCall>;
|
|
141
155
|
/**
|
|
142
156
|
* Point the registry at a new payment adapter. Pass the result to `schedule`.
|
|
143
157
|
*
|
|
@@ -11,6 +11,11 @@ export declare const _eSIMUniqueIdentifier: (client: WalletClient, eSIMWalletAdd
|
|
|
11
11
|
* `buyDataBundleWithToken`, since a price over the ceiling reverts.
|
|
12
12
|
*/
|
|
13
13
|
export declare const _priceCapUSDCents: (client: WalletClient, eSIMWalletAddress: Address) => Promise<bigint>;
|
|
14
|
+
/**
|
|
15
|
+
* What the admin key may still charge this eSIM wallet, in USD cents. Only the
|
|
16
|
+
* owner can raise it, so a purchase above it needs the user first.
|
|
17
|
+
*/
|
|
18
|
+
export declare const _adminAllowanceUSDCents: (client: WalletClient, eSIMWalletAddress: Address) => Promise<bigint>;
|
|
14
19
|
/** The pending owner proposed via `requestTransferOwnership` (zero if none). */
|
|
15
20
|
export declare const _newRequestedOwner: (client: WalletClient, eSIMWalletAddress: Address) => Promise<Address>;
|
|
16
21
|
/** The current owner (device wallet) of this eSIM wallet. */
|
|
@@ -27,6 +27,8 @@ export declare const _paused: (client: WalletClient) => Promise<boolean>;
|
|
|
27
27
|
* cap of its own. Never zero.
|
|
28
28
|
*/
|
|
29
29
|
export declare const _defaultPriceCapUSDCents: (client: WalletClient) => Promise<bigint>;
|
|
30
|
+
/** What the admin key may charge a newly created eSIM wallet in total, in USD cents. */
|
|
31
|
+
export declare const _defaultAdminAllowanceUSDCents: (client: WalletClient) => Promise<bigint>;
|
|
30
32
|
/** The vault EOA recorded in the registry. */
|
|
31
33
|
export declare const _vault: (client: WalletClient) => Promise<Address>;
|
|
32
34
|
/** The pending admin nominated via `requestAdminUpdate` (zero address if none). */
|
|
@@ -44,12 +44,12 @@ export declare const _removeESIMWallet: (client: KokioSmartAccountClient, addres
|
|
|
44
44
|
* Rotate the P256 key that owns this wallet. The registry is told in the same
|
|
45
45
|
* call, so its record of the owner cannot drift from the wallet's.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* `newOwnerSignature` is the new passkey's WebAuthn assertion over
|
|
48
|
+
* `rotationChallenge(newOwner)`, ABI-encoded as a `WebAuthnSignature` with no
|
|
49
|
+
* version or validUntil header. Without it the contract reverts with
|
|
50
|
+
* `NewOwnerKeyCannotSign`, so a wallet can only move to a key that can sign.
|
|
51
51
|
*/
|
|
52
|
-
export declare const _transferOwnership: (client: KokioSmartAccountClient, address: Address, newOwner: P256Key) => Promise<`0x${string}`>;
|
|
52
|
+
export declare const _transferOwnership: (client: KokioSmartAccountClient, address: Address, newOwner: P256Key, newOwnerSignature: Hex) => Promise<`0x${string}`>;
|
|
53
53
|
/**
|
|
54
54
|
* Top up the gas deposit the EntryPoint holds for this wallet, from the wallet's
|
|
55
55
|
* own balance. Anyone may pay into any account's deposit, so an EOA can do this
|
|
@@ -81,6 +81,12 @@ export declare const _canPullFunds: (client: KokioSmartAccountClient, address: A
|
|
|
81
81
|
* the same owner key's wallet at a different salt.
|
|
82
82
|
*/
|
|
83
83
|
export declare const _isValidSignature: (client: KokioSmartAccountClient, address: Address, messageHash: Hex, signature: Hex) => Promise<Hex>;
|
|
84
|
+
/**
|
|
85
|
+
* The bytes the new passkey must sign before `transferOwnership` accepts it.
|
|
86
|
+
* Bound to this wallet, this chain and `newOwner`, so it cannot be reused for
|
|
87
|
+
* another rotation.
|
|
88
|
+
*/
|
|
89
|
+
export declare const _rotationChallenge: (client: KokioSmartAccountClient, address: Address, newOwner: P256Key) => Promise<Hex>;
|
|
84
90
|
/** The registry this wallet reports its ownership changes to. */
|
|
85
91
|
export declare const _registry: (client: KokioSmartAccountClient, address: Address) => Promise<Address>;
|
|
86
92
|
/** The factory that deploys this wallet's eSIM wallets. */
|
|
@@ -11,6 +11,14 @@ import { KokioSmartAccountClient } from "../types.js";
|
|
|
11
11
|
* owner has to set it again.
|
|
12
12
|
*/
|
|
13
13
|
export declare const _setPriceCapUSDCents: (client: KokioSmartAccountClient, address: Address, cap: bigint) => Promise<`0x${string}`>;
|
|
14
|
+
/**
|
|
15
|
+
* Set the total the admin key may charge this eSIM wallet, in USD cents. It
|
|
16
|
+
* replaces what is left rather than adding to it, and zero stops admin charges.
|
|
17
|
+
*
|
|
18
|
+
* `onlyDeviceWallet`, so only the user can raise what the admin may spend. A
|
|
19
|
+
* handover resets it to the registry default.
|
|
20
|
+
*/
|
|
21
|
+
export declare const _setAdminAllowanceUSDCents: (client: KokioSmartAccountClient, address: Address, allowance: bigint) => Promise<`0x${string}`>;
|
|
14
22
|
/**
|
|
15
23
|
* Buy a data bundle in `asset`, an ERC-20 the payment adapter accepts.
|
|
16
24
|
*
|
|
@@ -53,6 +61,12 @@ export declare const _owner: (client: KokioSmartAccountClient, address: Address)
|
|
|
53
61
|
* state is reachable.
|
|
54
62
|
*/
|
|
55
63
|
export declare const _priceCapUSDCents: (client: KokioSmartAccountClient, address: Address) => Promise<bigint>;
|
|
64
|
+
/**
|
|
65
|
+
* What the admin key may still charge this eSIM wallet, in USD cents. Each admin
|
|
66
|
+
* purchase lowers it and nothing refills it, so the owner tops it up with
|
|
67
|
+
* `setAdminAllowanceUSDCents`. The owner's own purchases do not touch it.
|
|
68
|
+
*/
|
|
69
|
+
export declare const _adminAllowanceUSDCents: (client: KokioSmartAccountClient, address: Address) => Promise<bigint>;
|
|
56
70
|
/**
|
|
57
71
|
* The device wallet this eSIM wallet belongs to. Tracks `owner`, but it is its
|
|
58
72
|
* own storage slot with its own getter, so read whichever one you mean.
|
|
@@ -149,6 +149,16 @@ export declare class PriceOutOfRangeError extends KokioError {
|
|
|
149
149
|
readonly priceUSDCents: bigint;
|
|
150
150
|
constructor(priceUSDCents: bigint);
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* An admin purchase priced above what the eSIM wallet's owner still allows the
|
|
154
|
+
* admin key to charge. Thrown before sending, since the contract would revert
|
|
155
|
+
* with `AdminAllowanceExceeded`. The owner raises it with `setAdminAllowanceUSDCents`.
|
|
156
|
+
*/
|
|
157
|
+
export declare class AdminAllowanceExceededError extends KokioError {
|
|
158
|
+
readonly priceUSDCents: bigint;
|
|
159
|
+
readonly remainingUSDCents: bigint;
|
|
160
|
+
constructor(priceUSDCents: bigint, remainingUSDCents: bigint);
|
|
161
|
+
}
|
|
152
162
|
/**
|
|
153
163
|
* A payment reference that is not 32 bytes, has an empty order part, or
|
|
154
164
|
* carries a tag this SDK cannot write over or read back.
|
|
@@ -70,6 +70,8 @@ export declare const _isESIMIdentifierClaimed: (client: KokioSmartAccountClient,
|
|
|
70
70
|
export declare const _eSIMWalletForIdentifier: (client: KokioSmartAccountClient, eSIMUniqueIdentifier: string) => Promise<Address>;
|
|
71
71
|
/** The fallback price ceiling in USD cents for a wallet holding no cap of its own. */
|
|
72
72
|
export declare const _defaultPriceCapUSDCents: (client: KokioSmartAccountClient) => Promise<bigint>;
|
|
73
|
+
/** What the admin key may charge a newly created eSIM wallet in total, in USD cents. */
|
|
74
|
+
export declare const _defaultAdminAllowanceUSDCents: (client: KokioSmartAccountClient) => Promise<bigint>;
|
|
73
75
|
/** The payment adapter this registry currently points at. */
|
|
74
76
|
export declare const _paymentAdapter: (client: KokioSmartAccountClient) => Promise<Address>;
|
|
75
77
|
/**
|