@kheopskit/core 5.1.0 → 5.1.2
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/dist/errors-Caq2csKx.mjs +181 -0
- package/dist/errors-Caq2csKx.mjs.map +1 -0
- package/dist/errors-DPw6pc2H.js +222 -0
- package/dist/errors-DPw6pc2H.js.map +1 -0
- package/dist/ethereum.d.mts +39 -38
- package/dist/ethereum.d.ts +39 -38
- package/dist/ethereum.js +214 -281
- package/dist/ethereum.js.map +1 -1
- package/dist/ethereum.mjs +211 -282
- package/dist/ethereum.mjs.map +1 -1
- package/dist/{getCachedObservable-C4E8dfMp.d.ts → getCachedObservable-LUq9IfEx.d.mts} +5 -2
- package/dist/{getCachedObservable-C4E8dfMp.d.mts → getCachedObservable-LUq9IfEx.d.ts} +5 -2
- package/dist/iconCache-BSa42Sui.mjs +343 -0
- package/dist/iconCache-BSa42Sui.mjs.map +1 -0
- package/dist/iconCache-DS4zNiP1.js +396 -0
- package/dist/iconCache-DS4zNiP1.js.map +1 -0
- package/dist/index.d.mts +65 -59
- package/dist/index.d.ts +65 -59
- package/dist/index.js +901 -1015
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +885 -1016
- package/dist/index.mjs.map +1 -1
- package/dist/injectedWallets-B1MCxAE9.js +148 -0
- package/dist/injectedWallets-B1MCxAE9.js.map +1 -0
- package/dist/injectedWallets-B3Vysfvr.mjs +119 -0
- package/dist/injectedWallets-B3Vysfvr.mjs.map +1 -0
- package/dist/internal.d.mts +18 -16
- package/dist/internal.d.ts +18 -16
- package/dist/internal.js +9 -20
- package/dist/internal.mjs +3 -20
- package/dist/polkadot.d.mts +37 -36
- package/dist/polkadot.d.ts +37 -36
- package/dist/polkadot.js +178 -220
- package/dist/polkadot.js.map +1 -1
- package/dist/polkadot.mjs +175 -221
- package/dist/polkadot.mjs.map +1 -1
- package/dist/polkadotExtensions-BoVKhNU_.mjs +23 -0
- package/dist/polkadotExtensions-BoVKhNU_.mjs.map +1 -0
- package/dist/polkadotExtensions-y4J9UzYl.js +28 -0
- package/dist/polkadotExtensions-y4J9UzYl.js.map +1 -0
- package/dist/solana.d.mts +50 -48
- package/dist/solana.d.ts +50 -48
- package/dist/solana.js +320 -378
- package/dist/solana.js.map +1 -1
- package/dist/solana.mjs +314 -379
- package/dist/solana.mjs.map +1 -1
- package/dist/types-Cb-vuEru.d.mts +330 -0
- package/dist/types-Cb-vuEru.d.ts +330 -0
- package/dist/types-DKU-SNio.js +169 -0
- package/dist/{chunk-P7BPHHVV.js.map → types-DKU-SNio.js.map} +1 -1
- package/dist/types-jnifAAA0.mjs +104 -0
- package/dist/types-jnifAAA0.mjs.map +1 -0
- package/package.json +12 -12
- package/dist/chunk-3Y5N4N3Q.mjs +0 -267
- package/dist/chunk-3Y5N4N3Q.mjs.map +0 -1
- package/dist/chunk-BWUUHUDK.mjs +0 -24
- package/dist/chunk-BWUUHUDK.mjs.map +0 -1
- package/dist/chunk-D3EQMFZ2.js +0 -24
- package/dist/chunk-D3EQMFZ2.js.map +0 -1
- package/dist/chunk-DF7EKK4G.mjs +0 -106
- package/dist/chunk-DF7EKK4G.mjs.map +0 -1
- package/dist/chunk-EH73P476.js +0 -106
- package/dist/chunk-EH73P476.js.map +0 -1
- package/dist/chunk-JVSCMJY5.mjs +0 -147
- package/dist/chunk-JVSCMJY5.mjs.map +0 -1
- package/dist/chunk-P7BPHHVV.js +0 -76
- package/dist/chunk-SO64R7Z6.js +0 -267
- package/dist/chunk-SO64R7Z6.js.map +0 -1
- package/dist/chunk-WOPCW2OX.mjs +0 -76
- package/dist/chunk-WOPCW2OX.mjs.map +0 -1
- package/dist/chunk-XOGQMEV2.js +0 -147
- package/dist/chunk-XOGQMEV2.js.map +0 -1
- package/dist/internal.js.map +0 -1
- package/dist/internal.mjs.map +0 -1
- package/dist/types-0iDBydsK.d.mts +0 -327
- package/dist/types-0iDBydsK.d.ts +0 -327
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { C as WalletId, D as WalletAccountId, E as parseWalletId, O as getWalletAccountId, S as isWalletConnectWallet, T as isValidWalletId, _ as WalletConnectWallet, a as CachedAccount, b as WalletType, c as KheopskitPlatform, d as KheopskitStoreData, f as PlatformContext, g as WalletConnectProvider, h as WalletConnectMetadata, i as BaseWalletAccount, k as parseWalletAccountId, l as KheopskitState, m as WalletConnectConfig, n as AppKitInstance, o as CachedWallet, p as PolkadotAccountType, r as BaseWallet, s as KheopskitConfig, t as AccountOf, u as KheopskitStore, v as WalletOf, w as getWalletId, x as isInjectedWallet, y as WalletPlatform } from "./types-Cb-vuEru.js";
|
|
2
|
+
import { t as clearAllCachedObservables } from "./getCachedObservable-LUq9IfEx.js";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
//#region src/utils/isValidAddress.d.ts
|
|
6
5
|
declare const isValidAddress: (address: string) => boolean;
|
|
7
|
-
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/api/appKit.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Clears the cached AppKit observable.
|
|
10
10
|
* Use when configuration changes or for testing purposes.
|
|
11
11
|
* Note: This does NOT destroy the appKit instance created by Reown.
|
|
12
12
|
*/
|
|
13
13
|
declare const resetAppKitCache: () => void;
|
|
14
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/api/config.d.ts
|
|
15
16
|
/**
|
|
16
17
|
* Default storage key for persisting wallet connection state.
|
|
17
18
|
* Can be overridden via config.storageKey to avoid conflicts
|
|
@@ -19,24 +20,25 @@ declare const resetAppKitCache: () => void;
|
|
|
19
20
|
*/
|
|
20
21
|
declare const DEFAULT_STORAGE_KEY = "kheopskit";
|
|
21
22
|
declare const resolveConfig: <const P extends readonly KheopskitPlatform[] = readonly KheopskitPlatform[]>(config?: Partial<KheopskitConfig<P>>) => KheopskitConfig<P>;
|
|
22
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/api/errors.d.ts
|
|
23
25
|
/**
|
|
24
26
|
* Stable error codes thrown by kheopskit. Catch a {@link KheopskitError} and
|
|
25
27
|
* branch on `error.code` instead of matching message strings.
|
|
26
28
|
*/
|
|
27
|
-
type KheopskitErrorCode =
|
|
29
|
+
type KheopskitErrorCode =
|
|
28
30
|
/** `connect()` called on a wallet that is already connected. */
|
|
29
|
-
"WALLET_ALREADY_CONNECTED"
|
|
31
|
+
"WALLET_ALREADY_CONNECTED" |
|
|
30
32
|
/** `disconnect()` called on a wallet that is not connected. */
|
|
31
|
-
|
|
33
|
+
"WALLET_NOT_CONNECTED" |
|
|
32
34
|
/** The wallet does not advertise a capability kheopskit needs to proceed. */
|
|
33
|
-
|
|
35
|
+
"FEATURE_NOT_SUPPORTED" |
|
|
34
36
|
/** No active WalletConnect session for the requested operation. */
|
|
35
|
-
|
|
37
|
+
"NO_SESSION" |
|
|
36
38
|
/** No provider available for the requested namespace. */
|
|
37
|
-
|
|
39
|
+
"NO_PROVIDER" |
|
|
38
40
|
/** The requested chain cannot be used for this operation (e.g. a Solana cluster with no CAIP-2 id over WalletConnect). */
|
|
39
|
-
|
|
41
|
+
"UNSUPPORTED_CHAIN";
|
|
40
42
|
/**
|
|
41
43
|
* Error thrown by kheopskit wallet/account operations. Carries a stable
|
|
42
44
|
* {@link KheopskitErrorCode} and, when relevant, the offending wallet id.
|
|
@@ -53,26 +55,27 @@ type KheopskitErrorCode =
|
|
|
53
55
|
* ```
|
|
54
56
|
*/
|
|
55
57
|
declare class KheopskitError extends Error {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
readonly code: KheopskitErrorCode;
|
|
59
|
+
/** The wallet id this error relates to, when applicable. */
|
|
60
|
+
readonly walletId?: WalletId;
|
|
61
|
+
constructor(code: KheopskitErrorCode, message: string, options?: {
|
|
62
|
+
walletId?: WalletId;
|
|
63
|
+
cause?: unknown;
|
|
64
|
+
});
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/api/store.d.ts
|
|
65
68
|
type CreateKheopskitStoreOptions = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Cookie string for SSR hydration.
|
|
71
|
+
* When provided, uses cookieStorage instead of localStorage.
|
|
72
|
+
*/
|
|
73
|
+
ssrCookies?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Custom storage key to namespace the stored data.
|
|
76
|
+
* @default "kheopskit"
|
|
77
|
+
*/
|
|
78
|
+
storageKey?: string;
|
|
76
79
|
};
|
|
77
80
|
/**
|
|
78
81
|
* Creates a kheopskit store with the appropriate storage backend.
|
|
@@ -88,22 +91,23 @@ declare const createKheopskitStore: (options?: CreateKheopskitStoreOptions) => K
|
|
|
88
91
|
* Lazily initialized to avoid SSR issues with module-level code.
|
|
89
92
|
*/
|
|
90
93
|
declare const getDefaultStore: () => KheopskitStore;
|
|
91
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/api/hydration.d.ts
|
|
92
96
|
/** Result of {@link getHydratedSnapshot}: placeholder wallets and accounts built from the cache. */
|
|
93
97
|
type HydratedSnapshot = {
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
wallets: (BaseWallet | WalletConnectWallet)[];
|
|
99
|
+
accounts: BaseWalletAccount[];
|
|
96
100
|
};
|
|
97
101
|
type GetHydratedSnapshotOptions = {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Enrich wallets that have no icon from the localStorage icon cache.
|
|
104
|
+
*
|
|
105
|
+
* Must stay `false` for any snapshot that has to match server-rendered markup
|
|
106
|
+
* (React's `getServerSnapshot` runs on the client during hydration, where the
|
|
107
|
+
* icon cache is populated — enriching there would diverge from the server,
|
|
108
|
+
* which always sees an empty cache).
|
|
109
|
+
*/
|
|
110
|
+
icons?: boolean;
|
|
107
111
|
};
|
|
108
112
|
/**
|
|
109
113
|
* Builds the cached-state snapshot every consumer must agree on: read the
|
|
@@ -117,21 +121,23 @@ type GetHydratedSnapshotOptions = {
|
|
|
117
121
|
* sharing this helper, that agreement holds by construction.
|
|
118
122
|
*/
|
|
119
123
|
declare const getHydratedSnapshot: (store: KheopskitStore, platforms: readonly KheopskitPlatform[], options?: GetHydratedSnapshotOptions) => HydratedSnapshot;
|
|
120
|
-
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/api/kheopskit.d.ts
|
|
121
126
|
/** Options for {@link getKheopskit$}. */
|
|
122
127
|
type GetKheopskitOptions = {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Cookie string for SSR hydration. When provided, state is read from cookies
|
|
130
|
+
* instead of localStorage so the server can hydrate without a flash. Pass the
|
|
131
|
+
* request's `cookie` header.
|
|
132
|
+
*/
|
|
133
|
+
ssrCookies?: string;
|
|
134
|
+
/**
|
|
135
|
+
* An existing store to reuse instead of creating one. Advanced escape hatch —
|
|
136
|
+
* most callers omit it. (`@kheopskit/react` passes its provider-scoped store.)
|
|
137
|
+
*/
|
|
138
|
+
store?: ReturnType<typeof createKheopskitStore>;
|
|
134
139
|
};
|
|
135
140
|
declare const getKheopskit$: <const P extends readonly KheopskitPlatform[] = readonly KheopskitPlatform[]>(config?: Partial<KheopskitConfig<P>>, options?: GetKheopskitOptions) => Observable<KheopskitState<P>>;
|
|
136
|
-
|
|
137
|
-
export { BaseWallet, BaseWalletAccount, DEFAULT_STORAGE_KEY, type GetHydratedSnapshotOptions,
|
|
141
|
+
//#endregion
|
|
142
|
+
export { AccountOf, AppKitInstance, BaseWallet, BaseWalletAccount, CachedAccount, CachedWallet, DEFAULT_STORAGE_KEY, type GetHydratedSnapshotOptions, GetKheopskitOptions, type HydratedSnapshot, KheopskitConfig, KheopskitError, type KheopskitErrorCode, KheopskitPlatform, KheopskitState, KheopskitStore, KheopskitStoreData, PlatformContext, PolkadotAccountType, type WalletAccountId, WalletConnectConfig, WalletConnectMetadata, WalletConnectProvider, WalletConnectWallet, type WalletId, WalletOf, WalletPlatform, WalletType, clearAllCachedObservables, createKheopskitStore, getDefaultStore, getHydratedSnapshot, getKheopskit$, getWalletAccountId, getWalletId, isInjectedWallet, isValidAddress, isValidWalletId, isWalletConnectWallet, parseWalletAccountId, parseWalletId, resetAppKitCache, resolveConfig };
|
|
143
|
+
//# sourceMappingURL=index.d.ts.map
|