@sodax/wallet-sdk-react 1.5.6-beta → 2.0.0-rc.1

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 (211) hide show
  1. package/README.md +103 -145
  2. package/ai-exported/AGENTS.md +122 -0
  3. package/ai-exported/integration/README.md +102 -0
  4. package/ai-exported/integration/ai-rules.md +136 -0
  5. package/ai-exported/integration/architecture.md +181 -0
  6. package/ai-exported/integration/examples/01-minimal-evm.tsx +75 -0
  7. package/ai-exported/integration/examples/02-multi-chain-modal.tsx +169 -0
  8. package/ai-exported/integration/examples/03-nextjs-app-router.tsx +99 -0
  9. package/ai-exported/integration/examples/04-walletconnect-setup.tsx +89 -0
  10. package/ai-exported/integration/examples/README.md +29 -0
  11. package/ai-exported/integration/recipes/batch-operations.md +223 -0
  12. package/ai-exported/integration/recipes/bridge-to-sdk.md +164 -0
  13. package/ai-exported/integration/recipes/chain-detection.md +254 -0
  14. package/ai-exported/integration/recipes/connect-button.md +156 -0
  15. package/ai-exported/integration/recipes/multi-chain-modal.md +199 -0
  16. package/ai-exported/integration/recipes/setup.md +158 -0
  17. package/ai-exported/integration/recipes/sign-message.md +137 -0
  18. package/ai-exported/integration/recipes/sub-path-imports.md +95 -0
  19. package/ai-exported/integration/recipes/switch-chain.md +141 -0
  20. package/ai-exported/integration/recipes/walletconnect-setup.md +139 -0
  21. package/ai-exported/integration/reference/api-surface.md +175 -0
  22. package/ai-exported/integration/reference/chain-support.md +78 -0
  23. package/ai-exported/integration/reference/connectors.md +74 -0
  24. package/ai-exported/integration/reference/hooks.md +204 -0
  25. package/ai-exported/integration/reference/wallet-brands.md +106 -0
  26. package/ai-exported/migration/README.md +49 -0
  27. package/ai-exported/migration/ai-rules.md +144 -0
  28. package/ai-exported/migration/breaking-changes.md +305 -0
  29. package/ai-exported/migration/checklist.md +159 -0
  30. package/ai-exported/migration/recipes/connect-button.md +166 -0
  31. package/ai-exported/migration/recipes/multi-chain-modal.md +244 -0
  32. package/ai-exported/migration/recipes/ssr-setup.md +162 -0
  33. package/ai-exported/migration/recipes/walletconnect-migration.md +168 -0
  34. package/ai-exported/migration/reference/components.md +73 -0
  35. package/ai-exported/migration/reference/config.md +307 -0
  36. package/ai-exported/migration/reference/hooks.md +278 -0
  37. package/ai-exported/migration/reference/imports.md +157 -0
  38. package/dist/XConnector-B9YQTVJ4.d.ts +146 -0
  39. package/dist/chunk-2BOUGCJ7.mjs +150 -0
  40. package/dist/chunk-2BOUGCJ7.mjs.map +1 -0
  41. package/dist/chunk-66BAUK56.mjs +202 -0
  42. package/dist/chunk-66BAUK56.mjs.map +1 -0
  43. package/dist/chunk-7ULB6DW4.mjs +102 -0
  44. package/dist/chunk-7ULB6DW4.mjs.map +1 -0
  45. package/dist/chunk-BKJB527E.mjs +125 -0
  46. package/dist/chunk-BKJB527E.mjs.map +1 -0
  47. package/dist/chunk-BXJLBR4G.mjs +88 -0
  48. package/dist/chunk-BXJLBR4G.mjs.map +1 -0
  49. package/dist/chunk-E5IAZ7E6.mjs +186 -0
  50. package/dist/chunk-E5IAZ7E6.mjs.map +1 -0
  51. package/dist/chunk-MAQ47Q52.mjs +33 -0
  52. package/dist/chunk-MAQ47Q52.mjs.map +1 -0
  53. package/dist/chunk-MXZVF5HR.mjs +34 -0
  54. package/dist/chunk-MXZVF5HR.mjs.map +1 -0
  55. package/dist/chunk-N5A2TMF6.mjs +33 -0
  56. package/dist/chunk-N5A2TMF6.mjs.map +1 -0
  57. package/dist/chunk-NY7U7OJW.mjs +64 -0
  58. package/dist/chunk-NY7U7OJW.mjs.map +1 -0
  59. package/dist/chunk-PJLEJVAU.mjs +140 -0
  60. package/dist/chunk-PJLEJVAU.mjs.map +1 -0
  61. package/dist/chunk-PLCA4ZDJ.mjs +1585 -0
  62. package/dist/chunk-PLCA4ZDJ.mjs.map +1 -0
  63. package/dist/chunk-TZMKDXFA.mjs +3 -0
  64. package/dist/chunk-TZMKDXFA.mjs.map +1 -0
  65. package/dist/chunk-X2MHIWXO.mjs +100 -0
  66. package/dist/chunk-X2MHIWXO.mjs.map +1 -0
  67. package/dist/chunk-XZ7CHO2S.mjs +41 -0
  68. package/dist/chunk-XZ7CHO2S.mjs.map +1 -0
  69. package/dist/config-OlnzyEUE.d.ts +146 -0
  70. package/dist/index.cjs +2784 -1594
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.d.ts +768 -1498
  73. package/dist/index.mjs +463 -2004
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/xchains/bitcoin/index.cjs +1927 -0
  76. package/dist/xchains/bitcoin/index.cjs.map +1 -0
  77. package/dist/xchains/bitcoin/index.d.ts +125 -0
  78. package/dist/xchains/bitcoin/index.mjs +16 -0
  79. package/dist/xchains/bitcoin/index.mjs.map +1 -0
  80. package/dist/xchains/evm/index.cjs +316 -0
  81. package/dist/xchains/evm/index.cjs.map +1 -0
  82. package/dist/xchains/evm/index.d.ts +39 -0
  83. package/dist/xchains/evm/index.mjs +5 -0
  84. package/dist/xchains/evm/index.mjs.map +1 -0
  85. package/dist/xchains/icon/index.cjs +311 -0
  86. package/dist/xchains/icon/index.cjs.map +1 -0
  87. package/dist/xchains/icon/index.d.ts +37 -0
  88. package/dist/xchains/icon/index.mjs +7 -0
  89. package/dist/xchains/icon/index.mjs.map +1 -0
  90. package/dist/xchains/injective/index.cjs +223 -0
  91. package/dist/xchains/injective/index.cjs.map +1 -0
  92. package/dist/xchains/injective/index.d.ts +35 -0
  93. package/dist/xchains/injective/index.mjs +5 -0
  94. package/dist/xchains/injective/index.mjs.map +1 -0
  95. package/dist/xchains/near/index.cjs +190 -0
  96. package/dist/xchains/near/index.cjs.map +1 -0
  97. package/dist/xchains/near/index.d.ts +34 -0
  98. package/dist/xchains/near/index.mjs +6 -0
  99. package/dist/xchains/near/index.mjs.map +1 -0
  100. package/dist/xchains/solana/index.cjs +186 -0
  101. package/dist/xchains/solana/index.cjs.map +1 -0
  102. package/dist/xchains/solana/index.d.ts +26 -0
  103. package/dist/xchains/solana/index.mjs +7 -0
  104. package/dist/xchains/solana/index.mjs.map +1 -0
  105. package/dist/xchains/stacks/index.cjs +240 -0
  106. package/dist/xchains/stacks/index.cjs.map +1 -0
  107. package/dist/xchains/stacks/index.d.ts +36 -0
  108. package/dist/xchains/stacks/index.mjs +5 -0
  109. package/dist/xchains/stacks/index.mjs.map +1 -0
  110. package/dist/xchains/stellar/index.cjs +322 -0
  111. package/dist/xchains/stellar/index.cjs.map +1 -0
  112. package/dist/xchains/stellar/index.d.ts +44 -0
  113. package/dist/xchains/stellar/index.mjs +6 -0
  114. package/dist/xchains/stellar/index.mjs.map +1 -0
  115. package/dist/xchains/sui/index.cjs +248 -0
  116. package/dist/xchains/sui/index.cjs.map +1 -0
  117. package/dist/xchains/sui/index.d.ts +37 -0
  118. package/dist/xchains/sui/index.mjs +7 -0
  119. package/dist/xchains/sui/index.mjs.map +1 -0
  120. package/docs/ADDING_A_NEW_CHAIN.md +440 -0
  121. package/docs/ARCHITECTURE.md +291 -0
  122. package/docs/BATCH_OPERATIONS.md +267 -0
  123. package/docs/CHAIN_DETECTION.md +216 -0
  124. package/docs/CONFIGURE_PROVIDER.md +360 -0
  125. package/docs/CONNECTORS.md +247 -0
  126. package/docs/CONNECT_FLOW.md +276 -0
  127. package/docs/EVM_SWITCH_CHAIN.md +161 -0
  128. package/docs/SIGN_MESSAGE.md +213 -0
  129. package/docs/SUB_PATH_EXPORTS.md +246 -0
  130. package/docs/WALLETCONNECT.md +154 -0
  131. package/docs/WALLET_MODAL.md +331 -0
  132. package/docs/WALLET_PROVIDER_BRIDGE.md +226 -0
  133. package/package.json +34 -9
  134. package/skills/SKILLS.md +84 -0
  135. package/skills/bridge-to-sdk.md +148 -0
  136. package/skills/connect-button.md +116 -0
  137. package/skills/evm-only-walletconnect.md +111 -0
  138. package/skills/multi-chain-modal.md +178 -0
  139. package/skills/setup.md +107 -0
  140. package/dist/index.d.cts +0 -1579
  141. package/src/Hydrate.ts +0 -65
  142. package/src/SodaxWalletProvider.tsx +0 -97
  143. package/src/actions/getXChainType.ts +0 -8
  144. package/src/actions/getXService.ts +0 -33
  145. package/src/actions/index.ts +0 -2
  146. package/src/assets/wallets/hana.svg +0 -6
  147. package/src/assets/wallets/havah.svg +0 -76
  148. package/src/assets/wallets/keplr.svg +0 -30
  149. package/src/assets/wallets/metamask.svg +0 -60
  150. package/src/assets/wallets/phantom.svg +0 -4
  151. package/src/assets/wallets/sui.svg +0 -20
  152. package/src/core/XConnector.ts +0 -54
  153. package/src/core/XService.ts +0 -85
  154. package/src/core/index.ts +0 -2
  155. package/src/hooks/index.ts +0 -11
  156. package/src/hooks/useEthereumChainId.ts +0 -44
  157. package/src/hooks/useEvmSwitchChain.ts +0 -91
  158. package/src/hooks/useWalletProvider.ts +0 -206
  159. package/src/hooks/useXAccount.ts +0 -51
  160. package/src/hooks/useXAccounts.ts +0 -56
  161. package/src/hooks/useXBalances.ts +0 -65
  162. package/src/hooks/useXConnect.ts +0 -118
  163. package/src/hooks/useXConnection.ts +0 -72
  164. package/src/hooks/useXConnectors.ts +0 -72
  165. package/src/hooks/useXDisconnect.ts +0 -73
  166. package/src/hooks/useXService.ts +0 -8
  167. package/src/hooks/useXSignMessage.ts +0 -82
  168. package/src/index.ts +0 -19
  169. package/src/types/index.ts +0 -22
  170. package/src/useXWagmiStore.ts +0 -116
  171. package/src/utils/index.ts +0 -21
  172. package/src/xchains/bitcoin/BitcoinXConnector.ts +0 -34
  173. package/src/xchains/bitcoin/BitcoinXService.ts +0 -40
  174. package/src/xchains/bitcoin/OKXXConnector.ts +0 -117
  175. package/src/xchains/bitcoin/UnisatXConnector.ts +0 -117
  176. package/src/xchains/bitcoin/XverseXConnector.ts +0 -232
  177. package/src/xchains/bitcoin/index.ts +0 -7
  178. package/src/xchains/bitcoin/useBitcoinXConnectors.ts +0 -14
  179. package/src/xchains/evm/EvmXConnector.ts +0 -27
  180. package/src/xchains/evm/EvmXService.ts +0 -211
  181. package/src/xchains/evm/index.ts +0 -3
  182. package/src/xchains/icon/IconHanaXConnector.ts +0 -39
  183. package/src/xchains/icon/IconXService.ts +0 -117
  184. package/src/xchains/icon/actions.ts +0 -28
  185. package/src/xchains/icon/iconex/index.tsx +0 -46
  186. package/src/xchains/icon/index.ts +0 -2
  187. package/src/xchains/injective/InjectiveXConnector.ts +0 -60
  188. package/src/xchains/injective/InjectiveXService.ts +0 -62
  189. package/src/xchains/injective/actions.ts +0 -32
  190. package/src/xchains/injective/index.ts +0 -2
  191. package/src/xchains/near/NearXConnector.ts +0 -42
  192. package/src/xchains/near/NearXService.ts +0 -46
  193. package/src/xchains/near/useNearXConnectors.ts +0 -23
  194. package/src/xchains/solana/SolanaXConnector.ts +0 -26
  195. package/src/xchains/solana/SolanaXService.ts +0 -46
  196. package/src/xchains/solana/index.ts +0 -2
  197. package/src/xchains/stacks/StacksXConnector.ts +0 -63
  198. package/src/xchains/stacks/StacksXService.ts +0 -59
  199. package/src/xchains/stacks/constants.ts +0 -42
  200. package/src/xchains/stacks/index.ts +0 -4
  201. package/src/xchains/stacks/useStacksXConnectors.ts +0 -7
  202. package/src/xchains/stellar/CustomSorobanServer.ts +0 -93
  203. package/src/xchains/stellar/StellarWalletsKitXConnector.ts +0 -53
  204. package/src/xchains/stellar/StellarXService.ts +0 -93
  205. package/src/xchains/stellar/actions.ts +0 -24
  206. package/src/xchains/stellar/index.tsx +0 -2
  207. package/src/xchains/stellar/useStellarXConnectors.ts +0 -21
  208. package/src/xchains/stellar/utils.ts +0 -49
  209. package/src/xchains/sui/SuiXConnector.ts +0 -28
  210. package/src/xchains/sui/SuiXService.ts +0 -66
  211. package/src/xchains/sui/index.ts +0 -2
package/dist/index.d.ts CHANGED
@@ -1,1579 +1,849 @@
1
- import { ChainId, ChainType, XToken, IBitcoinWalletProvider, BtcWalletAddressType, RpcConfig, IEvmWalletProvider, ISuiWalletProvider, IIconWalletProvider, IInjectiveWalletProvider, IStellarWalletProvider, ISolanaWalletProvider, INearWalletProvider, IStacksWalletProvider } from '@sodax/types';
2
- export { BtcWalletAddressType } from '@sodax/types';
3
- import { AddressPurpose } from 'sats-connect';
4
- import * as wagmi from 'wagmi';
5
- import { State, Config, Connector } from 'wagmi';
6
- import * as viem_chains from 'viem/chains';
7
- import * as wagmi_chains from 'wagmi/chains';
8
- import * as viem from 'viem';
9
- import React from 'react';
10
- import { IconService } from 'icon-sdk-js';
11
- import { IndexerGrpcAccountPortfolioApi, ChainGrpcWasmApi } from '@injectivelabs/sdk-ts';
12
- import { MsgBroadcaster } from '@injectivelabs/wallet-core';
13
- import { WalletStrategy } from '@injectivelabs/wallet-strategy';
14
- import { Wallet } from '@injectivelabs/wallet-base';
15
- import { Connection } from '@solana/web3.js';
16
- import { WalletContextState } from '@solana/wallet-adapter-react';
17
- import { StellarWalletsKit } from '@creit.tech/stellar-wallets-kit';
18
- import * as StellarSdk from '@stellar/stellar-sdk';
19
- import { SorobanRpc, Transaction, Memo, MemoType, Operation, FeeBumpTransaction } from '@stellar/stellar-sdk';
20
- import { StacksNetwork } from '@stacks/network';
21
- import { StacksProvider } from '@stacks/connect';
22
- import { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
23
- import * as immer from 'immer';
24
- import * as zustand_middleware from 'zustand/middleware';
25
- import * as zustand from 'zustand';
1
+ import { SpokeChainKey, GetChainType, ChainType, ChainKey, EvmChainKey, XToken, GetWalletProviderType } from '@sodax/types';
2
+ export { IWalletProvider } from '@sodax/types';
3
+ import { X as XAccount, I as IXConnector, a as XConnection, b as XService, c as XConnector } from './XConnector-B9YQTVJ4.js';
4
+ export { d as IXService } from './XConnector-B9YQTVJ4.js';
5
+ import * as react from 'react';
6
+ import { ReactNode } from 'react';
7
+ import { S as SodaxWalletConfig, C as ChainEntry, W as WalletDefaultsByKey, E as EvmChainEntry } from './config-OlnzyEUE.js';
8
+ export { B as BitcoinChainEntry, o as BitcoinTypeConfig, i as ChainMeta, k as ChainTypeConfig, j as ChainTypeOf, f as EvmAdapterFields, l as EvmTypeConfig, I as IconChainEntry, r as IconTypeConfig, d as InjectiveChainEntry, q as InjectiveTypeConfig, N as NearChainEntry, s as NearTypeConfig, g as SolanaAdapterFields, a as SolanaChainEntry, m as SolanaTypeConfig, e as StacksChainEntry, t as StacksTypeConfig, c as StellarChainEntry, p as StellarTypeConfig, h as SuiAdapterFields, b as SuiChainEntry, n as SuiTypeConfig } from './config-OlnzyEUE.js';
9
+ import { UseMutationResult } from '@tanstack/react-query';
10
+ import * as react_jsx_runtime from 'react/jsx-runtime';
11
+ import { EvmWalletDefaults } from '@sodax/wallet-sdk-core';
12
+ import 'wagmi';
13
+ import 'wagmi/connectors';
26
14
 
27
- declare function getXChainType(xChainId: ChainId | undefined): ChainType | undefined;
15
+ /**
16
+ * `GetChainType` only accepts `SpokeChainKey | ChainType` — it cannot be given `undefined`.
17
+ * When the generic may include `undefined`, narrow with `Exclude` and only union `undefined` on the result.
18
+ */
19
+ type GetXChainReturnType<K extends SpokeChainKey | undefined> = K extends SpokeChainKey ? GetChainType<K> : K extends undefined ? undefined : ChainType | undefined;
20
+ declare function getXChainType<K extends SpokeChainKey>(xChainId: K | undefined): GetXChainReturnType<K | undefined>;
21
+
22
+ type ChainActions = {
23
+ connect: (xConnectorId: string) => Promise<XAccount | undefined>;
24
+ disconnect: () => Promise<void>;
25
+ getConnectors: () => IXConnector[];
26
+ getConnection: () => XConnection | undefined;
27
+ signMessage?: (message: string) => Promise<string>;
28
+ };
29
+ type ChainActionsRegistry = Partial<Record<ChainType, ChainActions>>;
28
30
 
29
- type XAccount = {
30
- address: string | undefined;
31
- xChainType: ChainType | undefined;
32
- publicKey?: string;
31
+ declare function getXService(xChainType: ChainType): XService;
32
+
33
+ declare const WalletConfigProvider: react.Provider<SodaxWalletConfig | null>;
34
+ declare function useWalletConfig(): SodaxWalletConfig;
35
+ /** A chain type is "enabled" only when its slot is present in SodaxWalletConfig. */
36
+ declare function useIsChainEnabled(chainType: ChainType): boolean;
37
+ /** See {@link useIsChainEnabled} for the "enabled" semantic. */
38
+ declare function useEnabledChainTypes(): ChainType[];
39
+
40
+ type SortConnectorsOptions = {
41
+ /** Connector IDs to prioritize. Earlier entries win. */
42
+ preferred?: readonly string[];
33
43
  };
34
- type XConnection = {
35
- xAccount: XAccount;
36
- xConnectorId: string;
44
+ /**
45
+ * Stable sort of connectors for display. Ranking (highest first):
46
+ * 1. Appears in `preferred[]` — earlier entries rank higher
47
+ * 2. `connector.isInstalled === true`
48
+ * 3. Original order (stable)
49
+ *
50
+ * Pure function — does not subscribe or read window.
51
+ */
52
+ declare function sortConnectors<T extends IXConnector>(connectors: readonly T[], options?: SortConnectorsOptions): T[];
53
+
54
+ /**
55
+ * Extract `defaults` from a chain entry. Returns undefined when the entry is
56
+ * missing, or for Stacks's preset-name string variant (no `defaults` slot).
57
+ */
58
+ declare function getEntryDefaults<K extends ChainKey>(entry: ChainEntry<K> | undefined): WalletDefaultsByKey<K> | undefined;
59
+ /**
60
+ * Extract `rpcUrl` from a chain entry. Use for chains whose underlying factory
61
+ * expects a bare URL string (EVM/Solana/Sui/Icon/Near). Returns undefined for
62
+ * missing entries and for non-rpcUrl forms (Stacks preset name, object entries
63
+ * lacking the field) — downstream falls back to a public default.
64
+ */
65
+ declare function getRpcUrl<K extends ChainKey>(entry: ChainEntry<K> | undefined): string | undefined;
66
+ /**
67
+ * Resolve EVM wallet provider defaults for the chain currently active on a
68
+ * wagmi-supplied client. Used by `EvmHydrator` so the provider re-instantiates
69
+ * with the right defaults when wagmi swaps clients on chain switch.
70
+ *
71
+ * `getEvmChainKeyByChainId` lives in `@sodax/types` (alongside `baseChainInfo`,
72
+ * the data source); this helper composes it with the `SodaxWalletConfig.EVM.chains`
73
+ * lookup, which is React-layer concern.
74
+ */
75
+ declare function resolveEvmDefaults(activeChainId: number | undefined, evmChains: Partial<Record<EvmChainKey, EvmChainEntry>> | undefined): EvmWalletDefaults | undefined;
76
+
77
+ declare const isNativeToken: (xToken: XToken) => boolean;
78
+ declare const getWagmiChainId: (xChainId: SpokeChainKey) => number;
79
+
80
+ type UseXAccountOptions = {
81
+ xChainId: SpokeChainKey;
82
+ xChainType?: never;
83
+ } | {
84
+ xChainType: ChainType;
85
+ xChainId?: never;
37
86
  };
38
- type CurrencyKey = string;
39
- declare enum WalletId {
40
- METAMASK = "metamask",
41
- HANA = "hana",
42
- PHANTOM = "phantom",
43
- SUI = "sui",
44
- KEPLR = "keplr"
45
- }
87
+ /**
88
+ * Returns the connected `XAccount` for a chain family.
89
+ *
90
+ * Pass either `xChainId` (a `SpokeChainKey` — auto-resolved to its family) or
91
+ * `xChainType` (a `ChainType` directly), never both. EVM is family-level — wagmi
92
+ * maintains a single connection across every configured EVM network.
93
+ *
94
+ * Always returns a populated object, never `undefined`. When no wallet is connected,
95
+ * `address` is `undefined` but `xChainType` is filled — consumers can render
96
+ * `account.address ?? <ConnectCta />` without null-checking the wrapper.
97
+ *
98
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONNECT_FLOW.md#read-connected-account-state | Connect Flow — Read state}
99
+ */
100
+ declare function useXAccount({ xChainId, xChainType }: UseXAccountOptions): XAccount;
46
101
 
47
102
  /**
48
- * Base class for wallet provider connectors that handles connection management and wallet interactions
49
- *
50
- * @abstract
51
- * @class XConnector
52
- * @property {ChainType} xChainType - The blockchain type this connector supports
53
- * @property {string} name - Display name of the wallet provider
54
- * @property {string} _id - Unique identifier for the connector
55
- * @property {string | undefined} _icon - Optional icon URL for the wallet provider
103
+ * Returns connected accounts for every enabled chain type, keyed by `ChainType`.
104
+ *
105
+ * Each entry is always populated — disconnected chains have `address: undefined`,
106
+ * mirroring `useXAccount`'s shape. Iterates `enabledChains` so the result reflects
107
+ * exactly the slots present in `SodaxWalletProvider` config.
108
+ *
109
+ * Useful for "manage connections" panels and multi-chain status badges. For an
110
+ * enriched view with connector metadata (name, icon), use `useConnectedChains`
111
+ * which also exposes a hydration `status` flag to gate first-paint UI.
112
+ *
113
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONNECT_FLOW.md#read-connected-account-state | Connect Flow — Read state}
56
114
  */
57
- declare abstract class XConnector {
58
- /** The blockchain type this connector supports */
59
- readonly xChainType: ChainType;
60
- /** Display name of the wallet provider */
61
- readonly name: string;
62
- /** Unique identifier for the connector */
63
- private readonly _id;
64
- /** Optional icon URL for the wallet provider */
65
- private readonly _icon?;
66
- constructor(xChainType: ChainType, name: string, id: string);
67
- /**
68
- * Connects to the wallet provider
69
- * @returns Promise resolving to the connected account, or undefined if connection fails
70
- */
71
- abstract connect(): Promise<XAccount | undefined>;
72
- /**
73
- * Disconnects from the wallet provider
74
- */
75
- abstract disconnect(): Promise<void>;
76
- /** Get the unique identifier for this connector */
77
- get id(): string;
78
- /** Get the optional icon URL for this wallet provider */
79
- get icon(): string | undefined;
80
- }
115
+ declare function useXAccounts(): Partial<Record<"ICON" | "EVM" | "INJECTIVE" | "SUI" | "STELLAR" | "SOLANA" | "STACKS" | "NEAR" | "BITCOIN", XAccount>>;
81
116
 
82
117
  /**
83
- * Abstract base class for blockchain service implementations.
118
+ * React Query mutation that connects a wallet via the supplied `IXConnector`.
119
+ *
120
+ * Pass an `IXConnector` (from `useXConnectors` / `useXConnectorsByChain`) to
121
+ * `mutate` / `mutateAsync`. The hook delegates to the chain's `ChainActions.connect()`
122
+ * and writes the resulting connection state into the store on success.
84
123
  *
85
- * The XService class serves as a foundation for implementing blockchain-specific services
86
- * in a multi-chain environment. It provides a standardized interface for:
87
- * 1. Managing wallet connectors for different blockchain types
88
- * 2. Querying token balances across different chains
124
+ * **Provider-managed chains caveat** (EVM/Solana/Sui): the mutation resolves with
125
+ * `undefined` because connection state is set reactively by the chain's Hydrator
126
+ * after the native SDK reports `connected`. Read the resolved account via
127
+ * `useXAccount` / `useXConnection`, not the mutation's return value.
89
128
  *
90
- * Each blockchain implementation (e.g., Solana, EVM chains) extends this class
91
- * to provide chain-specific functionality while maintaining a consistent interface.
129
+ * **Non-provider chains** (Bitcoin, ICON, Injective, Stellar, NEAR, Stacks) return
130
+ * the resolved `XAccount` directly. Code defensively if your component supports
131
+ * both — `useXAccount` works for both cases.
92
132
  *
93
- * @abstract
94
- * @class XService
95
- * @property {ChainType} xChainType - The blockchain type this service handles (e.g., 'SOLANA', 'EVM')
96
- * @property {XConnector[]} xConnectors - Available wallet connectors for this chain
133
+ * Throws `Error('Chain "<X>" is not enabled or ChainActions not registered')` when
134
+ * the connector's chain type isn't mounted in `SodaxWalletProvider` config.
97
135
  *
136
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONNECT_FLOW.md#connect-a-wallet | Connect Flow — Connect}
98
137
  */
99
- declare abstract class XService {
100
- /** The blockchain type this service handles */
101
- readonly xChainType: ChainType;
102
- /** Available wallet connectors for this chain */
103
- private xConnectors;
104
- constructor(xChainType: ChainType);
105
- /**
106
- * Gets the balance of a specific token for an address
107
- * @param address The wallet address to check
108
- * @param xToken The token to get the balance for
109
- * @returns Promise resolving to the token balance as a bigint
110
- */
111
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
112
- /**
113
- * Gets balances for multiple tokens for an address
114
- * @param address The wallet address to check
115
- * @param xTokens Array of tokens to get balances for
116
- * @returns Promise resolving to object mapping token addresses to balances
117
- */
118
- getBalances(address: string | undefined, xTokens: readonly XToken[]): Promise<Record<string, bigint>>;
119
- /**
120
- * Gets all available connectors for this chain
121
- */
122
- getXConnectors(): XConnector[];
123
- /**
124
- * Sets the available connectors for this chain
125
- */
126
- setXConnectors(xConnectors: XConnector[]): void;
127
- /**
128
- * Gets a specific connector by its ID
129
- * @param xConnectorId The connector ID to look up
130
- * @returns The matching connector or undefined if not found
131
- */
132
- getXConnectorById(xConnectorId: string): XConnector | undefined;
133
- }
138
+ declare function useXConnect(): UseMutationResult<XAccount | undefined, Error, IXConnector>;
134
139
 
135
- declare function getXService(xChainType: ChainType): XService;
140
+ type UseXConnectionOptions = {
141
+ xChainType?: ChainType;
142
+ };
143
+ /**
144
+ * Returns the active `XConnection` for a chain type — `{ xAccount, xConnectorId }` —
145
+ * or `undefined` when no wallet is connected.
146
+ *
147
+ * Use this when you need the connector identity (e.g. to label a disconnect button
148
+ * with the wallet name or icon). For just the address, prefer `useXAccount`, which
149
+ * always returns a populated object and saves a null check.
150
+ *
151
+ * Returns `undefined` when `xChainType` is omitted — the field is optional to
152
+ * accommodate consumers that branch on chain availability.
153
+ */
154
+ declare function useXConnection({ xChainType }?: UseXConnectionOptions): XConnection | undefined;
136
155
 
137
- declare const isNativeToken: (xToken: XToken) => boolean;
138
- declare const getWagmiChainId: (xChainId: ChainId) => number;
156
+ /**
157
+ * Returns active wallet connections keyed by `ChainType`.
158
+ *
159
+ * Only chains with a connected wallet have entries — disconnected chains are absent
160
+ * from the map (unlike `useXAccounts`, which always populates every enabled chain).
161
+ *
162
+ * The returned object reference is the persisted `xConnections` slice — stable
163
+ * across re-renders that don't change connection state. Mutate via `useXConnect` /
164
+ * `useXDisconnect`, never directly.
165
+ */
166
+ declare function useXConnections(): Partial<Record<ChainType, XConnection>>;
167
+
168
+ type UseXConnectorsOptions = {
169
+ xChainType?: ChainType;
170
+ };
171
+ /**
172
+ * Returns available wallet connectors for a specific chain type, with enriched
173
+ * metadata (`isInstalled`, `installUrl`, `icon`).
174
+ *
175
+ * Each `connector.isInstalled` reads `window.*` at access time — no extra subscription
176
+ * is installed. Components receive fresh values through normal React render triggers
177
+ * (store updates, parent re-renders).
178
+ *
179
+ * Returns `[]` when the chain isn't enabled in `SodaxWalletProvider` config and logs a
180
+ * one-time warning per chain to help debug missing connector lists. For multi-chain
181
+ * pickers, prefer `useXConnectorsByChain` which avoids the warning per chain.
182
+ *
183
+ * Pair with `sortConnectors(connectors, { preferred })` to rank installed/preferred wallets
184
+ * first. `preferred` matches by exact `connector.id` — for substring/case-insensitive matching,
185
+ * use `useIsWalletInstalled`.
186
+ *
187
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONNECT_FLOW.md#discover-connectors | Connect Flow — Discover}
188
+ */
189
+ declare function useXConnectors({ xChainType }?: UseXConnectorsOptions): IXConnector[];
139
190
 
140
- declare class BitcoinXService extends XService {
141
- private static instance;
142
- private rpcUrl;
143
- private constructor();
144
- static getInstance(rpcUrl?: string): BitcoinXService;
145
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
146
- }
191
+ /**
192
+ * Returns the connector list for every enabled chain type, grouped by `ChainType`.
193
+ *
194
+ * Used for multi-chain wallet pickers (e.g. listing every available wallet across
195
+ * EVM, Solana, Bitcoin in one render). For a single chain, prefer `useXConnectors`
196
+ * which also emits a one-time warning if the chain isn't enabled.
197
+ *
198
+ * Each connector's `isInstalled` reads `window.*` at access time — values stay
199
+ * fresh through normal React render triggers.
200
+ */
201
+ declare function useXConnectorsByChain(): Partial<Record<ChainType, IXConnector[]>>;
147
202
 
148
203
  /**
149
- * Abstract base class for Bitcoin wallet connectors.
150
- * Subclasses implement wallet-specific connection logic (Unisat, Xverse, OKX).
204
+ * Either `connectors`, `chainType`, or both. The union prevents an empty
205
+ * `{}` at the type level the hook must narrow at least one axis so the
206
+ * return value has a meaningful interpretation (not "is any wallet installed
207
+ * anywhere", which is rarely the intent).
151
208
  */
152
- declare abstract class BitcoinXConnector extends XConnector {
153
- constructor(name: string, id: string);
154
- getXService(): BitcoinXService;
155
- abstract connect(): Promise<XAccount | undefined>;
156
- abstract disconnect(): Promise<void>;
209
+ type UseIsWalletInstalledOptions = {
157
210
  /**
158
- * Returns an IBitcoinWalletProvider instance after connecting.
159
- * Used by useSpokeProvider to build BitcoinSpokeProvider.
211
+ * Wallet brand identifiers (e.g. `'hana'`, `'phantom'`). Matched via
212
+ * case-insensitive substring against `connector.id` and `connector.name` —
213
+ * see {@link matchesConnectorIdentifier}. Returns `true` if ANY identifier
214
+ * matches an installed connector. Mirrors the `connectors` parameter of
215
+ * `useBatchConnect` / `useBatchDisconnect`.
160
216
  */
161
- abstract getWalletProvider(): IBitcoinWalletProvider | undefined;
217
+ connectors: readonly string[];
218
+ chainType?: ChainType;
219
+ } | {
220
+ connectors?: readonly string[];
221
+ /** Restrict the scan to a single chain. */
222
+ chainType: ChainType;
223
+ };
224
+ /**
225
+ * True when at least one connector across the configured chains is installed
226
+ * AND matches the supplied filters. `connectors` and `chainType` AND together;
227
+ * at least one of them must be supplied (enforced at the type level).
228
+ *
229
+ * @example
230
+ * // Single wallet across every chain
231
+ * const isHanaInstalled = useIsWalletInstalled({ connectors: ['hana'] });
232
+ *
233
+ * @example
234
+ * // Any of these wallets
235
+ * const hasMultiChainWallet = useIsWalletInstalled({ connectors: ['hana', 'okx', 'phantom'] });
236
+ *
237
+ * @example
238
+ * // Any wallet on a specific chain
239
+ * const hasBitcoin = useIsWalletInstalled({ chainType: 'BITCOIN' });
240
+ *
241
+ * @example
242
+ * // AND — Hana specifically on EVM
243
+ * const hanaOnEvm = useIsWalletInstalled({ connectors: ['hana'], chainType: 'EVM' });
244
+ */
245
+ declare function useIsWalletInstalled(options: UseIsWalletInstalledOptions): boolean;
246
+
247
+ type ChainGroup = {
248
+ chainType: ChainType;
249
+ /** All SpokeChainKeys that share this ChainType — e.g. every EVM network for `chainType: 'EVM'`. */
250
+ chainIds: readonly SpokeChainKey[];
251
+ displayName: string;
252
+ /** Icon URL from chainRegistry. `undefined` when SDK doesn't ship a default — consumer provides. */
253
+ iconUrl: string | undefined;
254
+ isConnected: boolean;
255
+ account: XAccount | undefined;
256
+ connectorId: string | undefined;
257
+ };
258
+ type UseChainGroupsOptions = {
162
259
  /**
163
- * Recreates a walletProvider from the browser extension window object
164
- * and stored xAccount data (no connect() call, no popup).
165
- * Used to restore provider after page reload without requiring reconnect.
260
+ * Display order by `chainType`. Chains not listed fall to the bottom,
261
+ * sorted alphabetically among themselves. Omit to follow the insertion
262
+ * order of `enabledChains` (driven by `SodaxWalletProvider` config).
166
263
  */
167
- abstract recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
168
- }
169
-
170
- interface UnisatWallet {
171
- getAccounts(): Promise<string[]>;
172
- getPublicKey(): Promise<string>;
173
- signPsbt(psbtHex: string, options?: {
174
- autoFinalized?: boolean;
175
- }): Promise<string>;
176
- signMessage(message: string, type?: 'bip322-simple' | 'ecdsa'): Promise<string>;
177
- requestAccounts(): Promise<string[]>;
178
- sendBitcoin(address: string, satoshis: number): Promise<string>;
179
- }
180
- declare global {
181
- interface Window {
182
- unisat?: UnisatWallet;
183
- }
184
- }
185
- declare class UnisatXConnector extends BitcoinXConnector {
186
- private walletProvider;
187
- constructor();
188
- static isAvailable(): boolean;
189
- get icon(): string;
190
- connect(): Promise<XAccount | undefined>;
191
- disconnect(): Promise<void>;
192
- getWalletProvider(): IBitcoinWalletProvider | undefined;
193
- recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
194
- }
195
-
196
- declare class XverseXConnector extends BitcoinXConnector {
197
- private walletProvider;
198
- /** Address purpose used when connecting. Taproot (Ordinals) by default to match Radfi. */
199
- addressPurpose: AddressPurpose;
200
- constructor();
201
- /** Set address purpose and persist to localStorage. */
202
- setAddressPurpose(type: BtcWalletAddressType): void;
203
- static isAvailable(): boolean;
204
- get icon(): string;
205
- connect(): Promise<XAccount | undefined>;
206
- disconnect(): Promise<void>;
207
- getWalletProvider(): IBitcoinWalletProvider | undefined;
208
- recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
209
- }
210
-
211
- interface OKXBitcoinWallet {
212
- getAccounts(): Promise<string[]>;
213
- getPublicKey(): Promise<string>;
214
- signPsbt(psbtHex: string, options?: {
215
- autoFinalized?: boolean;
216
- }): Promise<string>;
217
- signMessage(message: string, type?: 'bip322-simple' | 'ecdsa'): Promise<string>;
218
- connect(): Promise<{
219
- address: string;
220
- publicKey: string;
221
- }>;
222
- sendBitcoin(toAddress: string, satoshis: number): Promise<string>;
223
- }
224
- declare global {
225
- interface Window {
226
- okxwallet?: {
227
- bitcoin?: OKXBitcoinWallet;
228
- };
229
- }
230
- }
231
- declare class OKXXConnector extends BitcoinXConnector {
232
- private walletProvider;
233
- constructor();
234
- static isAvailable(): boolean;
235
- get icon(): string;
236
- connect(): Promise<XAccount | undefined>;
237
- disconnect(): Promise<void>;
238
- getWalletProvider(): IBitcoinWalletProvider | undefined;
239
- recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
240
- }
241
-
264
+ order?: readonly ChainType[];
265
+ };
242
266
  /**
243
- * Hook to return available Bitcoin wallet connectors from the globally registered xService.
267
+ * Returns one `ChainGroup` per enabled chain type. EVM collapses to a single
268
+ * group covering every EVM network via `chainIds`. Use for rendering modal
269
+ * chain-pickers.
270
+ *
271
+ * @example
272
+ * const groups = useChainGroups();
273
+ * return groups.map(g => (
274
+ * <button key={g.chainType}>
275
+ * {g.iconUrl && <img src={g.iconUrl} alt="" />}
276
+ * {g.displayName}
277
+ * {g.isConnected && <Badge>Connected</Badge>}
278
+ * </button>
279
+ * ));
280
+ *
281
+ * @example
282
+ * // Deterministic display order — useful when the chain picker must render
283
+ * // hub-first regardless of enabledChains insertion order.
284
+ * const groups = useChainGroups({ order: ['EVM', 'ICON', 'SOLANA'] });
244
285
  */
245
- declare function useBitcoinXConnectors(): BitcoinXConnector[];
246
-
247
- type WagmiOptions = {
248
- reconnectOnMount?: boolean;
249
- ssr?: boolean;
286
+ declare function useChainGroups({ order }?: UseChainGroupsOptions): ChainGroup[];
287
+
288
+ type ConnectedChain = {
289
+ chainType: ChainType;
290
+ account: XAccount;
291
+ connectorId: string;
292
+ connectorName: string | undefined;
293
+ connectorIcon: string | undefined;
250
294
  };
251
- type SodaxWalletProviderOptions = {
252
- wagmi?: WagmiOptions;
253
- solana?: {
254
- autoConnect?: boolean;
255
- };
256
- sui?: {
257
- autoConnect?: boolean;
258
- };
295
+ type UseConnectedChainsResult = {
296
+ /** One entry per chain currently holding a connected account. */
297
+ chains: ConnectedChain[];
298
+ /** Number of connected chains. */
299
+ total: number;
300
+ /**
301
+ * `'loading'` until the store rehydrates from localStorage. Gate UI that
302
+ * switches visibly on connection state (e.g. `total >= 1 ? Connected : Cta`)
303
+ * with this flag to avoid flicker on reload.
304
+ */
305
+ status: 'loading' | 'ready';
259
306
  };
260
- type SodaxWalletProviderProps = {
261
- children: React.ReactNode;
262
- rpcConfig: RpcConfig;
263
- options?: SodaxWalletProviderOptions;
264
- initialState?: State;
307
+ type UseConnectedChainsOptions = {
308
+ /**
309
+ * Display order by `chainType`. Chains not listed fall to the bottom,
310
+ * sorted alphabetically among themselves. Omit to use the default
311
+ * `ChainTypeArr` order from `@sodax/types` (stable across page reloads).
312
+ */
313
+ order?: readonly ChainType[];
265
314
  };
266
- declare const SodaxWalletProvider: ({ children, rpcConfig, options, initialState }: SodaxWalletProviderProps) => React.JSX.Element;
267
-
268
- declare const createWagmiConfig: (config: RpcConfig, options?: WagmiOptions) => Config<readonly [{
269
- blockExplorers: {
270
- readonly default: {
271
- readonly name: "Etherscan";
272
- readonly url: "https://etherscan.io";
273
- readonly apiUrl: "https://api.etherscan.io/api";
274
- };
275
- };
276
- contracts: {
277
- readonly ensRegistry: {
278
- readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
279
- };
280
- readonly ensUniversalResolver: {
281
- readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
282
- readonly blockCreated: 19258213;
283
- };
284
- readonly multicall3: {
285
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
286
- readonly blockCreated: 14353601;
287
- };
288
- };
289
- ensTlds?: readonly string[] | undefined;
290
- id: 1;
291
- name: "Ethereum";
292
- nativeCurrency: {
293
- readonly name: "Ether";
294
- readonly symbol: "ETH";
295
- readonly decimals: 18;
296
- };
297
- rpcUrls: {
298
- readonly default: {
299
- readonly http: readonly ["https://eth.merkle.io"];
300
- };
301
- };
302
- sourceId?: number | undefined | undefined;
303
- testnet?: boolean | undefined | undefined;
304
- custom?: Record<string, unknown> | undefined;
305
- fees?: viem.ChainFees<undefined> | undefined;
306
- formatters?: undefined;
307
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
308
- }, {
309
- blockExplorers: {
310
- readonly default: {
311
- readonly name: "SnowTrace";
312
- readonly url: "https://snowtrace.io";
313
- readonly apiUrl: "https://api.snowtrace.io";
314
- };
315
- };
316
- contracts: {
317
- readonly multicall3: {
318
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
319
- readonly blockCreated: 11907934;
320
- };
321
- };
322
- ensTlds?: readonly string[] | undefined;
323
- id: 43114;
324
- name: "Avalanche";
325
- nativeCurrency: {
326
- readonly decimals: 18;
327
- readonly name: "Avalanche";
328
- readonly symbol: "AVAX";
329
- };
330
- rpcUrls: {
331
- readonly default: {
332
- readonly http: readonly ["https://api.avax.network/ext/bc/C/rpc"];
333
- };
334
- };
335
- sourceId?: number | undefined | undefined;
336
- testnet?: boolean | undefined | undefined;
337
- custom?: Record<string, unknown> | undefined;
338
- fees?: viem.ChainFees<undefined> | undefined;
339
- formatters?: undefined;
340
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
341
- }, {
342
- blockExplorers: {
343
- readonly default: {
344
- readonly name: "Arbiscan";
345
- readonly url: "https://arbiscan.io";
346
- readonly apiUrl: "https://api.arbiscan.io/api";
347
- };
348
- };
349
- contracts: {
350
- readonly multicall3: {
351
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
352
- readonly blockCreated: 7654707;
353
- };
354
- };
355
- ensTlds?: readonly string[] | undefined;
356
- id: 42161;
357
- name: "Arbitrum One";
358
- nativeCurrency: {
359
- readonly name: "Ether";
360
- readonly symbol: "ETH";
361
- readonly decimals: 18;
362
- };
363
- rpcUrls: {
364
- readonly default: {
365
- readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
366
- };
367
- };
368
- sourceId?: number | undefined | undefined;
369
- testnet?: boolean | undefined | undefined;
370
- custom?: Record<string, unknown> | undefined;
371
- fees?: viem.ChainFees<undefined> | undefined;
372
- formatters?: undefined;
373
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
374
- }, {
375
- blockExplorers: {
376
- readonly default: {
377
- readonly name: "Basescan";
378
- readonly url: "https://basescan.org";
379
- readonly apiUrl: "https://api.basescan.org/api";
380
- };
381
- };
382
- contracts: {
383
- readonly disputeGameFactory: {
384
- readonly 1: {
385
- readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
386
- };
387
- };
388
- readonly l2OutputOracle: {
389
- readonly 1: {
390
- readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
391
- };
392
- };
393
- readonly multicall3: {
394
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
395
- readonly blockCreated: 5022;
396
- };
397
- readonly portal: {
398
- readonly 1: {
399
- readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
400
- readonly blockCreated: 17482143;
401
- };
402
- };
403
- readonly l1StandardBridge: {
404
- readonly 1: {
405
- readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
406
- readonly blockCreated: 17482143;
407
- };
408
- };
409
- readonly gasPriceOracle: {
410
- readonly address: "0x420000000000000000000000000000000000000F";
411
- };
412
- readonly l1Block: {
413
- readonly address: "0x4200000000000000000000000000000000000015";
414
- };
415
- readonly l2CrossDomainMessenger: {
416
- readonly address: "0x4200000000000000000000000000000000000007";
417
- };
418
- readonly l2Erc721Bridge: {
419
- readonly address: "0x4200000000000000000000000000000000000014";
420
- };
421
- readonly l2StandardBridge: {
422
- readonly address: "0x4200000000000000000000000000000000000010";
423
- };
424
- readonly l2ToL1MessagePasser: {
425
- readonly address: "0x4200000000000000000000000000000000000016";
426
- };
427
- };
428
- ensTlds?: readonly string[] | undefined;
429
- id: 8453;
430
- name: "Base";
431
- nativeCurrency: {
432
- readonly name: "Ether";
433
- readonly symbol: "ETH";
434
- readonly decimals: 18;
435
- };
436
- rpcUrls: {
437
- readonly default: {
438
- readonly http: readonly ["https://mainnet.base.org"];
439
- };
440
- };
441
- sourceId: 1;
442
- testnet?: boolean | undefined | undefined;
443
- custom?: Record<string, unknown> | undefined;
444
- fees?: viem.ChainFees<undefined> | undefined;
445
- formatters: {
446
- readonly block: {
447
- exclude: [] | undefined;
448
- format: (args: wagmi_chains.OpStackRpcBlock) => {
449
- baseFeePerGas: bigint | null;
450
- blobGasUsed: bigint;
451
- difficulty: bigint;
452
- excessBlobGas: bigint;
453
- extraData: viem.Hex;
454
- gasLimit: bigint;
455
- gasUsed: bigint;
456
- hash: `0x${string}` | null;
457
- logsBloom: `0x${string}` | null;
458
- miner: `0x${string}`;
459
- mixHash: viem.Hash;
460
- nonce: `0x${string}` | null;
461
- number: bigint | null;
462
- parentBeaconBlockRoot?: `0x${string}` | undefined;
463
- parentHash: viem.Hash;
464
- receiptsRoot: viem.Hex;
465
- sealFields: viem.Hex[];
466
- sha3Uncles: viem.Hash;
467
- size: bigint;
468
- stateRoot: viem.Hash;
469
- timestamp: bigint;
470
- totalDifficulty: bigint | null;
471
- transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
472
- transactionsRoot: viem.Hash;
473
- uncles: viem.Hash[];
474
- withdrawals?: viem.Withdrawal[] | undefined | undefined;
475
- withdrawalsRoot?: `0x${string}` | undefined;
476
- } & {};
477
- type: "block";
478
- };
479
- readonly transaction: {
480
- exclude: [] | undefined;
481
- format: (args: wagmi_chains.OpStackRpcTransaction) => ({
482
- blockHash: `0x${string}` | null;
483
- blockNumber: bigint | null;
484
- from: `0x${string}`;
485
- gas: bigint;
486
- hash: viem.Hash;
487
- input: viem.Hex;
488
- nonce: number;
489
- r: viem.Hex;
490
- s: viem.Hex;
491
- to: `0x${string}` | null;
492
- transactionIndex: number | null;
493
- typeHex: viem.Hex | null;
494
- v: bigint;
495
- value: bigint;
496
- yParity: number;
497
- gasPrice?: undefined | undefined;
498
- maxFeePerBlobGas?: undefined | undefined;
499
- maxFeePerGas: bigint;
500
- maxPriorityFeePerGas: bigint;
501
- isSystemTx?: boolean;
502
- mint?: bigint | undefined | undefined;
503
- sourceHash: viem.Hex;
504
- type: "deposit";
505
- } | {
506
- r: viem.Hex;
507
- s: viem.Hex;
508
- v: bigint;
509
- to: `0x${string}` | null;
510
- from: `0x${string}`;
511
- gas: bigint;
512
- nonce: number;
513
- value: bigint;
514
- blockHash: `0x${string}` | null;
515
- blockNumber: bigint | null;
516
- hash: viem.Hash;
517
- input: viem.Hex;
518
- transactionIndex: number | null;
519
- typeHex: viem.Hex | null;
520
- accessList?: undefined | undefined;
521
- authorizationList?: undefined | undefined;
522
- blobVersionedHashes?: undefined | undefined;
523
- chainId?: number | undefined;
524
- yParity?: undefined | undefined;
525
- type: "legacy";
526
- gasPrice: bigint;
527
- maxFeePerBlobGas?: undefined | undefined;
528
- maxFeePerGas?: undefined | undefined;
529
- maxPriorityFeePerGas?: undefined | undefined;
530
- isSystemTx?: undefined | undefined;
531
- mint?: undefined | undefined;
532
- sourceHash?: undefined | undefined;
533
- } | {
534
- blockHash: `0x${string}` | null;
535
- blockNumber: bigint | null;
536
- from: `0x${string}`;
537
- gas: bigint;
538
- hash: viem.Hash;
539
- input: viem.Hex;
540
- nonce: number;
541
- r: viem.Hex;
542
- s: viem.Hex;
543
- to: `0x${string}` | null;
544
- transactionIndex: number | null;
545
- typeHex: viem.Hex | null;
546
- v: bigint;
547
- value: bigint;
548
- yParity: number;
549
- accessList: viem.AccessList;
550
- authorizationList?: undefined | undefined;
551
- blobVersionedHashes?: undefined | undefined;
552
- chainId: number;
553
- type: "eip2930";
554
- gasPrice: bigint;
555
- maxFeePerBlobGas?: undefined | undefined;
556
- maxFeePerGas?: undefined | undefined;
557
- maxPriorityFeePerGas?: undefined | undefined;
558
- isSystemTx?: undefined | undefined;
559
- mint?: undefined | undefined;
560
- sourceHash?: undefined | undefined;
561
- } | {
562
- blockHash: `0x${string}` | null;
563
- blockNumber: bigint | null;
564
- from: `0x${string}`;
565
- gas: bigint;
566
- hash: viem.Hash;
567
- input: viem.Hex;
568
- nonce: number;
569
- r: viem.Hex;
570
- s: viem.Hex;
571
- to: `0x${string}` | null;
572
- transactionIndex: number | null;
573
- typeHex: viem.Hex | null;
574
- v: bigint;
575
- value: bigint;
576
- yParity: number;
577
- accessList: viem.AccessList;
578
- authorizationList?: undefined | undefined;
579
- blobVersionedHashes?: undefined | undefined;
580
- chainId: number;
581
- type: "eip1559";
582
- gasPrice?: undefined | undefined;
583
- maxFeePerBlobGas?: undefined | undefined;
584
- maxFeePerGas: bigint;
585
- maxPriorityFeePerGas: bigint;
586
- isSystemTx?: undefined | undefined;
587
- mint?: undefined | undefined;
588
- sourceHash?: undefined | undefined;
589
- } | {
590
- blockHash: `0x${string}` | null;
591
- blockNumber: bigint | null;
592
- from: `0x${string}`;
593
- gas: bigint;
594
- hash: viem.Hash;
595
- input: viem.Hex;
596
- nonce: number;
597
- r: viem.Hex;
598
- s: viem.Hex;
599
- to: `0x${string}` | null;
600
- transactionIndex: number | null;
601
- typeHex: viem.Hex | null;
602
- v: bigint;
603
- value: bigint;
604
- yParity: number;
605
- accessList: viem.AccessList;
606
- authorizationList?: undefined | undefined;
607
- blobVersionedHashes: readonly viem.Hex[];
608
- chainId: number;
609
- type: "eip4844";
610
- gasPrice?: undefined | undefined;
611
- maxFeePerBlobGas: bigint;
612
- maxFeePerGas: bigint;
613
- maxPriorityFeePerGas: bigint;
614
- isSystemTx?: undefined | undefined;
615
- mint?: undefined | undefined;
616
- sourceHash?: undefined | undefined;
617
- } | {
618
- blockHash: `0x${string}` | null;
619
- blockNumber: bigint | null;
620
- from: `0x${string}`;
621
- gas: bigint;
622
- hash: viem.Hash;
623
- input: viem.Hex;
624
- nonce: number;
625
- r: viem.Hex;
626
- s: viem.Hex;
627
- to: `0x${string}` | null;
628
- transactionIndex: number | null;
629
- typeHex: viem.Hex | null;
630
- v: bigint;
631
- value: bigint;
632
- yParity: number;
633
- accessList: viem.AccessList;
634
- authorizationList: viem.SignedAuthorizationList;
635
- blobVersionedHashes?: undefined | undefined;
636
- chainId: number;
637
- type: "eip7702";
638
- gasPrice?: undefined | undefined;
639
- maxFeePerBlobGas?: undefined | undefined;
640
- maxFeePerGas: bigint;
641
- maxPriorityFeePerGas: bigint;
642
- isSystemTx?: undefined | undefined;
643
- mint?: undefined | undefined;
644
- sourceHash?: undefined | undefined;
645
- }) & {};
646
- type: "transaction";
647
- };
648
- readonly transactionReceipt: {
649
- exclude: [] | undefined;
650
- format: (args: wagmi_chains.OpStackRpcTransactionReceipt) => {
651
- blobGasPrice?: bigint | undefined;
652
- blobGasUsed?: bigint | undefined;
653
- blockHash: viem.Hash;
654
- blockNumber: bigint;
655
- contractAddress: `0x${string}` | null | undefined;
656
- cumulativeGasUsed: bigint;
657
- effectiveGasPrice: bigint;
658
- from: `0x${string}`;
659
- gasUsed: bigint;
660
- logs: viem.Log<bigint, number, false>[];
661
- logsBloom: viem.Hex;
662
- root?: `0x${string}` | undefined;
663
- status: "success" | "reverted";
664
- to: `0x${string}` | null;
665
- transactionHash: viem.Hash;
666
- transactionIndex: number;
667
- type: viem.TransactionType;
668
- l1GasPrice: bigint | null;
669
- l1GasUsed: bigint | null;
670
- l1Fee: bigint | null;
671
- l1FeeScalar: number | null;
672
- } & {};
673
- type: "transactionReceipt";
674
- };
675
- };
676
- serializers: {
677
- readonly transaction: typeof wagmi_chains.serializeTransactionOpStack;
678
- };
679
- }, {
680
- blockExplorers: {
681
- readonly default: {
682
- readonly name: "BscScan";
683
- readonly url: "https://bscscan.com";
684
- readonly apiUrl: "https://api.bscscan.com/api";
685
- };
686
- };
687
- contracts: {
688
- readonly multicall3: {
689
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
690
- readonly blockCreated: 15921452;
691
- };
692
- };
693
- ensTlds?: readonly string[] | undefined;
694
- id: 56;
695
- name: "BNB Smart Chain";
696
- nativeCurrency: {
697
- readonly decimals: 18;
698
- readonly name: "BNB";
699
- readonly symbol: "BNB";
700
- };
701
- rpcUrls: {
702
- readonly default: {
703
- readonly http: readonly ["https://56.rpc.thirdweb.com"];
704
- };
705
- };
706
- sourceId?: number | undefined | undefined;
707
- testnet?: boolean | undefined | undefined;
708
- custom?: Record<string, unknown> | undefined;
709
- fees?: viem.ChainFees<undefined> | undefined;
710
- formatters?: undefined;
711
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
712
- }, {
713
- blockExplorers: {
714
- readonly default: {
715
- readonly name: "Sonic Explorer";
716
- readonly url: "https://sonicscan.org";
717
- };
718
- };
719
- contracts: {
720
- readonly multicall3: {
721
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
722
- readonly blockCreated: 60;
723
- };
724
- };
725
- ensTlds?: readonly string[] | undefined;
726
- id: 146;
727
- name: "Sonic";
728
- nativeCurrency: {
729
- readonly decimals: 18;
730
- readonly name: "Sonic";
731
- readonly symbol: "S";
732
- };
733
- rpcUrls: {
734
- readonly default: {
735
- readonly http: readonly ["https://rpc.soniclabs.com"];
736
- };
737
- };
738
- sourceId?: number | undefined | undefined;
739
- testnet: false;
740
- custom?: Record<string, unknown> | undefined;
741
- fees?: viem.ChainFees<undefined> | undefined;
742
- formatters?: undefined;
743
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
744
- }, {
745
- blockExplorers: {
746
- readonly default: {
747
- readonly name: "Optimism Explorer";
748
- readonly url: "https://optimistic.etherscan.io";
749
- readonly apiUrl: "https://api-optimistic.etherscan.io/api";
750
- };
751
- };
752
- contracts: {
753
- readonly disputeGameFactory: {
754
- readonly 1: {
755
- readonly address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9";
756
- };
757
- };
758
- readonly l2OutputOracle: {
759
- readonly 1: {
760
- readonly address: "0xdfe97868233d1aa22e815a266982f2cf17685a27";
761
- };
762
- };
763
- readonly multicall3: {
764
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
765
- readonly blockCreated: 4286263;
766
- };
767
- readonly portal: {
768
- readonly 1: {
769
- readonly address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed";
770
- };
771
- };
772
- readonly l1StandardBridge: {
773
- readonly 1: {
774
- readonly address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1";
775
- };
776
- };
777
- readonly gasPriceOracle: {
778
- readonly address: "0x420000000000000000000000000000000000000F";
779
- };
780
- readonly l1Block: {
781
- readonly address: "0x4200000000000000000000000000000000000015";
782
- };
783
- readonly l2CrossDomainMessenger: {
784
- readonly address: "0x4200000000000000000000000000000000000007";
785
- };
786
- readonly l2Erc721Bridge: {
787
- readonly address: "0x4200000000000000000000000000000000000014";
788
- };
789
- readonly l2StandardBridge: {
790
- readonly address: "0x4200000000000000000000000000000000000010";
791
- };
792
- readonly l2ToL1MessagePasser: {
793
- readonly address: "0x4200000000000000000000000000000000000016";
794
- };
795
- };
796
- ensTlds?: readonly string[] | undefined;
797
- id: 10;
798
- name: "OP Mainnet";
799
- nativeCurrency: {
800
- readonly name: "Ether";
801
- readonly symbol: "ETH";
802
- readonly decimals: 18;
803
- };
804
- rpcUrls: {
805
- readonly default: {
806
- readonly http: readonly ["https://mainnet.optimism.io"];
807
- };
808
- };
809
- sourceId: 1;
810
- testnet?: boolean | undefined | undefined;
811
- custom?: Record<string, unknown> | undefined;
812
- fees?: viem.ChainFees<undefined> | undefined;
813
- formatters: {
814
- readonly block: {
815
- exclude: [] | undefined;
816
- format: (args: wagmi_chains.OpStackRpcBlock) => {
817
- baseFeePerGas: bigint | null;
818
- blobGasUsed: bigint;
819
- difficulty: bigint;
820
- excessBlobGas: bigint;
821
- extraData: viem.Hex;
822
- gasLimit: bigint;
823
- gasUsed: bigint;
824
- hash: `0x${string}` | null;
825
- logsBloom: `0x${string}` | null;
826
- miner: `0x${string}`;
827
- mixHash: viem.Hash;
828
- nonce: `0x${string}` | null;
829
- number: bigint | null;
830
- parentBeaconBlockRoot?: `0x${string}` | undefined;
831
- parentHash: viem.Hash;
832
- receiptsRoot: viem.Hex;
833
- sealFields: viem.Hex[];
834
- sha3Uncles: viem.Hash;
835
- size: bigint;
836
- stateRoot: viem.Hash;
837
- timestamp: bigint;
838
- totalDifficulty: bigint | null;
839
- transactions: `0x${string}`[] | viem_chains.OpStackTransaction<boolean>[];
840
- transactionsRoot: viem.Hash;
841
- uncles: viem.Hash[];
842
- withdrawals?: viem.Withdrawal[] | undefined | undefined;
843
- withdrawalsRoot?: `0x${string}` | undefined;
844
- } & {};
845
- type: "block";
846
- };
847
- readonly transaction: {
848
- exclude: [] | undefined;
849
- format: (args: wagmi_chains.OpStackRpcTransaction) => ({
850
- blockHash: `0x${string}` | null;
851
- blockNumber: bigint | null;
852
- from: `0x${string}`;
853
- gas: bigint;
854
- hash: viem.Hash;
855
- input: viem.Hex;
856
- nonce: number;
857
- r: viem.Hex;
858
- s: viem.Hex;
859
- to: `0x${string}` | null;
860
- transactionIndex: number | null;
861
- typeHex: viem.Hex | null;
862
- v: bigint;
863
- value: bigint;
864
- yParity: number;
865
- gasPrice?: undefined | undefined;
866
- maxFeePerBlobGas?: undefined | undefined;
867
- maxFeePerGas: bigint;
868
- maxPriorityFeePerGas: bigint;
869
- isSystemTx?: boolean;
870
- mint?: bigint | undefined | undefined;
871
- sourceHash: viem.Hex;
872
- type: "deposit";
873
- } | {
874
- r: viem.Hex;
875
- s: viem.Hex;
876
- v: bigint;
877
- to: `0x${string}` | null;
878
- from: `0x${string}`;
879
- gas: bigint;
880
- nonce: number;
881
- value: bigint;
882
- blockHash: `0x${string}` | null;
883
- blockNumber: bigint | null;
884
- hash: viem.Hash;
885
- input: viem.Hex;
886
- transactionIndex: number | null;
887
- typeHex: viem.Hex | null;
888
- accessList?: undefined | undefined;
889
- authorizationList?: undefined | undefined;
890
- blobVersionedHashes?: undefined | undefined;
891
- chainId?: number | undefined;
892
- yParity?: undefined | undefined;
893
- type: "legacy";
894
- gasPrice: bigint;
895
- maxFeePerBlobGas?: undefined | undefined;
896
- maxFeePerGas?: undefined | undefined;
897
- maxPriorityFeePerGas?: undefined | undefined;
898
- isSystemTx?: undefined | undefined;
899
- mint?: undefined | undefined;
900
- sourceHash?: undefined | undefined;
901
- } | {
902
- blockHash: `0x${string}` | null;
903
- blockNumber: bigint | null;
904
- from: `0x${string}`;
905
- gas: bigint;
906
- hash: viem.Hash;
907
- input: viem.Hex;
908
- nonce: number;
909
- r: viem.Hex;
910
- s: viem.Hex;
911
- to: `0x${string}` | null;
912
- transactionIndex: number | null;
913
- typeHex: viem.Hex | null;
914
- v: bigint;
915
- value: bigint;
916
- yParity: number;
917
- accessList: viem.AccessList;
918
- authorizationList?: undefined | undefined;
919
- blobVersionedHashes?: undefined | undefined;
920
- chainId: number;
921
- type: "eip2930";
922
- gasPrice: bigint;
923
- maxFeePerBlobGas?: undefined | undefined;
924
- maxFeePerGas?: undefined | undefined;
925
- maxPriorityFeePerGas?: undefined | undefined;
926
- isSystemTx?: undefined | undefined;
927
- mint?: undefined | undefined;
928
- sourceHash?: undefined | undefined;
929
- } | {
930
- blockHash: `0x${string}` | null;
931
- blockNumber: bigint | null;
932
- from: `0x${string}`;
933
- gas: bigint;
934
- hash: viem.Hash;
935
- input: viem.Hex;
936
- nonce: number;
937
- r: viem.Hex;
938
- s: viem.Hex;
939
- to: `0x${string}` | null;
940
- transactionIndex: number | null;
941
- typeHex: viem.Hex | null;
942
- v: bigint;
943
- value: bigint;
944
- yParity: number;
945
- accessList: viem.AccessList;
946
- authorizationList?: undefined | undefined;
947
- blobVersionedHashes?: undefined | undefined;
948
- chainId: number;
949
- type: "eip1559";
950
- gasPrice?: undefined | undefined;
951
- maxFeePerBlobGas?: undefined | undefined;
952
- maxFeePerGas: bigint;
953
- maxPriorityFeePerGas: bigint;
954
- isSystemTx?: undefined | undefined;
955
- mint?: undefined | undefined;
956
- sourceHash?: undefined | undefined;
957
- } | {
958
- blockHash: `0x${string}` | null;
959
- blockNumber: bigint | null;
960
- from: `0x${string}`;
961
- gas: bigint;
962
- hash: viem.Hash;
963
- input: viem.Hex;
964
- nonce: number;
965
- r: viem.Hex;
966
- s: viem.Hex;
967
- to: `0x${string}` | null;
968
- transactionIndex: number | null;
969
- typeHex: viem.Hex | null;
970
- v: bigint;
971
- value: bigint;
972
- yParity: number;
973
- accessList: viem.AccessList;
974
- authorizationList?: undefined | undefined;
975
- blobVersionedHashes: readonly viem.Hex[];
976
- chainId: number;
977
- type: "eip4844";
978
- gasPrice?: undefined | undefined;
979
- maxFeePerBlobGas: bigint;
980
- maxFeePerGas: bigint;
981
- maxPriorityFeePerGas: bigint;
982
- isSystemTx?: undefined | undefined;
983
- mint?: undefined | undefined;
984
- sourceHash?: undefined | undefined;
985
- } | {
986
- blockHash: `0x${string}` | null;
987
- blockNumber: bigint | null;
988
- from: `0x${string}`;
989
- gas: bigint;
990
- hash: viem.Hash;
991
- input: viem.Hex;
992
- nonce: number;
993
- r: viem.Hex;
994
- s: viem.Hex;
995
- to: `0x${string}` | null;
996
- transactionIndex: number | null;
997
- typeHex: viem.Hex | null;
998
- v: bigint;
999
- value: bigint;
1000
- yParity: number;
1001
- accessList: viem.AccessList;
1002
- authorizationList: viem.SignedAuthorizationList;
1003
- blobVersionedHashes?: undefined | undefined;
1004
- chainId: number;
1005
- type: "eip7702";
1006
- gasPrice?: undefined | undefined;
1007
- maxFeePerBlobGas?: undefined | undefined;
1008
- maxFeePerGas: bigint;
1009
- maxPriorityFeePerGas: bigint;
1010
- isSystemTx?: undefined | undefined;
1011
- mint?: undefined | undefined;
1012
- sourceHash?: undefined | undefined;
1013
- }) & {};
1014
- type: "transaction";
1015
- };
1016
- readonly transactionReceipt: {
1017
- exclude: [] | undefined;
1018
- format: (args: wagmi_chains.OpStackRpcTransactionReceipt) => {
1019
- blobGasPrice?: bigint | undefined;
1020
- blobGasUsed?: bigint | undefined;
1021
- blockHash: viem.Hash;
1022
- blockNumber: bigint;
1023
- contractAddress: `0x${string}` | null | undefined;
1024
- cumulativeGasUsed: bigint;
1025
- effectiveGasPrice: bigint;
1026
- from: `0x${string}`;
1027
- gasUsed: bigint;
1028
- logs: viem.Log<bigint, number, false>[];
1029
- logsBloom: viem.Hex;
1030
- root?: `0x${string}` | undefined;
1031
- status: "success" | "reverted";
1032
- to: `0x${string}` | null;
1033
- transactionHash: viem.Hash;
1034
- transactionIndex: number;
1035
- type: viem.TransactionType;
1036
- l1GasPrice: bigint | null;
1037
- l1GasUsed: bigint | null;
1038
- l1Fee: bigint | null;
1039
- l1FeeScalar: number | null;
1040
- } & {};
1041
- type: "transactionReceipt";
1042
- };
1043
- };
1044
- serializers: {
1045
- readonly transaction: typeof wagmi_chains.serializeTransactionOpStack;
1046
- };
1047
- }, {
1048
- blockExplorers: {
1049
- readonly default: {
1050
- readonly name: "PolygonScan";
1051
- readonly url: "https://polygonscan.com";
1052
- readonly apiUrl: "https://api.polygonscan.com/api";
1053
- };
1054
- };
1055
- contracts: {
1056
- readonly multicall3: {
1057
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1058
- readonly blockCreated: 25770160;
1059
- };
1060
- };
1061
- ensTlds?: readonly string[] | undefined;
1062
- id: 137;
1063
- name: "Polygon";
1064
- nativeCurrency: {
1065
- readonly name: "POL";
1066
- readonly symbol: "POL";
1067
- readonly decimals: 18;
1068
- };
1069
- rpcUrls: {
1070
- readonly default: {
1071
- readonly http: readonly ["https://polygon-rpc.com"];
1072
- };
1073
- };
1074
- sourceId?: number | undefined | undefined;
1075
- testnet?: boolean | undefined | undefined;
1076
- custom?: Record<string, unknown> | undefined;
1077
- fees?: viem.ChainFees<undefined> | undefined;
1078
- formatters?: undefined;
1079
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1080
- }, {
1081
- blockExplorers: {
1082
- readonly default: {
1083
- readonly name: "HyperEVMScan";
1084
- readonly url: "https://hyperevmscan.io/";
1085
- };
1086
- };
1087
- contracts: {
1088
- readonly multicall3: {
1089
- readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
1090
- readonly blockCreated: 13051;
1091
- };
1092
- };
1093
- ensTlds?: readonly string[] | undefined;
1094
- id: 999;
1095
- name: "HyperEVM";
1096
- nativeCurrency: {
1097
- readonly decimals: 18;
1098
- readonly name: "HYPE";
1099
- readonly symbol: "HYPE";
1100
- };
1101
- rpcUrls: {
1102
- readonly default: {
1103
- readonly http: readonly ["https://rpc.hyperliquid.xyz/evm"];
1104
- };
1105
- };
1106
- sourceId?: number | undefined;
1107
- testnet?: boolean | undefined;
1108
- custom?: Record<string, unknown> | undefined;
1109
- fees?: viem.ChainFees<undefined> | undefined;
1110
- formatters?: undefined;
1111
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1112
- }, {
1113
- blockExplorers: {
1114
- readonly default: {
1115
- readonly name: "LightLink Phoenix Explorer";
1116
- readonly url: "https://phoenix.lightlink.io";
1117
- };
1118
- };
1119
- contracts: {
1120
- readonly multicall3: {
1121
- readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1122
- readonly blockCreated: 125499184;
1123
- };
1124
- };
1125
- ensTlds?: readonly string[] | undefined;
1126
- id: 1890;
1127
- name: "LightLink Phoenix Mainnet";
1128
- nativeCurrency: {
1129
- readonly decimals: 18;
1130
- readonly name: "Ether";
1131
- readonly symbol: "ETH";
1132
- };
1133
- rpcUrls: {
1134
- readonly default: {
1135
- readonly http: readonly ["https://replicator.phoenix.lightlink.io/rpc/v1"];
1136
- };
1137
- };
1138
- sourceId?: number | undefined | undefined;
1139
- testnet: false;
1140
- custom?: Record<string, unknown> | undefined;
1141
- fees?: viem.ChainFees<undefined> | undefined;
1142
- formatters?: undefined;
1143
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1144
- readonly network: "lightlink-phoenix";
1145
- }, {
1146
- blockExplorers: {
1147
- readonly default: {
1148
- readonly name: "KaiaScan";
1149
- readonly url: "https://kaiascan.io";
1150
- readonly apiUrl: "https://api-cypress.klaytnscope.com/api";
1151
- };
1152
- };
1153
- contracts: {
1154
- readonly multicall3: {
1155
- readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
1156
- readonly blockCreated: 96002415;
1157
- };
1158
- };
1159
- ensTlds?: readonly string[] | undefined;
1160
- id: 8217;
1161
- name: "Kaia";
1162
- nativeCurrency: {
1163
- readonly decimals: 18;
1164
- readonly name: "Kaia";
1165
- readonly symbol: "KAIA";
1166
- };
1167
- rpcUrls: {
1168
- readonly default: {
1169
- readonly http: readonly ["https://public-en.node.kaia.io"];
1170
- };
1171
- };
1172
- sourceId?: number | undefined | undefined;
1173
- testnet?: boolean | undefined | undefined;
1174
- custom?: Record<string, unknown> | undefined;
1175
- fees?: viem.ChainFees<undefined> | undefined;
1176
- formatters?: undefined;
1177
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1178
- }, {
1179
- blockExplorers: {
1180
- readonly default: {
1181
- readonly name: "Routescan";
1182
- readonly url: "https://redbelly.routescan.io";
1183
- readonly apiUrl: "https://api.routescan.io/v2/network/mainnet/evm/151/etherscan/api";
1184
- };
1185
- };
1186
- contracts?: {
1187
- [x: string]: viem.ChainContract | {
1188
- [sourceId: number]: viem.ChainContract | undefined;
1189
- } | undefined;
1190
- ensRegistry?: viem.ChainContract | undefined;
1191
- ensUniversalResolver?: viem.ChainContract | undefined;
1192
- multicall3?: viem.ChainContract | undefined;
1193
- universalSignatureVerifier?: viem.ChainContract | undefined;
1194
- } | undefined;
1195
- ensTlds?: readonly string[] | undefined;
1196
- id: 151;
1197
- name: "Redbelly Network Mainnet";
1198
- nativeCurrency: {
1199
- readonly name: "Redbelly Native Coin";
1200
- readonly symbol: "RBNT";
1201
- readonly decimals: 18;
1202
- };
1203
- rpcUrls: {
1204
- readonly default: {
1205
- readonly http: readonly ["https://governors.mainnet.redbelly.network"];
1206
- };
1207
- };
1208
- sourceId?: number | undefined | undefined;
1209
- testnet: false;
1210
- custom?: Record<string, unknown> | undefined;
1211
- fees?: viem.ChainFees<undefined> | undefined;
1212
- formatters?: undefined;
1213
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1214
- }], {
1215
- 1: viem.HttpTransport<undefined, false>;
1216
- 43114: viem.HttpTransport<undefined, false>;
1217
- 42161: viem.HttpTransport<undefined, false>;
1218
- 8453: viem.HttpTransport<undefined, false>;
1219
- 56: viem.HttpTransport<undefined, false>;
1220
- 146: viem.HttpTransport<undefined, false>;
1221
- 10: viem.HttpTransport<undefined, false>;
1222
- 137: viem.HttpTransport<undefined, false>;
1223
- 999: viem.HttpTransport<undefined, false>;
1224
- 1890: viem.HttpTransport<undefined, false>;
1225
- 151: viem.HttpTransport<undefined, false>;
1226
- 8217: viem.HttpTransport<undefined, false>;
1227
- }, readonly wagmi.CreateConnectorFn[]>;
1228
315
  /**
1229
- * Service class for handling EVM chain interactions.
1230
- * Implements singleton pattern and provides methods for wallet/chain operations.
316
+ * Aggregate view of every currently-connected chain with enriched connector
317
+ * metadata (name + icon) looked up from the store. Useful for "Manage
318
+ * connections" UIs and status badges.
319
+ *
320
+ * Gate rendering on `status === 'ready'` to avoid the "Connect wallet" →
321
+ * "Connected" flicker on reload while the store rehydrates from localStorage.
322
+ *
323
+ * @example
324
+ * const { chains, total, status } = useConnectedChains();
325
+ * if (status === 'loading') return <Skeleton />;
326
+ * return total >= 1 ? <ConnectedChainsDisplay chains={chains} /> : <ConnectCta />;
327
+ *
328
+ * @example
329
+ * // Deterministic display order — required if rendering a list that must
330
+ * // be stable across page reloads (hydrator race otherwise randomizes
331
+ * // insertion order).
332
+ * const { chains } = useConnectedChains({ order: ['EVM', 'ICON', 'SOLANA'] });
1231
333
  */
1232
- declare class EvmXService extends XService {
1233
- private static instance;
1234
- wagmiConfig: Config | undefined;
1235
- private constructor();
1236
- getXConnectors(): never[];
1237
- static getInstance(): EvmXService;
1238
- _getTokenBalance(address: string | undefined, chainId: number, tokenAddress: string): Promise<bigint>;
1239
- _getChainBalance(address: string | undefined, chainId: number): Promise<bigint>;
1240
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
1241
- getBalances(address: string | undefined, xTokens: XToken[]): Promise<{}>;
1242
- }
1243
-
1244
- declare class EvmXConnector extends XConnector {
1245
- connector: Connector;
1246
- constructor(connector: Connector);
1247
- connect(): Promise<XAccount | undefined>;
1248
- disconnect(): Promise<void>;
1249
- get id(): string;
1250
- get icon(): string | undefined;
1251
- }
1252
-
1253
- declare class IconXService extends XService {
1254
- private static instance;
1255
- iconService: IconService;
1256
- private constructor();
1257
- static getInstance(): IconXService;
1258
- private getAggregateData;
1259
- getBalances(address: string | undefined, xTokens: XToken[]): Promise<{}>;
1260
- }
1261
-
1262
- declare class IconHanaXConnector extends XConnector {
1263
- constructor();
1264
- connect(): Promise<XAccount | undefined>;
1265
- disconnect(): Promise<void>;
1266
- get icon(): string;
1267
- }
1268
-
1269
- declare class InjectiveXService extends XService {
1270
- private static instance;
1271
- walletStrategy: WalletStrategy;
1272
- indexerGrpcAccountPortfolioApi: IndexerGrpcAccountPortfolioApi;
1273
- chainGrpcWasmApi: ChainGrpcWasmApi;
1274
- msgBroadcaster: MsgBroadcaster;
1275
- private constructor();
1276
- static getInstance(): InjectiveXService;
1277
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
1278
- }
1279
-
1280
- declare class InjectiveXConnector extends XConnector {
1281
- private wallet;
1282
- constructor(name: string, wallet: Wallet);
1283
- getXService(): InjectiveXService;
1284
- connect(): Promise<XAccount | undefined>;
1285
- disconnect(): Promise<void>;
1286
- get icon(): string | undefined;
1287
- }
1288
-
1289
- declare class SolanaXService extends XService {
1290
- private static instance;
1291
- connection: Connection | undefined;
1292
- wallet: WalletContextState | undefined;
1293
- private constructor();
1294
- static getInstance(): SolanaXService;
1295
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
1296
- }
1297
-
1298
- declare class SolanaXConnector extends XConnector {
1299
- wallet: any;
1300
- constructor(wallet: any);
1301
- getXService(): SolanaXService;
1302
- connect(): Promise<XAccount | undefined>;
1303
- disconnect(): Promise<void>;
1304
- get icon(): any;
1305
- }
1306
-
1307
- declare class CustomSorobanServer extends SorobanRpc.Server {
1308
- private readonly customHeaders;
1309
- constructor(serverUrl: string, customHeaders: Record<string, string>);
1310
- simulateTransaction(tx: Transaction<Memo<MemoType>, Operation[]>): Promise<SorobanRpc.Api.SimulateTransactionResponse>;
1311
- sendTransaction(tx: Transaction | FeeBumpTransaction): Promise<SorobanRpc.Api.SendTransactionResponse>;
1312
- getTransaction(hash: string): Promise<SorobanRpc.Api.GetTransactionResponse>;
1313
- }
334
+ declare function useConnectedChains({ order }?: UseConnectedChainsOptions): UseConnectedChainsResult;
1314
335
 
1315
- declare class StellarXService extends XService {
1316
- private static instance;
1317
- walletsKit: StellarWalletsKit;
1318
- server: StellarSdk.Horizon.Server;
1319
- sorobanServer: CustomSorobanServer;
1320
- private constructor();
1321
- static getInstance(): StellarXService;
1322
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
1323
- }
1324
-
1325
- type StellarWalletType = {
1326
- icon: string;
1327
- id: string;
1328
- isAvailable: boolean;
1329
- name: string;
1330
- type: string;
1331
- url: string;
336
+ type UseXDisconnectArgs = {
337
+ xChainType: ChainType;
1332
338
  };
1333
- declare class StellarWalletsKitXConnector extends XConnector {
1334
- _wallet: StellarWalletType;
1335
- constructor(wallet: StellarWalletType);
1336
- getXService(): StellarXService;
1337
- connect(): Promise<XAccount | undefined>;
1338
- disconnect(): Promise<void>;
1339
- get icon(): string;
1340
- }
1341
-
1342
- declare class SuiXService extends XService {
1343
- private static instance;
1344
- suiClient: any;
1345
- suiWallet: any;
1346
- suiAccount: any;
1347
- private constructor();
1348
- static getInstance(): SuiXService;
1349
- getBalances(address: string | undefined, xTokens: readonly XToken[]): Promise<Record<string, bigint>>;
1350
- }
1351
-
1352
- declare class SuiXConnector extends XConnector {
1353
- wallet: any;
1354
- constructor(wallet: any);
1355
- getXService(): SuiXService;
1356
- connect(): Promise<XAccount | undefined>;
1357
- disconnect(): Promise<void>;
1358
- get icon(): any;
1359
- }
1360
-
1361
- declare class StacksXService extends XService {
1362
- private static instance;
1363
- network: StacksNetwork | undefined;
1364
- private constructor();
1365
- static getInstance(): StacksXService;
1366
- getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
1367
- }
1368
-
1369
- interface StacksProviderConfig {
1370
- /** The provider ID matching the window path, e.g. 'LeatherProvider' or 'XverseProviders.BitcoinProvider' */
1371
- id: string;
1372
- name: string;
1373
- icon: string;
1374
- installUrl?: string;
1375
- }
1376
- declare class StacksXConnector extends XConnector {
1377
- private readonly config;
1378
- constructor(config: StacksProviderConfig);
1379
- connect(): Promise<XAccount | undefined>;
1380
- disconnect(): Promise<void>;
1381
- get icon(): string;
1382
- getProvider(): StacksProvider | undefined;
1383
- }
1384
-
1385
- declare const STACKS_PROVIDERS: StacksProviderConfig[];
1386
-
1387
- declare function useStacksXConnectors(): StacksXConnector[];
1388
-
1389
- declare function useXAccount(chainIdentifier?: ChainType | ChainId): XAccount;
1390
-
1391
- declare function useXAccounts(): Partial<Record<"ICON" | "EVM" | "INJECTIVE" | "SUI" | "STELLAR" | "SOLANA" | "STACKS" | "NEAR" | "BITCOIN", XAccount>>;
1392
-
1393
339
  /**
1394
- * Hook for connecting to various blockchain wallets across different chains
340
+ * Returns a callback that disconnects the wallet for a given chain type.
341
+ *
342
+ * The callback delegates to the chain's `ChainActions.disconnect()` — provider-managed
343
+ * chains (EVM/Solana/Sui) trigger native SDK disconnect and let the Hydrator clear the
344
+ * store; non-provider chains call `unsetXConnection` directly.
345
+ *
346
+ * **Never throws.** When no `ChainActions` are registered (chain not enabled in
347
+ * `SodaxWalletProvider` config), the callback logs a warning and resolves silently.
348
+ * Even if the wallet's native disconnect throws, the store is cleared — the UI never
349
+ * gets stuck on "connected" state.
1395
350
  *
1396
- * Handles connection logic for EVM, SUI, Solana and other supported chains.
1397
- * Sets up wallet connections and stores connection state in XWagmiStore.
351
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONNECT_FLOW.md#disconnect | Connect Flow Disconnect}
352
+ */
353
+ declare function useXDisconnect(): (args: UseXDisconnectArgs) => Promise<void>;
354
+
355
+ type ConnectionStatus = 'idle' | 'connecting' | 'success' | 'error';
356
+ type UseConnectionFlowResult = {
357
+ /** `'idle' | 'connecting' | 'success' | 'error'` — reflects the last attempt. */
358
+ status: ConnectionStatus;
359
+ /** Raw error from the last failed attempt; null when no error. Inspect `activeConnector.isInstalled` for the install-CTA branch. */
360
+ error: Error | null;
361
+ /** Connector the current / last attempt targeted. */
362
+ activeConnector: XConnector | null;
363
+ /** Chain the current / last attempt targeted. */
364
+ activeChainType: ChainType | null;
365
+ /** Connect and return the resolved account. Errors populate `error` instead of throwing. */
366
+ connect: (connector: XConnector) => Promise<XAccount | undefined>;
367
+ /** Disconnect a specific chain. Matches `useXDisconnect` semantics. */
368
+ disconnect: (args: UseXDisconnectArgs) => Promise<void>;
369
+ /** Re-runs the last attempted `connect(connector)`. No-op if no prior attempt. */
370
+ retry: () => Promise<XAccount | undefined>;
371
+ /** Clears `status`, `error`, and `activeConnector`. */
372
+ reset: () => void;
373
+ };
374
+ /**
375
+ * Wrapper around `useXConnect` + `useXDisconnect` that surfaces the raw error
376
+ * on state instead of throwing, plus tracks the active connector and exposes
377
+ * `retry()`. Unlike calling `useXConnect` directly, `connect()` here never
378
+ * throws — errors flow into `error` so render code stays linear.
1398
379
  *
1399
- * @param {void} - No parameters required
1400
- * @returns {UseMutationResult<XAccount | undefined, Error, XConnector>} Mutation result containing:
1401
- * - mutateAsync: Function to connect a wallet
1402
- * - isPending: Boolean indicating if connection is in progress
1403
- * - error: Any error that occurred
1404
- * - data: Connected account data if successful
380
+ * For the "install CTA" branch, read `activeConnector.isInstalled` and
381
+ * `activeConnector.installUrl` (populated by Phase 1). No error classification
382
+ * is done here consumers log the raw error for unrecognized cases.
1405
383
  *
1406
384
  * @example
1407
- * ```ts
1408
- * const { mutateAsync: connect, isPending } = useXConnect();
1409
- *
1410
- * const handleConnect = async (connector: XConnector) => {
1411
- * try {
1412
- * await connect(connector);
1413
- * } catch (err) {
1414
- * console.error(err);
385
+ * const { status, error, connect, retry, activeConnector } = useConnectionFlow();
386
+ *
387
+ * if (status === 'error' && error) {
388
+ * if (activeConnector && !activeConnector.isInstalled) {
389
+ * return <a href={activeConnector.installUrl}>Install →</a>;
1415
390
  * }
1416
- * };
1417
- * ```
391
+ * return <button onClick={retry}>Failed — retry</button>;
392
+ * }
393
+ *
394
+ * return (
395
+ * <button onClick={() => connect(connector)} disabled={status === 'connecting'}>
396
+ * {status === 'connecting' ? 'Waiting for wallet…' : 'Connect'}
397
+ * </button>
398
+ * );
1418
399
  */
1419
- declare function useXConnect(): UseMutationResult<XAccount | undefined, Error, XConnector>;
400
+ declare function useConnectionFlow(): UseConnectionFlowResult;
401
+
402
+ /** Lifecycle of a sequential batch operation (`useBatchConnect`, `useBatchDisconnect`). */
403
+ type BatchOperationStatus = 'idle' | 'running' | 'done';
1420
404
 
1421
405
  /**
1422
- * Hook for accessing connection details for a specific blockchain
1423
- *
1424
- * Retrieves the current connection state for the specified chain type,
1425
- * including the connected account and connector ID.
406
+ * Per-target event emitted by `onProgress` as the batch advances. Lets consumers
407
+ * render a live "EVM: connecting… done; ICON: skipped; SUI: connecting…" log
408
+ * instead of waiting for the final `run()` promise.
409
+ */
410
+ type BatchConnectProgressEvent = {
411
+ chainType: ChainType;
412
+ outcome: 'success';
413
+ } | {
414
+ chainType: ChainType;
415
+ outcome: 'failure';
416
+ error: Error;
417
+ } | {
418
+ chainType: ChainType;
419
+ outcome: 'skipped';
420
+ };
421
+ type BatchConnectResult = {
422
+ /** Chain types where the connect attempt succeeded. */
423
+ successful: ChainType[];
424
+ /** Chain types where the connect attempt threw, paired with the raw error. */
425
+ failed: Array<{
426
+ chainType: ChainType;
427
+ error: Error;
428
+ }>;
429
+ /** Chain types skipped because `{ skipConnected: true }` and an account was already present. */
430
+ skipped: ChainType[];
431
+ };
432
+ type UseBatchConnectOptions = {
433
+ /**
434
+ * Wallet brand identifiers (e.g. `'hana'`, `'phantom'`). Matched via
435
+ * case-insensitive substring against `connector.id` and `connector.name` —
436
+ * see {@link matchesConnectorIdentifier}.
437
+ *
438
+ * Resolution is **per-chain priority with fallback-on-failure**: for each
439
+ * chain, every matching connector is queued in identifier order. The runner
440
+ * tries them sequentially and stops at the first one that connects. If an
441
+ * earlier identifier's connector fails (popup denied, extension error, …),
442
+ * the next identifier's connector is tried. Subsequent identifiers are
443
+ * silently skipped once a chain succeeds — only one popup per chain on the
444
+ * happy path.
445
+ *
446
+ * To target a specific connector (not a brand), use
447
+ * `useXConnectors(chainType).find(c => c.id === '...')` directly instead of
448
+ * this API.
449
+ *
450
+ * @example ['hana'] // Hana across every chain it supports
451
+ * @example ['hana', 'phantom'] // prefer Hana per chain; if Hana fails or
452
+ * // is unavailable on a chain, fall back to
453
+ * // Phantom (e.g. Solana).
454
+ */
455
+ connectors: readonly string[];
456
+ /** Skip chains whose account is already connected at `run()` time. */
457
+ skipConnected?: boolean;
458
+ /**
459
+ * Fires once per target as the batch progresses. Useful for live progress UI
460
+ * (a spinner-per-chain list). Errors thrown from `onProgress` are caught and
461
+ * logged — they do NOT fail the batch.
462
+ */
463
+ onProgress?: (event: BatchConnectProgressEvent) => void;
464
+ };
465
+ type UseBatchConnectResult = {
466
+ run: () => Promise<BatchConnectResult>;
467
+ status: BatchOperationStatus;
468
+ result: BatchConnectResult | null;
469
+ /**
470
+ * Clears `status` and `result`. Calling `reset()` while `status === 'running'`
471
+ * only clears the observable state — the in-flight batch is NOT aborted
472
+ * (there is no cancellation signal). When the batch eventually resolves,
473
+ * `status` flips to `'done'` and `result` populates again. Typical usage
474
+ * is to call `reset()` only after `status === 'done'`.
475
+ */
476
+ reset: () => void;
477
+ };
478
+ /**
479
+ * Connect every chain where one of the supplied wallet identifiers matches
480
+ * an available connector. Sequential (safe for extensions that share popup
481
+ * singletons); errors never throw from `run()` — failures are collected into
482
+ * `result.failed`.
1426
483
  *
1427
- * @param {ChainType} xChainType - The type of blockchain to get connection details for
1428
- * @returns {XConnection | undefined} Connection details including account and connector ID, or undefined if not connected
484
+ * Replaces the apps/web-era per-wallet wrappers
485
+ * (`useConnectAllWithHana`, `useConnectRestWithHana`): pass the wallet name(s)
486
+ * and the hook discovers all compatible chains from the registry.
1429
487
  *
1430
488
  * @example
1431
- * ```ts
1432
- * const connection = useXConnection('EVM');
489
+ * // Connect Hana on every chain it supports (EVM, ICON, Solana, Sui, Stellar...)
490
+ * const { run, status, result } = useBatchConnect({ connectors: ['hana'] });
491
+ * await run();
1433
492
  *
1434
- * if (connection) {
1435
- * console.log('Connected account:', connection.xAccount.address);
1436
- * console.log('Using connector:', connection.xConnectorId);
1437
- * }
1438
- * ```
493
+ * @example
494
+ * // Only connect chains not already connected
495
+ * const { run } = useBatchConnect({ connectors: ['hana'], skipConnected: true });
496
+ * await run();
1439
497
  */
1440
- declare function useXConnection(xChainType: ChainType | undefined): XConnection | undefined;
498
+ declare function useBatchConnect({ connectors, skipConnected, onProgress, }: UseBatchConnectOptions): UseBatchConnectResult;
1441
499
 
1442
500
  /**
1443
- * Hook to retrieve available wallet connectors for a specific blockchain type.
501
+ * Per-target event emitted by `onProgress` as the batch advances.
502
+ */
503
+ type BatchDisconnectProgressEvent = {
504
+ chainType: ChainType;
505
+ outcome: 'success';
506
+ } | {
507
+ chainType: ChainType;
508
+ outcome: 'failure';
509
+ error: Error;
510
+ };
511
+ type BatchDisconnectResult = {
512
+ /** Chain types where disconnect succeeded. */
513
+ successful: ChainType[];
514
+ /** Chain types where disconnect threw, paired with the raw error. */
515
+ failed: Array<{
516
+ chainType: ChainType;
517
+ error: Error;
518
+ }>;
519
+ };
520
+ type UseBatchDisconnectOptions = {
521
+ /**
522
+ * Wallet brand identifiers to scope the disconnect (e.g. `'hana'`,
523
+ * `'xverse'`). Matched via case-insensitive substring against
524
+ * `connector.id` and `connector.name` — see {@link matchesConnectorIdentifier}.
525
+ * Only chains whose *currently active* connector matches at least one
526
+ * identifier are disconnected.
527
+ *
528
+ * Omit this field to disconnect every currently-connected chain regardless
529
+ * of which wallet is active.
530
+ *
531
+ * To target a specific connector (not a brand), use
532
+ * `useXConnectors(chainType).find(c => c.id === '...')` + `useXDisconnect`
533
+ * directly instead of this API.
534
+ *
535
+ * @example ['hana'] // disconnect every chain Hana is connected on
536
+ * @example ['hana', 'xverse'] // disconnect chains with Hana OR Xverse active
537
+ */
538
+ connectors?: readonly string[];
539
+ /**
540
+ * Fires once per target as the batch progresses. Errors thrown from
541
+ * `onProgress` are caught and logged — they do NOT fail the batch.
542
+ */
543
+ onProgress?: (event: BatchDisconnectProgressEvent) => void;
544
+ };
545
+ type UseBatchDisconnectResult = {
546
+ run: () => Promise<BatchDisconnectResult>;
547
+ status: BatchOperationStatus;
548
+ result: BatchDisconnectResult | null;
549
+ /**
550
+ * Clears `status` and `result`. Calling `reset()` while `status === 'running'`
551
+ * only clears the observable state — the in-flight batch is NOT aborted
552
+ * (there is no cancellation signal). When the batch eventually resolves,
553
+ * `status` flips to `'done'` and `result` populates again. Typical usage
554
+ * is to call `reset()` only after `status === 'done'`.
555
+ */
556
+ reset: () => void;
557
+ };
558
+ /**
559
+ * Disconnect chains sequentially, optionally scoped to a specific wallet.
560
+ * Mirrors {@link useBatchConnect}'s identifier-based API:
561
+ *
562
+ * @example
563
+ * // Disconnect every chain Hana is currently connected on
564
+ * const { run } = useBatchDisconnect({ connectors: ['hana'] });
565
+ * await run();
1444
566
  *
1445
- * This hook aggregates wallet connectors from different blockchain ecosystems:
1446
- * - EVM: Uses wagmi connectors
1447
- * - Sui: Uses Sui wallet adapters
1448
- * - Stellar: Uses custom Stellar connectors
1449
- * - Solana: Uses Solana wallet adapters (filtered to installed wallets only)
567
+ * @example
568
+ * // Disconnect every currently-connected chain regardless of wallet
569
+ * const { run } = useBatchDisconnect();
570
+ * await run();
1450
571
  *
1451
- * @param xChainType - The blockchain type to get connectors for ('EVM' | 'SUI' | 'STELLAR' | 'SOLANA' | 'NEAR' | 'STACKS')
1452
- * @returns An array of XConnector instances compatible with the specified chain type
572
+ * Best-effort: errors are collected, not thrown. `run()` is idempotent a
573
+ * double-invocation while one batch is in flight returns the same promise.
1453
574
  */
1454
- declare function useXConnectors(xChainType: ChainType | undefined): XConnector[];
575
+ declare function useBatchDisconnect({ connectors, onProgress, }?: UseBatchDisconnectOptions): UseBatchDisconnectResult;
1455
576
 
1456
577
  /**
1457
- * Hook for disconnecting from a specific blockchain wallet
1458
- *
1459
- * Handles disconnection logic for EVM, SUI, Solana and other supported chains.
1460
- * Clears connection state from XWagmiStore.
578
+ * Discriminated union for the wallet-modal flow state machine.
579
+ * See `useWalletModal()` for transitions and consumer usage.
580
+ */
581
+ type WalletModalState = {
582
+ kind: 'closed';
583
+ } | {
584
+ kind: 'chainSelect';
585
+ } | {
586
+ kind: 'walletSelect';
587
+ chainType: ChainType;
588
+ } | {
589
+ kind: 'connecting';
590
+ chainType: ChainType;
591
+ connector: XConnector;
592
+ } | {
593
+ kind: 'success';
594
+ chainType: ChainType;
595
+ connector: XConnector;
596
+ account: XAccount;
597
+ } | {
598
+ kind: 'error';
599
+ chainType: ChainType;
600
+ connector: XConnector;
601
+ error: Error;
602
+ };
603
+
604
+ type UseWalletModalOptions = {
605
+ /**
606
+ * Fires once after a successful connect attempt initiated through the modal,
607
+ * before the consumer transitions away from the `success` state. Side-effects
608
+ * the SDK shouldn't bake in (registration check, terms-of-service modal, app
609
+ * routing) belong here.
610
+ */
611
+ onConnected?: (chainType: ChainType, account: XAccount) => void | Promise<void>;
612
+ /**
613
+ * How long (ms) to wait for a provider-managed chain's Hydrator to populate
614
+ * `xConnections[chainType]` with an account whose `xConnectorId` matches the
615
+ * connector the user picked. Defaults to 5000ms. Raise this for slow
616
+ * networks / wallets that take a long time to surface the account after
617
+ * the user approves the popup. Ignored for non-provider chains (Bitcoin,
618
+ * ICON, Stellar, NEAR, Stacks, Injective) — those return the account
619
+ * directly from `connect()`.
620
+ */
621
+ hydrationTimeoutMs?: number;
622
+ };
623
+ /**
624
+ * WalletConnect UX caveat
625
+ * -----------------------
626
+ * When the user picks an EVM WalletConnect connector, wagmi opens its own QR
627
+ * modal as a third-party UI. While that QR modal is visible, `useWalletModal`
628
+ * stays in `connecting` — the consumer may prefer to auto-hide the Sodax
629
+ * modal to avoid two dialogs stacking. Detect WC via
630
+ * `state.kind === 'connecting' && state.connector.id === 'walletConnect'`
631
+ * (wagmi's connector id) and conditionally render `null` until the attempt
632
+ * resolves. Not wired into the SDK because partners integrating their own
633
+ * dialog system decide the policy (hide, fade, keep).
634
+ */
635
+ type UseWalletModalResult = {
636
+ /** Discriminated union — switch on `state.kind` for type-narrowed fields. */
637
+ state: WalletModalState;
638
+ /** Transition `closed → chainSelect`. No-op if already open. */
639
+ open: () => void;
640
+ /** Transition any → `closed`. */
641
+ close: () => void;
642
+ /**
643
+ * Smart back: walletSelect → chainSelect; connecting/error → walletSelect
644
+ * (preserve chainType so user can pick another wallet or retry); success → closed;
645
+ * closed/chainSelect → no-op.
646
+ */
647
+ back: () => void;
648
+ /** Transition `chainSelect → walletSelect(chainType)`. */
649
+ selectChain: (chainType: ChainType) => void;
650
+ /**
651
+ * Transition `walletSelect → connecting → success | error`. Composes
652
+ * `useXConnect` internally; failures populate `state.error` instead of
653
+ * throwing.
654
+ *
655
+ * Concurrency:
656
+ * - Same connector already in flight → returns the same promise (dedupes
657
+ * double-clicks).
658
+ * - Different connector clicked before the previous attempt settles → starts
659
+ * a new attempt; the previous attempt's late resolution is dropped and
660
+ * does not overwrite the current state.
661
+ * - User calls `back()` / `close()` mid-connect → the in-flight attempt's
662
+ * late resolution is dropped and does not transition to `success`/`error`.
663
+ *
664
+ * `back()` / `close()` mid-connect caveat: if the wallet already approved
665
+ * before the transition, `xConnections` is populated by `useXConnect` /
666
+ * the Hydrator independently of the modal state machine. Leaving the
667
+ * `connecting` state only drops the pending `success`/`error` transition
668
+ * — the account stays connected. Call `useXDisconnect(chainType)` from
669
+ * the same handler that calls `back()` / `close()` if a full rollback is
670
+ * required.
671
+ */
672
+ selectWallet: (connector: XConnector) => Promise<XAccount | undefined>;
673
+ /** Re-runs the last `selectWallet` from an `error` state. No-op otherwise. */
674
+ retry: () => Promise<XAccount | undefined>;
675
+ };
676
+ /**
677
+ * Headless modal lifecycle for multi-chain wallet connection. Owns the flow
678
+ * `closed → chainSelect → walletSelect → connecting → success | error` as a
679
+ * Zustand slice so multiple components (header CTA, inline buttons, settings)
680
+ * see the same lifecycle without prop drilling.
1461
681
  *
1462
- * @param {void} - No parameters required
1463
- * @returns {(xChainType: ChainType) => Promise<void>} Async function that disconnects from the specified chain
682
+ * The hook is render-agnostic pair it with any dialog/drawer/inline UI:
1464
683
  *
1465
684
  * @example
1466
- * ```ts
1467
- * const disconnect = useXDisconnect();
685
+ * const modal = useWalletModal({
686
+ * onConnected: async (chainType, account) => {
687
+ * // App-specific side effect (e.g. terms-of-service check)
688
+ * await registerIfNew(chainType, account.address);
689
+ * },
690
+ * });
1468
691
  *
1469
- * const handleDisconnect = async (xChainType: ChainType) => {
1470
- * await disconnect(xChainType);
1471
- * };
1472
- * ```
692
+ * switch (modal.state.kind) {
693
+ * case 'closed': return <button onClick={modal.open}>Connect</button>;
694
+ * case 'chainSelect': return <ChainList onPick={modal.selectChain} onBack={modal.close} />;
695
+ * case 'walletSelect': return <WalletList chainType={modal.state.chainType} onPick={modal.selectWallet} onBack={modal.back} />;
696
+ * case 'connecting': return <Spinner connector={modal.state.connector} />;
697
+ * case 'success': return null; // onConnected fired; consumer can call modal.close()
698
+ * case 'error': return <ErrorView error={modal.state.error} onRetry={modal.retry} onBack={modal.back} />;
699
+ * }
1473
700
  */
1474
- declare function useXDisconnect(): (xChainType: ChainType) => Promise<void>;
1475
-
1476
- declare function useXService(xChainType: ChainType | undefined): XService | undefined;
701
+ declare function useWalletModal({ onConnected, hydrationTimeoutMs, }?: UseWalletModalOptions): UseWalletModalResult;
1477
702
 
703
+ type UseXServiceOptions = {
704
+ xChainType?: ChainType;
705
+ };
1478
706
  /**
1479
- * Hook to fetch token balances for multiple tokens on a specific chain
707
+ * Returns the chain-specific `XService` instance for advanced reads balance lookups
708
+ * (`xService.getBalance(address, xToken)`), connector enumeration, or chain-specific
709
+ * methods on concrete subclasses.
1480
710
  *
1481
- * @param params - Query parameters object
1482
- * @param params.xChainId - Chain identifier (e.g. '0xa86a.avax', '0x1.base', '0x2.bsc', '0x89.polygon', '0x1.optimism')
1483
- * @param params.xTokens - Array of token objects to fetch balances for.
1484
- * @param params.address - Wallet address to fetch balances for. If undefined, returns empty object
711
+ * Most consumers don't need this — `useWalletProvider` is the higher-level bridge to
712
+ * `@sodax/sdk`, and `useXConnectors` returns the connector list directly. Reach for
713
+ * `useXService` only when you need the service object itself (e.g. passing it to
714
+ * `useXBalances` from `@sodax/dapp-kit`).
1485
715
  *
1486
- * @returns UseQueryResult containing an object mapping token addresses to their balances as bigints.
1487
- * The balances are denominated in the token's smallest unit (e.g. wei for ETH).
1488
- * Returns empty object if wallet is not connected or service is unavailable.
716
+ * Returns `undefined` when `xChainType` is omitted or the chain isn't enabled.
1489
717
  */
718
+ declare function useXService({ xChainType }?: UseXServiceOptions): XService | undefined;
719
+
1490
720
  /**
1491
- * @example
1492
- * ```tsx
1493
- * // Example usage in a component
1494
- * function TokenBalances({ tokens }: { tokens: XToken[] }) {
1495
- * const { address } = useXAccount('EVM');
1496
- * const { data: balances } = useXBalances({
1497
- * xChainId: '0xa86a.avax',
1498
- * xTokens: tokens,
1499
- * address,
1500
- * });
1501
- *
1502
- * return (
1503
- * <div>
1504
- * {tokens.map(token => (
1505
- * <div key={token.address}>
1506
- * {token.symbol}: {formatUnits(balances?.[token.address] || 0n, token.decimals)}
1507
- * </div>
1508
- * ))}
1509
- * </div>
1510
- * );
1511
- * }
1512
- * ```
721
+ * Returns the `XService` instance for every enabled chain, keyed by `ChainType`.
722
+ *
723
+ * Each service singleton owns its connector list and exposes balance readers; concrete
724
+ * subclasses (e.g. `EvmXService`, `BitcoinXService`) carry chain-specific methods. For
725
+ * a single chain, prefer `useXService` which is keyed by `xChainType` directly.
726
+ */
727
+ declare function useXServices(): Partial<Record<ChainType, XService>>;
728
+
729
+ /**
730
+ * Reads the list of `ChainType`s currently enabled in `SodaxWalletProvider` config.
731
+ *
732
+ * Reflects which chain-type slots are present (`config.EVM`, `config.SOLANA`, …) — not
733
+ * which chains have a wallet connected. Use `useConnectedChains` for the latter.
734
+ *
735
+ * @returns Stable array reference; re-renders only when `enabledChains` changes (i.e. on
736
+ * `initChainServices` after mount, never afterwards because config is captured once).
1513
737
  */
1514
- declare function useXBalances({ xChainId, xTokens, address, }: {
1515
- xChainId: ChainId;
1516
- xTokens: readonly XToken[];
1517
- address: string | undefined;
1518
- }): UseQueryResult<{
1519
- [key: string]: bigint;
1520
- }>;
738
+ declare function useEnabledChains(): ChainType[];
1521
739
 
1522
- interface UseEvmSwitchChainReturn {
740
+ type UseEvmSwitchChainOptions = {
741
+ xChainId: SpokeChainKey;
742
+ };
743
+ type UseEvmSwitchChainReturn = {
1523
744
  isWrongChain: boolean;
1524
745
  handleSwitchChain: () => void;
1525
- }
1526
- declare const useEvmSwitchChain: (expectedXChainId: ChainId) => UseEvmSwitchChainReturn;
746
+ };
747
+ /**
748
+ * Hook to handle EVM chain switching functionality.
749
+ * Safe to call when EVM is disabled — returns no-op values.
750
+ *
751
+ * Conditionally delegates to useEvmSwitchChainInner which uses wagmi hooks
752
+ * (useAccount, useSwitchChain) that require WagmiProvider. When EVM is disabled,
753
+ * WagmiProvider is not mounted, so we must not call those hooks.
754
+ *
755
+ * This technically violates Rules of Hooks (conditional hook call), but is safe
756
+ * because `evmEnabled` is derived from config which is immutable after mount —
757
+ * the branch never changes during the component's lifetime.
758
+ */
759
+ declare function useEvmSwitchChain({ xChainId }: UseEvmSwitchChainOptions): UseEvmSwitchChainReturn;
760
+
761
+ /** Empty slot in `walletProviders` is normal before a wallet is connected. */
762
+ type GetWalletProviderReturnType<K extends ChainType | undefined> = K extends ChainType ? GetWalletProviderType<K> | undefined : undefined;
1527
763
 
764
+ type UseWalletProviderOptions = {
765
+ xChainId?: SpokeChainKey;
766
+ xChainType?: ChainType;
767
+ };
1528
768
  /**
1529
- * Hook to get the appropriate wallet provider based on the chain type.
1530
- * Supports EVM, SUI, ICON, INJECTIVE, STELLAR, SOLANA and NEAR chains.
769
+ * Returns the typed `IXxxWalletProvider` instance for the requested chain — ready to plug
770
+ * into any `@sodax/sdk` call's `walletProvider` slot.
1531
771
  *
1532
- * @param {ChainId | undefined} spokeChainId - The chain ID to get the wallet provider for. Can be any valid ChainId value.
1533
- * @returns {EvmWalletProvider | SuiWalletProvider | IconWalletProvider | InjectiveWalletProvider | undefined}
1534
- * The appropriate wallet provider instance for the given chain ID, or undefined if:
1535
- * - No chain ID is provided
1536
- * - Chain type is not supported
1537
- * - Required wallet provider options are not available
772
+ * Pass either `xChainId` (a `SpokeChainKey`) or `xChainType` (a `ChainType` family),
773
+ * never both. The chain key form gives the narrowest TypeScript inference (e.g.
774
+ * `xChainId: ChainKeys.BSC_MAINNET` `IEvmWalletProvider | undefined`).
1538
775
  *
1539
- * @example
1540
- * ```tsx
1541
- * // Get wallet provider for a specific chain
1542
- * const walletProvider = useWalletProvider('sui');
1543
- * ```
776
+ * Returns `undefined` when:
777
+ * - The chain isn't enabled in `SodaxWalletProvider` config (logs a one-time warning).
778
+ * - No wallet is connected for that chain yet.
779
+ *
780
+ * For provider-managed chains (EVM/Solana/Sui), the returned provider is rebuilt by the
781
+ * Hydrator whenever the underlying client changes (chain switch, wallet swap). For
782
+ * non-provider chains, the provider is created as a side-effect of `setXConnection`.
783
+ *
784
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/WALLET_PROVIDER_BRIDGE.md | Wallet Provider Bridge}
1544
785
  */
1545
- declare function useWalletProvider(spokeChainId: ChainId | undefined): IEvmWalletProvider | ISuiWalletProvider | IIconWalletProvider | IInjectiveWalletProvider | IStellarWalletProvider | ISolanaWalletProvider | IBitcoinWalletProvider | INearWalletProvider | IStacksWalletProvider | undefined;
786
+ declare function useWalletProvider<S extends SpokeChainKey>(options: {
787
+ xChainId: S;
788
+ xChainType?: never;
789
+ }): GetWalletProviderType<GetChainType<S>> | undefined;
790
+ declare function useWalletProvider<K extends ChainType | undefined>(options?: {
791
+ xChainId?: never;
792
+ xChainType?: K;
793
+ }): GetWalletProviderReturnType<K> | undefined;
1546
794
 
1547
795
  type SignMessageReturnType = `0x${string}` | Uint8Array | string | undefined;
1548
- declare function useXSignMessage(): UseMutationResult<SignMessageReturnType, Error, {
796
+ type XSignMessageVariables = {
1549
797
  xChainType: ChainType;
1550
798
  message: string;
1551
- }, unknown>;
799
+ };
800
+ /**
801
+ * React Query mutation that delegates message signing to the connected wallet via
802
+ * `ChainActions.signMessage` — registered per chain by the `chainRegistry` (non-provider
803
+ * chains) or by the `<Chain>Actions` component (provider-managed chains).
804
+ *
805
+ * The signature shape varies by chain: hex `\`0x${string}\`` for EVM, `Uint8Array` for
806
+ * Solana, base64 `string` for Stellar/Sui, etc. Branch on `xChainType` when consuming.
807
+ *
808
+ * **Bitcoin auto-selects** between BIP-322 (P2WPKH/P2TR) and ECDSA (P2SH/P2PKH) based
809
+ * on the connected address type — same dispatch logic as the SDK's
810
+ * `BitcoinSpokeProvider.authenticateWithWallet`.
811
+ *
812
+ * **Returns `undefined`** when the chain doesn't implement `signMessage` — currently
813
+ * only ICON (Hana wallet exposes no signing API). A one-time `console.warn` accompanies
814
+ * the `undefined`.
815
+ *
816
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/SIGN_MESSAGE.md | Sign Message}
817
+ */
818
+ declare function useXSignMessage(): UseMutationResult<SignMessageReturnType, Error, XSignMessageVariables, unknown>;
1552
819
 
1553
- type XWagmiStore = {
1554
- xServices: Partial<Record<ChainType, XService>>;
1555
- xConnections: Partial<Record<ChainType, XConnection>>;
1556
- setXConnection: (xChainType: ChainType, xConnection: XConnection) => void;
1557
- unsetXConnection: (xChainType: ChainType) => void;
820
+ type SodaxWalletProviderProps = {
821
+ children: ReactNode;
822
+ /**
823
+ * Captured once on mount. Dynamic changes require remounting `SodaxWalletProvider`
824
+ * passing a new reference on subsequent renders has no effect.
825
+ */
826
+ config: SodaxWalletConfig;
1558
827
  };
1559
- declare const useXWagmiStore: zustand.UseBoundStore<Omit<Omit<Omit<zustand.StoreApi<XWagmiStore>, "setState"> & {
1560
- setState<A extends string | {
1561
- type: string;
1562
- }>(partial: XWagmiStore | Partial<XWagmiStore> | ((state: XWagmiStore) => XWagmiStore | Partial<XWagmiStore>), replace?: boolean | undefined, action?: A | undefined): void;
1563
- }, "persist"> & {
1564
- persist: {
1565
- setOptions: (options: Partial<zustand_middleware.PersistOptions<XWagmiStore, unknown>>) => void;
1566
- clearStorage: () => void;
1567
- rehydrate: () => Promise<void> | void;
1568
- hasHydrated: () => boolean;
1569
- onHydrate: (fn: (state: XWagmiStore) => void) => () => void;
1570
- onFinishHydration: (fn: (state: XWagmiStore) => void) => () => void;
1571
- getOptions: () => Partial<zustand_middleware.PersistOptions<XWagmiStore, unknown>>;
1572
- };
1573
- }, "setState"> & {
1574
- setState(nextStateOrUpdater: XWagmiStore | Partial<XWagmiStore> | ((state: immer.WritableDraft<XWagmiStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
1575
- type: string;
1576
- } | undefined): void;
1577
- }>;
828
+ /**
829
+ * Root provider for SODAX wallet connectivity. Mounts only the chain-type adapters opted
830
+ * into via `config` and bridges to `@sodax/wallet-sdk-core` so SDK calls receive a typed
831
+ * `IXxxWalletProvider`.
832
+ *
833
+ * Top-level keys on `SodaxWalletConfig` are chain-type slots (`EVM`, `SOLANA`, `BITCOIN`, …).
834
+ * Omit a slot to skip mounting that adapter; pass `{}` to mount with SDK defaults. Provider-
835
+ * managed chains (EVM/Solana/Sui) wrap their native React adapter (wagmi / wallet-adapter /
836
+ * dapp-kit) plus a `<Hydrator>` that syncs adapter state into the Zustand store; non-provider
837
+ * chains register `ChainActions` directly during `useInitChainServices`.
838
+ *
839
+ * **Config is captured once on mount** via `useRef` — subsequent re-renders with a new
840
+ * reference have no effect. To swap config at runtime, remount with a new `key` prop.
841
+ *
842
+ * Must be wrapped by `<QueryClientProvider>` from `@tanstack/react-query` (or, if also
843
+ * using `@sodax/dapp-kit`, see Setup skill for the full provider-stack ordering).
844
+ *
845
+ * @see {@link https://github.com/icon-project/sodax-sdks/blob/main/packages/wallet-sdk-react/docs/CONFIGURE_PROVIDER.md | Configure SodaxWalletProvider}
846
+ */
847
+ declare const SodaxWalletProvider: ({ children, config }: SodaxWalletProviderProps) => react_jsx_runtime.JSX.Element;
1578
848
 
1579
- export { BitcoinXConnector, BitcoinXService, type CurrencyKey, EvmXConnector, EvmXService, IconHanaXConnector, IconXService, InjectiveXConnector, InjectiveXService, OKXXConnector, STACKS_PROVIDERS, SodaxWalletProvider, type SodaxWalletProviderOptions, type SodaxWalletProviderProps, SolanaXConnector, SolanaXService, type StacksProviderConfig, StacksXConnector, StacksXService, StellarWalletsKitXConnector, StellarXService, SuiXConnector, SuiXService, UnisatXConnector, type WagmiOptions, WalletId, type XAccount, type XConnection, XConnector, XService, XverseXConnector, createWagmiConfig as createWagmi, createWagmiConfig, getWagmiChainId, getXChainType, getXService, isNativeToken, useBitcoinXConnectors, useEvmSwitchChain, useStacksXConnectors, useWalletProvider, useXAccount, useXAccounts, useXBalances, useXConnect, useXConnection, useXConnectors, useXDisconnect, useXService, useXSignMessage, useXWagmiStore };
849
+ export { type BatchConnectProgressEvent, type BatchConnectResult, type BatchDisconnectProgressEvent, type BatchDisconnectResult, type BatchOperationStatus, type ChainActions, type ChainActionsRegistry, ChainEntry, type ChainGroup, type ConnectedChain, type ConnectionStatus, EvmChainEntry, IXConnector, SodaxWalletConfig, SodaxWalletProvider, type SodaxWalletProviderProps, type SortConnectorsOptions, type UseBatchConnectOptions, type UseBatchConnectResult, type UseBatchDisconnectOptions, type UseBatchDisconnectResult, type UseChainGroupsOptions, type UseConnectedChainsOptions, type UseConnectedChainsResult, type UseConnectionFlowResult, type UseEvmSwitchChainOptions, type UseEvmSwitchChainReturn, type UseIsWalletInstalledOptions, type UseWalletModalOptions, type UseWalletModalResult, type UseWalletProviderOptions, type UseXAccountOptions, type UseXConnectionOptions, type UseXConnectorsOptions, type UseXDisconnectArgs, type UseXServiceOptions, WalletConfigProvider, WalletDefaultsByKey, type WalletModalState, XAccount, XConnection, XConnector, XService, type XSignMessageVariables, getEntryDefaults, getRpcUrl, getWagmiChainId, getXChainType, getXService, isNativeToken, resolveEvmDefaults, sortConnectors, useBatchConnect, useBatchDisconnect, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage };