Add cryptocurrency swap functionality to your platform in minutes
npm install @cloaxpay/swap-widget
# or
yarn add @cloaxpay/swap-widgetimport { SwapWidget } from '@cloaxpay/swap-widget'
function MyPage() {
return (
<SwapWidget
theme="dark"
primaryColor="#3B82F6"
onSuccess={(swapId) => {
console.log('Swap completed:', swapId)
// Handle success
}}
onError={(error) => {
console.error('Swap failed:', error)
// Handle error
}}
/>
)
}theme - 'light' | 'dark' (default: 'dark')
primaryColor - Hex color (default: '#3B82F6')
allowedCoins - string[] - Restrict available coins (optional)
defaultFromCoin - Pre-select from coin (optional)
defaultToCoin - Pre-select to coin (optional)
onSuccess - (swapId: string) => void
onError - (error: string) => void
<iframe
src="https://cloaxpay.com/swap"
width="500"
height="700"
style="border: none; border-radius: 12px;"
></iframe>