Skip to main content
High-level React hooks library for dApp developers. Wraps @sodax/sdk with React Query into feature-organized hooks. Used alongside @sodax/wallet-sdk-react (no direct dependency — shared types come from @sodax/sdk).

Features

  • Swap/IntentuseQuote, useSwap, useSwapAllowance, useSwapApprove, useCancelSwap, useCreateLimitOrder, useCancelLimitOrder, useStatus
  • BridgeuseBridge, useBridgeAllowance, useBridgeApprove, useGetBridgeableAmount, useGetBridgeableTokens
  • Money MarketuseSupply, useWithdraw, useBorrow, useRepay, useMMAllowance, useMMApprove, plus reserves data hooks
  • StakinguseStake, useUnstake, useInstantUnstake, useClaim, useCancelUnstake, approval hooks, info/config/ratio queries
  • DEXuseDexDeposit, useDexWithdraw, useSupplyLiquidity, useDecreaseLiquidity, useClaimRewards, pool/position queries, param builders
  • MigrationuseMigrateIcxToSoda, useRevertMigrateSodaToIcx, useMigratebnUSD, useMigrateBaln, useMigrationApprove, useMigrationAllowance
  • Bitcoin (Bound Exchange)useRadfiAuth, useRadfiSession, useTradingWallet, useTradingWalletBalance, useBitcoinBalance, useFundTradingWallet, useRadfiWithdraw, useExpiredUtxos, useRenewUtxos
  • PartneruseFetchAssetsBalances, useGetAutoSwapPreferences, useIsTokenApproved, useApproveToken, useSetSwapPreference, useFeeClaimSwap
  • RecoveryuseHubAssetBalances, useWithdrawHubAsset
  • Backend Queries — Intent tracking, swap-tx submission + status, orderbook, money market position queries
  • ShareduseXBalances, useDeriveUserWalletAddress, useGetUserHubWalletAddress, useStellarTrustlineCheck, useEstablishTrustline, useStellarGate, useEstimateGas
  • SponsoringuseStellarAccountActive, useStellarAccountStatus, useSponsorConfig, useActivateStellarAccount

Installation

Quick Start

1. Set up providers

RPC URLs are injected through config.chains. SodaxProvider is the outermost wrapper; QueryClientProvider wraps everything inside it.

2. Get a wallet provider

3. Use feature hooks

All mutation hooks accept no arguments at initialization. Domain inputs (params, walletProvider) flow through mutate(vars):

Requirements

  • Node.js >= 20.12.0
  • React >= 18
  • TypeScript

API Reference

Provider

  • SodaxProvider — Wraps your app, creates the Sodax SDK instance. Accepts config?: SodaxOptions.
  • createSodaxQueryClient() — Factory for a QueryClient with global mutation observability (onMutationError hook, meta.silent opt-out).

Swap Hooks

Money Market Hooks

Bridge Hooks

Staking Hooks

DEX Hooks

Migration Hooks

Bitcoin (Bound Exchange) Hooks

Partner Hooks

Recovery Hooks

Shared Hooks

Sponsoring Hooks

Stellar accounts must exist on-chain before they can hold or receive anything, and a new user holds 0 XLM. These drive sponsored activation, where the SODAX sponsor pays the account’s base reserve.

Backend Query Hooks

Swaps API Hooks (sodax.api.swaps)

Typed wrappers over the backend Swaps API v2 — one useSwapsApi* hook per endpoint (21 total). Highlights: See src/hooks/swapsApi/ for the full set (tokens, deadline, allowance, approve, submit/cancel intent, status, hash, packet, extra-data, intent lookups, limit orders, gas, fees).

DEX Utils

Development

AI agent docs

AI-readable docs for @sodax/dapp-kit (and the other @sodax/* packages) are shipped via @sodax/skills — a separate npm package bundling Claude-Code SKILL.md files and a long-form knowledge tree. Recommended: skills CLI — from your project root:
npm + AGENTS.md pointer (fallback for web chats, or when you prefer a devDependency over the CLI):
Then point your agent at node_modules/@sodax/skills/AGENTS.md. See docs/ai-integration-guide.md for all install modes and per-tool wiring.

License

MIT

Support