@sodax/skills 2.0.0-rc.4

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 (197) hide show
  1. package/.claude-plugin/plugin.json +13 -0
  2. package/AGENTS.md +81 -0
  3. package/LICENSE +21 -0
  4. package/README.md +49 -0
  5. package/knowledge/dapp-kit/AGENTS.md +50 -0
  6. package/knowledge/dapp-kit/integration/README.md +49 -0
  7. package/knowledge/dapp-kit/integration/ai-rules.md +80 -0
  8. package/knowledge/dapp-kit/integration/architecture.md +276 -0
  9. package/knowledge/dapp-kit/integration/features/README.md +29 -0
  10. package/knowledge/dapp-kit/integration/features/auxiliary-services.md +169 -0
  11. package/knowledge/dapp-kit/integration/features/bitcoin.md +87 -0
  12. package/knowledge/dapp-kit/integration/features/bridge.md +91 -0
  13. package/knowledge/dapp-kit/integration/features/dex.md +152 -0
  14. package/knowledge/dapp-kit/integration/features/migration.md +118 -0
  15. package/knowledge/dapp-kit/integration/features/money-market.md +144 -0
  16. package/knowledge/dapp-kit/integration/features/staking.md +123 -0
  17. package/knowledge/dapp-kit/integration/features/swap.md +101 -0
  18. package/knowledge/dapp-kit/integration/quickstart.md +188 -0
  19. package/knowledge/dapp-kit/integration/recipes/README.md +136 -0
  20. package/knowledge/dapp-kit/integration/recipes/backend-queries.md +157 -0
  21. package/knowledge/dapp-kit/integration/recipes/bitcoin.md +193 -0
  22. package/knowledge/dapp-kit/integration/recipes/bridge.md +174 -0
  23. package/knowledge/dapp-kit/integration/recipes/dex.md +204 -0
  24. package/knowledge/dapp-kit/integration/recipes/invalidations.md +115 -0
  25. package/knowledge/dapp-kit/integration/recipes/migration.md +212 -0
  26. package/knowledge/dapp-kit/integration/recipes/money-market.md +207 -0
  27. package/knowledge/dapp-kit/integration/recipes/mutation-error-handling.md +118 -0
  28. package/knowledge/dapp-kit/integration/recipes/observability.md +93 -0
  29. package/knowledge/dapp-kit/integration/recipes/setup.md +168 -0
  30. package/knowledge/dapp-kit/integration/recipes/staking.md +202 -0
  31. package/knowledge/dapp-kit/integration/recipes/swap.md +272 -0
  32. package/knowledge/dapp-kit/integration/recipes/wallet-connectivity.md +128 -0
  33. package/knowledge/dapp-kit/integration/reference/README.md +12 -0
  34. package/knowledge/dapp-kit/integration/reference/glossary.md +190 -0
  35. package/knowledge/dapp-kit/integration/reference/hooks-index.md +190 -0
  36. package/knowledge/dapp-kit/integration/reference/public-api.md +110 -0
  37. package/knowledge/dapp-kit/integration/reference/querykey-conventions.md +179 -0
  38. package/knowledge/dapp-kit/migration/README.md +60 -0
  39. package/knowledge/dapp-kit/migration/ai-rules.md +81 -0
  40. package/knowledge/dapp-kit/migration/breaking-changes/hook-signatures.md +233 -0
  41. package/knowledge/dapp-kit/migration/breaking-changes/querykey-conventions.md +108 -0
  42. package/knowledge/dapp-kit/migration/breaking-changes/result-handling.md +211 -0
  43. package/knowledge/dapp-kit/migration/breaking-changes/sdk-leakage.md +167 -0
  44. package/knowledge/dapp-kit/migration/checklist.md +89 -0
  45. package/knowledge/dapp-kit/migration/features/README.md +34 -0
  46. package/knowledge/dapp-kit/migration/features/auxiliary-services.md +114 -0
  47. package/knowledge/dapp-kit/migration/features/bitcoin.md +88 -0
  48. package/knowledge/dapp-kit/migration/features/bridge.md +160 -0
  49. package/knowledge/dapp-kit/migration/features/dex.md +101 -0
  50. package/knowledge/dapp-kit/migration/features/migration.md +120 -0
  51. package/knowledge/dapp-kit/migration/features/money-market.md +139 -0
  52. package/knowledge/dapp-kit/migration/features/staking.md +109 -0
  53. package/knowledge/dapp-kit/migration/features/swap.md +133 -0
  54. package/knowledge/dapp-kit/migration/recipes.md +185 -0
  55. package/knowledge/dapp-kit/migration/reference/README.md +15 -0
  56. package/knowledge/dapp-kit/migration/reference/deleted-hooks.md +110 -0
  57. package/knowledge/dapp-kit/migration/reference/error-shape-crosswalk.md +144 -0
  58. package/knowledge/dapp-kit/migration/reference/renamed-hooks.md +68 -0
  59. package/knowledge/sdk/AGENTS.md +41 -0
  60. package/knowledge/sdk/integration/README.md +41 -0
  61. package/knowledge/sdk/integration/ai-rules.md +75 -0
  62. package/knowledge/sdk/integration/architecture.md +533 -0
  63. package/knowledge/sdk/integration/chain-specifics.md +189 -0
  64. package/knowledge/sdk/integration/features/README.md +19 -0
  65. package/knowledge/sdk/integration/features/auxiliary-services.md +189 -0
  66. package/knowledge/sdk/integration/features/bridge.md +136 -0
  67. package/knowledge/sdk/integration/features/dex.md +182 -0
  68. package/knowledge/sdk/integration/features/icx-bnusd-baln.md +181 -0
  69. package/knowledge/sdk/integration/features/money-market.md +198 -0
  70. package/knowledge/sdk/integration/features/staking.md +166 -0
  71. package/knowledge/sdk/integration/features/swap.md +207 -0
  72. package/knowledge/sdk/integration/quickstart.md +213 -0
  73. package/knowledge/sdk/integration/recipes/README.md +21 -0
  74. package/knowledge/sdk/integration/recipes/backend-server-init.md +69 -0
  75. package/knowledge/sdk/integration/recipes/chain-key-narrowing.md +65 -0
  76. package/knowledge/sdk/integration/recipes/gas-estimation.md +33 -0
  77. package/knowledge/sdk/integration/recipes/initialize-sodax.md +78 -0
  78. package/knowledge/sdk/integration/recipes/raw-tx-flow.md +71 -0
  79. package/knowledge/sdk/integration/recipes/result-and-errors.md +104 -0
  80. package/knowledge/sdk/integration/recipes/signed-tx-flow.md +46 -0
  81. package/knowledge/sdk/integration/recipes/testing.md +101 -0
  82. package/knowledge/sdk/integration/reference/README.md +18 -0
  83. package/knowledge/sdk/integration/reference/chain-keys.md +67 -0
  84. package/knowledge/sdk/integration/reference/error-codes.md +165 -0
  85. package/knowledge/sdk/integration/reference/glossary.md +32 -0
  86. package/knowledge/sdk/integration/reference/public-api.md +138 -0
  87. package/knowledge/sdk/integration/reference/wallet-providers.md +62 -0
  88. package/knowledge/sdk/migration/README.md +58 -0
  89. package/knowledge/sdk/migration/ai-rules.md +80 -0
  90. package/knowledge/sdk/migration/breaking-changes/architecture.md +344 -0
  91. package/knowledge/sdk/migration/breaking-changes/result-and-errors.md +363 -0
  92. package/knowledge/sdk/migration/breaking-changes/type-system.md +341 -0
  93. package/knowledge/sdk/migration/checklist.md +67 -0
  94. package/knowledge/sdk/migration/features/README.md +35 -0
  95. package/knowledge/sdk/migration/features/auxiliary-services.md +156 -0
  96. package/knowledge/sdk/migration/features/bridge.md +128 -0
  97. package/knowledge/sdk/migration/features/dex.md +143 -0
  98. package/knowledge/sdk/migration/features/icx-bnusd-baln.md +151 -0
  99. package/knowledge/sdk/migration/features/money-market.md +214 -0
  100. package/knowledge/sdk/migration/features/staking.md +138 -0
  101. package/knowledge/sdk/migration/features/swap.md +198 -0
  102. package/knowledge/sdk/migration/recipes.md +350 -0
  103. package/knowledge/sdk/migration/reference/README.md +18 -0
  104. package/knowledge/sdk/migration/reference/deleted-exports.md +127 -0
  105. package/knowledge/sdk/migration/reference/error-code-crosswalk.md +104 -0
  106. package/knowledge/sdk/migration/reference/return-shapes.md +49 -0
  107. package/knowledge/sdk/migration/reference/sodax-config.md +145 -0
  108. package/knowledge/wallet-sdk-core/AGENTS.md +43 -0
  109. package/knowledge/wallet-sdk-core/integration/README.md +108 -0
  110. package/knowledge/wallet-sdk-core/integration/ai-rules.md +141 -0
  111. package/knowledge/wallet-sdk-core/integration/architecture.md +212 -0
  112. package/knowledge/wallet-sdk-core/integration/features/README.md +22 -0
  113. package/knowledge/wallet-sdk-core/integration/features/bitcoin.md +103 -0
  114. package/knowledge/wallet-sdk-core/integration/features/evm.md +102 -0
  115. package/knowledge/wallet-sdk-core/integration/features/icon.md +88 -0
  116. package/knowledge/wallet-sdk-core/integration/features/injective.md +92 -0
  117. package/knowledge/wallet-sdk-core/integration/features/near.md +92 -0
  118. package/knowledge/wallet-sdk-core/integration/features/solana.md +104 -0
  119. package/knowledge/wallet-sdk-core/integration/features/stacks.md +91 -0
  120. package/knowledge/wallet-sdk-core/integration/features/stellar.md +95 -0
  121. package/knowledge/wallet-sdk-core/integration/features/sui.md +96 -0
  122. package/knowledge/wallet-sdk-core/integration/quickstart.md +259 -0
  123. package/knowledge/wallet-sdk-core/integration/recipes/README.md +15 -0
  124. package/knowledge/wallet-sdk-core/integration/recipes/bridge-to-sdk.md +145 -0
  125. package/knowledge/wallet-sdk-core/integration/recipes/defaults-and-overrides.md +159 -0
  126. package/knowledge/wallet-sdk-core/integration/recipes/library-exports.md +129 -0
  127. package/knowledge/wallet-sdk-core/integration/recipes/setup-browser-extension.md +137 -0
  128. package/knowledge/wallet-sdk-core/integration/recipes/setup-private-key.md +115 -0
  129. package/knowledge/wallet-sdk-core/integration/recipes/sign-and-broadcast.md +201 -0
  130. package/knowledge/wallet-sdk-core/integration/recipes/testing.md +163 -0
  131. package/knowledge/wallet-sdk-core/integration/reference/README.md +13 -0
  132. package/knowledge/wallet-sdk-core/integration/reference/chain-support.md +65 -0
  133. package/knowledge/wallet-sdk-core/integration/reference/glossary.md +28 -0
  134. package/knowledge/wallet-sdk-core/integration/reference/interfaces.md +131 -0
  135. package/knowledge/wallet-sdk-core/integration/reference/provider-classes.md +54 -0
  136. package/knowledge/wallet-sdk-core/integration/reference/public-api.md +128 -0
  137. package/knowledge/wallet-sdk-core/migration/README.md +84 -0
  138. package/knowledge/wallet-sdk-core/migration/ai-rules.md +139 -0
  139. package/knowledge/wallet-sdk-core/migration/breaking-changes/README.md +14 -0
  140. package/knowledge/wallet-sdk-core/migration/breaking-changes/base-wallet-provider.md +52 -0
  141. package/knowledge/wallet-sdk-core/migration/breaking-changes/defaults-config.md +57 -0
  142. package/knowledge/wallet-sdk-core/migration/breaking-changes/folder-layout.md +99 -0
  143. package/knowledge/wallet-sdk-core/migration/breaking-changes/library-exports.md +58 -0
  144. package/knowledge/wallet-sdk-core/migration/checklist.md +62 -0
  145. package/knowledge/wallet-sdk-core/migration/recipes/README.md +12 -0
  146. package/knowledge/wallet-sdk-core/migration/recipes/adopt-defaults.md +84 -0
  147. package/knowledge/wallet-sdk-core/migration/recipes/adopt-library-exports.md +99 -0
  148. package/knowledge/wallet-sdk-core/migration/reference/README.md +12 -0
  149. package/knowledge/wallet-sdk-core/migration/reference/added-fields.md +71 -0
  150. package/knowledge/wallet-sdk-core/migration/reference/deleted-exports.md +35 -0
  151. package/knowledge/wallet-sdk-core/migration/reference/renamed-symbols.md +31 -0
  152. package/knowledge/wallet-sdk-core/migration/reference/return-shapes.md +23 -0
  153. package/knowledge/wallet-sdk-react/AGENTS.md +46 -0
  154. package/knowledge/wallet-sdk-react/integration/README.md +103 -0
  155. package/knowledge/wallet-sdk-react/integration/ai-rules.md +136 -0
  156. package/knowledge/wallet-sdk-react/integration/architecture.md +185 -0
  157. package/knowledge/wallet-sdk-react/integration/examples/01-minimal-evm.tsx +75 -0
  158. package/knowledge/wallet-sdk-react/integration/examples/02-multi-chain-modal.tsx +169 -0
  159. package/knowledge/wallet-sdk-react/integration/examples/03-nextjs-app-router.tsx +99 -0
  160. package/knowledge/wallet-sdk-react/integration/examples/04-walletconnect-setup.tsx +89 -0
  161. package/knowledge/wallet-sdk-react/integration/examples/README.md +29 -0
  162. package/knowledge/wallet-sdk-react/integration/recipes/batch-operations.md +224 -0
  163. package/knowledge/wallet-sdk-react/integration/recipes/bridge-to-sdk.md +165 -0
  164. package/knowledge/wallet-sdk-react/integration/recipes/chain-detection.md +259 -0
  165. package/knowledge/wallet-sdk-react/integration/recipes/connect-button.md +159 -0
  166. package/knowledge/wallet-sdk-react/integration/recipes/multi-chain-modal.md +203 -0
  167. package/knowledge/wallet-sdk-react/integration/recipes/setup.md +163 -0
  168. package/knowledge/wallet-sdk-react/integration/recipes/sign-message.md +138 -0
  169. package/knowledge/wallet-sdk-react/integration/recipes/sub-path-imports.md +97 -0
  170. package/knowledge/wallet-sdk-react/integration/recipes/switch-chain.md +144 -0
  171. package/knowledge/wallet-sdk-react/integration/recipes/walletconnect-setup.md +139 -0
  172. package/knowledge/wallet-sdk-react/integration/reference/api-surface.md +176 -0
  173. package/knowledge/wallet-sdk-react/integration/reference/chain-support.md +79 -0
  174. package/knowledge/wallet-sdk-react/integration/reference/connectors.md +75 -0
  175. package/knowledge/wallet-sdk-react/integration/reference/hooks.md +212 -0
  176. package/knowledge/wallet-sdk-react/integration/reference/wallet-brands.md +107 -0
  177. package/knowledge/wallet-sdk-react/migration/README.md +49 -0
  178. package/knowledge/wallet-sdk-react/migration/ai-rules.md +144 -0
  179. package/knowledge/wallet-sdk-react/migration/breaking-changes.md +310 -0
  180. package/knowledge/wallet-sdk-react/migration/checklist.md +159 -0
  181. package/knowledge/wallet-sdk-react/migration/recipes/connect-button.md +170 -0
  182. package/knowledge/wallet-sdk-react/migration/recipes/multi-chain-modal.md +245 -0
  183. package/knowledge/wallet-sdk-react/migration/recipes/ssr-setup.md +165 -0
  184. package/knowledge/wallet-sdk-react/migration/recipes/walletconnect-migration.md +170 -0
  185. package/knowledge/wallet-sdk-react/migration/reference/components.md +75 -0
  186. package/knowledge/wallet-sdk-react/migration/reference/config.md +339 -0
  187. package/knowledge/wallet-sdk-react/migration/reference/hooks.md +336 -0
  188. package/knowledge/wallet-sdk-react/migration/reference/imports.md +158 -0
  189. package/package.json +59 -0
  190. package/skills/sodax-dapp-kit-integration/SKILL.md +71 -0
  191. package/skills/sodax-dapp-kit-migration/SKILL.md +58 -0
  192. package/skills/sodax-sdk-integration/SKILL.md +66 -0
  193. package/skills/sodax-sdk-migration/SKILL.md +75 -0
  194. package/skills/sodax-wallet-sdk-core-integration/SKILL.md +55 -0
  195. package/skills/sodax-wallet-sdk-core-migration/SKILL.md +56 -0
  196. package/skills/sodax-wallet-sdk-react-integration/SKILL.md +80 -0
  197. package/skills/sodax-wallet-sdk-react-migration/SKILL.md +71 -0
@@ -0,0 +1,62 @@
1
+ # Migration checklist
2
+
3
+ Run through every item before declaring the migration done. Each item is machine-checkable.
4
+
5
+ ---
6
+
7
+ ## Mandatory
8
+
9
+ - [ ] **No deep imports from `@sodax/wallet-sdk-core/src/…`**
10
+ ```bash
11
+ grep -rn "@sodax/wallet-sdk-core/" <user-src> | grep -v "from '@sodax/wallet-sdk-core'"
12
+ # expect empty
13
+ ```
14
+ v1's flat layout (`wallet-providers/EvmWalletProvider.ts`) no longer resolves under v2's folder-per-chain layout. Only the barrel root is public.
15
+
16
+ - [ ] **No imports of internal utilities**
17
+ ```bash
18
+ grep -rn "shallowMerge" <user-src>
19
+ # expect empty
20
+ ```
21
+ `shallowMerge` is internal in v2 (and didn't exist in v1). Use `defaults` config + per-call options.
22
+
23
+ - [ ] **`pnpm checkTs` exits clean** with no `@sodax/wallet-sdk-core` symbol errors.
24
+
25
+ ---
26
+
27
+ ## Recommended (optional cleanup)
28
+
29
+ - [ ] **Drop direct upstream-SDK type imports covered by `library-exports`**
30
+ ```bash
31
+ grep -rn "from 'viem'" <user-src> | grep -E "WalletClient|PublicClient|TransactionReceipt|SendTransactionParameters|WaitForTransactionReceiptParameters|HttpTransportConfig|PublicClientConfig|WalletClientConfig"
32
+ grep -rn "from '@stellar/stellar-sdk'" <user-src> | grep "Networks"
33
+ grep -rn "from '@stacks/transactions'" <user-src> | grep -E "PostConditionMode|ClarityValue|PostConditionModeName"
34
+ grep -rn "from '@mysten/wallet-standard'" <user-src>
35
+ grep -rn "from '@solana/web3.js'" <user-src> | grep -E "Commitment|ConnectionConfig|SendOptions"
36
+ grep -rn "from '@injectivelabs/networks'" <user-src> | grep "Network"
37
+ grep -rn "from '@injectivelabs/ts-types'" <user-src> | grep -E "ChainId|EvmChainId"
38
+ grep -rn "from '@injectivelabs/wallet-core'" <user-src> | grep "MsgBroadcaster"
39
+ grep -rn "from '@hot-labs/near-connect'" <user-src> | grep "NearConnector"
40
+ grep -rn "from '@stacks/network'" <user-src> | grep "StacksNetwork"
41
+ grep -rn "from '@stacks/connect'" <user-src> | grep "StacksProvider"
42
+ # if any matches, decide whether to re-import via @sodax/wallet-sdk-core
43
+ ```
44
+
45
+ - [ ] **Direct upstream-SDK deps removed from `package.json`** (only if 100% replaced by library-exports)
46
+ ```bash
47
+ cat <user>/package.json | jq -r '.dependencies | keys[]' | grep -E '^(viem|@stellar/stellar-sdk|@stacks/transactions|@mysten/sui|@mysten/wallet-standard|@solana/web3.js|@injectivelabs/networks|@injectivelabs/ts-types|@injectivelabs/wallet-core|@hot-labs/near-connect|@stacks/network|@stacks/connect)$'
48
+ # confirm each remaining entry is genuinely needed for a runtime symbol library-exports doesn't cover
49
+ ```
50
+
51
+ - [ ] **`defaults` adopted in places where wrappers were hand-rolled**
52
+ Look for ad-hoc wrappers (`makeProvider`, `buildProvider`, `withDefaults`) that injected default gas / commitment / timeout values, and replace them with provider-level `defaults` config.
53
+
54
+ ---
55
+
56
+ ## Verification of behavior
57
+
58
+ - [ ] **Get-address smoke test** passes for every provider the user constructs.
59
+ - [ ] **One signing flow** runs end-to-end against a testnet (or recorded mock).
60
+ - [ ] **CI passes** (`pnpm lint && pnpm checkTs && pnpm test`).
61
+
62
+ When all mandatory + behavior items above are checked, the migration is done. Optional items are bonus.
@@ -0,0 +1,12 @@
1
+ # Migration recipes
2
+
3
+ Paired before/after for each migration task. Apply only what the user's project triggers.
4
+
5
+ **There are no mandatory migration recipes for wallet-sdk-core.** v1 consumer code drops in unchanged.
6
+
7
+ | Recipe | When to apply | Mandatory? |
8
+ |---|---|---|
9
+ | [`adopt-defaults.md`](./adopt-defaults.md) | User has hand-rolled wrappers (`makeProvider`, `buildProvider`, `withDefaults`) that injected default options. | No — additive cleanup. |
10
+ | [`adopt-library-exports.md`](./adopt-library-exports.md) | User imports types directly from upstream chain SDKs that `library-exports` now covers. | No — additive cleanup. |
11
+
12
+ If the user's only signal is "wallet-sdk-core was bumped to v2", **no recipe is needed**. Run `pnpm checkTs`, verify zero `@sodax/wallet-sdk-core` errors, and stop.
@@ -0,0 +1,84 @@
1
+ # Recipe: Adopt `defaults` (optional cleanup)
2
+
3
+ Replace hand-rolled wrappers with provider-level `defaults`. Optional — older per-call style still works.
4
+
5
+ **Apply when:** the user has a helper like `makeProvider(pk)` or `withDefaults(provider)` that injects fixed options on every call.
6
+
7
+ ---
8
+
9
+ ## Before — hand-rolled wrapper
10
+
11
+ ```ts
12
+ import { EvmWalletProvider } from '@sodax/wallet-sdk-core';
13
+ import type { EvmRawTransaction } from '@sodax/types';
14
+ import { ChainKeys } from '@sodax/types';
15
+
16
+ function makeEvmProvider(pk: `0x${string}`) {
17
+ const provider = new EvmWalletProvider({ privateKey: pk, chainId: ChainKeys.SONIC_MAINNET });
18
+
19
+ return {
20
+ ...provider,
21
+ sendTransaction(tx: EvmRawTransaction) {
22
+ // hard-coded gas on every call
23
+ return provider.sendTransaction(tx, { gas: 3_000_000n });
24
+ },
25
+ };
26
+ }
27
+ ```
28
+
29
+ ## After — provider-level `defaults`
30
+
31
+ ```ts
32
+ import { EvmWalletProvider } from '@sodax/wallet-sdk-core';
33
+ import { ChainKeys } from '@sodax/types';
34
+
35
+ const provider = new EvmWalletProvider({
36
+ privateKey: process.env.EVM_PK as `0x${string}`,
37
+ chainId: ChainKeys.SONIC_MAINNET,
38
+ defaults: {
39
+ sendTransaction: { gas: 3_000_000n },
40
+ },
41
+ });
42
+
43
+ // Use directly — defaults apply automatically; per-call override still works.
44
+ await provider.sendTransaction(tx);
45
+ await provider.sendTransaction(tx2, { gas: 5_000_000n });
46
+ ```
47
+
48
+ ---
49
+
50
+ ## Steps
51
+
52
+ 1. **Identify the wrapper.** Look for functions that wrap a provider and inject options on every method call.
53
+ 2. **Move the injected options into `defaults`.** Pick the right slice — `defaults.sendTransaction` for EVM, `defaults.signAndExecuteTxn` for Sui, flat `defaults` for Bitcoin / Stellar / ICON / Injective / NEAR / Stacks.
54
+ 3. **Delete the wrapper.** Replace call sites with direct provider method calls.
55
+ 4. **Keep behavior for callers that already pass options.** Per-call options shallow-merge over defaults, so existing call sites that pass `{ gas: 5_000_000n }` still get exactly that gas value.
56
+
57
+ ---
58
+
59
+ ## When NOT to adopt
60
+
61
+ | Scenario | Why skip |
62
+ |---|---|
63
+ | The wrapper does more than inject defaults (e.g. logging, telemetry, retries) | `defaults` is just a config slice; it can't do behavior wrapping. Keep the wrapper. |
64
+ | The "default" actually changes per call (e.g. dynamic gas estimation) | That's not a default — it's per-call logic. Keep it inline. |
65
+ | The user's code base would gain churn for trivial savings | Migration cost > value. Leave it. |
66
+
67
+ ---
68
+
69
+ ## Verification
70
+
71
+ ```bash
72
+ # 1. Type check
73
+ pnpm checkTs
74
+
75
+ # 2. Search for remaining hand-rolled wrappers (heuristic)
76
+ grep -rnE "function\s+(make|build|with)(Wallet|Evm|Solana|Sui|Bitcoin|Stellar|Icon|Injective|Near|Stacks)Provider" <user-src>
77
+ # review each — confirm each is justified per the table above
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Why
83
+
84
+ See [`../breaking-changes/defaults-config.md`](../breaking-changes/defaults-config.md) for the model.
@@ -0,0 +1,99 @@
1
+ # Recipe: Adopt `library-exports` (optional cleanup)
2
+
3
+ Re-import types from `@sodax/wallet-sdk-core` instead of upstream chain SDKs. Optionally drop direct chain-SDK deps from `package.json`.
4
+
5
+ **Apply when:** the user imports type names like `WalletClient`, `PublicClient`, `Networks`, `PostConditionMode`, `NearConnector`, etc. directly from their upstream packages.
6
+
7
+ For the full list of re-exported types, see [`../../integration/recipes/library-exports.md`](../../integration/recipes/library-exports.md).
8
+
9
+ ---
10
+
11
+ ## Before
12
+
13
+ ```ts
14
+ import type { WalletClient, PublicClient, TransactionReceipt } from 'viem';
15
+ import { Networks } from '@stellar/stellar-sdk';
16
+ import { PostConditionMode } from '@stacks/transactions';
17
+ import type { WalletAccount, WalletWithFeatures, SuiWalletFeatures } from '@mysten/wallet-standard';
18
+ import type { Commitment, ConnectionConfig, SendOptions } from '@solana/web3.js';
19
+ ```
20
+
21
+ ## After
22
+
23
+ ```ts
24
+ import type {
25
+ WalletClient,
26
+ PublicClient,
27
+ TransactionReceipt,
28
+ WalletAccount,
29
+ WalletWithFeatures,
30
+ SuiWalletFeatures,
31
+ Commitment,
32
+ ConnectionConfig,
33
+ SendOptions,
34
+ } from '@sodax/wallet-sdk-core';
35
+
36
+ import { Networks, PostConditionMode } from '@sodax/wallet-sdk-core';
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Steps
42
+
43
+ 1. **Identify candidate imports.** Run the grep below to find type imports from upstream chain SDKs:
44
+ ```bash
45
+ grep -rn "from 'viem'" <user-src> | grep -E "WalletClient|PublicClient|TransactionReceipt|SendTransactionParameters|WaitForTransactionReceiptParameters"
46
+ grep -rn "from '@stellar/stellar-sdk'" <user-src> | grep "Networks"
47
+ grep -rn "from '@stacks/transactions'" <user-src> | grep -E "PostConditionMode|ClarityValue|PostConditionModeName"
48
+ # …see ../../integration/recipes/library-exports.md for the full grep list
49
+ ```
50
+
51
+ 2. **Replace one import statement at a time.** Switch the `from` clause to `@sodax/wallet-sdk-core`. Re-run `pnpm checkTs` after each file.
52
+
53
+ 3. **Check whether the upstream package is still needed for runtime.** If the consumer's only remaining import from `viem` (etc.) is one of the re-exported types, you can drop the dep from `package.json`. If they also import `createPublicClient`, `Connection`, `Transaction`, etc. — keep the dep.
54
+
55
+ ```bash
56
+ grep -rn "from 'viem'" <user-src> # confirm nothing remains
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Trade-offs
62
+
63
+ | Switch | Trade-off |
64
+ |---|---|
65
+ | Type imports | Lossless. Same symbol, different module. |
66
+ | Dep removal (after switching all imports) | Smaller `node_modules`, faster installs. But you re-add the dep if you later need a runtime helper. |
67
+ | Version pinning | After dep removal, you no longer control the chain-SDK version directly — it's locked to whatever SODAX uses. Acceptable for most apps. |
68
+
69
+ ---
70
+
71
+ ## When NOT to adopt
72
+
73
+ | Scenario | Why skip |
74
+ |---|---|
75
+ | The user is pinned to a specific chain-SDK version different from SODAX's | Adopting library-exports forces SODAX's version. Keep direct imports. |
76
+ | The user imports many runtime symbols (`createPublicClient`, etc.) not in library-exports | Migration churn for limited benefit — they still need the dep. |
77
+ | The user is mid-migration to another chain SDK and library-exports doesn't cover the new one | Wait until library-exports catches up, or just keep the direct dep. |
78
+
79
+ ---
80
+
81
+ ## Verification
82
+
83
+ ```bash
84
+ # 1. Type check
85
+ pnpm checkTs
86
+
87
+ # 2. No remaining direct upstream-SDK type imports
88
+ grep -rn "from 'viem'" <user-src> | grep -E "WalletClient|PublicClient|TransactionReceipt"
89
+ # expect empty (or kept on purpose with justification)
90
+
91
+ # 3. Optional: confirm the upstream dep was actually removed
92
+ cat <user>/package.json | jq -r '.dependencies | keys[]'
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Why
98
+
99
+ See [`../breaking-changes/library-exports.md`](../breaking-changes/library-exports.md) for the motivation.
@@ -0,0 +1,12 @@
1
+ # Migration reference
2
+
3
+ Lookup tables. Use these to answer "what was renamed / added / removed" without reading the breaking-change narratives.
4
+
5
+ | File | Use for |
6
+ |---|---|
7
+ | [`renamed-symbols.md`](./renamed-symbols.md) | Old name → new name. |
8
+ | [`deleted-exports.md`](./deleted-exports.md) | Symbols removed; what to use instead. |
9
+ | [`added-fields.md`](./added-fields.md) | New optional fields you can adopt. |
10
+ | [`return-shapes.md`](./return-shapes.md) | Method return shapes that changed (none currently — placeholder for future). |
11
+
12
+ For narrative WHY behind each change, see [`../breaking-changes/`](../breaking-changes/).
@@ -0,0 +1,71 @@
1
+ # Added fields and types
2
+
3
+ Additive changes that older code does not use. All optional — no migration required.
4
+
5
+ ---
6
+
7
+ ## New types
8
+
9
+ | Type | Chain(s) | Purpose |
10
+ |---|---|---|
11
+ | `EvmWalletDefaults` | EVM | `defaults` slice shape |
12
+ | `EvmSendTransactionPolicy` | EVM | Per-call options shape for `sendTransaction` |
13
+ | `EvmWaitForTransactionReceiptPolicy` | EVM | Per-call options shape for `waitForTransactionReceipt` |
14
+ | `SolanaWalletDefaults` | Solana | `defaults` slice shape |
15
+ | `SuiWalletDefaults` | Sui | `defaults` slice shape |
16
+ | `SuiSignAndExecutePolicy` | Sui | Per-call options for `signAndExecuteTxn` |
17
+ | `SuiGetCoinsPolicy` | Sui | Per-call options for `getCoins` |
18
+ | `BitcoinWalletDefaults` | Bitcoin | `defaults` slice shape |
19
+ | `StellarWalletDefaults` | Stellar | `defaults` slice shape |
20
+ | `IconWalletDefaults` | ICON | `defaults` slice shape |
21
+ | `InjectiveWalletDefaults` | Injective | `defaults` slice shape |
22
+ | `NearWalletDefaults` | NEAR | `defaults` slice shape |
23
+ | `NearTxExecutionStatus` | NEAR | Status union for `waitUntil` default |
24
+ | `StacksWalletDefaults` | Stacks | `defaults` slice shape |
25
+ | `BaseWalletProvider<TDefaults>` | all | Abstract base class (consumers do not subclass) |
26
+
27
+ ---
28
+
29
+ ## New optional fields on existing configs
30
+
31
+ | Config | Field | Default if omitted |
32
+ |---|---|---|
33
+ | `PrivateKeyEvmWalletConfig` | `defaults?: EvmWalletDefaults` | `{}` |
34
+ | `BrowserExtensionEvmWalletConfig` | `defaults?: EvmWalletDefaults` | `{}` (note: transport/clients in defaults are no-ops here) |
35
+ | `PrivateKeySolanaWalletConfig` | `defaults?: SolanaWalletDefaults` | `{}` |
36
+ | `BrowserExtensionSolanaWalletConfig` | `defaults?: SolanaWalletDefaults` | `{}` |
37
+ | `PrivateKeySuiWalletConfig` | `defaults?: SuiWalletDefaults` | `{}` |
38
+ | `BrowserExtensionSuiWalletConfig` | `defaults?: SuiWalletDefaults` | `{}` |
39
+ | `PrivateKeyBitcoinWalletConfig` | `defaults?: BitcoinWalletDefaults` | `{}` |
40
+ | `BrowserExtensionBitcoinWalletConfig` | `defaults?: BitcoinWalletDefaults` | `{}` |
41
+ | `PrivateKeyStellarWalletConfig` | `defaults?: StellarWalletDefaults` | `{}` |
42
+ | `BrowserExtensionStellarWalletConfig` | `defaults?: StellarWalletDefaults` | `{}` |
43
+ | `PrivateKeyIconWalletConfig` | `defaults?: IconWalletDefaults` | `{}` |
44
+ | `BrowserExtensionIconWalletConfig` | `defaults?: IconWalletDefaults` | `{}` |
45
+ | `SecretInjectiveWalletConfig` | `defaults?: InjectiveWalletDefaults` | `{}` |
46
+ | `BrowserExtensionInjectiveWalletConfig` | `defaults?: InjectiveWalletDefaults` | `{}` |
47
+ | `PrivateKeyNearWalletConfig` | `defaults?: NearWalletDefaults` | `{}` |
48
+ | `BrowserExtensionNearWalletConfig` | `defaults?: NearWalletDefaults` | `{}` |
49
+ | `PrivateKeyStacksWalletConfig` | `defaults?: StacksWalletDefaults` | `{}` |
50
+ | `BrowserExtensionStacksWalletConfig` | `defaults?: StacksWalletDefaults` | `{}` |
51
+
52
+ ---
53
+
54
+ ## New library-exports re-exports
55
+
56
+ See [`../../integration/recipes/library-exports.md`](../../integration/recipes/library-exports.md) for the full table. Re-exporting these means consumers can drop direct deps on upstream chain SDKs for type-only usage.
57
+
58
+ Summary:
59
+
60
+ - **viem** — `Account`, `Address`, `Chain`, `Transport`, `PublicClient`, `WalletClient`, `HttpTransportConfig`, `PublicClientConfig`, `WalletClientConfig`, `SendTransactionParameters`, `WaitForTransactionReceiptParameters`, `TransactionReceipt`
61
+ - **@mysten/sui** — `SuiTransactionBlockResponseOptions`, `Transaction`, `TransactionArgument`
62
+ - **@mysten/wallet-standard** — `SuiWalletFeatures`, `WalletAccount`, `WalletWithFeatures`
63
+ - **@solana/web3.js** — `Commitment`, `ConnectionConfig`, `SendOptions`
64
+ - **@injectivelabs/*** — `Network`, `ChainId`, `EvmChainId`, `MsgBroadcaster`
65
+ - **@stellar/stellar-sdk** — `Networks` (runtime value)
66
+ - **@stacks/transactions** — `PostConditionMode` (runtime enum), `ClarityValue`, `PostConditionModeName`
67
+ - **@stacks/network** — `StacksNetwork`
68
+ - **@stacks/connect** — `StacksProvider`
69
+ - **near-api-js** — `KeyPairString`
70
+ - **@hot-labs/near-connect** — `NearConnector`
71
+ - **bitcoinjs-lib** — `Network as BitcoinJsNetwork`
@@ -0,0 +1,35 @@
1
+ # Deleted exports
2
+
3
+ **No symbols were deleted from the public surface between v1 and v2.** Every v1 named export is still available on v2's barrel.
4
+
5
+ If a v1 import does not compile against v2, the cause is most likely:
6
+
7
+ | Symptom | Likely cause |
8
+ |---|---|
9
+ | `Cannot find module '@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider'` | Deep import from v1's flat layout. Replace with barrel: `from '@sodax/wallet-sdk-core'`. See [`../breaking-changes/folder-layout.md`](../breaking-changes/folder-layout.md). |
10
+ | `'X' has no exported member 'Y'` against `@sodax/sdk` or `@sodax/types` | Not this package. See the corresponding package's migration docs. |
11
+ | Symbol `shallowMerge` not found | Internal in both v1 and v2 (v1 didn't even have it). Use `defaults` config + per-call options. |
12
+
13
+ ---
14
+
15
+ ## Internal symbols (never publicly exported, in any version)
16
+
17
+ | Symbol | Where it lives | Replacement |
18
+ |---|---|---|
19
+ | `shallowMerge` | `src/utils/merge.ts` (v2 only — did not exist in v1) | Use the `defaults` config + per-call options. Merge is automatic. |
20
+ | `serializeReceipt` | private static on `EvmWalletProvider` | `waitForTransactionReceipt` already returns the serialised shape. |
21
+ | Anything under `src/utils/` | — | Internal. |
22
+
23
+ If user code deep-imports one of these, it must be replaced with a public API call.
24
+
25
+ ---
26
+
27
+ ## How to verify
28
+
29
+ ```bash
30
+ grep -rn "shallowMerge" <user-src>
31
+ # expect empty
32
+
33
+ grep -rn "@sodax/wallet-sdk-core/" <user-src> | grep -v "from '@sodax/wallet-sdk-core'"
34
+ # expect empty
35
+ ```
@@ -0,0 +1,31 @@
1
+ # Renamed symbols
2
+
3
+ **None.** No symbol exported from `@sodax/wallet-sdk-core` was renamed between v1 and v2.
4
+
5
+ This file exists so AI agents and humans can look up "what was renamed" and get a definitive **nothing**. If you suspect a rename, you are almost certainly looking at the wrong package:
6
+
7
+ - `@sodax/sdk` — has real v1→v2 renames (e.g. `EvmSpokeProvider` → `EvmSpokeService`).
8
+ - `@sodax/types` — has real v1→v2 renames (e.g. `SONIC_MAINNET_CHAIN_ID` removed in favor of `ChainKeys.SONIC_MAINNET`).
9
+ - `@sodax/wallet-sdk-react` — has real v1→v2 renames (e.g. `useXWagmiStore` removed; `rpcConfig` prop → `config`).
10
+
11
+ For wallet-sdk-core itself, v1 and v2 share **identical** public type names:
12
+
13
+ - `EvmWalletConfig`, `PrivateKeyEvmWalletConfig`, `BrowserExtensionEvmWalletConfig`
14
+ - `SolanaWalletConfig`, `PrivateKeySolanaWalletConfig`, `BrowserExtensionSolanaWalletConfig`
15
+ - `SuiWalletConfig`, `PrivateKeySuiWalletConfig`, `BrowserExtensionSuiWalletConfig`
16
+ - `BitcoinWalletConfig`, `PrivateKeyBitcoinWalletConfig`, `BrowserExtensionBitcoinWalletConfig`
17
+ - `StellarWalletConfig`, `PrivateKeyStellarWalletConfig`, `BrowserExtensionStellarWalletConfig`
18
+ - `IconWalletConfig`, `PrivateKeyIconWalletConfig`, `BrowserExtensionIconWalletConfig`
19
+ - `InjectiveWalletConfig`, **`SecretInjectiveWalletConfig`** (note: not `PrivateKey*` — same in v1), `BrowserExtensionInjectiveWalletConfig`
20
+ - `NearWalletConfig`, `PrivateKeyNearWalletConfig`, `BrowserExtensionNearWalletConfig`
21
+ - `StacksWalletConfig`, `PrivateKeyStacksWalletConfig`, `BrowserExtensionStacksWalletConfig`
22
+
23
+ …and the corresponding provider class names (`EvmWalletProvider`, …).
24
+
25
+ If a v1 codebase compiles against v2 with no symbol-not-found errors, that is the expected outcome.
26
+
27
+ ---
28
+
29
+ ## What WAS added
30
+
31
+ See [`added-fields.md`](./added-fields.md) for new types (`*WalletDefaults`, `*Policy` types, `BaseWalletProvider`) and new optional fields (`defaults?`, Stellar's `rpcUrl?`).
@@ -0,0 +1,23 @@
1
+ # Return shapes
2
+
3
+ Method return shapes that changed between RC versions.
4
+
5
+ ---
6
+
7
+ ## Currently: no breaking return-shape changes
8
+
9
+ All provider method return types are stable across the RC series. This file is a placeholder — future return-shape changes will be documented here in the same format used by `@sodax/sdk`'s migration docs (paired before/after shapes per method).
10
+
11
+ ---
12
+
13
+ ## What to check anyway
14
+
15
+ If you suspect a return shape issue:
16
+
17
+ ```bash
18
+ pnpm checkTs
19
+ ```
20
+
21
+ Any TypeScript error mentioning a `@sodax/wallet-sdk-core` method's return type is most likely (a) propagated from `@sodax/sdk` / `@sodax/types` (which **did** change between v1 and v2), or (b) the consumer is reading a method that **never had** the shape they expect.
22
+
23
+ For (a), open an issue with the version delta — we'll add it to this file. For (b), see [`../../integration/reference/interfaces.md`](../../integration/reference/interfaces.md) for the authoritative current shape.
@@ -0,0 +1,46 @@
1
+ # Knowledge tree — `@sodax/wallet-sdk-react`
2
+
3
+ Long-form knowledge supporting the `@sodax/wallet-sdk-react` skills under `@sodax/skills`. The action-oriented entry points are the SKILL.md files in the sibling `skills/` directory:
4
+
5
+ - New code → `packages/skills/skills/sodax-wallet-sdk-react-integration/SKILL.md`
6
+ - Porting v1 → `packages/skills/skills/sodax-wallet-sdk-react-migration/SKILL.md`
7
+
8
+ **Don't read this tree top-to-bottom.** Load files from the **Workflow** section of the relevant SKILL.md.
9
+
10
+ ## Package summary
11
+
12
+ `@sodax/wallet-sdk-react` is the React wallet-connectivity layer for SODAX dapps. Covers `SodaxWalletProvider` setup, hook-based connect/disconnect/account/signing UX across 9 chain types (EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks), headless wallet-modal primitives, WalletConnect for non-injected wallets (Fireblocks/Ledger/mobile), and `useWalletProvider` for bridging the connected wallet into `@sodax/sdk` calls.
13
+
14
+ Audience: dApp builders. Backend / Node code uses `@sodax/wallet-sdk-core` directly instead.
15
+
16
+ The package name **did not** change between v1 and v2. Migration is detected by import surface (`useXWagmiStore`, positional hook args, removed `rpcConfig` / `options` / `initialState` props on `SodaxWalletProvider`), not by package name.
17
+
18
+ Peer deps: `react >= 19`, `@tanstack/react-query 5.x`.
19
+
20
+ ## Layout
21
+
22
+ ```
23
+ knowledge/wallet-sdk-react/
24
+ ├── AGENTS.md # You are here
25
+ ├── integration/ # New code
26
+ │ ├── README.md
27
+ │ ├── ai-rules.md
28
+ │ ├── architecture.md # Provider mount tree, frozen config, EVM single-connection, xChainType vs xChainId
29
+ │ ├── quickstart.md
30
+ │ ├── examples/ # 4 working .tsx app shells (minimal-evm, multi-chain-modal, nextjs-app-router, walletconnect-setup)
31
+ │ ├── recipes/ # 10 recipes (setup, connect-button, multi-chain-modal, walletconnect-setup, bridge-to-sdk, sign-message, switch-chain, batch-operations, chain-detection, sub-path-imports)
32
+ │ └── reference/ # api-surface, chain-support, connectors, hooks, wallet-brands
33
+ └── migration/ # v1 → v2
34
+ ├── README.md
35
+ ├── ai-rules.md
36
+ ├── checklist.md
37
+ ├── breaking-changes.md # Full narrative of every v1 → v2 change
38
+ ├── recipes/ # connect-button, multi-chain-modal, ssr-setup, walletconnect-migration
39
+ └── reference/ # imports, hooks, config, components (v1 → v2 mappings)
40
+ ```
41
+
42
+ ## Cross-references
43
+
44
+ - SDK calls: `packages/skills/knowledge/sdk/integration/recipes/signed-tx-flow.md` shows how the connected wallet plugs into SDK payloads via `useWalletProvider`.
45
+ - Lower-level wallet providers: `packages/skills/knowledge/wallet-sdk-core/` (the underlying provider classes that `useWalletProvider` returns).
46
+ - Higher-level feature hooks: `packages/skills/knowledge/dapp-kit/` (React hooks wrapping `@sodax/sdk` — almost every wallet-sdk-react consumer also uses dapp-kit).
@@ -0,0 +1,103 @@
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
+ // @ai-snippets-skip
76
+ <SodaxProvider config={sodaxConfig}> {/* @sodax/dapp-kit */}
77
+ <QueryClientProvider client={queryClient}>
78
+ <SodaxWalletProvider config={walletConfig}> {/* this package */}
79
+ {children}
80
+ </SodaxWalletProvider>
81
+ </QueryClientProvider>
82
+ </SodaxProvider>
83
+ ```
84
+
85
+ `SodaxProvider` (from dapp-kit) wraps the lot. `QueryClientProvider` must wrap `SodaxWalletProvider` because hooks inside use React Query.
86
+
87
+ ---
88
+
89
+ ## Conventions worth knowing
90
+
91
+ - **Hooks use a single options object.** `useXConnectors({ xChainType: 'EVM' })`, not positional args.
92
+ - **`xChainId` (chain key) and `xChainType` (family) are both accepted** by `useXAccount` and `useWalletProvider`. Pass one, not both.
93
+ - **`useXConnect` is a React Query mutation.** Pass an `IXConnector` to `mutateAsync`.
94
+ - **Persisted connections.** Connections survive reload via `localStorage` key `xwagmi-store`. Gate UI on `useConnectedChains().status === 'ready'` to avoid hydration flicker.
95
+ - **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.
96
+
97
+ ---
98
+
99
+ ## Getting help
100
+
101
+ - API surface lookup: [`reference/`](./reference/).
102
+ - Bug or missing feature: [open an issue](https://github.com/icon-project/sodax-sdks/issues).
103
+ - Internal architecture (only relevant for SODAX maintainers): `../CLAUDE.md` in the package root.