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

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 +12 -5
  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-MAFHQGRP.mjs} +54 -30
  8. package/dist/{chunk-BKJB527E.mjs → chunk-MWWVB7TD.mjs} +2 -4
  9. package/dist/{chunk-MXZVF5HR.mjs → chunk-NAKCAL2M.mjs} +0 -2
  10. package/dist/{chunk-PJLEJVAU.mjs → chunk-OPYSVPRW.mjs} +10 -6
  11. package/dist/chunk-QMXBY3UI.mjs +1 -0
  12. package/dist/{chunk-MAQ47Q52.mjs → chunk-TACW7Z4D.mjs} +0 -2
  13. package/dist/chunk-VPNYFVP6.mjs +53 -0
  14. package/dist/{chunk-2BOUGCJ7.mjs → chunk-WPZOLGVB.mjs} +4 -6
  15. package/dist/{chunk-66BAUK56.mjs → chunk-X7BHR7WS.mjs} +4 -6
  16. package/dist/{chunk-N5A2TMF6.mjs → chunk-XJA2MJMG.mjs} +2 -4
  17. package/dist/{chunk-E5IAZ7E6.mjs → chunk-Z5GXDHGL.mjs} +11 -7
  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 +1 -1
  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 +39 -31
  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
@@ -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-Z5GXDHGL.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-WPZOLGVB.mjs';
2
+ import '../../chunk-TACW7Z4D.mjs';
3
+ import '../../chunk-NAKCAL2M.mjs';
4
+ import '../../chunk-7V7O3Q7Y.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-OPYSVPRW.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';
package/package.json CHANGED
@@ -1,29 +1,45 @@
1
1
  {
2
2
  "name": "@sodax/wallet-sdk-react",
3
+ "private": false,
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
3
7
  "license": "MIT",
4
- "version": "2.0.0-rc.1",
8
+ "version": "2.0.0-rc.11",
5
9
  "description": "Wallet SDK of Sodax",
10
+ "keywords": [
11
+ "sodax",
12
+ "wallet",
13
+ "sdk",
14
+ "react",
15
+ "multichain",
16
+ "web3"
17
+ ],
18
+ "homepage": "https://github.com/icon-project/sodax-sdks/tree/main/packages/wallet-sdk-react",
19
+ "bugs": {
20
+ "url": "https://github.com/icon-project/sodax-sdks/issues"
21
+ },
6
22
  "type": "module",
7
- "main": "./dist/index.cjs",
23
+ "main": "./dist/index.mjs",
8
24
  "module": "./dist/index.mjs",
9
25
  "types": "./dist/index.d.ts",
26
+ "engines": {
27
+ "node": ">=20.12.0"
28
+ },
10
29
  "files": [
11
30
  "dist",
12
- "README.md",
13
- "docs",
14
- "skills",
15
- "ai-exported"
31
+ "!dist/**/*.map",
32
+ "README.md"
16
33
  ],
34
+ "sideEffects": false,
17
35
  "exports": {
18
36
  ".": {
19
37
  "types": "./dist/index.d.ts",
20
- "import": "./dist/index.mjs",
21
- "require": "./dist/index.cjs"
38
+ "import": "./dist/index.mjs"
22
39
  },
23
40
  "./xchains/*": {
24
41
  "types": "./dist/xchains/*/index.d.ts",
25
- "import": "./dist/xchains/*/index.mjs",
26
- "require": "./dist/xchains/*/index.cjs"
42
+ "import": "./dist/xchains/*/index.mjs"
27
43
  }
28
44
  },
29
45
  "typesVersions": {
@@ -38,9 +54,6 @@
38
54
  "url": "https://github.com/icon-project/sodax-sdks"
39
55
  },
40
56
  "dependencies": {
41
- "@stacks/connect": "8.2.6",
42
- "@stacks/network": "7.3.1",
43
- "@stacks/transactions": "7.3.1",
44
57
  "@creit.tech/stellar-wallets-kit": "^1.7.5",
45
58
  "@hot-labs/near-connect": "0.10.0",
46
59
  "@injectivelabs/networks": "1.18.14",
@@ -49,57 +62,52 @@
49
62
  "@injectivelabs/wallet-base": "1.18.14",
50
63
  "@injectivelabs/wallet-core": "1.18.14",
51
64
  "@injectivelabs/wallet-cosmos": "1.18.14",
52
- "@injectivelabs/wallet-evm": "1.18.14",
53
- "@injectivelabs/wallet-strategy": "1.18.14",
54
65
  "@mysten/dapp-kit": "0.14.18",
55
66
  "@mysten/sui": "1.21.2",
56
67
  "near-api-js": "7.2.0",
57
68
  "@solana/spl-token": "0.4.9",
58
69
  "@solana/wallet-adapter-react": "0.15.35",
59
- "@solana/wallet-adapter-wallets": "0.19.30",
60
70
  "@solana/web3.js": "1.98.0",
61
71
  "@stellar/stellar-sdk": "15.1.0",
62
- "@walletconnect/ethereum-provider": "^2.23.9",
63
72
  "icon-sdk-js": "1.5.3",
64
73
  "immer": "10.1.1",
65
74
  "sats-connect": "^4.2.1",
66
75
  "viem": "2.29.2",
67
76
  "wagmi": "2.16.9",
68
77
  "zustand": "4.5.2",
69
- "bs58": "6.0.0",
70
- "@sodax/types": "2.0.0-rc.1",
71
- "@sodax/wallet-sdk-core": "2.0.0-rc.1"
78
+ "@sodax/libs": "2.0.0-rc.11",
79
+ "@sodax/wallet-sdk-core": "2.0.0-rc.11",
80
+ "@sodax/types": "2.0.0-rc.11"
72
81
  },
73
82
  "devDependencies": {
83
+ "@arethetypeswrong/cli": "0.17.4",
74
84
  "@testing-library/react": "^16.1.0",
75
85
  "@types/react": "^19.0.8",
76
86
  "@types/react-dom": "^19.0.3",
87
+ "cross-env": "7.0.3",
77
88
  "happy-dom": "^20.8.9",
78
89
  "knip": "5.30.5",
90
+ "madge": "8.0.0",
79
91
  "react-dom": "19.1.4",
92
+ "tslib": "2.8.1",
80
93
  "tsup": "8.5.0",
81
94
  "typescript": "5.5.4",
82
- "vitest": "2.1.9"
95
+ "vitest": "3.2.4"
83
96
  },
84
97
  "peerDependencies": {
85
98
  "@tanstack/react-query": "5.x",
86
99
  "react": ">=19"
87
100
  },
88
- "engines": {
89
- "node": ">=18.0.0"
90
- },
91
101
  "scripts": {
92
- "build": "NODE_OPTIONS=--max-old-space-size=8192 tsup",
102
+ "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 tsup",
93
103
  "dev": "tsup --watch ./src",
94
104
  "clean": "rm -rf dist && rm -rf node_modules && rm -rf .turbo",
95
105
  "pretty": "biome format . --write",
96
106
  "checkTs": "tsc --noEmit",
97
- "checkTs:examples": "tsc --noEmit -p tsconfig.examples.json",
107
+ "check-exports": "attw --pack --profile esm-only",
98
108
  "test": "vitest run",
99
- "knip": "knip",
100
- "lint": "biome lint . --write",
101
- "check:ai-exported": "bash ./scripts/check-ai-exported.sh",
102
- "check:ai-links": "bash ./scripts/check-ai-links.sh",
103
- "check:ai-imports": "bash ./scripts/check-ai-imports.sh"
109
+ "check:knip": "knip",
110
+ "check:circular-deps": "madge --circular $(find ./src -name '*.ts' -o -name '*.tsx')",
111
+ "lint": "biome lint . --write"
104
112
  }
105
113
  }
@@ -1,122 +0,0 @@
1
- # AGENTS.md — `@sodax/wallet-sdk-react` AI Export
2
-
3
- You are a coding agent helping a developer **integrate** or **migrate** the `@sodax/wallet-sdk-react` package. This document is your entry point. Read this first, then route to the right sub-folder.
4
-
5
- The files in this `ai-exported/` directory are designed for AI consumption: short, table-heavy, self-contained recipes, and machine-checkable checklists. Human-readable narrative lives in each folder's `README.md`.
6
-
7
- ---
8
-
9
- ## Step 1 — Identify the task
10
-
11
- | User says... | Path | Start at |
12
- |---|---|---|
13
- | "upgrade to v2", "migrate from v1", "old hooks no longer work", "useXWagmiStore is gone" | **migration** | `migration/ai-rules.md` |
14
- | "add wallet connect", "set up SodaxWalletProvider", "first time using this lib" | **integration** | `integration/ai-rules.md` |
15
- | Looking up a v1 → v2 symbol mapping | direct | `migration/reference/*.md` |
16
- | Looking up a hook signature or available connector | direct | `integration/reference/*.md` |
17
-
18
- The package name **did not change** between v1 and v2 — both versions publish as `@sodax/wallet-sdk-react`. Migration is detected by import surface (`useXWagmiStore`, positional hook args, `rpcConfig` / `options` / `initialState` props on `SodaxWalletProvider`), not by package name.
19
-
20
- If both signals appear (project has v1 patterns AND wants new features), **migration first, then integration**.
21
-
22
- ---
23
-
24
- ## Step 2 — Load the right context
25
-
26
- **For migration tasks:**
27
-
28
- 1. `migration/ai-rules.md` — DO/DON'T + workflow + stop conditions
29
- 2. `migration/breaking-changes.md` — narrative WHY behind each change
30
- 3. `migration/reference/*.md` — lookup tables (imports, hooks, config, components)
31
- 4. `migration/recipes/<task>.md` — paired before/after for the specific use case
32
- 5. `migration/checklist.md` — verification loop
33
-
34
- **For integration tasks:**
35
-
36
- 1. `integration/ai-rules.md` — DO/DON'T + workflow
37
- 2. `integration/recipes/setup.md` — always read this first (everything else depends on it)
38
- 3. `integration/recipes/<task>.md` — task-specific guide
39
- 4. `integration/reference/*.md` — API surface lookup
40
-
41
- ---
42
-
43
- ## Step 3 — Honor flow-specific stop conditions
44
-
45
- Each flow has its own list of conditions that **HARD STOP** code generation and require asking the user:
46
-
47
- - Migration stops → [`migration/ai-rules.md`](./migration/ai-rules.md) § "Stop conditions"
48
- - Integration stops → [`integration/ai-rules.md`](./integration/ai-rules.md) § "Stop conditions"
49
-
50
- Read the relevant list **before** applying any change. When stopping, quote the offending file/line and present the user with concrete options. Do **not** guess.
51
-
52
- Cross-flow signals (true regardless of flow):
53
-
54
- - User explicitly requests a behavior that v2 does not support (custom chain not in [`integration/reference/chain-support.md`](./integration/reference/chain-support.md), custom `XService` / `XConnector` subclass with non-trivial logic).
55
- - User mixes both v1 and v2 patterns in new code being written — do migration first, then integration.
56
-
57
- ---
58
-
59
- ## Step 4 — Verification protocol
60
-
61
- After **every** code change you make:
62
-
63
- 1. Run `pnpm checkTs` from the user's app root (or the package the change touched).
64
- 2. If errors mention `@sodax/wallet-sdk-react`, look up the symbol in `migration/reference/` or `integration/reference/`.
65
- 3. If a symbol isn't in any reference file, **stop and ask**. Do not invent migrations.
66
- 4. After all errors resolve, mark the relevant items in `migration/checklist.md` (for migrations) or move to the next recipe.
67
-
68
- You are **done** when:
69
- - `pnpm checkTs` exits clean for the user's project.
70
- - All items in `migration/checklist.md` are checked (migration only).
71
- - The user has confirmed the changed flow works in their dev environment.
72
-
73
- ---
74
-
75
- ## Conventions in this directory
76
-
77
- - **Recipes are self-contained.** A recipe file in `recipes/` contains everything needed to apply the change — before/after code, steps, verification. Do not jump between files.
78
- - **Reference files are tables.** `reference/*.md` contains markdown tables and paired code blocks marked `// v1 ❌` and `// v2 ✅`. Treat them as lookup, not narrative.
79
- - **Token budget**: Each file is sized to fit comfortably in your context. If you find yourself loading more than 3 files for a single task, you are probably doing it wrong — re-route via the table above.
80
- - **Single source of truth**: Behavioral / breaking-change *explanations* live only in `migration/breaking-changes.md`. Other files reference it but do not duplicate the prose.
81
-
82
- ---
83
-
84
- ## Quick symbol lookup
85
-
86
- If the user mentions a symbol you don't recognize, grep these files in order:
87
-
88
- ```
89
- migration/reference/imports.md — import path changes
90
- migration/reference/hooks.md — hook renames + signature changes
91
- migration/reference/config.md — SodaxWalletProvider config changes
92
- migration/reference/components.md — component / provider renames
93
- integration/reference/hooks.md — full v2 hook surface
94
- integration/reference/connectors.md — available wallet connectors per chain
95
- integration/reference/chain-support.md — supported chains + slots
96
- ```
97
-
98
- If still not found: the symbol may be **internal** (not exported from v2) or **removed**. Ask the user to share the v1 file/line so you can decide.
99
-
100
- ---
101
-
102
- ## Package context
103
-
104
- - **Name**: `@sodax/wallet-sdk-react` (same package name in v1 and v2)
105
- - **Version target**: v2.x (current).
106
- - **Peer deps**: `react >= 19`, `@tanstack/react-query 5.x`
107
- - **Install**: `pnpm add @sodax/wallet-sdk-react @tanstack/react-query`
108
- - **Audience**: dApp builders integrating multi-chain wallet connectivity (9 chain types: EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks).
109
-
110
- For internal architecture (only relevant if you're modifying the package itself, not consuming it), see `../CLAUDE.md` in the parent directory.
111
-
112
- ---
113
-
114
- ## Pointers
115
-
116
- - [`integration/README.md`](./integration/README.md) — start here for new integrations: file index, recommended reading order, install snippet, provider-stack ordering.
117
- - [`migration/README.md`](./migration/README.md) — start here for v1 → v2 ports: file index, reading order, cross-cutting checklist pointer.
118
- - [`integration/recipes/setup.md`](./integration/recipes/setup.md) — install, mount `SodaxWalletProvider`, pick chain slots.
119
- - [`integration/architecture.md`](./integration/architecture.md) — mental model: provider mount tree, frozen config, EVM single-connection, `xChainType` vs `xChainId`.
120
- - [`integration/reference/`](./integration/reference/) — hooks, connectors, chain-support, wallet-brand identifiers lookup tables.
121
- - [`integration/reference/wallet-brands.md`](./integration/reference/wallet-brands.md) — known wallet brand identifiers (`'hana'`, `'phantom'`, `'xverse'`, …) for batch hooks, plus a runtime discovery snippet.
122
- - [`migration/breaking-changes.md`](./migration/breaking-changes.md) — full narrative of every v1 → v2 change.
@@ -1,102 +0,0 @@
1
- # Integration: First-time setup (Human-readable overview)
2
-
3
- This folder helps you integrate `@sodax/wallet-sdk-react` into a fresh React app. It is the **human-facing** entry point for new integrations. If you are a coding agent, read [`ai-rules.md`](./ai-rules.md) first.
4
-
5
- If you are migrating from v1 instead, see `../migration/`.
6
-
7
- ---
8
-
9
- ## What this package does
10
-
11
- `@sodax/wallet-sdk-react` is the React layer over `@sodax/wallet-sdk-core`. It gives you:
12
-
13
- - **Multi-chain wallet connect** across 9 chain types (EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks).
14
- - **Hooks** (`useXConnect`, `useXAccount`, `useXDisconnect`, `useXSignMessage`, etc.) backed by a Zustand store — composable and SSR-safe.
15
- - **Headless modal primitives** (`useWalletModal`, `useChainGroups`, `useBatchConnect`) — bring your own UI.
16
- - **Typed wallet providers** for hand-off to `@sodax/sdk` calls (`useWalletProvider`).
17
-
18
- ---
19
-
20
- ## Recommended path (in order)
21
-
22
- If this is your first time using the package:
23
-
24
- 1. [`recipes/setup.md`](./recipes/setup.md) — install, wire `SodaxWalletProvider`, pick chain slots. **Always do this first**.
25
- 2. Pick a connect UX (one, not both):
26
- - [`recipes/connect-button.md`](./recipes/connect-button.md) — single chain, simplest UX.
27
- - [`recipes/multi-chain-modal.md`](./recipes/multi-chain-modal.md) — chain picker + connector picker, headless.
28
- 3. [`recipes/sign-message.md`](./recipes/sign-message.md) — sign messages cross-chain (auth flows).
29
- 4. [`recipes/bridge-to-sdk.md`](./recipes/bridge-to-sdk.md) — pass `walletProvider` to `@sodax/sdk` calls (swaps, lending, staking, etc.).
30
- 5. [`recipes/switch-chain.md`](./recipes/switch-chain.md) — switch the active EVM network when source chain doesn't match.
31
- 6. [`recipes/chain-detection.md`](./recipes/chain-detection.md) — list enabled chains, render connected list with hydration gate, install detection.
32
- 7. Add advanced features as needed:
33
- - [`recipes/walletconnect-setup.md`](./recipes/walletconnect-setup.md) — enable WalletConnect for enterprise-custody / mobile-only wallets.
34
- - [`recipes/batch-operations.md`](./recipes/batch-operations.md) — batch connect / disconnect across multiple chains.
35
- - [`recipes/sub-path-imports.md`](./recipes/sub-path-imports.md) — deep imports from `xchains/<chain>` for `instanceof` checks or custom connector lists.
36
- 8. Reference docs (lookup as needed):
37
- - [`reference/hooks.md`](./reference/hooks.md) — full hook surface with signatures.
38
- - [`reference/connectors.md`](./reference/connectors.md) — available wallet connectors per chain.
39
- - [`reference/chain-support.md`](./reference/chain-support.md) — supported chains, slots, and adapter notes.
40
- 9. Copy-paste examples (runnable code, minimal narrative):
41
- - [`examples/`](./examples/) — 4 self-contained `.tsx` files: minimal EVM setup, multi-chain modal, Next.js App Router, WalletConnect setup.
42
-
43
- ---
44
-
45
- ## Install
46
-
47
- ```bash
48
- pnpm add @sodax/wallet-sdk-react @tanstack/react-query
49
- ```
50
-
51
- Peer dependencies:
52
-
53
- ```json
54
- {
55
- "react": ">=19",
56
- "@tanstack/react-query": "5.x"
57
- }
58
- ```
59
-
60
- ---
61
-
62
- ## Pair with `@sodax/sdk` and `@sodax/dapp-kit`
63
-
64
- Most apps integrate this package together with the SDK and dapp-kit:
65
-
66
- ```
67
- @sodax/sdk ← business logic (swaps, lending, staking, etc.)
68
- @sodax/dapp-kit ← high-level React hooks combining SDK + wallet-sdk
69
- @sodax/wallet-sdk-react ← wallet connectivity (this package)
70
- ```
71
-
72
- If you are using all three, mount providers in this order at the app root:
73
-
74
- ```tsx
75
- <SodaxProvider config={sodaxConfig}> {/* @sodax/dapp-kit */}
76
- <QueryClientProvider client={queryClient}>
77
- <SodaxWalletProvider config={walletConfig}> {/* this package */}
78
- {children}
79
- </SodaxWalletProvider>
80
- </QueryClientProvider>
81
- </SodaxProvider>
82
- ```
83
-
84
- `SodaxProvider` (from dapp-kit) wraps the lot. `QueryClientProvider` must wrap `SodaxWalletProvider` because hooks inside use React Query.
85
-
86
- ---
87
-
88
- ## Conventions worth knowing
89
-
90
- - **Hooks use a single options object.** `useXConnectors({ xChainType: 'EVM' })`, not positional args.
91
- - **`xChainId` (chain key) and `xChainType` (family) are both accepted** by `useXAccount` and `useWalletProvider`. Pass one, not both.
92
- - **`useXConnect` is a React Query mutation.** Pass an `IXConnector` to `mutateAsync`.
93
- - **Persisted connections.** Connections survive reload via `localStorage` key `xwagmi-store`. Gate UI on `useConnectedChains().status === 'ready'` to avoid hydration flicker.
94
- - **EVM is one connection across all networks.** wagmi treats every configured EVM chain as part of one connector — there is no per-network connect/disconnect.
95
-
96
- ---
97
-
98
- ## Getting help
99
-
100
- - API surface lookup: [`reference/`](./reference/).
101
- - Bug or missing feature: [open an issue](https://github.com/icon-project/sodax-sdks/issues).
102
- - Internal architecture (only relevant for SODAX maintainers): `../CLAUDE.md` in the package root.