@sodax/skills 2.0.0-rc.10
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.
- package/.claude-plugin/plugin.json +18 -0
- package/AGENTS.md +83 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/package.json +58 -0
- package/skills/sodax-dapp-kit/SKILL.md +129 -0
- package/skills/sodax-dapp-kit/integration/knowledge/README.md +49 -0
- package/skills/sodax-dapp-kit/integration/knowledge/ai-rules.md +80 -0
- package/skills/sodax-dapp-kit/integration/knowledge/architecture.md +276 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/README.md +29 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/auxiliary-services.md +169 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/bitcoin.md +87 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/bridge.md +91 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/dex.md +152 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/migration.md +118 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/money-market.md +144 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/staking.md +123 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/swap.md +101 -0
- package/skills/sodax-dapp-kit/integration/knowledge/quickstart.md +188 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/README.md +136 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/backend-queries.md +157 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/bitcoin.md +193 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/bridge.md +174 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/dex.md +204 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/invalidations.md +115 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/migration.md +212 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/money-market.md +207 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/mutation-error-handling.md +118 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/observability.md +93 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/setup.md +168 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/staking.md +202 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/swap.md +272 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/wallet-connectivity.md +128 -0
- package/skills/sodax-dapp-kit/integration/knowledge/reference/README.md +12 -0
- package/skills/sodax-dapp-kit/integration/knowledge/reference/glossary.md +190 -0
- package/skills/sodax-dapp-kit/integration/knowledge/reference/hooks-index.md +190 -0
- package/skills/sodax-dapp-kit/integration/knowledge/reference/public-api.md +110 -0
- package/skills/sodax-dapp-kit/integration/knowledge/reference/querykey-conventions.md +179 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/README.md +60 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/ai-rules.md +81 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/breaking-changes/hook-signatures.md +233 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/breaking-changes/querykey-conventions.md +108 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/breaking-changes/result-handling.md +211 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/breaking-changes/sdk-leakage.md +167 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/checklist.md +89 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/README.md +34 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/auxiliary-services.md +114 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/bitcoin.md +88 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/bridge.md +160 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/dex.md +101 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/migration.md +120 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/money-market.md +139 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/staking.md +109 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/features/swap.md +133 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/recipes.md +185 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/reference/README.md +15 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/reference/deleted-hooks.md +110 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/reference/error-shape-crosswalk.md +144 -0
- package/skills/sodax-dapp-kit/migration-v1-to-v2/knowledge/reference/renamed-hooks.md +68 -0
- package/skills/sodax-sdk/SKILL.md +140 -0
- package/skills/sodax-sdk/backend-api/SKILL.md +52 -0
- package/skills/sodax-sdk/bridge/SKILL.md +49 -0
- package/skills/sodax-sdk/dex/SKILL.md +50 -0
- package/skills/sodax-sdk/integration/knowledge/README.md +43 -0
- package/skills/sodax-sdk/integration/knowledge/ai-rules.md +75 -0
- package/skills/sodax-sdk/integration/knowledge/architecture.md +517 -0
- package/skills/sodax-sdk/integration/knowledge/chain-specifics.md +189 -0
- package/skills/sodax-sdk/integration/knowledge/features/README.md +21 -0
- package/skills/sodax-sdk/integration/knowledge/features/backend-api.md +81 -0
- package/skills/sodax-sdk/integration/knowledge/features/bridge.md +172 -0
- package/skills/sodax-sdk/integration/knowledge/features/dex.md +182 -0
- package/skills/sodax-sdk/integration/knowledge/features/migration.md +181 -0
- package/skills/sodax-sdk/integration/knowledge/features/money-market.md +198 -0
- package/skills/sodax-sdk/integration/knowledge/features/partner.md +63 -0
- package/skills/sodax-sdk/integration/knowledge/features/recovery.md +50 -0
- package/skills/sodax-sdk/integration/knowledge/features/staking.md +171 -0
- package/skills/sodax-sdk/integration/knowledge/features/swap.md +273 -0
- package/skills/sodax-sdk/integration/knowledge/quickstart.md +213 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/README.md +21 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/backend-server-init.md +69 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/chain-key-narrowing.md +65 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/gas-estimation.md +33 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/initialize-sodax.md +78 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/raw-tx-flow.md +71 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/result-and-errors.md +104 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/signed-tx-flow.md +46 -0
- package/skills/sodax-sdk/integration/knowledge/recipes/testing.md +101 -0
- package/skills/sodax-sdk/integration/knowledge/reference/README.md +18 -0
- package/skills/sodax-sdk/integration/knowledge/reference/chain-keys.md +67 -0
- package/skills/sodax-sdk/integration/knowledge/reference/error-codes.md +165 -0
- package/skills/sodax-sdk/integration/knowledge/reference/glossary.md +32 -0
- package/skills/sodax-sdk/integration/knowledge/reference/public-api.md +138 -0
- package/skills/sodax-sdk/integration/knowledge/reference/wallet-providers.md +62 -0
- package/skills/sodax-sdk/migration/SKILL.md +65 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/README.md +58 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/ai-rules.md +76 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/breaking-changes/architecture.md +344 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/breaking-changes/result-and-errors.md +363 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/breaking-changes/type-system.md +341 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/checklist.md +67 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/README.md +37 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/backend-api.md +92 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/bridge.md +128 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/dex.md +143 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/migration.md +151 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/money-market.md +214 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/partner.md +59 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/recovery.md +35 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/staking.md +143 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/features/swap.md +198 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/recipes.md +350 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/README.md +18 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/deleted-exports.md +127 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/error-code-crosswalk.md +104 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/return-shapes.md +49 -0
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/sodax-config.md +145 -0
- package/skills/sodax-sdk/money-market/SKILL.md +52 -0
- package/skills/sodax-sdk/partner/SKILL.md +51 -0
- package/skills/sodax-sdk/recovery/SKILL.md +49 -0
- package/skills/sodax-sdk/staking/SKILL.md +49 -0
- package/skills/sodax-sdk/swap/SKILL.md +67 -0
- package/skills/sodax-wallet-sdk-core/SKILL.md +114 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/README.md +108 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/ai-rules.md +141 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/architecture.md +212 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/README.md +22 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/bitcoin.md +103 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/evm.md +102 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/icon.md +88 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/injective.md +92 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/near.md +92 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/solana.md +104 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/stacks.md +91 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/stellar.md +95 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/sui.md +96 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/quickstart.md +259 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/README.md +15 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/bridge-to-sdk.md +145 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/defaults-and-overrides.md +159 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/library-exports.md +129 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/setup-browser-extension.md +137 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/setup-private-key.md +115 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/sign-and-broadcast.md +201 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/recipes/testing.md +163 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/README.md +13 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/chain-support.md +65 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/glossary.md +28 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/interfaces.md +131 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/provider-classes.md +54 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/public-api.md +128 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/README.md +84 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/ai-rules.md +139 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/breaking-changes/README.md +14 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/breaking-changes/base-wallet-provider.md +52 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/breaking-changes/defaults-config.md +57 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/breaking-changes/folder-layout.md +99 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/breaking-changes/library-exports.md +58 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/checklist.md +62 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/recipes/README.md +12 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/recipes/adopt-defaults.md +84 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/recipes/adopt-library-exports.md +99 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/reference/README.md +12 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/reference/added-fields.md +71 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/reference/deleted-exports.md +35 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/reference/renamed-symbols.md +31 -0
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/reference/return-shapes.md +23 -0
- package/skills/sodax-wallet-sdk-react/SKILL.md +154 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/README.md +103 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/ai-rules.md +136 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/architecture.md +185 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/01-minimal-evm.tsx +75 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/02-multi-chain-modal.tsx +169 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/03-nextjs-app-router.tsx +99 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/04-walletconnect-setup.tsx +89 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/README.md +29 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/batch-operations.md +224 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/bridge-to-sdk.md +165 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/chain-detection.md +259 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/connect-button.md +159 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/multi-chain-modal.md +203 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/setup.md +163 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/sign-message.md +138 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/sub-path-imports.md +97 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/switch-chain.md +144 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/walletconnect-setup.md +139 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/api-surface.md +176 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/chain-support.md +79 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/connectors.md +75 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/hooks.md +212 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/wallet-brands.md +107 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/README.md +49 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/ai-rules.md +144 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/breaking-changes.md +310 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/checklist.md +159 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/recipes/connect-button.md +170 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/recipes/multi-chain-modal.md +245 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/recipes/ssr-setup.md +165 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/recipes/walletconnect-migration.md +170 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/reference/components.md +75 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/reference/config.md +339 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/reference/hooks.md +336 -0
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/reference/imports.md +158 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# `SodaxConfig` constructor reshape
|
|
2
|
+
|
|
3
|
+
The v2 `Sodax` constructor accepts a `DeepPartial<SodaxConfig>`. Several config fields renamed, moved, or were added between v1 and v2; if your project passed a custom config, check these.
|
|
4
|
+
|
|
5
|
+
## v2 `SodaxConfig` shape (source of truth)
|
|
6
|
+
|
|
7
|
+
Defined in `@sodax/types` (`packages/types/src/sodax-config/sodax-config.ts`):
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type SodaxConfig = {
|
|
11
|
+
fee: PartnerFee | undefined; // global partner fee (overridable per-feature)
|
|
12
|
+
chains: Record<SpokeChainKey, SpokeChainConfig>; // per-spoke-chain config (rpcUrl + tx polling + chain-specific shape)
|
|
13
|
+
swaps: SwapsConfig; // supported swap tokens per chain
|
|
14
|
+
moneyMarket: MoneyMarketConfig; // money market service config
|
|
15
|
+
bridge: BridgeConfig; // bridge partner-fee override
|
|
16
|
+
dex: DexConfig; // DEX service config
|
|
17
|
+
hub: HubConfig; // hub-chain (Sonic) provider config
|
|
18
|
+
api: ApiConfig; // backend API endpoint
|
|
19
|
+
solver: SolverConfig; // intent solver endpoint + contracts
|
|
20
|
+
relay: RelayConfig; // intent-relay endpoint
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
A matching default `sodaxConfig` const is exported from the same module — `new Sodax()` deep-merges your `DeepPartial<SodaxConfig>` over it.
|
|
25
|
+
|
|
26
|
+
## v1 shape (for reference)
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// v1 — packages/sdk/src/shared/entities/Sodax.ts
|
|
30
|
+
type SodaxConfig = {
|
|
31
|
+
swaps?: SolverConfigParams; // { intentsContract, solverApiEndpoint, protocolIntentsContract?, partnerFee? }
|
|
32
|
+
moneyMarket?: MoneyMarketConfigParams;
|
|
33
|
+
migration?: MigrationServiceConfig;
|
|
34
|
+
bridge?: BridgeServiceConfig;
|
|
35
|
+
dex?: DexServiceConfig;
|
|
36
|
+
hubProviderConfig?: EvmHubProviderConfig; // { hubRpcUrl, chainConfig }
|
|
37
|
+
relayerApiEndpoint?: HttpUrl; // single URL string
|
|
38
|
+
backendApiConfig?: BackendApiConfig;
|
|
39
|
+
partners?: PartnerServiceConfig;
|
|
40
|
+
sharedConfig?: typeof defaultSharedConfig;
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
All v1 fields were **optional**. v1 had **no** top-level `rpcConfig` on `SodaxConfig` — RPC URLs were a separate prop accepted by the framework-layer `SodaxProvider` (alongside the `config` prop carrying `SodaxConfig`); the `Sodax` class constructor itself never received `rpcConfig`.
|
|
45
|
+
|
|
46
|
+
## v1 → v2 field map
|
|
47
|
+
|
|
48
|
+
| v1 location | v2 location | Notes |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `SodaxConfig.swaps` (`SolverConfigParams` — `{ intentsContract, solverApiEndpoint, protocolIntentsContract?, partnerFee? }`) | **Split into two:** `SodaxConfig.solver: SolverConfig` (`{ intentsContract, solverApiEndpoint, protocolIntentsContract }`) and `SodaxConfig.swaps: SwapsConfig` (supported tokens per chain — new in v2). | v1 partner-fee inside `SolverConfigParams` moves to the global `SodaxConfig.fee` slot or per-feature configs. |
|
|
51
|
+
| `SodaxConfig.hubProviderConfig` (`EvmHubProviderConfig` — `{ hubRpcUrl, chainConfig }`) | **`SodaxConfig.hub`** (`HubConfig` — full hub addresses + native token + bnUSD + polling + RPC URL). | Field renamed `hubProviderConfig` → `hub`. Shape expanded: v1 just had RPC URL + chain config; v2 ships the full hub-contract address map. |
|
|
52
|
+
| `SodaxConfig.moneyMarket` (`MoneyMarketConfigParams`) | `SodaxConfig.moneyMarket` (`MoneyMarketConfig` — required, shape changed). | Reshape, see `@sodax/types/src/common/common.ts` MoneyMarketConfig. |
|
|
53
|
+
| `SodaxConfig.bridge` (`BridgeServiceConfig`) | `SodaxConfig.bridge` (`BridgeConfig` — `{ partnerFee }`). | Reshape; smaller. |
|
|
54
|
+
| `SodaxConfig.dex` (`DexServiceConfig`) | `SodaxConfig.dex` (`DexConfig`). | Reshape. |
|
|
55
|
+
| `SodaxConfig.relayerApiEndpoint: HttpUrl` (string) | **`SodaxConfig.relay`** (`RelayConfig` — object with relayer URL + chain-id map). | Renamed + reshaped from string to object. |
|
|
56
|
+
| `SodaxConfig.backendApiConfig` (`BackendApiConfig`) | **`SodaxConfig.api`** (`ApiConfig`). | Renamed. |
|
|
57
|
+
| (Separate `rpcConfig` prop on the framework-layer SodaxProvider, NOT a `SodaxConfig` field) | **`SodaxConfig.chains`** (`Record<SpokeChainKey, SpokeChainConfig>`). | v2 absorbs RPC URLs + polling + chain-specific extras into the `SodaxConfig.chains` mapped type. v1's separate `rpcConfig` provider prop is gone. The standalone `RpcConfig` type still ships from `@sodax/types` for utility use (e.g. the demo's `providers.tsx` declares a local `RpcConfig` then maps values into `chains`), but it is not a `SodaxConfig` field. |
|
|
58
|
+
| `SodaxConfig.migration` (`MigrationServiceConfig`) | **Removed.** Migration service runs with hard-coded defaults. | No replacement on `SodaxConfig`. v2 surfaces customization via per-method params on `sodax.migration.*`, not constructor config — see [`../features/migration.md`](../features/migration.md). |
|
|
59
|
+
| `SodaxConfig.partners` (`PartnerServiceConfig`) | **Removed.** Partner service runs with defaults. | Per-claim partner-fee config now flows via call-level params on `sodax.partners.*` methods. |
|
|
60
|
+
| `SodaxConfig.sharedConfig` (`typeof defaultSharedConfig`) | **Removed.** | Absorbed into `ConfigService` + per-chain `SpokeChainConfig`. Override individual chains via `SodaxConfig.chains[key]`. |
|
|
61
|
+
| (none in v1) | **`SodaxConfig.fee: PartnerFee \| undefined`** (new). | Global partner-fee, applies to all features unless overridden by feature-level config (`bridge.partnerFee`, money market, etc.). |
|
|
62
|
+
| (v1 had no top-level `configService` injection slot on `SodaxConfig` — `ConfigService` was always constructed internally from `backendApiConfig` + `sharedConfig`.) | Same — `ConfigService` is internal. v2 does **not** expose a typed slot to inject a custom `IConfigApi` either. To swap the backend in tests, point `SodaxConfig.api.baseURL` at a mock server. | See Pitfall below. |
|
|
63
|
+
|
|
64
|
+
Migration:
|
|
65
|
+
|
|
66
|
+
```diff
|
|
67
|
+
- // v1 — typical SodaxConfig literal
|
|
68
|
+
- const sodaxConfig = {
|
|
69
|
+
- hubProviderConfig: { hubRpcUrl: 'https://…', chainConfig: getHubChainConfig() },
|
|
70
|
+
- moneyMarket: getMoneyMarketConfig(hubChainId),
|
|
71
|
+
- swaps: {
|
|
72
|
+
- intentsContract: '0x…',
|
|
73
|
+
- solverApiEndpoint: 'https://…',
|
|
74
|
+
- protocolIntentsContract: '0x…',
|
|
75
|
+
- partnerFee: { address: '0x…', percentage: 10 },
|
|
76
|
+
- },
|
|
77
|
+
- relayerApiEndpoint: 'https://relay.example.com',
|
|
78
|
+
- } satisfies SodaxConfig;
|
|
79
|
+
- // RPC URLs were passed as a SEPARATE prop on the framework-layer SodaxProvider
|
|
80
|
+
- // (alongside the sodaxConfig). The Sodax constructor itself never saw rpcConfig.
|
|
81
|
+
|
|
82
|
+
+ // v2 — DeepPartial<SodaxConfig> passed directly to new Sodax(...)
|
|
83
|
+
+ const sodax = new Sodax({
|
|
84
|
+
+ hub: { /* HubConfig — usually omit, default ships full hub addresses */ },
|
|
85
|
+
+ solver: {
|
|
86
|
+
+ intentsContract: '0x…',
|
|
87
|
+
+ solverApiEndpoint: 'https://…',
|
|
88
|
+
+ protocolIntentsContract: '0x…',
|
|
89
|
+
+ },
|
|
90
|
+
+ swaps: {
|
|
91
|
+
+ supportedTokens: { /* per-chain table */ },
|
|
92
|
+
+ },
|
|
93
|
+
+ relay: { /* RelayConfig — relayer URL + chain-id map */ },
|
|
94
|
+
+ fee: { address: '0x…', percentage: 10 }, // global partner fee (moved out of swaps)
|
|
95
|
+
+ chains: {
|
|
96
|
+
+ [ChainKeys.SONIC_MAINNET]: { rpcUrl: 'https://…' },
|
|
97
|
+
+ [ChainKeys.ARBITRUM_MAINNET]: { rpcUrl: 'https://…' },
|
|
98
|
+
+ [ChainKeys.BITCOIN_MAINNET]: { /* BitcoinSpokeChainConfig shape */ },
|
|
99
|
+
+ // …
|
|
100
|
+
+ },
|
|
101
|
+
+ });
|
|
102
|
+
+ await sodax.config.initialize();
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Per-chain `SpokeChainConfig` shape
|
|
106
|
+
|
|
107
|
+
`SodaxConfig.chains` is keyed by `SpokeChainKey`; each entry's value type varies by chain family. The user-overridable surface (`rpcUrl`, polling config, chain-specific extras) is the same set of fields `RpcConfig` covers in v1, but nested inside `SpokeChainConfig` rather than flat. Inspect the type at:
|
|
108
|
+
|
|
109
|
+
- `packages/types/src/chains/chains.ts` — `SpokeChainConfig` discriminated union
|
|
110
|
+
- `packages/types/src/common/common.ts` — `BitcoinRpcConfig`, `StellarRpcConfig`, `InjectiveRpcConfig` (used inside the EVM-non-EVM branches)
|
|
111
|
+
|
|
112
|
+
See [`../breaking-changes/type-system.md`](../breaking-changes/type-system.md) § 5 for the chain-family-specific entry shapes.
|
|
113
|
+
|
|
114
|
+
### Pitfall
|
|
115
|
+
|
|
116
|
+
If you previously injected a custom `ConfigService` for testing (a v1 escape hatch), v2 doesn't accept one at the top level — and unlike what earlier doc versions claimed, **v2 also doesn't expose a typed slot to inject a custom `IConfigApi`**. The realistic options:
|
|
117
|
+
|
|
118
|
+
- Point `SodaxConfig.api.baseURL` at a local mock backend server.
|
|
119
|
+
- Construct your own `BackendApiService`-compatible object in your app/test bootstrap and swap it in where you control the `Sodax` instance.
|
|
120
|
+
|
|
121
|
+
The `SodaxConfig.api` field is `ApiConfig` (`{ baseURL, timeout, headers }`) — there is no `api.api` sub-field for IConfigApi injection.
|
|
122
|
+
|
|
123
|
+
### Pitfall — module-scope reads
|
|
124
|
+
|
|
125
|
+
If your code reads hub addresses or default configs **before** the `Sodax` instance exists (module-scope constants), use the re-exported defaults from `@sodax/types` (also flow through `@sodax/sdk` since it re-exports the entire types surface):
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { hubConfig, sodaxConfig } from '@sodax/sdk';
|
|
129
|
+
|
|
130
|
+
const HUB_WALLET = hubConfig.addresses.hubWallet; // module-scope OK
|
|
131
|
+
const DEFAULT_RELAY = sodaxConfig.relay; // module-scope OK
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`hubConfig` / `sodaxConfig` are the **packaged defaults** — the same values `ConfigService` falls back to if the backend is unreachable. Once you have a `Sodax` instance, prefer `sodax.config.getHubChainConfig()` / `sodax.config.*` so backend-driven updates take effect.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## Cross-references
|
|
140
|
+
|
|
141
|
+
- [`README.md`](README.md) — migration reference index.
|
|
142
|
+
- [`../README.md`](../README.md) — migration overview.
|
|
143
|
+
- [`../checklist.md`](../checklist.md) — top-level migration checklist.
|
|
144
|
+
- [`../breaking-changes/type-system.md`](../breaking-changes/type-system.md) § 5 — per-chain config entry shapes.
|
|
145
|
+
- [`deleted-exports.md`](deleted-exports.md) — `getHubChainConfig()` and other deleted symbols.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-sdk-money-market
|
|
3
|
+
description: 'Granular skill for the @sodax/sdk v2 money-market feature only — cross-chain lending and borrowing (supply, borrow, withdraw, repay) and per-position reads. Use when the consumer task is specifically money-market (e.g. "supply on Sodax", "borrow against my position", "Sodax lending", "withdraw collateral", "repay debt", "cross-chain borrow"). Covers BOTH integration (write new v2 code) and migration (port v1 MoneyMarketService to v2). Skill links into the parent sodax-sdk knowledge tree — does NOT duplicate it. For React dapps, prefer the sodax-dapp-kit skill.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Money Market (Core SDK granular skill)
|
|
7
|
+
|
|
8
|
+
Granular skill for the lending/borrowing feature of `@sodax/sdk` v2. Access via `sodax.moneyMarket`. Feature tag for errors: `'moneyMarket'`.
|
|
9
|
+
|
|
10
|
+
## Step 1 — Clarify with user before coding
|
|
11
|
+
|
|
12
|
+
1. **New code or v1 → v2 port?**
|
|
13
|
+
2. **Which operation?** `supply`, `borrow`, `withdraw`, `repay`, or just position reads.
|
|
14
|
+
3. **Same-chain or cross-chain borrow?** `borrow` can deliver funds back to the source chain or to a different spoke chain.
|
|
15
|
+
4. **Signed flow or unsigned-tx (`createXxxIntent`)?**
|
|
16
|
+
5. **Need user-position reads** (aToken balance, reserves data, formatted summaries)? Those come from `sodax.backendApi`, not `MoneyMarketService` — load [`../backend-api/SKILL.md`](../backend-api/SKILL.md) alongside.
|
|
17
|
+
|
|
18
|
+
## Integration workflow
|
|
19
|
+
|
|
20
|
+
1. [`../integration/knowledge/ai-rules.md`](../integration/knowledge/ai-rules.md) — DO / DO NOT.
|
|
21
|
+
2. [`../integration/knowledge/features/money-market.md`](../integration/knowledge/features/money-market.md) — `MoneyMarketService` API, action params, hub-asset / aToken mapping.
|
|
22
|
+
3. Path-specific recipe:
|
|
23
|
+
- Signed → [`../integration/knowledge/recipes/signed-tx-flow.md`](../integration/knowledge/recipes/signed-tx-flow.md)
|
|
24
|
+
- Backend / unsigned → [`../integration/knowledge/recipes/raw-tx-flow.md`](../integration/knowledge/recipes/raw-tx-flow.md)
|
|
25
|
+
4. Gas estimation before action methods → [`../integration/knowledge/recipes/gas-estimation.md`](../integration/knowledge/recipes/gas-estimation.md).
|
|
26
|
+
5. Errors (`feature: 'moneyMarket'`) → [`../integration/knowledge/recipes/result-and-errors.md`](../integration/knowledge/recipes/result-and-errors.md) and [`../integration/knowledge/reference/error-codes.md`](../integration/knowledge/reference/error-codes.md).
|
|
27
|
+
6. Reading user position → load [`../backend-api/SKILL.md`](../backend-api/SKILL.md) for `BackendApiService.getMoneyMarketPosition`, `getAllMoneyMarketAssets`, etc.
|
|
28
|
+
|
|
29
|
+
### Money-market-specific anti-patterns
|
|
30
|
+
|
|
31
|
+
- **Confusing `token` (hub asset address) with the spoke-chain token address.** `MoneyMarketParams<K>.token` is the hub asset (a `0x...` address on Sonic), not the user's spoke-chain ERC20.
|
|
32
|
+
- **Skipping allowance check before `supply` / `repay`.** Use `isAllowanceValid` then `approve` with the action-discriminated args.
|
|
33
|
+
- **Calling reserve-data reads on `MoneyMarketService`.** Those live on `sodax.backendApi`.
|
|
34
|
+
|
|
35
|
+
## Migration workflow (v1 → v2)
|
|
36
|
+
|
|
37
|
+
1. [`../migration-v1-to-v2/knowledge/ai-rules.md`](../migration-v1-to-v2/knowledge/ai-rules.md).
|
|
38
|
+
2. [`../migration-v1-to-v2/knowledge/features/money-market.md`](../migration-v1-to-v2/knowledge/features/money-market.md) — v1 `MoneyMarketError` → v2 `SodaxError<C>` with `feature: 'moneyMarket'`.
|
|
39
|
+
3. Add `srcChainKey` + `srcAddress` to every action params object — these were not in v1 shapes.
|
|
40
|
+
|
|
41
|
+
## Verification
|
|
42
|
+
|
|
43
|
+
1. `pnpm tsc --noEmit` clean.
|
|
44
|
+
2. Every `await sodax.moneyMarket.<method>(...)` has `if (!result.ok)` branching.
|
|
45
|
+
3. `instanceof MoneyMarketError` → `isSodaxError(e) && e.feature === 'moneyMarket'`.
|
|
46
|
+
|
|
47
|
+
## Related granular skills (same family)
|
|
48
|
+
|
|
49
|
+
- [`../backend-api/SKILL.md`](../backend-api/SKILL.md) — reads (`BackendApiService`) for user position, asset metadata, suppliers/borrowers lists.
|
|
50
|
+
- [`../swap/SKILL.md`](../swap/SKILL.md) — when supplying collateral that requires an upstream swap.
|
|
51
|
+
|
|
52
|
+
For multi-feature tasks, load the broad [`sodax-sdk` skill](../SKILL.md).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-sdk-partner
|
|
3
|
+
description: 'Granular skill for the @sodax/sdk v2 partner-fee feature only — `PartnerService` (operations on `sodax.partners.feeClaim`). Token approval on the hub, auto-swap preferences, immediate fee-claim swap, intent-driven auto-swap, asset-balance reads. Use when the task is partner-fee work (e.g. "claim partner fee", "configure partner auto-swap preference", "approve partner fee token on Sodax hub", "Sodax PartnerService"). Covers BOTH integration and migration. Skill links into the parent sodax-sdk knowledge tree. For React dapps, prefer sodax-dapp-kit.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Partner (Core SDK granular skill)
|
|
7
|
+
|
|
8
|
+
Granular skill for `PartnerService` — `sodax.partners`. Operations live on `sodax.partners.feeClaim` (the parent only exposes `feeClaim` and `config`). Feature tag for errors: `'partner'`.
|
|
9
|
+
|
|
10
|
+
## Step 1 — Clarify with user before coding
|
|
11
|
+
|
|
12
|
+
1. **New code or v1 → v2 port?**
|
|
13
|
+
2. **Which operation?**
|
|
14
|
+
- One-time setup: `isTokenApproved` → `approveToken` → `setSwapPreference`.
|
|
15
|
+
- Recurring: `swap` (immediate) or `createIntentAutoSwap` (intent-driven auto-swap).
|
|
16
|
+
- Reads: `getAutoSwapPreferences`, `fetchAssetsBalances`.
|
|
17
|
+
3. **Signed flow or unsigned-tx?**
|
|
18
|
+
|
|
19
|
+
## Integration workflow
|
|
20
|
+
|
|
21
|
+
1. [`../integration/knowledge/ai-rules.md`](../integration/knowledge/ai-rules.md).
|
|
22
|
+
2. [`../integration/knowledge/features/partner.md`](../integration/knowledge/features/partner.md) — `PartnerService` API, common call shape (approve → preference → swap).
|
|
23
|
+
3. Path-specific recipe:
|
|
24
|
+
- Signed → [`../integration/knowledge/recipes/signed-tx-flow.md`](../integration/knowledge/recipes/signed-tx-flow.md)
|
|
25
|
+
- Unsigned → [`../integration/knowledge/recipes/raw-tx-flow.md`](../integration/knowledge/recipes/raw-tx-flow.md)
|
|
26
|
+
4. Errors (`feature: 'partner'`) → [`../integration/knowledge/reference/error-codes.md`](../integration/knowledge/reference/error-codes.md).
|
|
27
|
+
|
|
28
|
+
### Partner-specific anti-patterns
|
|
29
|
+
|
|
30
|
+
- **Calling `sodax.partners.claimFees(...)`.** Method doesn't exist on `sodax.partners` directly — all fee-claim operations live on `sodax.partners.feeClaim`.
|
|
31
|
+
- **Skipping the `isTokenApproved` check before fee claim.** The partner's fee token must be approved on the hub once; subsequent claims reuse the allowance.
|
|
32
|
+
- **Forgetting to `setSwapPreference`.** Without an auto-swap preference, partner-collected fees stay in the original asset.
|
|
33
|
+
|
|
34
|
+
## Migration workflow (v1 → v2)
|
|
35
|
+
|
|
36
|
+
1. [`../migration-v1-to-v2/knowledge/ai-rules.md`](../migration-v1-to-v2/knowledge/ai-rules.md).
|
|
37
|
+
2. [`../migration-v1-to-v2/knowledge/features/partner.md`](../migration-v1-to-v2/knowledge/features/partner.md) — drop `spokeProvider`, add `walletProvider`, `srcChainKey`, `srcAddress`. All 5 v1 typed errors collapse into `SodaxError<C>` with `feature: 'partner'`.
|
|
38
|
+
|
|
39
|
+
## Verification
|
|
40
|
+
|
|
41
|
+
1. `pnpm tsc --noEmit` clean.
|
|
42
|
+
2. Every `await sodax.partners.feeClaim.<method>(...)` has `if (!result.ok)`.
|
|
43
|
+
3. No `instanceof PartnerFeeClaimError` (or the 4 sibling v1 error classes).
|
|
44
|
+
|
|
45
|
+
## Related granular skills (same family)
|
|
46
|
+
|
|
47
|
+
- [`../recovery/SKILL.md`](../recovery/SKILL.md) — partner-collected funds stuck on the hub.
|
|
48
|
+
- [`../backend-api/SKILL.md`](../backend-api/SKILL.md) — backend HTTP client for tracking partner-claim intents.
|
|
49
|
+
- [`../swap/SKILL.md`](../swap/SKILL.md) — partner-fee `swap` and `createIntentAutoSwap` reuse the swap intent layer.
|
|
50
|
+
|
|
51
|
+
For multi-feature tasks, load the broad [`sodax-sdk` skill](../SKILL.md).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-sdk-recovery
|
|
3
|
+
description: 'Granular skill for the @sodax/sdk v2 recovery feature only — `RecoveryService` for withdrawing stuck hub-wallet assets back to a spoke chain. Use when the task is recovering assets stranded on the hub after a failed cross-chain operation (e.g. "recover stuck assets on Sonic", "Sodax RecoveryService", "fetchHubAssetBalances", "withdrawHubAsset", "stuck-asset withdrawal"). Service is NEW in v2 (no v1 equivalent). Covers BOTH integration and the v2-only migration note. Skill links into the parent sodax-sdk knowledge tree.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Recovery (Core SDK granular skill)
|
|
7
|
+
|
|
8
|
+
Granular skill for `RecoveryService` — `sodax.recovery`. Feature tag for errors: `'recovery'`. Service is **new in v2** — no v1 equivalent.
|
|
9
|
+
|
|
10
|
+
## Step 1 — Clarify with user before coding
|
|
11
|
+
|
|
12
|
+
1. **What's the trigger?** Recovery should follow a *known* failed cross-chain operation. If the user can't name the failure, investigate the original op first.
|
|
13
|
+
2. **Which operation?**
|
|
14
|
+
- `fetchHubAssetBalances` (read; list stuck hub assets for the user).
|
|
15
|
+
- `withdrawHubAsset` (mutation; withdraw one entry back to a chosen spoke chain).
|
|
16
|
+
3. **Signed flow or unsigned-tx?** `withdrawHubAsset` follows the same `WalletProviderSlot<K, Raw>` pattern as other mutations.
|
|
17
|
+
|
|
18
|
+
## Integration workflow
|
|
19
|
+
|
|
20
|
+
1. [`../integration/knowledge/ai-rules.md`](../integration/knowledge/ai-rules.md).
|
|
21
|
+
2. [`../integration/knowledge/features/recovery.md`](../integration/knowledge/features/recovery.md) — `RecoveryService` API + when-to-use guidance.
|
|
22
|
+
3. Path-specific recipe:
|
|
23
|
+
- Signed → [`../integration/knowledge/recipes/signed-tx-flow.md`](../integration/knowledge/recipes/signed-tx-flow.md)
|
|
24
|
+
- Unsigned → [`../integration/knowledge/recipes/raw-tx-flow.md`](../integration/knowledge/recipes/raw-tx-flow.md)
|
|
25
|
+
4. Errors (`feature: 'recovery'`) → [`../integration/knowledge/reference/error-codes.md`](../integration/knowledge/reference/error-codes.md).
|
|
26
|
+
|
|
27
|
+
### Recovery-specific anti-patterns
|
|
28
|
+
|
|
29
|
+
- **Treating recovery as a routine flow.** It's a workaround for failures; calling it on successfully completed flows wastes gas and confuses users.
|
|
30
|
+
- **Skipping the balance read.** `fetchHubAssetBalances` returns the full set of hub assets for a user; pick the one to withdraw rather than guessing the address.
|
|
31
|
+
- **Ignoring the underlying failure.** Recovery moves the asset but doesn't explain why the original op failed — investigate first (relay timeout? bad params? destination chain issue?).
|
|
32
|
+
|
|
33
|
+
## Migration workflow (v1 → v2)
|
|
34
|
+
|
|
35
|
+
1. [`../migration-v1-to-v2/knowledge/ai-rules.md`](../migration-v1-to-v2/knowledge/ai-rules.md).
|
|
36
|
+
2. [`../migration-v1-to-v2/knowledge/features/recovery.md`](../migration-v1-to-v2/knowledge/features/recovery.md) — service is new in v2; no port to do. If you have v1 workaround code that walked the hub wallet abstraction manually, replace it with `fetchHubAssetBalances` + `withdrawHubAsset`.
|
|
37
|
+
|
|
38
|
+
## Verification
|
|
39
|
+
|
|
40
|
+
1. `pnpm tsc --noEmit` clean.
|
|
41
|
+
2. Every `await sodax.recovery.<method>(...)` has `if (!result.ok)`.
|
|
42
|
+
3. Any v1 ad-hoc "find stuck assets" workaround code is removed.
|
|
43
|
+
|
|
44
|
+
## Related granular skills (same family)
|
|
45
|
+
|
|
46
|
+
- [`../swap/SKILL.md`](../swap/SKILL.md), [`../bridge/SKILL.md`](../bridge/SKILL.md), [`../money-market/SKILL.md`](../money-market/SKILL.md), etc. — the upstream features whose failures may strand assets.
|
|
47
|
+
- [`../backend-api/SKILL.md`](../backend-api/SKILL.md) — intent / tx lookups to diagnose the original failure before recovering.
|
|
48
|
+
|
|
49
|
+
For multi-feature tasks, load the broad [`sodax-sdk` skill](../SKILL.md).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-sdk-staking
|
|
3
|
+
description: 'Granular skill for the @sodax/sdk v2 staking feature only — SODA ↔ xSoda staking via ERC-4626 vault. Stake, unstake (with penalty curve), instant unstake (slippage), claim, cancel unstake. Use when the task is staking (e.g. "stake SODA", "unstake xSoda", "claim Sodax staking rewards", "instant unstake with penalty", "cancel pending unstake", "get staking info from spoke"). Covers BOTH integration and migration. Skill links into the parent sodax-sdk knowledge tree. For React dapps, prefer sodax-dapp-kit.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Staking (Core SDK granular skill)
|
|
7
|
+
|
|
8
|
+
Granular skill for `StakingService` — `sodax.staking`. Feature tag: `'staking'`.
|
|
9
|
+
|
|
10
|
+
## Step 1 — Clarify with user before coding
|
|
11
|
+
|
|
12
|
+
1. **New code or v1 → v2 port?**
|
|
13
|
+
2. **Which operation?** `stake`, `unstake`, `instantUnstake` (penalty), `claim`, `cancelUnstake`.
|
|
14
|
+
3. **Cross-chain** (staking from a spoke chain) **or hub-side** (Sonic)? Staking from a spoke routes through the relay.
|
|
15
|
+
4. **Need user staking info?**
|
|
16
|
+
- From a **spoke** address (most consumer code): `getStakingInfoFromSpoke(srcAddress, srcChainKey)` — resolves spoke → hub then reads.
|
|
17
|
+
- From a **hub** address directly (already on Sonic): `getStakingInfo(hubAddress)`. Both are public reads on `StakingService`.
|
|
18
|
+
|
|
19
|
+
## Integration workflow
|
|
20
|
+
|
|
21
|
+
1. [`../integration/knowledge/ai-rules.md`](../integration/knowledge/ai-rules.md).
|
|
22
|
+
2. [`../integration/knowledge/features/staking.md`](../integration/knowledge/features/staking.md) — `StakingService` API, penalty curve, instant-unstake slippage, claim flow.
|
|
23
|
+
3. Path-specific recipe:
|
|
24
|
+
- Signed → [`../integration/knowledge/recipes/signed-tx-flow.md`](../integration/knowledge/recipes/signed-tx-flow.md)
|
|
25
|
+
- Unsigned → [`../integration/knowledge/recipes/raw-tx-flow.md`](../integration/knowledge/recipes/raw-tx-flow.md)
|
|
26
|
+
4. Errors (`feature: 'staking'`) → [`../integration/knowledge/reference/error-codes.md`](../integration/knowledge/reference/error-codes.md).
|
|
27
|
+
|
|
28
|
+
### Staking-specific anti-patterns
|
|
29
|
+
|
|
30
|
+
- **Passing a spoke address to `getStakingInfo`.** It expects a hub address. Use `getStakingInfoFromSpoke(srcAddress, srcChainKey)` if you only have the spoke address — it derives the hub wallet internally.
|
|
31
|
+
- **Forgetting allowance before `stake`.** Like other action services, requires `approve` + `isAllowanceValid` flow.
|
|
32
|
+
|
|
33
|
+
## Migration workflow (v1 → v2)
|
|
34
|
+
|
|
35
|
+
1. [`../migration-v1-to-v2/knowledge/ai-rules.md`](../migration-v1-to-v2/knowledge/ai-rules.md).
|
|
36
|
+
2. [`../migration-v1-to-v2/knowledge/features/staking.md`](../migration-v1-to-v2/knowledge/features/staking.md) — v1 `StakingError` → v2 `SodaxError<C>` with `feature: 'staking'`. If v1 code passed a spoke address into `getStakingInfo`, switch to `getStakingInfoFromSpoke(srcAddress, srcChainKey)` instead (v2 added it as the spoke-side wrapper; the hub-side `getStakingInfo(hubAddress)` is still public).
|
|
37
|
+
|
|
38
|
+
## Verification
|
|
39
|
+
|
|
40
|
+
1. `pnpm tsc --noEmit` clean.
|
|
41
|
+
2. Every `await sodax.staking.<method>(...)` has `if (!result.ok)`.
|
|
42
|
+
3. `getStakingInfo` call sites pass a hub address (not a spoke address); spoke-side reads use `getStakingInfoFromSpoke`.
|
|
43
|
+
|
|
44
|
+
## Related granular skills (same family)
|
|
45
|
+
|
|
46
|
+
- [`../migration/SKILL.md`](../migration/SKILL.md) — BALN → SODA migration also stakes (lockup periods 0–24 months); use it for BALN-specific lock flows.
|
|
47
|
+
- [`../recovery/SKILL.md`](../recovery/SKILL.md) — recovery for stuck staking-related assets.
|
|
48
|
+
|
|
49
|
+
For multi-feature tasks, load the broad [`sodax-sdk` skill](../SKILL.md).
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-sdk-swap
|
|
3
|
+
description: 'Granular skill for the @sodax/sdk v2 swap feature only — intent-based swaps via solver (market orders + limit orders) and cancel/approve flows. Use when the consumer has decided the task is a swap (e.g. "swap with Sodax", "Sodax intent swap", "limit order on Sodax", "cross-chain swap via Sonic", "cancel a Sodax intent") and you want to skip loading the broad sodax-sdk skill. Covers BOTH integration (write new v2 swap code) and migration (port v1 swap to v2) — picks via Step 1 question. Skill is intentionally short and links into the parent sodax-sdk knowledge tree (../integration/knowledge/, ../migration-v1-to-v2/knowledge/) for full reference. For React dapps doing swaps, prefer the sodax-dapp-kit skill instead.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Swap (Core SDK granular skill)
|
|
7
|
+
|
|
8
|
+
Granular skill for the swap feature of `@sodax/sdk` v2. Source-of-truth reference lives in the parent broad skill's knowledge tree — this file is the focused workflow only.
|
|
9
|
+
|
|
10
|
+
## Step 1 — Clarify with user before coding
|
|
11
|
+
|
|
12
|
+
Swap has materially different code paths depending on the answers. Don't skip:
|
|
13
|
+
|
|
14
|
+
1. **Are you writing new code, or porting v1 code to v2?**
|
|
15
|
+
- New code → § Integration workflow below.
|
|
16
|
+
- Port v1 → v2 → § Migration workflow.
|
|
17
|
+
2. **Signed flow (frontend wallet, browser/RN) or unsigned-tx flow (backend / custom relay)?**
|
|
18
|
+
- Signed → `raw: false` + `walletProvider`.
|
|
19
|
+
- Unsigned → `raw: true`, you handle relay yourself.
|
|
20
|
+
3. **One-shot `swap()` or step-by-step (`createIntent` → backend submit → `postExecution`)?**
|
|
21
|
+
- One-shot is the default for frontends. Step-by-step is for backends that already have a relay/orchestration layer.
|
|
22
|
+
4. **Market order or limit order?** Limit orders use a different params shape (no `deadline`).
|
|
23
|
+
|
|
24
|
+
## Integration workflow (writing new v2 swap code)
|
|
25
|
+
|
|
26
|
+
Read in order. Skipping `ai-rules.md` is the most common cause of agents reverting to v1 patterns.
|
|
27
|
+
|
|
28
|
+
1. [`../integration/knowledge/ai-rules.md`](../integration/knowledge/ai-rules.md) — DO / DO NOT list.
|
|
29
|
+
2. [`../integration/knowledge/features/swap.md`](../integration/knowledge/features/swap.md) — `SwapService` API surface, action params, return shapes, error codes (`feature: 'swap'`).
|
|
30
|
+
3. Path-specific recipe:
|
|
31
|
+
- Signed one-shot → [`../integration/knowledge/recipes/signed-tx-flow.md`](../integration/knowledge/recipes/signed-tx-flow.md)
|
|
32
|
+
- Backend step-by-step → [`../integration/knowledge/recipes/raw-tx-flow.md`](../integration/knowledge/recipes/raw-tx-flow.md) + [`../integration/knowledge/recipes/backend-server-init.md`](../integration/knowledge/recipes/backend-server-init.md)
|
|
33
|
+
4. Error handling for swap-specific codes (`INTENT_CREATION_FAILED`, `EXECUTION_FAILED`, `RELAY_TIMEOUT`, solver-side `EXTERNAL_API_ERROR`) → [`../integration/knowledge/recipes/result-and-errors.md`](../integration/knowledge/recipes/result-and-errors.md) and [`../integration/knowledge/reference/error-codes.md`](../integration/knowledge/reference/error-codes.md).
|
|
34
|
+
5. Cross-chain destination quirks (Stellar trustline, BTC PSBT, Solana PDA) → [`../integration/knowledge/chain-specifics.md`](../integration/knowledge/chain-specifics.md).
|
|
35
|
+
|
|
36
|
+
### Swap-specific anti-patterns
|
|
37
|
+
|
|
38
|
+
- **`try { await sodax.swaps.swap(...) } catch` for SDK-level failures.** v2 returns `Result<T>` — branch on `result.ok`. `catch` only fires for thrown exceptions (e.g. missing `walletProvider`), not for `RELAY_TIMEOUT` or `EXECUTION_FAILED`.
|
|
39
|
+
- **Forgetting the discriminator.** `raw: false` is required on signed swaps; without it TypeScript rejects `walletProvider`.
|
|
40
|
+
- **Calling `submitSwapTx` with the full `relayData` object.** The backend expects the `payload: string` field, not the wrapper.
|
|
41
|
+
|
|
42
|
+
## Migration workflow (port v1 swap to v2)
|
|
43
|
+
|
|
44
|
+
1. [`../migration-v1-to-v2/knowledge/ai-rules.md`](../migration-v1-to-v2/knowledge/ai-rules.md) — DO / DO NOT (read first).
|
|
45
|
+
2. [`../migration-v1-to-v2/knowledge/features/swap.md`](../migration-v1-to-v2/knowledge/features/swap.md) — v1 → v2 swap port playbook.
|
|
46
|
+
3. Cross-cutting renames (apply repo-wide before swap-specific edits) → [`../migration-v1-to-v2/knowledge/breaking-changes/type-system.md`](../migration-v1-to-v2/knowledge/breaking-changes/type-system.md).
|
|
47
|
+
4. Error code crosswalk (v1 `IntentError` → v2 `SodaxError<C>` with `feature: 'swap'`) → [`../migration-v1-to-v2/knowledge/reference/error-code-crosswalk.md`](../migration-v1-to-v2/knowledge/reference/error-code-crosswalk.md).
|
|
48
|
+
|
|
49
|
+
## Verification
|
|
50
|
+
|
|
51
|
+
1. `pnpm tsc --noEmit` from the consumer repo exits clean.
|
|
52
|
+
2. Every `await sodax.swaps.<method>(...)` call site has `if (!result.ok)` branching.
|
|
53
|
+
3. No `xToken.xChainId`, no `*_MAINNET_CHAIN_ID`, no `*SpokeProvider` references (migration only).
|
|
54
|
+
4. `isSodaxError(e)` (not bare `instanceof SodaxError`) in cross-bundle code.
|
|
55
|
+
|
|
56
|
+
## Related granular skills (same family)
|
|
57
|
+
|
|
58
|
+
- [`../money-market/SKILL.md`](../money-market/SKILL.md) — if the swap is followed by a supply/borrow action.
|
|
59
|
+
- [`../partner/SKILL.md`](../partner/SKILL.md) — partner fees on swap.
|
|
60
|
+
- [`../recovery/SKILL.md`](../recovery/SKILL.md) — stuck-asset recovery for failed swaps.
|
|
61
|
+
- [`../backend-api/SKILL.md`](../backend-api/SKILL.md) — `submitSwapTx` and intent / orderbook lookups (step-by-step swap flow + diagnostics).
|
|
62
|
+
|
|
63
|
+
For tasks spanning multiple features, load the broad [`sodax-sdk` skill](../SKILL.md) instead.
|
|
64
|
+
|
|
65
|
+
## Wallet provider (different SDK package family)
|
|
66
|
+
|
|
67
|
+
This skill treats `walletProvider` as a contract (`IEvmWalletProvider` etc.) — it does not instantiate one. For Node bots / scripts / non-React backends that need a wallet implementation (private-key EVM, Solana keypair, Stellar SDK, etc.), **also load the `sodax-wallet-sdk-core` skill (integration mode)**. That package ships ready-made `I*WalletProvider` classes for all 9 chain families.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sodax-wallet-sdk-core
|
|
3
|
+
description: 'INTEGRATION (write NEW code) — @sodax/wallet-sdk-core is the low-level multi-chain wallet layer (one provider class per chain family across 9 chain types: EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks). Each class accepts either a private-key config (Node scripts, CI, bots, indexers) or a browser-extension config (custom non-React browser flows) and signs + broadcasts transactions. Use whenever a backend, script, test, or non-React browser flow needs to instantiate a wallet provider directly — `EvmWalletProvider`, `SolanaWalletProvider`, etc. Triggers on "instantiate EvmWalletProvider", "sign a tx from a Node script", "wallet provider for backend", "private-key signing", "wallet-sdk-core setup", any `*WalletProvider` class name. For React dapps prefer `sodax-wallet-sdk-react` instead — most React consumers never touch this package directly and get a typed `IXxxWalletProvider` via `useWalletProvider(...)`. MIGRATION (port v1 → v2) — v1 → v2 changes are additive (same class names, same config-type names, same config shapes). The only mechanical migration is replacing deep imports from v1''s flat `wallet-providers/<chain>.ts` layout with barrel imports, plus optionally adopting the new `defaults` field and re-imported library types. Triggers on imports from `@sodax/wallet-sdk-core/wallet-providers/…`, bumping from an older RC, or adopting new additive `defaults` / `*WalletDefaults` / `*Policy` fields. Most projects don''t need a wallet-sdk-core migration — the real migration target is usually `@sodax/sdk` or `@sodax/types`. Load this skill if EITHER applies; the body gates by mode.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# When to use this skill
|
|
7
|
+
|
|
8
|
+
AGENTS.md routes you here when you're working with `@sodax/wallet-sdk-core` v2 — either writing new code or upgrading an older project.
|
|
9
|
+
|
|
10
|
+
**Pick your mode:**
|
|
11
|
+
|
|
12
|
+
- Writing NEW v2 code (greenfield wallet provider setup, no v1 deep imports)? → § **Integration mode** below.
|
|
13
|
+
- Upgrading EXISTING code (deep imports from `@sodax/wallet-sdk-core/wallet-providers/…`, bumping from an older RC)? → § **Migration mode** below. **Headline: v1 code drops in unchanged at the wallet-sdk-core surface** — if compile errors appear here, the real migration target is almost certainly `@sodax/sdk` or `@sodax/types` (load `sodax-sdk` skill instead).
|
|
14
|
+
|
|
15
|
+
For React consumers → use `sodax-wallet-sdk-react` (they get the typed wallet provider via `useWalletProvider(...)` and pass it to `@sodax/sdk` calls).
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Integration mode (writing new v2 code)
|
|
20
|
+
|
|
21
|
+
Direct usage of `@sodax/wallet-sdk-core` is the right choice for:
|
|
22
|
+
|
|
23
|
+
- Backend / Node scripts (CI tests, indexers, bots, server APIs).
|
|
24
|
+
- Custom browser flows that don't use React.
|
|
25
|
+
- Tests that need to sign with a deterministic key.
|
|
26
|
+
|
|
27
|
+
### Workflow
|
|
28
|
+
|
|
29
|
+
1. Read [`integration/knowledge/ai-rules.md`](./integration/knowledge/ai-rules.md) — DO / DON'T + workflow + stop conditions.
|
|
30
|
+
2. Read [`integration/knowledge/architecture.md`](./integration/knowledge/architecture.md) — mental model: `BaseWalletProvider`, dual-config discriminants (`{ type: 'PRIVATE_KEY', … }` vs `{ type: 'BROWSER_EXTENSION', … }`), shallow `defaults` merge, library-exports.
|
|
31
|
+
3. Read [`integration/knowledge/quickstart.md`](./integration/knowledge/quickstart.md) — copy-paste minimal example for the chain you need.
|
|
32
|
+
4. For your chain, read [`integration/knowledge/features/`](./integration/knowledge/features/) — per-chain config table + methods + gotchas (one file per chain family).
|
|
33
|
+
5. Task-specific recipes → [`integration/knowledge/recipes/`](./integration/knowledge/recipes/) — `setup-private-key.md`, `setup-browser-extension.md`, `sign-and-broadcast.md`, `defaults-and-overrides.md`, `library-exports.md`, `bridge-to-sdk.md` (pass provider to `@sodax/sdk`).
|
|
34
|
+
6. Lookups → [`integration/knowledge/reference/`](./integration/knowledge/reference/) — public API, provider classes, interfaces (`IXxxWalletProvider`), chain support, glossary.
|
|
35
|
+
|
|
36
|
+
### Conventions to follow (integration)
|
|
37
|
+
|
|
38
|
+
- **Dual-config discriminant.** Every chain's provider config has a `type` discriminator: `'PRIVATE_KEY'` (Node / scripts) or `'BROWSER_EXTENSION'` (consumer dApps). Pick one — don't merge them.
|
|
39
|
+
- **`defaults` is a shallow merge.** Each provider accepts a `defaults` field for per-method overrides (e.g. `waitForTransactionReceipt`, `gasPrice`). The merge into the per-call options is **shallow**, not deep. Top-level keys overwrite wholesale.
|
|
40
|
+
- **Use barrel imports**, not deep imports. Import classes from `@sodax/wallet-sdk-core`, not from `@sodax/wallet-sdk-core/wallet-providers/<chain>.ts`.
|
|
41
|
+
- **Re-import chain SDK types from the barrel.** `@sodax/wallet-sdk-core` re-exports the types you need (e.g. `WalletClient` from viem, `SuiClient` from `@mysten/sui`). Don't add the underlying SDK as a direct dep — risks version skew.
|
|
42
|
+
- **`IXxxWalletProvider` is the interface to pass into `@sodax/sdk`.** When bridging to the SDK, narrow with `useWalletProvider({ xChainId: ChainKeys.X })` (React) or just construct the provider directly and pass it in the SDK call payload (`{ raw: false, walletProvider }`).
|
|
43
|
+
|
|
44
|
+
### Top traps to avoid (integration)
|
|
45
|
+
|
|
46
|
+
1. **Mixing the two config variants.** `PRIVATE_KEY` and `BROWSER_EXTENSION` are mutually exclusive. Each chain's `*WalletProviderConfig` is a discriminated union — TypeScript catches mixing, but only if you don't use `as`.
|
|
47
|
+
2. **Adding viem / `@mysten/sui` / `@solana/web3.js` as a direct dep** when the type was importable from `@sodax/wallet-sdk-core`. See `integration/recipes/library-exports.md`.
|
|
48
|
+
3. **Deep-importing `@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider`**. v1's flat layout is gone; use barrel imports.
|
|
49
|
+
4. **Expecting `defaults` to deep-merge.** It doesn't — top-level keys overwrite wholesale.
|
|
50
|
+
5. **Trying to extend `BaseWalletProvider` directly** in consumer code. That's a maintainer-only path — write a thin wrapper over an existing provider instead.
|
|
51
|
+
|
|
52
|
+
### Verification (integration)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm tsc --noEmit # must exit clean
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If errors mention `@sodax/wallet-sdk-core`, look up the symbol in `integration/knowledge/reference/`. If the symbol isn't there, stop and ask the user — don't invent classes.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Migration mode (v1 → v2 porting)
|
|
63
|
+
|
|
64
|
+
Pick this mode ONLY if you see one of these patterns:
|
|
65
|
+
|
|
66
|
+
- Deep imports: `import { … } from '@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider'` (or similar per-chain file).
|
|
67
|
+
- Bumping `@sodax/wallet-sdk-core` from an older RC and wanting to adopt new additive features (`defaults`, `*WalletDefaults`, `*Policy` types).
|
|
68
|
+
|
|
69
|
+
The package name **did not change** across versions. Class names, config-type names, and config shapes are **identical** v1 → v2. **No mandatory edits** at the wallet-sdk-core surface — v1 code drops in unchanged.
|
|
70
|
+
|
|
71
|
+
If a project does more than the deep-import cleanup at this surface, the real migration target is almost certainly `@sodax/sdk` (chain-key renames, Result<T>, error model) or `@sodax/types`. Route to the `sodax-sdk` skill (migration mode) instead.
|
|
72
|
+
|
|
73
|
+
### Workflow
|
|
74
|
+
|
|
75
|
+
1. Read [`migration-v1-to-v2/knowledge/ai-rules.md`](./migration-v1-to-v2/knowledge/ai-rules.md) — DO / DON'T + workflow. **The headline: v1 code drops in unchanged.**
|
|
76
|
+
2. Read [`migration-v1-to-v2/knowledge/README.md`](./migration-v1-to-v2/knowledge/README.md) — what (additively) changed, read order, TL;DR.
|
|
77
|
+
3. Read the breaking-change writeups under [`breaking-changes/`](./migration-v1-to-v2/knowledge/breaking-changes/) — `folder-layout.md` (deep-import → barrel), `defaults-config.md`, `base-wallet-provider.md`, `library-exports.md`.
|
|
78
|
+
4. For mechanical changes, apply the recipes in [`recipes/`](./migration-v1-to-v2/knowledge/recipes/) — `adopt-defaults.md`, `adopt-library-exports.md`. **Both are optional** — they're cleanup paths, not requirements.
|
|
79
|
+
5. Confirm no renames / deletions exist by checking [`reference/`](./migration-v1-to-v2/knowledge/reference/) — `renamed-symbols.md` (empty), `deleted-exports.md` (empty), `added-fields.md` (additive new surface).
|
|
80
|
+
6. Verify with [`checklist.md`](./migration-v1-to-v2/knowledge/checklist.md).
|
|
81
|
+
|
|
82
|
+
### Top mechanical changes
|
|
83
|
+
|
|
84
|
+
1. **Deep imports → barrel imports.** Replace `import { EvmWalletProvider } from '@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider'` with `import { EvmWalletProvider } from '@sodax/wallet-sdk-core'`. The flat `wallet-providers/*.ts` layout is gone.
|
|
85
|
+
2. **(Optional) Re-import chain SDK types from the barrel.** Replace direct imports of `WalletClient` (viem), `SuiClient` (@mysten/sui), etc. with re-exports from `@sodax/wallet-sdk-core`. Removes the underlying SDK as a direct dep, eliminates version skew. See `recipes/adopt-library-exports.md`.
|
|
86
|
+
3. **(Optional) Adopt `defaults` field.** New `defaults` (shallow-merge) field on each provider's config lets you set per-method overrides centrally. See `recipes/adopt-defaults.md`.
|
|
87
|
+
|
|
88
|
+
### Top traps to avoid (migration)
|
|
89
|
+
|
|
90
|
+
1. **Treating this as a real migration.** It isn't — v1 code drops in unchanged at the wallet-sdk-core surface. If the consumer's compile errors point at this package, look one layer deeper — they're almost certainly `@sodax/types` renames bleeding through (e.g. `xChainId` → `chainKey`) and the real fix is in the `sodax-sdk` skill (migration mode).
|
|
91
|
+
2. **Extending `BaseWalletProvider` in consumer code.** That's a maintainer path. If a project subclasses it, scope confirmation with the user before touching anything.
|
|
92
|
+
|
|
93
|
+
### Stop conditions (defer to user)
|
|
94
|
+
|
|
95
|
+
| Signal | Why stop |
|
|
96
|
+
|---|---|
|
|
97
|
+
| Compile errors mention `@sodax/sdk` or `@sodax/types` symbols | Not this migration. Route to `sodax-sdk` skill (migration mode). |
|
|
98
|
+
| Project extends `BaseWalletProvider` with non-trivial logic | Maintainer-only path. Confirm scope first. |
|
|
99
|
+
| User wants a chain family not in `integration/knowledge/reference/chain-support.md` | Adding a new chain is a maintainer task. |
|
|
100
|
+
|
|
101
|
+
### Verification (migration)
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
pnpm tsc --noEmit # must exit clean
|
|
105
|
+
# No leftover deep imports from v1's flat layout:
|
|
106
|
+
grep -rE "from '@sodax/wallet-sdk-core/wallet-providers/" src/ # empty
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
# Related skills
|
|
112
|
+
|
|
113
|
+
- `sodax-sdk` — pass the constructed provider into SDK calls (`{ raw: false, walletProvider }`); SDK-side v1 → v2 work happens there.
|
|
114
|
+
- `sodax-wallet-sdk-react` — for React dapps; this skill is only relevant if NOT using React.
|