/sodax-skills:sodax-dapp-kitfrom sodax-skills
Integrates SODAX DeFi into React dapps via @sodax/dapp-kit — React Query hooks for swaps, lending, staking, bridging, DEX liquidity, leverage-yield vaults, token migration, and Bitcoin trading. Handles both new v2 integration and v1-to-v2 migration.
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/dapp-kit v2 — either writing new code or porting from v1.
Pick your mode:
useSpokeProvider, invalidateMmQueries, legacy useMigrate, *_MAINNET_CHAIN_ID)? → § Migration mode below.For backend / Node → use sodax-sdk (dapp-kit is React-only).
Every dapp-kit consumer also needs wallet connectivity — also load sodax-wallet-sdk-react.
If the user has already picked one feature, load the matching granular skill instead of this broad one. It is a few KB of focused workflow and links straight into the right knowledge files, for integration and, where a v1 surface existed, migration.
| Feature | Granular skill | Trigger phrases |
|---|---|---|
| Intent-based swap (market + limit orders) | ./swap/SKILL.md | "useSwap", "useQuote", "limit order in React" |
| Cross-chain lending / borrowing | ./money-market/SKILL.md | "useSupply", "useBorrow", "money market UI" |
| SODA ↔ xSODA staking | ./staking/SKILL.md | "useStake", "instant unstake", "staking UI" |
| Direct token bridge via vault | ./bridge/SKILL.md | "useBridge", "bridge tokens in React" |
| Concentrated-liquidity LP | ./dex/SKILL.md | "useSupplyLiquidity", "LP position UI", "usePools" |
| Leverage-yield vaults and leverage positions (on-chain hooks; a user-facing vault screen starts from the product anatomy) | ./leverage-yield/SKILL.md | "leverage yield vault", "vault UI / screen / dashboard", "deposit into a vault", "lsoda shares", "vault APR / TVL", "useLeverageYieldDeposit", "useLeverageYieldVaultSwap", "open a leverage position" |
| ICX / bnUSD / BALN token migration | ./migration/SKILL.md | "useMigrateIcxToSoda", "migrate bnUSD" (NOT v1→v2 porting) |
| Bitcoin trading via Radfi | ./bitcoin/SKILL.md | "useRadfiAuth", "trading wallet", "Bound Exchange" |
| Partner fees, recovery, backend reads, the Swaps / Bridge / Leverage Yield API hooks, Stellar account activation, shared utilities (balances, gas, trustlines) | ./auxiliary-services/SKILL.md | "useFeeClaimSwap", "useWithdrawHubAsset", "useBackendIntentByTxHash", "useSwapsApiQuote", "useLeverageYieldApi*", "useStellarGate", "useXBalances" |
Load this broad skill (keep reading below) when the feature is undecided, the task spans several features, or the consumer is porting a full v1 codebase.
Pick this mode when the consumer is a React dapp using @sodax/dapp-kit hooks. Common signals:
useSwap, useMoneyMarket*, useStake, useBridge, useDex*, useLeverageYield*, useMigrate*, useRadfi*, usePartner*, useRecovery*.SodaxProvider, createSodaxQueryClient.mutateAsyncSafe.onSuccess (note: hook-owned invalidations already run; yours runs after).integration/knowledge/ai-rules.md — DO / DO NOT / workflow / stop conditions.integration/knowledge/quickstart.md — install + wire providers + first feature.integration/knowledge/architecture.md — hook shapes, queryKey conventions, useSafeMutation, unwrapResult, Result<T>.integration/knowledge/features/ — swap.md, money-market.md, staking.md, bridge.md, dex.md, leverage-yield.md (vaults + leverage positions), migration.md, bitcoin.md (Bound Exchange, dapp-kit-unique), auxiliary-services.md (partner + recovery + backend + shared).integration/knowledge/recipes/ — setup.md, wallet-connectivity.md, per-feature, mutation-error-handling.md, observability.md, invalidations.md. Building a user-facing leverage-yield vault screen → leverage-yield-product-anatomy.md.integration/knowledge/reference/ — hooks-index.md, querykey-conventions.md, public-api.md, glossary.md.{ mutationOptions } at hook-init; query hooks take { params, queryOptions }. ALL domain inputs (params, walletProvider, per-call config) flow through mutate(vars) for mutations.SafeUseMutationResult — extends React Query's UseMutationResult with mutateAsyncSafe(vars): Promise<Result<TData>> (never rejects). Use mutateAsyncSafe for sequenced flows; mutateAsync for try/catch flows; mutate for fire-and-forget render-driven flows.mutationFn throws on SDK !ok. dapp-kit calls unwrapResult on the SDK's Result<T>, throwing on failure. This makes React Query's native error model engage (isError, error, onError, retry, devtools). mutateAsyncSafe packages the throw back into Result<T> for ergonomic branching.onSuccess, derived from vars. Consumer-provided onSuccess runs after. v1's manual invalidateMmQueries utilities are gone.[feature, action, ...identifiers]. First segment matches the directory name (swap, mm, bridge, staking, dex, leverageYield, bitcoin, partner, recovery, backend, shared, migrate). camelCase. Bigints stringified.useMutation directly — consumers depend on mutateAsyncSafe.mutateAsyncSafe's Result.ok for sequenced flows. The user-reject case is modal, not exceptional.ChainKeys.* over hard-coded chain strings. The set evolves per release.spokeProvider. It's not a v2 concept. walletProvider flows through mutate(vars) for signed flows.onSuccess runs after for any extra logic.import { useSwap, SodaxProvider, createSodaxQueryClient } from '@sodax/dapp-kit'. dapp-kit re-exports @sodax/sdk's public surface (ChainKeys, SodaxConfig, types) — you can import them from dapp-kit directly.@sodax/types as a dependency — re-exported via @sodax/sdk.useSpokeProvider. Deleted. Pass walletProvider from useWalletProvider({ xChainId: chainKey }) (@sodax/wallet-sdk-react) directly into mutate(vars).data as Result<T>. v2's mutationFn unwraps before resolving — data is the unwrapped success value (e.g. SwapResponse, TxHashPair). For SDK failures, look at mutation.error or use mutateAsyncSafe for the Result<T> shape.try/catch on mutateAsync. v2's mutateAsync rejects on SDK !ok. Prefer mutateAsyncSafe (never rejects).spokeProvider / params. v1 hooks took these positionally or at hook-init. v2 hooks take only { mutationOptions } (mutations) or { params, queryOptions } (queries). All domain inputs live in mutate(vars) for mutations.xToken.xChainId or hard-coding *_MAINNET_CHAIN_ID. SDK leakage — these were renamed: XToken.chainKey, ChainKeys.X_MAINNET.pnpm tsc --noEmit # must exit clean
In browser:
data with the unwrapped success value.!ok errors arrive via mutation.error (when using mutate / mutateAsync) or as result.ok === false (when using mutateAsyncSafe).Pick this mode when the consumer has v1 dapp-kit patterns. Grep signals:
grep -rE 'useSpokeProvider|invalidateMmQueries|useMigrate\b' src/
grep -rE '_MAINNET_CHAIN_ID\b|\bxChainId\b' src/
If the project has both v1 patterns AND wants new features: migration first, then integration. Stale v1 patterns leak into new code if you skip it.
The SDK underneath also changed — load the sodax-sdk skill (migration mode) alongside this one (the migration trees cross-link).
migration-v1-to-v2/knowledge/ai-rules.md — DO / DO NOT / workflow / stop conditions.migration-v1-to-v2/knowledge/README.md — overview, reading order, glossary.checklist.md — top-down cross-cutting steps.breaking-changes/hook-signatures.md — single-arg policy + ReadHookParams / MutationHookParams.breaking-changes/result-handling.md — Result<T> success-path → throws; mutateAsyncSafe.breaking-changes/querykey-conventions.md — camelCase + default mutationKey.breaking-changes/sdk-leakage.md — cross-links to SDK migration tree.features/ — swap.md, money-market.md, staking.md, bridge.md, dex.md, migration.md, bitcoin.md, auxiliary-services.md.recipes.md.reference/ — deleted-hooks.md (e.g. useSpokeProvider, invalidateMmQueries, legacy useMigrate), renamed-hooks.md, error-shape-crosswalk.md.useSpokeProvider. Deleted. Pass walletProvider from useWalletProvider({ xChainId: chainKey }) (@sodax/wallet-sdk-react) directly into mutate(vars).data as Result<T>. v2's mutationFn unwraps before resolving — data is the unwrapped success value.try/catch on mutateAsync. v2's mutateAsync rejects on SDK !ok. Prefer mutateAsyncSafe (never rejects).spokeProvider / params. v1 hooks took these positionally or at hook-init. v2 hooks take only { mutationOptions } (mutations) or { params, queryOptions } (queries). All domain inputs live in mutate(vars) for mutations.xToken.xChainId or hard-coding *_MAINNET_CHAIN_ID. SDK leakage. Renamed: XToken.chainKey, ChainKeys.X_MAINNET.pnpm tsc --noEmit # must exit clean
grep -rE 'useSpokeProvider|invalidateMmQueries\b' src/ # empty
Manual:
mutateAsyncSafe and branch on result.ok.onSuccess runs after, doesn't duplicate them).sodax-wallet-sdk-react — wire the wallet, get the walletProvider to feed into dapp-kit mutate(vars).sodax-sdk — for any direct SDK call alongside dapp-kit hooks (and where the SDK-level v1 → v2 work happens).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/features/README.md (opens in a new tab)integration/knowledge/features/auxiliary-services.md (opens in a new tab)integration/knowledge/features/bitcoin.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.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/staking.md (opens in a new tab)integration/knowledge/features/swap.md (opens in a new tab)integration/knowledge/quickstart.md (opens in a new tab)integration/knowledge/recipes/README.md (opens in a new tab)integration/knowledge/recipes/backend-queries.md (opens in a new tab)integration/knowledge/recipes/bitcoin.md (opens in a new tab)integration/knowledge/recipes/bridge.md (opens in a new tab)integration/knowledge/recipes/dex.md (opens in a new tab)integration/knowledge/recipes/invalidations.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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-skills4 skills in this plugin
/sodax-sdkIntegrate SODAX cross-chain DeFi into a backend, Node script, bot, indexer, or non-React app with @sodax/sdk — intent-based swaps and limit orders, money market lending/borrowing, staking, bridging, concentrated-liquidity DEX, leverage-yield vaults (lsoda* deposit/withdraw, vault APR) and leverage positions, ICX/bnUSD/BALN token migration, partner fees, stuck-asset recovery, Stellar sponsoring, and the typed backend API clients, with Sonic as the hub. INTEGRATION (write NEW v2 code) — use whenever non-React code calls `@sodax/sdk` directly. Triggers on "use @sodax/sdk", "swap with Sodax", "Sodax bridge", "Sodax money market", "Sodax staking", "leverage yield vault", "sodax.leverageYield", "cross-chain DeFi", "Sonic hub", any `Sodax` / `ChainKeys` / `Result<T>` / `SodaxError` symbol. React dapps: prefer `sodax-dapp-kit`. MIGRATION (port v1 → v2) — v2 replaced `*SpokeProvider` classes with chain-key-driven routing, throws with `Result<T>`, module-specific error unions with `SodaxError<C>`, ad-hoc wallet/raw branching with `WalletProviderSlot<K, Raw>`, and static lookup tables with `ConfigService`. Triggers on "migrate Sodax v1", "upgrade @sodax/sdk", "v1 → v2", "useSpokeProvider broken", "Sodax error types changed", v1 fingerprints (`_MAINNET_CHAIN_ID`, `*SpokeProvider`, `xChainId`, `SpokeChainId`, `MoneyMarketError`/`IntentError`/`StakingError`/`BridgeError`/`MigrationError`/`AssetServiceError`/`ConcentratedLiquidityError`/`RelayError`). Load this skill if EITHER applies; the body gates by mode./sodax-wallet-sdk-coreSign and broadcast SODAX transactions from a backend, script, CI, bot, or non-React app with @sodax/wallet-sdk-core — one wallet-provider class per chain family (EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks, Tron). INTEGRATION (write NEW code) — each class accepts a private-key config (Node scripts, CI, bots, indexers) or a browser-extension config (custom non-React browser flows). Use whenever non-React code must instantiate a wallet provider directly. 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` — React consumers get a typed `IXxxWalletProvider` via `useWalletProvider(...)`. MIGRATION (port v1 → v2) — changes are additive (same class, config-type and config-shape names). The only mechanical step 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 `defaults` / `*WalletDefaults` / `*Policy` fields. Most projects need no wallet-sdk-core migration — the real target is usually `@sodax/sdk` or `@sodax/types`. Load this skill if EITHER applies; the body gates by mode./sodax-wallet-sdk-reactAdd SODAX multi-chain wallet connectivity to a React dapp with @sodax/wallet-sdk-react — connect/disconnect, account & signing hooks, a headless wallet modal, EVM chain switching, WalletConnect, Privy email login, and bridging the connected wallet into @sodax/sdk. INTEGRATION (write NEW code) — `SodaxWalletProvider` setup and hook-based UX across EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks and Tron; WalletConnect for non-injected wallets (Fireblocks/Ledger/mobile); `useWalletProvider` for signing SODAX calls. Triggers on "add wallet connect", "set up SodaxWalletProvider", "useXConnect", "useXAccount", "useWalletProvider", "useWalletModal", "wallet modal", "connect button", "multi-chain wallet UI", "WalletConnect for Fireblocks", "email login with Privy". Peer deps: `react >= 19`, `@tanstack/react-query 5.x`. MIGRATION (port v1 → v2) — `useXWagmiStore` left the public API (replace each selector with `useXServices` / `useXService({ xChainType })` / `useXConnections` / `useXConnection({ xChainType })`; do NOT rename to `useXWalletStore`, which is not exported), hooks take single-object params, `SodaxWalletProvider` takes `config: SodaxWalletConfig` (no `rpcConfig` / `options` / `initialState`), and chain slots are top-level on `SodaxWalletConfig` (no `chains: { EVM, … }` wrapper). Triggers on "useXWagmiStore is gone", "SodaxWalletProvider props broke", "old wallet-sdk-react hooks", "upgrade @sodax/wallet-sdk-react". Load this skill if EITHER applies; the body gates by mode.