createStable accepts a viem WalletClient, which is exactly what wagmi’s useWalletClient returns. You connect the wallet through wagmi as you normally would, then memoize a StableClient whenever the wallet client changes.
This guide assumes wagmi v2 and @tanstack/react-query.
1. Configure wagmi
Add Stable to the wagmi config. viem ships chain definitions for both networks.2. Build a hook that returns a StableClient
Memoize a StableClient against the current WalletClient. Recreate it when the wallet client identity changes.
3. Use it in a component
4. Bridge and swap from React
The samestable instance handles bridge and swap. Fetch the quote in an effect or a useQuery, then execute on click.
Caching quotes with
useQuery works well: pass quoteSwap / quoteBridge as the query function and forward the cached quote into swap / bridge. The SDK skips its internal quote call when one is provided.Next recommended
SDK reference
Every method, config field, and error class.
Use with viem
Compare the three signing modes side-by-side.
SDK quickstart
Run your first transfer, bridge, and swap on testnet.

