/sodax-skills:sodax-sdkfrom sodax-skills
Integrates SODAX cross-chain DeFi into backend, Node scripts, bots, or indexers using @sodax/sdk v2. Covers intent-based swaps, limit orders, money market lending/borrowing, staking, bridging, concentrated-liquidity DEX, leverage-yield vaults, token migration, partner fees, stuck-asset recovery, and Stellar sponsoring.
Ships in sodax-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
AGENTS.md routes you here when you're working with @sodax/sdk v2 — either writing new code or porting from v1.
Pick your mode:
useSpokeProvider, *_MAINNET_CHAIN_ID, xChainId, SpokeChainId, module-specific error classes)? → § Migration mode below.For React dapps using hooks → use sodax-dapp-kit instead (this skill is still relevant for any unwrapped SDK call).
If the user has already picked a single feature, load the matching granular skill instead of this broad one — it loads ~3 KB of focused workflow vs this file's ~13 KB and links directly into the right knowledge files. The granular skills sit in the same family (sdk) and cover both integration and migration via internal cross-links.
| Feature | Granular skill | Trigger phrases |
|---|---|---|
| Intent-based swap (market + limit orders) | ./swap/SKILL.md | "swap with Sodax", "limit order", "cancel intent" |
| Cross-chain lending / borrowing | ./money-market/SKILL.md | "supply", "borrow", "withdraw collateral", "repay" |
| Direct token bridge via vault | ./bridge/SKILL.md | "bridge tokens", "cross-chain transfer" |
| SODA ↔ xSoda staking | ./staking/SKILL.md | "stake SODA", "instant unstake", "claim staking rewards" |
| Concentrated-liquidity LP | ./dex/SKILL.md | "LP position", "concentrated liquidity", "deposit hub assets" |
| ICX / bnUSD / BALN token migration to SODAX | ./migration/SKILL.md | "migrate ICX", "legacy bnUSD", "BALN lockup" (NOT v1→v2 SDK porting) |
| Partner fees | ./partner/SKILL.md | "claim partner fee", "partner auto-swap preference", "approve partner fee token" |
| Stuck-asset recovery | ./recovery/SKILL.md | "recover stuck assets on Sonic", "RecoveryService", "withdrawHubAsset" |
| Sponsored Stellar account activation | ./sponsoring/SKILL.md | "activate a Stellar account", "user has no XLM", "sponsor base reserve", "sodax.sponsoring" |
| Backend HTTP client (intents, orderbook, MM reads) | ./backend-api/SKILL.md | "getIntentByHash", "Sodax backend API", "orderbook", "custom IConfigApiV1" |
| Swaps API client (quote, create-intent, submit-tx, fees) | ./swaps-api/SKILL.md | "sodax.api.swaps", "swap quote from backend", "submit swap tx", "swaps API v2" |
Leverage-yield vaults (lsoda* deposit/withdraw, vault APR, listVaults) and leverage positions | ./leverage-yield/SKILL.md | "leverage yield vault", "deposit into a vault", "sodax.leverageYield", "open a leverage position" |
| Leverage Yield API client (vault reads, APR, deposit/withdraw quote + intents) | ./leverage-yield-api/SKILL.md | "sodax.api.leverageYield", "vault APR from backend", "vault position from API", "leverage-yield API v2" |
| Bridge API client (allowance/approve, create-intent, submit-tx, tokens, fee/bridgeable discovery) | ./bridge-api/SKILL.md | "sodax.api.bridge", "createBridgeIntent via backend", "submit bridge tx", "bridge API v2" |
Load this broad skill (keep reading below) when:
This skill documents the SDK call sites — what to import, how to construct Sodax, which method to call, and how to handle the Result<T>. It does not prescribe application-layer concerns.
IEvmWalletProvider, ISolanaWalletProvider, etc.) → load the sodax-wallet-sdk-core skill (integration mode). It ships ready-made provider classes for all 9 chain families, both private-key (Node / scripts) and browser-extension modes. This skill only treats wallet providers as a contract (declare const evmWallet: IEvmWalletProvider).sodax-dapp-kit skill instead of this one.sodax-wallet-sdk-react skill.sodax.config. The SDK exposes sodax.config.findSupportedTokenBySymbol(chainKey, symbol) for per-chain lookups and sodax.bridge.getBridgeableTokens(from, to, token) / sodax.bridge.isBridgeable({ from, to }) for vault-pair checks. There is no exhaustive "all bridgeable pairs across all chains" table — derive it at runtime if needed.If the consumer needs a runnable end-to-end app (Node bot, CLI, full dApp), the right combination is: this skill (for SDK call sites) + sodax-wallet-sdk-core (for wallet providers) + the consumer's chosen framework code. The SDK does not ship an app skeleton.
Pick this mode when the consumer is writing new v2 code that calls @sodax/sdk directly (no React wrapper). Common signals:
Sodax.@sodax/dapp-kit.Follow in order. Skipping ai-rules.md is the most common cause of agents reverting to v1 patterns.
integration/knowledge/ai-rules.md — DO / DO NOT / workflow / stop conditions.integration/knowledge/quickstart.md — install, initialize, first-run troubleshooting.integration/knowledge/features/ — swap.md, money-market.md, staking.md, bridge.md, dex.md, leverage-yield.md, migration.md, partner.md, recovery.md, sponsoring.md, backend-api.md, swaps-api.md, bridge-api.md, leverage-yield-api.md.integration/knowledge/recipes/.integration/knowledge/reference/.integration/knowledge/chain-specifics.md.srcChainKey: ChainKeys.ETHEREUM_MAINNET on the request payload — the SDK routes internally and TypeScript narrows walletProvider to the chain-specific interface via GetWalletProviderType<K>. There are no *SpokeProvider classes to construct.Result<T>. Branch on result.ok. No throws across service boundaries. Sub-Result forwarding is the default: if (!sub.ok) return sub.SodaxError<C>. A single class with a closed 13-code reason vocabulary plus a feature field. The pair (feature, code) is your discriminator. Use isSodaxError(e) (not bare instanceof).WalletProviderSlot<K, Raw> enforces at compile time: { raw: false, walletProvider } for signing, { raw: true } for unsigned-tx building. Mixing them is a TypeScript error.sodax.config; tokens come from the installed version. Always read via sodax.config.* (e.g. sodax.config.spokeChainConfig[chainKey]). Direct imports of spokeChainConfig / sodaxConfig from @sodax/types / @sodax/sdk are packaged-default snapshots and silently miss new Sodax(config) overrides. Feature services accept only tokens bundled with the installed @sodax/sdk; for newer ones see recipes/initialize-sodax.md § "Where supported tokens come from".The DO / DO NOT / verification checklist lives in integration/knowledge/ai-rules.md — read it before writing any call site. The biggest source of generated v1-style code is skipping it.
Pick this mode when the consumer has existing v1 SDK code that needs to compile against v2. Common signals (grep for these):
grep -rE '_MAINNET_CHAIN_ID\b|\bSpokeProvider\b|\bxChainId\b|\bSpokeChainId\b|hubAssets|moneyMarketSupportedTokens' src/
grep -rE 'instanceof (MoneyMarketError|IntentError|StakingError|BridgeError|MigrationError|AssetServiceError|ConcentratedLiquidityError|RelayError)' src/
If the consumer has v1 fingerprints AND also wants new features: do migration first.
migration-v1-to-v2/knowledge/ai-rules.md — DO / DO NOT / workflow / stop conditions. Read first — prevents the most common porting mistakes.migration-v1-to-v2/knowledge/README.md — overview, reading order, cross-cutting checklist, v1↔v2 glossary.breaking-changes/type-system.md — renames at @sodax/types, ChainKeys, WalletProviderSlot, RpcConfig, IConfigApiV1 Result.breaking-changes/architecture.md — *SpokeProvider deletion, ConfigService, relay reshape.breaking-changes/result-and-errors.md — throws → Result<T>; module errors → SodaxError<C>; v1↔v2 code crosswalk.features/ — swap.md, money-market.md, staking.md, bridge.md, dex.md, migration.md, partner.md, recovery.md, backend-api.md — read only the ones the consumer uses.recipes.md.reference/ — deleted-exports.md, error-code-crosswalk.md, return-shapes.md, sodax-config.md.Apply in this order — type-level changes don't affect behavior; runtime patterns require thinking.
| v1 | v2 | Codemod |
|---|---|---|
*_MAINNET_CHAIN_ID | ChainKeys.*_MAINNET | regex (\w+)_MAINNET_CHAIN_ID → ChainKeys.$1_MAINNET |
XToken.xChainId (and tokens-likes) | XToken.chainKey | field rename |
SpokeChainId / ChainId | SpokeChainKey | type rename |
Token | XToken | type rename |
AddressType (BTC) | BtcAddressType | only at @sodax/types import sites |
Then on every signed-call payload: drop spokeProvider, add walletProvider, add raw: false discriminator, rename intentParams → params. Plus add srcChainKey + srcAddress to every action params object (MM, staking, deposit, …).
The full DO / DO NOT list, mode-specific pitfalls, and verification protocol live in migration-v1-to-v2/knowledge/ai-rules.md — read it before touching any call site. Highest-leverage rule: every await sodax.<feature>.<method>(...) call site must have if (!result.ok) branching.
sodax-wallet-sdk-core — set up a wallet provider for signing flows (integration mode) or upgrade an existing wallet-sdk-core surface (migration mode).sodax-dapp-kit — React hooks wrapping this SDK.sodax-wallet-sdk-react — React wallet connectivity layer.integration/knowledge/README.md (opens in a new tab)integration/knowledge/ai-rules.md (opens in a new tab)integration/knowledge/architecture.md (opens in a new tab)integration/knowledge/chain-specifics.md (opens in a new tab)integration/knowledge/features/README.md (opens in a new tab)integration/knowledge/features/backend-api.md (opens in a new tab)integration/knowledge/features/bridge-api.md (opens in a new tab)integration/knowledge/features/bridge.md (opens in a new tab)integration/knowledge/features/dex.md (opens in a new tab)integration/knowledge/features/leverage-yield-api.md (opens in a new tab)integration/knowledge/features/leverage-yield.md (opens in a new tab)integration/knowledge/features/migration.md (opens in a new tab)integration/knowledge/features/money-market.md (opens in a new tab)integration/knowledge/features/partner.md (opens in a new tab)integration/knowledge/features/recovery.md (opens in a new tab)integration/knowledge/features/sponsoring.md (opens in a new tab)integration/knowledge/features/staking.md (opens in a new tab)integration/knowledge/features/swap.md (opens in a new tab)integration/knowledge/features/swaps-api.md (opens in a new tab)integration/knowledge/quickstart.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/sodax-dapp-kitIntegrate SODAX into a React dapp with @sodax/dapp-kit — React Query hooks for swaps, money market lending/borrowing, staking, bridging, DEX liquidity, leverage-yield vaults (deposit/withdraw, APR / TVL / health) and leverage positions, token migration, Bitcoin trading (Radfi / Bound Exchange), partner fees, recovery, and backend API reads. INTEGRATION (write NEW code) — use whenever a React dapp needs SODAX feature hooks; backend code uses `@sodax/sdk`. Triggers on "use @sodax/dapp-kit", "useSwap", "useMoneyMarket", "useStake", "useBridge", "useDex", "useMigrate", "useLeverageYield", "leverage yield vault in React", "vault UI", any dapp-kit `use<Feature>` hook, "Sodax React hooks". v2 hook shape: mutation hooks return `SafeUseMutationResult` with `mutateAsyncSafe(vars): Promise<Result<TData>>`; mutationFn throws on SDK `!ok`; hooks own their invalidations. MIGRATION (port v1 → v2) — single-object hook params, mandatory `mutateAsyncSafe`, hook-owned invalidations, canonical queryKey/mutationKey conventions, on top of the reshaped SDK (chain-key-driven routing, `Result<T>` everywhere, `WalletProviderSlot<K, Raw>`). Triggers on "migrate @sodax/dapp-kit", "useSpokeProvider gone", "dapp-kit v1 → v2", "invalidateMmQueries broken", "dapp-kit hook signatures changed", v1 fingerprints (positional args, hook-init `spokeProvider`, `useSpokeProvider`, `invalidateMmQueries`, legacy `useMigrate`, `*_MAINNET_CHAIN_ID`). Load this skill if EITHER applies; the body gates by mode./sodax-Other plugins' skills for the same job
Generated from the plugin's indexed repository (gosodax/sodax-sdks) — no native marketplace selected
npx claudepluginhub p/icon-project-sodax-skills