Quick Start
An open-source, framework-agnostic React widget for cross-chain token swaps and bridges. Built-in wallet connection support (EVM + Solana), configurable theme system, and ready-to-use demo application.
Features
🔄 Cross-chain Swap & Bridge — Full trading flow with quote polling, gas estimation, approval handling
👛 Built-in Wallet Connection — Dynamic SDK + Wagmi v2 supporting EVM (MetaMask, OKX, etc.) and Solana (Phantom)
🎨 Configurable Theme — 14 color tokens for custom skinning
⚛️ Framework Agnostic — Works with any React framework (Next.js, Vite, Create React App, etc.)
📦 Tree-shakeable — ESM + CJS builds with TypeScript declarations
🔌 Configurable Default Tokens — Set default from/to chains and tokens
📱 Deep Link Support — Wallet app launch support in WebView (React Native) — see Deep Link Guide
Installation
npm install @wheelx-widget/widget @chakra-ui/react @emotion/reactNote: @chakra-ui/react and @emotion/react are required peer dependencies.
Quick Start
// main.tsx — wrap with ChakraProvider
import { ChakraProvider, defaultSystem } from '@chakra-ui/react'
import { createRoot } from 'react-dom/client'
import App from './App'
createRoot(document.getElementById('root')!).render(
<ChakraProvider value={defaultSystem}>
<App />
</ChakraProvider>
)Configuration
Theme Customization
Customize 14 visual tokens:
Default Chain/Token Configuration
Custom Dynamic Environment ID
API Base URL
Override the default WheelX API endpoint. Useful for testing against a staging or development environment.
Fixed Recipient Address (Different Address)
Configure fixed recipient addresses for EVM or Solana chains. When set, the widget will:
Display the configured address in the To field instead of showing "Connect Wallet"
Query the token balance of the configured address
Skip wallet connection for the target chain (only the source chain wallet is required for signing)
Show GetGas when the configured address has insufficient native token balance
This is useful for exchange or merchant scenarios where funds should always be sent to a specific address regardless of which wallet the user connects.
Priority order for recipient address:
Configured fixed address (
evmDifferentAddress/solanaDifferentAddress)User manually entered different address (via Different Address dialog)
Connected wallet address
Note: You can configure one, both, or neither. The widget will only use the relevant one based on the selected To chain.
API Reference
<WheelXProvider>
The root provider component that sets up wallet connections, React Query, and theme.
<WheelXWidget>
The main trading widget component.
WidgetConfig
WidgetTheme
Demo
A demo https://widget.wheelx.fi
API Endpoint
This widget connects to the WheelX API at https://api.wheelx.fi. The API domain is not configurable.
React Native / WebView Integration
If you embed the Widget into a React Native WebView, additional configuration is required to properly launch wallet apps.
Please refer to: Mobile Wallet Launch Guide (DEEP_LINK_GUIDE.md)
In short, three things are required:
Add
onMessagelistener in the WebViewConfigure
<queries>declaration in Android'sAndroidManifest.xmlConfigure
LSApplicationQueriesSchemesin iOS'sInfo.plist
License
MIT
Last updated