@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.
Files changed (76) hide show
  1. package/dist/errors-Caq2csKx.mjs +181 -0
  2. package/dist/errors-Caq2csKx.mjs.map +1 -0
  3. package/dist/errors-DPw6pc2H.js +222 -0
  4. package/dist/errors-DPw6pc2H.js.map +1 -0
  5. package/dist/ethereum.d.mts +39 -38
  6. package/dist/ethereum.d.ts +39 -38
  7. package/dist/ethereum.js +214 -281
  8. package/dist/ethereum.js.map +1 -1
  9. package/dist/ethereum.mjs +211 -282
  10. package/dist/ethereum.mjs.map +1 -1
  11. package/dist/{getCachedObservable-C4E8dfMp.d.ts → getCachedObservable-LUq9IfEx.d.mts} +5 -2
  12. package/dist/{getCachedObservable-C4E8dfMp.d.mts → getCachedObservable-LUq9IfEx.d.ts} +5 -2
  13. package/dist/iconCache-BSa42Sui.mjs +343 -0
  14. package/dist/iconCache-BSa42Sui.mjs.map +1 -0
  15. package/dist/iconCache-DS4zNiP1.js +396 -0
  16. package/dist/iconCache-DS4zNiP1.js.map +1 -0
  17. package/dist/index.d.mts +65 -59
  18. package/dist/index.d.ts +65 -59
  19. package/dist/index.js +901 -1015
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +885 -1016
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/injectedWallets-B1MCxAE9.js +148 -0
  24. package/dist/injectedWallets-B1MCxAE9.js.map +1 -0
  25. package/dist/injectedWallets-B3Vysfvr.mjs +119 -0
  26. package/dist/injectedWallets-B3Vysfvr.mjs.map +1 -0
  27. package/dist/internal.d.mts +18 -16
  28. package/dist/internal.d.ts +18 -16
  29. package/dist/internal.js +9 -20
  30. package/dist/internal.mjs +3 -20
  31. package/dist/polkadot.d.mts +37 -36
  32. package/dist/polkadot.d.ts +37 -36
  33. package/dist/polkadot.js +178 -220
  34. package/dist/polkadot.js.map +1 -1
  35. package/dist/polkadot.mjs +175 -221
  36. package/dist/polkadot.mjs.map +1 -1
  37. package/dist/polkadotExtensions-BoVKhNU_.mjs +23 -0
  38. package/dist/polkadotExtensions-BoVKhNU_.mjs.map +1 -0
  39. package/dist/polkadotExtensions-y4J9UzYl.js +28 -0
  40. package/dist/polkadotExtensions-y4J9UzYl.js.map +1 -0
  41. package/dist/solana.d.mts +50 -48
  42. package/dist/solana.d.ts +50 -48
  43. package/dist/solana.js +320 -378
  44. package/dist/solana.js.map +1 -1
  45. package/dist/solana.mjs +314 -379
  46. package/dist/solana.mjs.map +1 -1
  47. package/dist/types-Cb-vuEru.d.mts +330 -0
  48. package/dist/types-Cb-vuEru.d.ts +330 -0
  49. package/dist/types-DKU-SNio.js +169 -0
  50. package/dist/{chunk-P7BPHHVV.js.map → types-DKU-SNio.js.map} +1 -1
  51. package/dist/types-jnifAAA0.mjs +104 -0
  52. package/dist/types-jnifAAA0.mjs.map +1 -0
  53. package/package.json +12 -12
  54. package/dist/chunk-3Y5N4N3Q.mjs +0 -267
  55. package/dist/chunk-3Y5N4N3Q.mjs.map +0 -1
  56. package/dist/chunk-BWUUHUDK.mjs +0 -24
  57. package/dist/chunk-BWUUHUDK.mjs.map +0 -1
  58. package/dist/chunk-D3EQMFZ2.js +0 -24
  59. package/dist/chunk-D3EQMFZ2.js.map +0 -1
  60. package/dist/chunk-DF7EKK4G.mjs +0 -106
  61. package/dist/chunk-DF7EKK4G.mjs.map +0 -1
  62. package/dist/chunk-EH73P476.js +0 -106
  63. package/dist/chunk-EH73P476.js.map +0 -1
  64. package/dist/chunk-JVSCMJY5.mjs +0 -147
  65. package/dist/chunk-JVSCMJY5.mjs.map +0 -1
  66. package/dist/chunk-P7BPHHVV.js +0 -76
  67. package/dist/chunk-SO64R7Z6.js +0 -267
  68. package/dist/chunk-SO64R7Z6.js.map +0 -1
  69. package/dist/chunk-WOPCW2OX.mjs +0 -76
  70. package/dist/chunk-WOPCW2OX.mjs.map +0 -1
  71. package/dist/chunk-XOGQMEV2.js +0 -147
  72. package/dist/chunk-XOGQMEV2.js.map +0 -1
  73. package/dist/internal.js.map +0 -1
  74. package/dist/internal.mjs.map +0 -1
  75. package/dist/types-0iDBydsK.d.mts +0 -327
  76. package/dist/types-0iDBydsK.d.ts +0 -327
package/dist/index.d.ts CHANGED
@@ -1,17 +1,18 @@
1
- export { c as clearAllCachedObservables } from './getCachedObservable-C4E8dfMp.js';
2
- import { K as KheopskitPlatform, d as KheopskitConfig, a as WalletId, e as KheopskitStore, B as BaseWallet, b as WalletConnectWallet, f as BaseWalletAccount, g as KheopskitState } from './types-0iDBydsK.js';
3
- export { A as AccountOf, h as AppKitInstance, C as CachedAccount, j as CachedWallet, k as KheopskitStoreData, P as PlatformContext, l as PolkadotAccountType, W as WalletAccountId, m as WalletConnectConfig, n as WalletConnectMetadata, o as WalletConnectProvider, p as WalletOf, q as WalletPlatform, r as WalletType, s as getWalletAccountId, t as getWalletId, i as isInjectedWallet, u as isValidWalletId, c as isWalletConnectWallet, v as parseWalletAccountId, w as parseWalletId } from './types-0iDBydsK.js';
4
- import { Observable } from 'rxjs';
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
- | "WALLET_NOT_CONNECTED"
33
+ "WALLET_NOT_CONNECTED" |
32
34
  /** The wallet does not advertise a capability kheopskit needs to proceed. */
33
- | "FEATURE_NOT_SUPPORTED"
35
+ "FEATURE_NOT_SUPPORTED" |
34
36
  /** No active WalletConnect session for the requested operation. */
35
- | "NO_SESSION"
37
+ "NO_SESSION" |
36
38
  /** No provider available for the requested namespace. */
37
- | "NO_PROVIDER"
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
- | "UNSUPPORTED_CHAIN";
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
- readonly code: KheopskitErrorCode;
57
- /** The wallet id this error relates to, when applicable. */
58
- readonly walletId?: WalletId;
59
- constructor(code: KheopskitErrorCode, message: string, options?: {
60
- walletId?: WalletId;
61
- cause?: unknown;
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
- * Cookie string for SSR hydration.
68
- * When provided, uses cookieStorage instead of localStorage.
69
- */
70
- ssrCookies?: string;
71
- /**
72
- * Custom storage key to namespace the stored data.
73
- * @default "kheopskit"
74
- */
75
- storageKey?: string;
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
- wallets: (BaseWallet | WalletConnectWallet)[];
95
- accounts: BaseWalletAccount[];
98
+ wallets: (BaseWallet | WalletConnectWallet)[];
99
+ accounts: BaseWalletAccount[];
96
100
  };
97
101
  type GetHydratedSnapshotOptions = {
98
- /**
99
- * Enrich wallets that have no icon from the localStorage icon cache.
100
- *
101
- * Must stay `false` for any snapshot that has to match server-rendered markup
102
- * (React's `getServerSnapshot` runs on the client during hydration, where the
103
- * icon cache is populated — enriching there would diverge from the server,
104
- * which always sees an empty cache).
105
- */
106
- icons?: boolean;
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
- * Cookie string for SSR hydration. When provided, state is read from cookies
125
- * instead of localStorage so the server can hydrate without a flash. Pass the
126
- * request's `cookie` header.
127
- */
128
- ssrCookies?: string;
129
- /**
130
- * An existing store to reuse instead of creating one. Advanced escape hatch —
131
- * most callers omit it. (`@kheopskit/react` passes its provider-scoped store.)
132
- */
133
- store?: ReturnType<typeof createKheopskitStore>;
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, type GetKheopskitOptions, type HydratedSnapshot, KheopskitConfig, KheopskitError, type KheopskitErrorCode, KheopskitPlatform, KheopskitState, KheopskitStore, WalletConnectWallet, WalletId, createKheopskitStore, getDefaultStore, getHydratedSnapshot, getKheopskit$, isValidAddress, resetAppKitCache, resolveConfig };
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