Appearance
Exchange Pay (Core)
Deposit via an exchange provider with client.exchangePay. Route here when the payment method has type: exchange_pay (see Payment methods).
Supported providers:
- Binance Pay
- KuCoin Pay
- Gate Pay
- Bybit Pay
- Krak Pay
- OKX Pay
Prerequisites
- Create a client with a Swapped Connect
sessionId(from your backend). - Call
loadSession()and confirm the session is active (Initiated). - Let the user pick an Exchange Pay provider from payment methods.
ts
import {
createSwappedConnectClient,
IntegrationProvider,
IntegrationProviderType,
} from '@swapped/connect-sdk';
const client = createSwappedConnectClient({
sessionId: 'your-session-id',
});
await client.loadSession();
const methods = await client.paymentMethods.get({
type: IntegrationProviderType.ExchangePay,
});
const binance = methods.find(
method => method.provider === IntegrationProvider.Binance,
);Flow overview
| Step | What happens | Docs |
|---|---|---|
| 1. Currencies | Load supported tokens for the provider | Currencies |
| 2. Create order | User amount → createOrder | Orders & checkout |
| 3. Checkout | Show QR / links; optionally close | Orders & checkout |
| 4. Wait | Status updates + expiry countdown | Expiry, Events |
| 5. Done | Summary; restartSession() for another payment | Summary |
Session must stay active before createOrder. After a completed payment, call restartSession() before creating another order.
Step-by-step walkthrough: Example.
Providers
| Provider | Enum |
|---|---|
| Binance Pay | IntegrationProvider.Binance |
| KuCoin Pay | IntegrationProvider.Kucoin |
| Gate Pay | IntegrationProvider.Gate |
| Bybit Pay | IntegrationProvider.Bybit |
| Krak Pay | IntegrationProvider.KrakPay |
| OKX Pay | IntegrationProvider.Okx |
Methods by topic
| Topic | Methods / helpers |
|---|---|
| Currencies | getSupportedCurrencies, isExchangePayProvider |
| Orders & checkout | createOrder, getOrder, getActiveOrder, closeOrder, reset |
| Expiry | getActiveOrderExpiresAt, getExchangePayOrderTimeLeft, isExchangePayOrderExpired |
| Summary | getCompletedTransactionSummary |
| Events | onOrderUpdated, onOrderCompleted, onOrderExpired |
| Errors | How failures surface and what to do |