@sodax/wallet-sdk-react 2.0.0-rc.2 → 2.0.0-rc.20

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 (141) hide show
  1. package/README.md +14 -7
  2. package/dist/{XConnector-B9YQTVJ4.d.ts → XConnector-12q0OVe5.d.ts} +1 -1
  3. package/dist/{chunk-NY7U7OJW.mjs → chunk-7V7O3Q7Y.mjs} +0 -2
  4. package/dist/{chunk-BXJLBR4G.mjs → chunk-C6M34IVL.mjs} +2 -4
  5. package/dist/{chunk-X2MHIWXO.mjs → chunk-IFXZQW4C.mjs} +0 -2
  6. package/dist/{chunk-7ULB6DW4.mjs → chunk-JQ4H4GJ5.mjs} +3 -5
  7. package/dist/{chunk-PLCA4ZDJ.mjs → chunk-JTQGKX65.mjs} +254 -52
  8. package/dist/{chunk-E5IAZ7E6.mjs → chunk-LM7R5APS.mjs} +22 -11
  9. package/dist/{chunk-BKJB527E.mjs → chunk-MWWVB7TD.mjs} +2 -4
  10. package/dist/{chunk-MXZVF5HR.mjs → chunk-NAKCAL2M.mjs} +0 -2
  11. package/dist/{chunk-PJLEJVAU.mjs → chunk-OPX55MQO.mjs} +11 -6
  12. package/dist/chunk-QMXBY3UI.mjs +1 -0
  13. package/dist/{chunk-MAQ47Q52.mjs → chunk-TACW7Z4D.mjs} +0 -2
  14. package/dist/chunk-VPNYFVP6.mjs +53 -0
  15. package/dist/{chunk-2BOUGCJ7.mjs → chunk-WX23SYR6.mjs} +4 -6
  16. package/dist/{chunk-66BAUK56.mjs → chunk-X7BHR7WS.mjs} +4 -6
  17. package/dist/{chunk-N5A2TMF6.mjs → chunk-XJA2MJMG.mjs} +2 -4
  18. package/dist/{config-OlnzyEUE.d.ts → config-DEsqgrG1.d.ts} +10 -5
  19. package/dist/index.d.ts +6 -6
  20. package/dist/index.mjs +20 -31
  21. package/dist/xchains/bitcoin/index.d.ts +20 -3
  22. package/dist/xchains/bitcoin/index.mjs +14 -16
  23. package/dist/xchains/evm/index.d.ts +3 -3
  24. package/dist/xchains/evm/index.mjs +3 -5
  25. package/dist/xchains/icon/index.d.ts +1 -1
  26. package/dist/xchains/icon/index.mjs +5 -7
  27. package/dist/xchains/injective/index.d.ts +2 -2
  28. package/dist/xchains/injective/index.mjs +3 -5
  29. package/dist/xchains/near/index.d.ts +1 -1
  30. package/dist/xchains/near/index.mjs +4 -6
  31. package/dist/xchains/solana/index.d.ts +1 -1
  32. package/dist/xchains/solana/index.mjs +5 -7
  33. package/dist/xchains/stacks/index.d.ts +10 -4
  34. package/dist/xchains/stacks/index.mjs +3 -5
  35. package/dist/xchains/stellar/index.d.ts +1 -1
  36. package/dist/xchains/stellar/index.mjs +4 -6
  37. package/dist/xchains/sui/index.d.ts +1 -1
  38. package/dist/xchains/sui/index.mjs +5 -7
  39. package/package.json +37 -29
  40. package/ai-exported/AGENTS.md +0 -122
  41. package/ai-exported/integration/README.md +0 -102
  42. package/ai-exported/integration/ai-rules.md +0 -136
  43. package/ai-exported/integration/architecture.md +0 -181
  44. package/ai-exported/integration/examples/01-minimal-evm.tsx +0 -75
  45. package/ai-exported/integration/examples/02-multi-chain-modal.tsx +0 -169
  46. package/ai-exported/integration/examples/03-nextjs-app-router.tsx +0 -99
  47. package/ai-exported/integration/examples/04-walletconnect-setup.tsx +0 -89
  48. package/ai-exported/integration/examples/README.md +0 -29
  49. package/ai-exported/integration/recipes/batch-operations.md +0 -223
  50. package/ai-exported/integration/recipes/bridge-to-sdk.md +0 -164
  51. package/ai-exported/integration/recipes/chain-detection.md +0 -254
  52. package/ai-exported/integration/recipes/connect-button.md +0 -156
  53. package/ai-exported/integration/recipes/multi-chain-modal.md +0 -199
  54. package/ai-exported/integration/recipes/setup.md +0 -158
  55. package/ai-exported/integration/recipes/sign-message.md +0 -137
  56. package/ai-exported/integration/recipes/sub-path-imports.md +0 -95
  57. package/ai-exported/integration/recipes/switch-chain.md +0 -141
  58. package/ai-exported/integration/recipes/walletconnect-setup.md +0 -139
  59. package/ai-exported/integration/reference/api-surface.md +0 -175
  60. package/ai-exported/integration/reference/chain-support.md +0 -78
  61. package/ai-exported/integration/reference/connectors.md +0 -74
  62. package/ai-exported/integration/reference/hooks.md +0 -204
  63. package/ai-exported/integration/reference/wallet-brands.md +0 -106
  64. package/ai-exported/migration/README.md +0 -49
  65. package/ai-exported/migration/ai-rules.md +0 -144
  66. package/ai-exported/migration/breaking-changes.md +0 -305
  67. package/ai-exported/migration/checklist.md +0 -159
  68. package/ai-exported/migration/recipes/connect-button.md +0 -166
  69. package/ai-exported/migration/recipes/multi-chain-modal.md +0 -244
  70. package/ai-exported/migration/recipes/ssr-setup.md +0 -162
  71. package/ai-exported/migration/recipes/walletconnect-migration.md +0 -168
  72. package/ai-exported/migration/reference/components.md +0 -73
  73. package/ai-exported/migration/reference/config.md +0 -307
  74. package/ai-exported/migration/reference/hooks.md +0 -278
  75. package/ai-exported/migration/reference/imports.md +0 -157
  76. package/dist/chunk-2BOUGCJ7.mjs.map +0 -1
  77. package/dist/chunk-66BAUK56.mjs.map +0 -1
  78. package/dist/chunk-7ULB6DW4.mjs.map +0 -1
  79. package/dist/chunk-BKJB527E.mjs.map +0 -1
  80. package/dist/chunk-BXJLBR4G.mjs.map +0 -1
  81. package/dist/chunk-E5IAZ7E6.mjs.map +0 -1
  82. package/dist/chunk-MAQ47Q52.mjs.map +0 -1
  83. package/dist/chunk-MXZVF5HR.mjs.map +0 -1
  84. package/dist/chunk-N5A2TMF6.mjs.map +0 -1
  85. package/dist/chunk-NY7U7OJW.mjs.map +0 -1
  86. package/dist/chunk-PJLEJVAU.mjs.map +0 -1
  87. package/dist/chunk-PLCA4ZDJ.mjs.map +0 -1
  88. package/dist/chunk-TZMKDXFA.mjs +0 -3
  89. package/dist/chunk-TZMKDXFA.mjs.map +0 -1
  90. package/dist/chunk-X2MHIWXO.mjs.map +0 -1
  91. package/dist/chunk-XZ7CHO2S.mjs +0 -41
  92. package/dist/chunk-XZ7CHO2S.mjs.map +0 -1
  93. package/dist/index.cjs +0 -3337
  94. package/dist/index.cjs.map +0 -1
  95. package/dist/index.mjs.map +0 -1
  96. package/dist/xchains/bitcoin/index.cjs +0 -1927
  97. package/dist/xchains/bitcoin/index.cjs.map +0 -1
  98. package/dist/xchains/bitcoin/index.mjs.map +0 -1
  99. package/dist/xchains/evm/index.cjs +0 -316
  100. package/dist/xchains/evm/index.cjs.map +0 -1
  101. package/dist/xchains/evm/index.mjs.map +0 -1
  102. package/dist/xchains/icon/index.cjs +0 -311
  103. package/dist/xchains/icon/index.cjs.map +0 -1
  104. package/dist/xchains/icon/index.mjs.map +0 -1
  105. package/dist/xchains/injective/index.cjs +0 -223
  106. package/dist/xchains/injective/index.cjs.map +0 -1
  107. package/dist/xchains/injective/index.mjs.map +0 -1
  108. package/dist/xchains/near/index.cjs +0 -190
  109. package/dist/xchains/near/index.cjs.map +0 -1
  110. package/dist/xchains/near/index.mjs.map +0 -1
  111. package/dist/xchains/solana/index.cjs +0 -186
  112. package/dist/xchains/solana/index.cjs.map +0 -1
  113. package/dist/xchains/solana/index.mjs.map +0 -1
  114. package/dist/xchains/stacks/index.cjs +0 -240
  115. package/dist/xchains/stacks/index.cjs.map +0 -1
  116. package/dist/xchains/stacks/index.mjs.map +0 -1
  117. package/dist/xchains/stellar/index.cjs +0 -322
  118. package/dist/xchains/stellar/index.cjs.map +0 -1
  119. package/dist/xchains/stellar/index.mjs.map +0 -1
  120. package/dist/xchains/sui/index.cjs +0 -248
  121. package/dist/xchains/sui/index.cjs.map +0 -1
  122. package/dist/xchains/sui/index.mjs.map +0 -1
  123. package/docs/ADDING_A_NEW_CHAIN.md +0 -440
  124. package/docs/ARCHITECTURE.md +0 -291
  125. package/docs/BATCH_OPERATIONS.md +0 -267
  126. package/docs/CHAIN_DETECTION.md +0 -216
  127. package/docs/CONFIGURE_PROVIDER.md +0 -360
  128. package/docs/CONNECTORS.md +0 -247
  129. package/docs/CONNECT_FLOW.md +0 -276
  130. package/docs/EVM_SWITCH_CHAIN.md +0 -161
  131. package/docs/SIGN_MESSAGE.md +0 -213
  132. package/docs/SUB_PATH_EXPORTS.md +0 -246
  133. package/docs/WALLETCONNECT.md +0 -154
  134. package/docs/WALLET_MODAL.md +0 -331
  135. package/docs/WALLET_PROVIDER_BRIDGE.md +0 -226
  136. package/skills/SKILLS.md +0 -84
  137. package/skills/bridge-to-sdk.md +0 -148
  138. package/skills/connect-button.md +0 -116
  139. package/skills/evm-only-walletconnect.md +0 -111
  140. package/skills/multi-chain-modal.md +0 -178
  141. package/skills/setup.md +0 -107
@@ -0,0 +1,53 @@
1
+ import { isNativeToken } from './chunk-7V7O3Q7Y.mjs';
2
+ import { XService } from './chunk-IFXZQW4C.mjs';
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import { TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, getAssociatedTokenAddressSync, unpackAccount } from '@solana/spl-token';
5
+
6
+ var SolanaXService = class _SolanaXService extends XService {
7
+ static instance;
8
+ connection;
9
+ wallet;
10
+ constructor() {
11
+ super("SOLANA");
12
+ }
13
+ static getInstance() {
14
+ if (!_SolanaXService.instance) {
15
+ _SolanaXService.instance = new _SolanaXService();
16
+ }
17
+ return _SolanaXService.instance;
18
+ }
19
+ async getBalance(address, xToken) {
20
+ if (!address) return BigInt(0);
21
+ const connection = this.connection;
22
+ if (!connection) {
23
+ return BigInt(0);
24
+ }
25
+ try {
26
+ if (isNativeToken(xToken)) {
27
+ const newBalance = await connection.getBalance(new PublicKey(address));
28
+ return BigInt(newBalance);
29
+ }
30
+ const owner = new PublicKey(address);
31
+ const mint = new PublicKey(xToken.address);
32
+ const candidates = [TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID].map((programId) => ({
33
+ programId,
34
+ ata: getAssociatedTokenAddressSync(mint, owner, true, programId)
35
+ }));
36
+ const accounts = await connection.getMultipleAccountsInfo(candidates.map((c) => c.ata));
37
+ let balance = BigInt(0);
38
+ for (const [i, candidate] of candidates.entries()) {
39
+ const info = accounts[i];
40
+ if (!info) continue;
41
+ try {
42
+ balance += unpackAccount(candidate.ata, info, candidate.programId).amount;
43
+ } catch {
44
+ }
45
+ }
46
+ return balance;
47
+ } catch {
48
+ return BigInt(0);
49
+ }
50
+ }
51
+ };
52
+
53
+ export { SolanaXService };
@@ -1,7 +1,7 @@
1
- import { assert, isRecord, hasBooleanProperty } from './chunk-MAQ47Q52.mjs';
2
- import { WALLET_METADATA } from './chunk-MXZVF5HR.mjs';
3
- import { isNativeToken } from './chunk-NY7U7OJW.mjs';
4
- import { XService, XConnector } from './chunk-X2MHIWXO.mjs';
1
+ import { assert, isRecord, hasBooleanProperty } from './chunk-TACW7Z4D.mjs';
2
+ import { isNativeToken } from './chunk-7V7O3Q7Y.mjs';
3
+ import { WALLET_METADATA } from './chunk-NAKCAL2M.mjs';
4
+ import { XService, XConnector } from './chunk-IFXZQW4C.mjs';
5
5
  import * as IconSdkRaw from 'icon-sdk-js';
6
6
 
7
7
  var IconSdk = "default" in IconSdkRaw.default ? IconSdkRaw.default : IconSdkRaw;
@@ -146,5 +146,3 @@ var IconHanaXConnector = class extends XConnector {
146
146
  };
147
147
 
148
148
  export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId, request };
149
- //# sourceMappingURL=chunk-2BOUGCJ7.mjs.map
150
- //# sourceMappingURL=chunk-2BOUGCJ7.mjs.map
@@ -1,8 +1,8 @@
1
- import { STELLAR_DEFAULT_HORIZON_RPC_URL, STELLAR_DEFAULT_SOROBAN_RPC_URL } from './chunk-MXZVF5HR.mjs';
2
- import { XService, XConnector } from './chunk-X2MHIWXO.mjs';
3
- import { StellarWalletsKit, allowAllModules, WalletNetwork } from '@creit.tech/stellar-wallets-kit';
1
+ import { STELLAR_DEFAULT_HORIZON_RPC_URL, STELLAR_DEFAULT_SOROBAN_RPC_URL } from './chunk-NAKCAL2M.mjs';
2
+ import { XService, XConnector } from './chunk-IFXZQW4C.mjs';
3
+ import { StellarWalletsKit, WalletNetwork, allowAllModules } from '@creit.tech/stellar-wallets-kit';
4
4
  import * as StellarSdk from '@stellar/stellar-sdk';
5
- import { rpc, Address, Contract, TimeoutInfinite, scValToBigInt } from '@stellar/stellar-sdk';
5
+ import { rpc, Contract, TimeoutInfinite, scValToBigInt, Address } from '@stellar/stellar-sdk';
6
6
 
7
7
  var CustomSorobanServer = class extends rpc.Server {
8
8
  customHeaders;
@@ -198,5 +198,3 @@ var StellarWalletsKitXConnector = class extends XConnector {
198
198
  };
199
199
 
200
200
  export { StellarWalletsKitXConnector, StellarXService };
201
- //# sourceMappingURL=chunk-66BAUK56.mjs.map
202
- //# sourceMappingURL=chunk-66BAUK56.mjs.map
@@ -1,5 +1,5 @@
1
- import { SolanaXService } from './chunk-XZ7CHO2S.mjs';
2
- import { XConnector } from './chunk-X2MHIWXO.mjs';
1
+ import { SolanaXService } from './chunk-VPNYFVP6.mjs';
2
+ import { XConnector } from './chunk-IFXZQW4C.mjs';
3
3
 
4
4
  // src/xchains/solana/SolanaXConnector.ts
5
5
  var SolanaXConnector = class extends XConnector {
@@ -29,5 +29,3 @@ var SolanaXConnector = class extends XConnector {
29
29
  };
30
30
 
31
31
  export { SolanaXConnector };
32
- //# sourceMappingURL=chunk-N5A2TMF6.mjs.map
33
- //# sourceMappingURL=chunk-N5A2TMF6.mjs.map
@@ -1,8 +1,8 @@
1
- import { ChainType, EvmChainKey, SolanaChainKey, SuiChainKey, IconChainKey, NearChainKey, StellarChainKey, StellarRpcConfig, BitcoinChainKey, BitcoinRpcConfig, InjectiveChainKey, InjectiveRpcConfig, StacksChainKey, StacksNetworkName, StacksNetworkLike, ChainKey, baseChainInfo } from '@sodax/types';
2
- import { EvmWalletDefaults, SolanaWalletDefaults, SuiWalletDefaults, IconWalletDefaults, NearWalletDefaults, StellarWalletDefaults, BitcoinWalletDefaults, InjectiveWalletDefaults, StacksWalletDefaults } from '@sodax/wallet-sdk-core';
1
+ import { BitcoinRpcConfig, ChainType, EvmChainKey, SolanaChainKey, SuiChainKey, IconChainKey, NearChainKey, StellarChainKey, StellarRpcConfig, BitcoinChainKey, InjectiveChainKey, InjectiveRpcConfig, StacksChainKey, StacksNetworkName, StacksNetworkLike, ChainKey, baseChainInfo } from '@sodax/types';
2
+ import { BitcoinWalletDefaults, EvmWalletDefaults, SolanaWalletDefaults, SuiWalletDefaults, IconWalletDefaults, NearWalletDefaults, StellarWalletDefaults, InjectiveWalletDefaults, StacksWalletDefaults } from '@sodax/wallet-sdk-core';
3
3
  import { State } from 'wagmi';
4
4
  import { WalletConnectParameters } from 'wagmi/connectors';
5
- import { I as IXConnector } from './XConnector-B9YQTVJ4.js';
5
+ import { I as IXConnector } from './XConnector-12q0OVe5.js';
6
6
 
7
7
  type SimpleChainEntry<D> = {
8
8
  rpcUrl?: string;
@@ -29,7 +29,12 @@ type StacksChainEntry = StacksNetworkName | (StacksNetworkLike & {
29
29
  type EvmAdapterFields = {
30
30
  /** Attempt to reconnect previously connected wallets on mount. @default false */
31
31
  reconnectOnMount?: boolean;
32
- /** Enable SSR-safe hydration for Next.js. @default true */
32
+ /**
33
+ * wagmi hydration-timing flag (not an "app is SSR" flag).
34
+ * `true` defers wagmi reconnect into `useEffect`; `false` runs it in render
35
+ * and triggers React's "setState during render" warning. Keep `true` unless
36
+ * you know you need otherwise. @default true
37
+ */
33
38
  ssr?: boolean;
34
39
  /** Wagmi SSR hydration state — pass `cookieToInitialState()` to avoid disconnect flash on first load (Next.js only). */
35
40
  initialState?: State;
@@ -143,4 +148,4 @@ type SodaxWalletConfig = {
143
148
  [T in ChainType]?: ChainTypeConfig<T>;
144
149
  };
145
150
 
146
- export type { BitcoinChainEntry as B, ChainEntry as C, EvmChainEntry as E, IconChainEntry as I, NearChainEntry as N, SodaxWalletConfig as S, WalletDefaultsByKey as W, SolanaChainEntry as a, SuiChainEntry as b, StellarChainEntry as c, InjectiveChainEntry as d, StacksChainEntry as e, EvmAdapterFields as f, SolanaAdapterFields as g, SuiAdapterFields as h, ChainMeta as i, ChainTypeOf as j, ChainTypeConfig as k, EvmTypeConfig as l, SolanaTypeConfig as m, SuiTypeConfig as n, BitcoinTypeConfig as o, StellarTypeConfig as p, InjectiveTypeConfig as q, IconTypeConfig as r, NearTypeConfig as s, StacksTypeConfig as t };
151
+ export type { BitcoinChainEntry as B, ChainEntry as C, EvmAdapterFields as E, IconChainEntry as I, NearChainEntry as N, SodaxWalletConfig as S, WalletDefaultsByKey as W, BitcoinTypeConfig as a, ChainMeta as b, ChainTypeConfig as c, ChainTypeOf as d, EvmChainEntry as e, EvmTypeConfig as f, IconTypeConfig as g, InjectiveChainEntry as h, InjectiveTypeConfig as i, NearTypeConfig as j, SolanaAdapterFields as k, SolanaChainEntry as l, SolanaTypeConfig as m, StacksChainEntry as n, StacksTypeConfig as o, StellarChainEntry as p, StellarTypeConfig as q, SuiAdapterFields as r, SuiChainEntry as s, SuiTypeConfig as t };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { SpokeChainKey, GetChainType, ChainType, ChainKey, EvmChainKey, XToken, GetWalletProviderType } from '@sodax/types';
2
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';
3
+ import { X as XAccount, I as IXConnector, b as XConnection, d as XService, c as XConnector } from './XConnector-12q0OVe5.js';
4
+ export { a as IXService } from './XConnector-12q0OVe5.js';
5
5
  import * as react from 'react';
6
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';
7
+ import { S as SodaxWalletConfig, C as ChainEntry, W as WalletDefaultsByKey, e as EvmChainEntry } from './config-DEsqgrG1.js';
8
+ export { B as BitcoinChainEntry, a as BitcoinTypeConfig, b as ChainMeta, c as ChainTypeConfig, d as ChainTypeOf, E as EvmAdapterFields, f as EvmTypeConfig, I as IconChainEntry, g as IconTypeConfig, h as InjectiveChainEntry, i as InjectiveTypeConfig, N as NearChainEntry, j as NearTypeConfig, k as SolanaAdapterFields, l as SolanaChainEntry, m as SolanaTypeConfig, n as StacksChainEntry, o as StacksTypeConfig, p as StellarChainEntry, q as StellarTypeConfig, r as SuiAdapterFields, s as SuiChainEntry, t as SuiTypeConfig } from './config-DEsqgrG1.js';
9
9
  import { UseMutationResult } from '@tanstack/react-query';
10
10
  import * as react_jsx_runtime from 'react/jsx-runtime';
11
11
  import { EvmWalletDefaults } from '@sodax/wallet-sdk-core';
@@ -317,7 +317,7 @@ type UseConnectedChainsOptions = {
317
317
  * metadata (name + icon) looked up from the store. Useful for "Manage
318
318
  * connections" UIs and status badges.
319
319
  *
320
- * Gate rendering on `status === 'ready'` to avoid the "Connect wallet"
320
+ * Gate rendering on `status === 'ready'` to avoid the "Connect wallet" to
321
321
  * "Connected" flicker on reload while the store rehydrates from localStorage.
322
322
  *
323
323
  * @example
@@ -326,7 +326,7 @@ type UseConnectedChainsOptions = {
326
326
  * return total >= 1 ? <ConnectedChainsDisplay chains={chains} /> : <ConnectCta />;
327
327
  *
328
328
  * @example
329
- * // Deterministic display order required if rendering a list that must
329
+ * // Deterministic display order, required if rendering a list that must
330
330
  * // be stable across page reloads (hydrator race otherwise randomizes
331
331
  * // insertion order).
332
332
  * const { chains } = useConnectedChains({ order: ['EVM', 'ICON', 'SOLANA'] });
package/dist/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
- import { WalletConfigProvider, useXWalletStore, chainRegistry, useWalletConfig } from './chunk-PLCA4ZDJ.mjs';
2
- export { WalletConfigProvider, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage } from './chunk-PLCA4ZDJ.mjs';
3
- import { StellarXService } from './chunk-66BAUK56.mjs';
4
- import { SuiXService, SuiXConnector } from './chunk-7ULB6DW4.mjs';
5
- import { createWagmiConfig, EvmXService, EvmXConnector } from './chunk-E5IAZ7E6.mjs';
6
- import { request } from './chunk-2BOUGCJ7.mjs';
7
- import { assertSuiProviderShape } from './chunk-MAQ47Q52.mjs';
8
- import { InjectiveXService } from './chunk-BKJB527E.mjs';
9
- import './chunk-BXJLBR4G.mjs';
10
- import { SOLANA_DEFAULT_AUTO_CONNECT, SOLANA_DEFAULT_RPC_URL, SUI_DEFAULT_AUTO_CONNECT, SUI_DEFAULT_NETWORK, EVM_DEFAULT_RECONNECT_ON_MOUNT, EVM_DEFAULT_SSR, SOLANA_METAMASK_CONNECT_TIMEOUT_MS } from './chunk-MXZVF5HR.mjs';
11
- import { SolanaXConnector } from './chunk-N5A2TMF6.mjs';
12
- import { SolanaXService } from './chunk-XZ7CHO2S.mjs';
13
- import { getEntryDefaults, resolveEvmDefaults } from './chunk-NY7U7OJW.mjs';
14
- export { getEntryDefaults, getRpcUrl, getWagmiChainId, isNativeToken, resolveEvmDefaults, sortConnectors } from './chunk-NY7U7OJW.mjs';
15
- import './chunk-PJLEJVAU.mjs';
16
- import './chunk-TZMKDXFA.mjs';
17
- export { XConnector, XService } from './chunk-X2MHIWXO.mjs';
18
- import { useRef, useEffect, useMemo, useState } from 'react';
1
+ import { WalletConfigProvider, useXWalletStore, whenPersistReady, chainRegistry, useWalletConfig, usePersistHydrated } from './chunk-JTQGKX65.mjs';
2
+ export { WalletConfigProvider, getXChainType, getXService, useBatchConnect, useBatchDisconnect, useChainGroups, useConnectedChains, useConnectionFlow, useEnabledChainTypes, useEnabledChains, useEvmSwitchChain, useIsChainEnabled, useIsWalletInstalled, useWalletConfig, useWalletModal, useWalletProvider, useXAccount, useXAccounts, useXConnect, useXConnection, useXConnections, useXConnectors, useXConnectorsByChain, useXDisconnect, useXService, useXServices, useXSignMessage } from './chunk-JTQGKX65.mjs';
3
+ import { SuiXService, SuiXConnector } from './chunk-JQ4H4GJ5.mjs';
4
+ import './chunk-C6M34IVL.mjs';
5
+ import { createWagmiConfig, EvmXService, EvmXConnector } from './chunk-LM7R5APS.mjs';
6
+ import { request } from './chunk-WX23SYR6.mjs';
7
+ import { assertSuiProviderShape } from './chunk-TACW7Z4D.mjs';
8
+ import { InjectiveXService } from './chunk-MWWVB7TD.mjs';
9
+ import { SolanaXConnector } from './chunk-XJA2MJMG.mjs';
10
+ import { SolanaXService } from './chunk-VPNYFVP6.mjs';
11
+ import { getEntryDefaults, resolveEvmDefaults } from './chunk-7V7O3Q7Y.mjs';
12
+ export { getEntryDefaults, getRpcUrl, getWagmiChainId, isNativeToken, resolveEvmDefaults, sortConnectors } from './chunk-7V7O3Q7Y.mjs';
13
+ import './chunk-OPX55MQO.mjs';
14
+ import { StellarXService } from './chunk-X7BHR7WS.mjs';
15
+ import { SOLANA_DEFAULT_AUTO_CONNECT, SOLANA_DEFAULT_RPC_URL, SUI_DEFAULT_AUTO_CONNECT, SUI_DEFAULT_NETWORK, EVM_DEFAULT_RECONNECT_ON_MOUNT, EVM_DEFAULT_SSR, SOLANA_METAMASK_CONNECT_TIMEOUT_MS } from './chunk-NAKCAL2M.mjs';
16
+ import './chunk-QMXBY3UI.mjs';
17
+ export { XConnector, XService } from './chunk-IFXZQW4C.mjs';
18
+ import { useRef, useEffect, useMemo } from 'react';
19
19
  import { WagmiProvider, useConfig, useConnectors, useAccount, usePublicClient, useWalletClient, useReconnect, useConnect, useDisconnect, useSignMessage } from 'wagmi';
20
20
  import { walletConnect } from 'wagmi/connectors';
21
21
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
@@ -50,12 +50,7 @@ var EvmHydrator = () => {
50
50
  EvmXService.getInstance().setXConnectors(evmConnectors);
51
51
  useXWalletStore.getState().setXConnectors("EVM", evmConnectors);
52
52
  }, [evmConnectors]);
53
- const [hydrated, setHydrated] = useState(() => useXWalletStore.persist.hasHydrated());
54
- useEffect(() => {
55
- if (hydrated) return;
56
- const unsub = useXWalletStore.persist.onFinishHydration(() => setHydrated(true));
57
- return unsub;
58
- }, [hydrated]);
53
+ const hydrated = usePersistHydrated();
59
54
  useEffect(() => {
60
55
  if (!hydrated) return;
61
56
  if (status !== "disconnected") return;
@@ -509,11 +504,7 @@ function useInitChainServices(walletConfig) {
509
504
  reconnectStellar().catch((error) => console.warn("[wallet-sdk-react] Stellar reconnect failed:", error));
510
505
  }
511
506
  };
512
- if (useXWalletStore.persist.hasHydrated()) {
513
- afterHydration();
514
- } else {
515
- useXWalletStore.persist.onFinishHydration(afterHydration);
516
- }
507
+ whenPersistReady(afterHydration);
517
508
  }, []);
518
509
  }
519
510
  var SodaxWalletProvider = ({ children, config }) => {
@@ -534,5 +525,3 @@ var SodaxWalletProvider = ({ children, config }) => {
534
525
  };
535
526
 
536
527
  export { SodaxWalletProvider };
537
- //# sourceMappingURL=index.mjs.map
538
- //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { XToken, IBitcoinWalletProvider, BtcWalletAddressType } from '@sodax/types';
3
3
  export { BtcWalletAddressType } from '@sodax/types';
4
4
  import { BitcoinWalletDefaults } from '@sodax/wallet-sdk-core';
@@ -69,7 +69,7 @@ declare class UnisatXConnector extends BitcoinXConnector {
69
69
 
70
70
  declare class XverseXConnector extends BitcoinXConnector {
71
71
  private walletProvider;
72
- /** Address purpose used when connecting. Taproot (Ordinals) by default to match Radfi. */
72
+ /** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
73
73
  addressPurpose: AddressPurpose;
74
74
  constructor(defaults?: BitcoinWalletDefaults);
75
75
  /** Set address purpose and persist to localStorage. */
@@ -117,9 +117,26 @@ declare class OKXXConnector extends BitcoinXConnector {
117
117
  recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
118
118
  }
119
119
 
120
+ declare class BitcoinHanaXConnector extends BitcoinXConnector {
121
+ private walletProvider;
122
+ /** Address purpose used when connecting. Taproot (Ordinals) by default to match Bound Exchange. */
123
+ addressPurpose: AddressPurpose;
124
+ constructor(defaults?: BitcoinWalletDefaults);
125
+ /** Set address purpose and persist to localStorage. */
126
+ setAddressPurpose(type: BtcWalletAddressType): void;
127
+ static isAvailable(): boolean;
128
+ get isInstalled(): boolean;
129
+ get installUrl(): string;
130
+ get icon(): string;
131
+ connect(): Promise<XAccount | undefined>;
132
+ disconnect(): Promise<void>;
133
+ getWalletProvider(): IBitcoinWalletProvider | undefined;
134
+ recreateWalletProvider(xAccount: XAccount): IBitcoinWalletProvider | undefined;
135
+ }
136
+
120
137
  /**
121
138
  * Hook to return available Bitcoin wallet connectors from the globally registered xService.
122
139
  */
123
140
  declare function useBitcoinXConnectors(): BitcoinXConnector[];
124
141
 
125
- export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors };
142
+ export { BitcoinHanaXConnector, BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors };
@@ -1,16 +1,14 @@
1
- export { BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-PLCA4ZDJ.mjs';
2
- import '../../chunk-66BAUK56.mjs';
3
- import '../../chunk-7ULB6DW4.mjs';
4
- import '../../chunk-E5IAZ7E6.mjs';
5
- import '../../chunk-2BOUGCJ7.mjs';
6
- import '../../chunk-MAQ47Q52.mjs';
7
- import '../../chunk-BKJB527E.mjs';
8
- import '../../chunk-BXJLBR4G.mjs';
9
- import '../../chunk-MXZVF5HR.mjs';
10
- import '../../chunk-XZ7CHO2S.mjs';
11
- import '../../chunk-NY7U7OJW.mjs';
12
- import '../../chunk-PJLEJVAU.mjs';
13
- import '../../chunk-TZMKDXFA.mjs';
14
- import '../../chunk-X2MHIWXO.mjs';
15
- //# sourceMappingURL=index.mjs.map
16
- //# sourceMappingURL=index.mjs.map
1
+ export { BitcoinHanaXConnector, BitcoinXConnector, BitcoinXService, OKXXConnector, UnisatXConnector, XverseXConnector, useBitcoinXConnectors } from '../../chunk-JTQGKX65.mjs';
2
+ import '../../chunk-JQ4H4GJ5.mjs';
3
+ import '../../chunk-C6M34IVL.mjs';
4
+ import '../../chunk-LM7R5APS.mjs';
5
+ import '../../chunk-WX23SYR6.mjs';
6
+ import '../../chunk-TACW7Z4D.mjs';
7
+ import '../../chunk-MWWVB7TD.mjs';
8
+ import '../../chunk-VPNYFVP6.mjs';
9
+ import '../../chunk-7V7O3Q7Y.mjs';
10
+ import '../../chunk-OPX55MQO.mjs';
11
+ import '../../chunk-X7BHR7WS.mjs';
12
+ import '../../chunk-NAKCAL2M.mjs';
13
+ import '../../chunk-QMXBY3UI.mjs';
14
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,6 +1,6 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { XToken } from '@sodax/types';
3
- import { l as EvmTypeConfig } from '../../config-OlnzyEUE.js';
3
+ import { f as EvmTypeConfig } from '../../config-DEsqgrG1.js';
4
4
  import { Config, CreateConnectorFn, Connector } from 'wagmi';
5
5
  import '@sodax/wallet-sdk-core';
6
6
  import 'wagmi/connectors';
@@ -9,7 +9,7 @@ type WagmiOptions = {
9
9
  reconnectOnMount?: boolean;
10
10
  ssr?: boolean;
11
11
  };
12
- declare const createWagmiConfig: (evmChains: EvmTypeConfig["chains"], options?: WagmiOptions & {
12
+ declare const createWagmiConfig: (evmChains?: EvmTypeConfig["chains"], options?: WagmiOptions & {
13
13
  connectors?: CreateConnectorFn[];
14
14
  }) => Config;
15
15
  /**
@@ -1,5 +1,3 @@
1
- export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig } from '../../chunk-E5IAZ7E6.mjs';
2
- import '../../chunk-NY7U7OJW.mjs';
3
- import '../../chunk-X2MHIWXO.mjs';
4
- //# sourceMappingURL=index.mjs.map
5
- //# sourceMappingURL=index.mjs.map
1
+ export { EvmXConnector, EvmXService, createWagmiConfig as createWagmi, createWagmiConfig } from '../../chunk-LM7R5APS.mjs';
2
+ import '../../chunk-7V7O3Q7Y.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { IconService } from 'icon-sdk-js';
3
3
  import { XToken } from '@sodax/types';
4
4
 
@@ -1,7 +1,5 @@
1
- export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId } from '../../chunk-2BOUGCJ7.mjs';
2
- import '../../chunk-MAQ47Q52.mjs';
3
- import '../../chunk-MXZVF5HR.mjs';
4
- import '../../chunk-NY7U7OJW.mjs';
5
- import '../../chunk-X2MHIWXO.mjs';
6
- //# sourceMappingURL=index.mjs.map
7
- //# sourceMappingURL=index.mjs.map
1
+ export { CHAIN_INFO, IconHanaXConnector, IconXService, SupportedChainId } from '../../chunk-WX23SYR6.mjs';
2
+ import '../../chunk-TACW7Z4D.mjs';
3
+ import '../../chunk-7V7O3Q7Y.mjs';
4
+ import '../../chunk-NAKCAL2M.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,8 +1,8 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { IndexerGrpcAccountPortfolioApi, ChainGrpcWasmApi } from '@injectivelabs/sdk-ts';
3
3
  import { MsgBroadcaster } from '@injectivelabs/wallet-core';
4
4
  import { InjectiveRpcConfig, XToken } from '@sodax/types';
5
- import { WalletStrategy } from '@injectivelabs/wallet-strategy';
5
+ import { WalletStrategy } from '@sodax/libs/injective/wallet-strategy';
6
6
  import { Wallet } from '@injectivelabs/wallet-base';
7
7
 
8
8
  declare class InjectiveXService extends XService {
@@ -1,5 +1,3 @@
1
- export { InjectiveXConnector, InjectiveXService } from '../../chunk-BKJB527E.mjs';
2
- import '../../chunk-TZMKDXFA.mjs';
3
- import '../../chunk-X2MHIWXO.mjs';
4
- //# sourceMappingURL=index.mjs.map
5
- //# sourceMappingURL=index.mjs.map
1
+ export { InjectiveXConnector, InjectiveXService } from '../../chunk-MWWVB7TD.mjs';
2
+ import '../../chunk-QMXBY3UI.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { XToken } from '@sodax/types';
3
3
  import { NearConnector, NearWalletBase } from '@hot-labs/near-connect';
4
4
 
@@ -1,6 +1,4 @@
1
- export { NearXConnector, NearXService } from '../../chunk-BXJLBR4G.mjs';
2
- import '../../chunk-MXZVF5HR.mjs';
3
- import '../../chunk-TZMKDXFA.mjs';
4
- import '../../chunk-X2MHIWXO.mjs';
5
- //# sourceMappingURL=index.mjs.map
6
- //# sourceMappingURL=index.mjs.map
1
+ export { NearXConnector, NearXService } from '../../chunk-C6M34IVL.mjs';
2
+ import '../../chunk-NAKCAL2M.mjs';
3
+ import '../../chunk-QMXBY3UI.mjs';
4
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { XToken } from '@sodax/types';
3
3
  import { Connection } from '@solana/web3.js';
4
4
  import { WalletContextState, Wallet } from '@solana/wallet-adapter-react';
@@ -1,7 +1,5 @@
1
- export { SolanaXConnector } from '../../chunk-N5A2TMF6.mjs';
2
- export { SolanaXService } from '../../chunk-XZ7CHO2S.mjs';
3
- import '../../chunk-NY7U7OJW.mjs';
4
- import '../../chunk-TZMKDXFA.mjs';
5
- import '../../chunk-X2MHIWXO.mjs';
6
- //# sourceMappingURL=index.mjs.map
7
- //# sourceMappingURL=index.mjs.map
1
+ export { SolanaXConnector } from '../../chunk-XJA2MJMG.mjs';
2
+ export { SolanaXService } from '../../chunk-VPNYFVP6.mjs';
3
+ import '../../chunk-7V7O3Q7Y.mjs';
4
+ import '../../chunk-QMXBY3UI.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,13 +1,19 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
2
- import { XToken } from '@sodax/types';
3
- import { StacksNetwork, StacksNetworkName } from '@stacks/network';
4
- import { StacksProvider } from '@stacks/connect';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
+ import { StacksNetworkName, XToken } from '@sodax/types';
3
+ import { StacksNetwork } from '@sodax/libs/stacks/core';
4
+ import { StacksProvider } from '@sodax/libs/stacks/connect';
5
5
 
6
6
  declare class StacksXService extends XService {
7
7
  private static instance;
8
8
  network: StacksNetwork;
9
9
  private constructor();
10
10
  static getInstance(network?: StacksNetworkName | StacksNetwork): StacksXService;
11
+ /**
12
+ * @warning Network / fetch / contract-read failures are silently swallowed —
13
+ * `0n` is returned on any error. Callers cannot distinguish "zero balance"
14
+ * from "fetch failed"; UI that needs to surface the failure must wrap this
15
+ * call externally and re-fetch on its own error path.
16
+ */
11
17
  getBalance(address: string | undefined, xToken: XToken): Promise<bigint>;
12
18
  }
13
19
 
@@ -1,5 +1,3 @@
1
- export { STACKS_PROVIDERS, StacksXConnector, StacksXService, useStacksXConnectors } from '../../chunk-PJLEJVAU.mjs';
2
- import '../../chunk-TZMKDXFA.mjs';
3
- import '../../chunk-X2MHIWXO.mjs';
4
- //# sourceMappingURL=index.mjs.map
5
- //# sourceMappingURL=index.mjs.map
1
+ export { STACKS_PROVIDERS, StacksXConnector, StacksXService, useStacksXConnectors } from '../../chunk-OPX55MQO.mjs';
2
+ import '../../chunk-QMXBY3UI.mjs';
3
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { StellarWalletsKit } from '@creit.tech/stellar-wallets-kit';
3
3
  import * as StellarSdk from '@stellar/stellar-sdk';
4
4
  import { rpc, Transaction, Memo, MemoType, Operation, FeeBumpTransaction } from '@stellar/stellar-sdk';
@@ -1,6 +1,4 @@
1
- export { StellarWalletsKitXConnector, StellarXService } from '../../chunk-66BAUK56.mjs';
2
- import '../../chunk-MXZVF5HR.mjs';
3
- import '../../chunk-TZMKDXFA.mjs';
4
- import '../../chunk-X2MHIWXO.mjs';
5
- //# sourceMappingURL=index.mjs.map
6
- //# sourceMappingURL=index.mjs.map
1
+ export { StellarWalletsKitXConnector, StellarXService } from '../../chunk-X7BHR7WS.mjs';
2
+ import '../../chunk-NAKCAL2M.mjs';
3
+ import '../../chunk-QMXBY3UI.mjs';
4
+ import '../../chunk-IFXZQW4C.mjs';
@@ -1,4 +1,4 @@
1
- import { b as XService, c as XConnector, X as XAccount } from '../../XConnector-B9YQTVJ4.js';
1
+ import { d as XService, c as XConnector, X as XAccount } from '../../XConnector-12q0OVe5.js';
2
2
  import { ISuiWalletProvider, XToken } from '@sodax/types';
3
3
 
4
4
  interface SuiClientLike {
@@ -1,7 +1,5 @@
1
- export { SuiXConnector, SuiXService } from '../../chunk-7ULB6DW4.mjs';
2
- import '../../chunk-MAQ47Q52.mjs';
3
- import '../../chunk-NY7U7OJW.mjs';
4
- import '../../chunk-TZMKDXFA.mjs';
5
- import '../../chunk-X2MHIWXO.mjs';
6
- //# sourceMappingURL=index.mjs.map
7
- //# sourceMappingURL=index.mjs.map
1
+ export { SuiXConnector, SuiXService } from '../../chunk-JQ4H4GJ5.mjs';
2
+ import '../../chunk-TACW7Z4D.mjs';
3
+ import '../../chunk-7V7O3Q7Y.mjs';
4
+ import '../../chunk-QMXBY3UI.mjs';
5
+ import '../../chunk-IFXZQW4C.mjs';