/sodax-skills:sodax-wallet-sdk-corefrom sodax-skills
Guides integration and migration for @sodax/wallet-sdk-core v2 — signing/broadcasting SODAX transactions from backends, scripts, CI, bots, or non-React apps using chain-specific wallet providers (EVM, Solana, Sui, Bitcoin, Stellar, ICON, Injective, NEAR, Stacks, Tron).
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/wallet-sdk-core v2 — either writing new code or upgrading an older project.
Pick your mode:
@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).For React consumers → use sodax-wallet-sdk-react (they get the typed wallet provider via useWalletProvider(...) and pass it to @sodax/sdk calls).
If the task targets one chain family, load its granular skill instead of this broad one. It covers that provider's config, methods and gotchas, for both integration and migration.
| Chain family | Granular skill | Trigger phrases |
|---|---|---|
| EVM (Sonic hub + every EVM spoke) | ./evm/SKILL.md | "instantiate EvmWalletProvider", "viem wallet for Sonic / Base / Arbitrum" |
| Solana | ./solana/SKILL.md | "SolanaWalletProvider", "sign a Solana tx from Node" |
| Sui | ./sui/SKILL.md | "SuiWalletProvider", "Sui signing from a script" |
| Bitcoin (PSBT) | ./bitcoin/SKILL.md | "BitcoinWalletProvider", "sign a PSBT" |
| Stellar | ./stellar/SKILL.md | "StellarWalletProvider", "Stellar signing from a backend" |
| ICON | ./icon/SKILL.md | "IconWalletProvider", "Hana wallet relay" |
| Injective | ./injective/SKILL.md | "InjectiveWalletProvider", "Injective MsgBroadcaster" |
| NEAR | ./near/SKILL.md | "NearWalletProvider", "NEAR signing from Node" |
| Stacks | ./stacks/SKILL.md | "StacksWalletProvider", "Stacks signing from a script" |
| Tron | ./tron/SKILL.md | "TronWalletProvider", "TronLink signing outside React" |
Load this broad skill (keep reading below) when the task spans several chain families or the chain is undecided.
Direct usage of @sodax/wallet-sdk-core is the right choice for:
integration/knowledge/ai-rules.md — DO / DON'T + workflow + stop conditions.integration/knowledge/architecture.md — mental model: BaseWalletProvider, dual-config discriminants (Bitcoin/Stellar via an explicit type field, every other chain via field presence), shallow defaults merge, library-exports.integration/knowledge/quickstart.md — copy-paste minimal example for the chain you need.integration/knowledge/features/ — per-chain config table + methods + gotchas, one file per chain family: evm.md, solana.md, sui.md, bitcoin.md, stellar.md, icon.md, injective.md, near.md, stacks.md, tron.md.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).integration/knowledge/reference/ — public API, provider classes, interfaces (IXxxWalletProvider), chain support, glossary.type discriminator ('PRIVATE_KEY' for Node / scripts or 'BROWSER_EXTENSION' for consumer dApps); every other chain discriminates by field presence (e.g. privateKey vs walletClient/wallet). Either way, pick ONE variant — don't merge them.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.@sodax/wallet-sdk-core, not from @sodax/wallet-sdk-core/wallet-providers/<chain>.ts.@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.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 }).PRIVATE_KEY and BROWSER_EXTENSION are mutually exclusive. Most configs pick their variant by field presence, so TypeScript accepts a mixed config; only a type field discriminates one, and only if you don't use as.@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.@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider. v1's flat layout is gone; use barrel imports.defaults to deep-merge. It doesn't — top-level keys overwrite wholesale.BaseWalletProvider directly in consumer code. That's a maintainer-only path — write a thin wrapper over an existing provider instead.pnpm tsc --noEmit # must exit clean
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.
Pick this mode ONLY if you see one of these patterns:
import { … } from '@sodax/wallet-sdk-core/wallet-providers/EvmWalletProvider' (or similar per-chain file).@sodax/wallet-sdk-core from an older RC and wanting to adopt new additive features (defaults, *WalletDefaults, *Policy types).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.
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, error model) or @sodax/types. Route to the sodax-sdk skill (migration mode) instead.
migration-v1-to-v2/knowledge/ai-rules.md — DO / DON'T + workflow. The headline: v1 code drops in unchanged.migration-v1-to-v2/knowledge/README.md — what (additively) changed, read order, TL;DR.breaking-changes/ — folder-layout.md (deep-import → barrel), defaults-config.md, base-wallet-provider.md, library-exports.md.recipes/ — adopt-defaults.md, adopt-library-exports.md. Both are optional — they're cleanup paths, not requirements.reference/ — renamed-symbols.md (empty), deleted-exports.md (empty), added-fields.md (additive new surface).checklist.md.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.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.defaults field. New defaults (shallow-merge) field on each provider's config lets you set per-method overrides centrally. See recipes/adopt-defaults.md.@sodax/types renames bleeding through (e.g. xChainId → chainKey) and the real fix is in the sodax-sdk skill (migration mode).BaseWalletProvider in consumer code. That's a maintainer path. If a project subclasses it, scope confirmation with the user before touching anything.| Signal | Why stop |
|---|---|
Compile errors mention @sodax/sdk or @sodax/types symbols | Not this migration. Route to sodax-sdk skill (migration mode). |
Project extends BaseWalletProvider with non-trivial logic | Maintainer-only path. Confirm scope first. |
User wants a chain family not in integration/knowledge/reference/chain-support.md | Adding a new chain is a maintainer task. |
pnpm tsc --noEmit # must exit clean
# No leftover deep imports from v1's flat layout:
grep -rE "from '@sodax/wallet-sdk-core/wallet-providers/" src/ # empty
sodax-sdk — pass the constructed provider into SDK calls ({ raw: false, walletProvider }); SDK-side v1 → v2 work happens there.sodax-wallet-sdk-react — for React dapps; this skill is only relevant if NOT using React.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/bitcoin.md (opens in a new tab)integration/knowledge/features/evm.md (opens in a new tab)integration/knowledge/features/icon.md (opens in a new tab)integration/knowledge/features/injective.md (opens in a new tab)integration/knowledge/features/near.md (opens in a new tab)integration/knowledge/features/solana.md (opens in a new tab)integration/knowledge/features/stacks.md (opens in a new tab)integration/knowledge/features/stellar.md (opens in a new tab)integration/knowledge/features/sui.md (opens in a new tab)integration/knowledge/features/tron.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/bridge-to-sdk.md (opens in a new tab)integration/knowledge/recipes/defaults-and-overrides.md (opens in a new tab)integration/knowledge/recipes/library-exports.md (opens in a new tab)integration/knowledge/recipes/setup-browser-extension.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sodax, wallet-sdk, transaction-signing, blockchain, multi-chain
Other plugins' skills for the same job
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-sdkGenerated from the plugin's indexed repository (gosodax/sodax-sdks) — no native marketplace selected
npx claudepluginhub p/icon-project-sodax-skills