Appearance
Currencies
Load supported deposit currencies for an Exchange Pay provider.
When to use
After the user picks a provider. Use the list to build token + network + amount UI. Each row’s minAmountFiat / maxAmountFiat are the amount-field bounds.
Methods
| Method | Purpose |
|---|---|
getSupportedCurrencies({ provider }) | Promise<ExchangePaySupportedCurrency[]> for that provider |
getMaxAmountFiat(provider) | Fiat maximum for that provider (config override, else default) |
getPreferredCurrencyToReceive() | Session default receive token, or null |
isExchangePayProvider(provider) | Type guard - whether a payment-method provider is Exchange Pay |
Unavailable currencies are filtered out. Mins are SDK-resolved (ceiled to cents, floored at the client default of $1). Max is $1,000,000 by default, or a per-method override from remote paymentMethods (KuCoin Pay $45,000, Bybit Pay $40,000).
Example
ts
import { IntegrationProvider, Network, TokenSymbol } from '@swapped/connect-sdk'
if (!client.exchangePay.isExchangePayProvider(IntegrationProvider.Binance)) {
throw new Error('Not an Exchange Pay provider')
}
const currencies = await client.exchangePay.getSupportedCurrencies({
provider: IntegrationProvider.Binance,
})
const usdc = currencies.find(
currency =>
currency.symbol === TokenSymbol.USDC &&
currency.blockchain === Network.Solana,
)
if (!usdc) {
throw new Error('USDC on Solana is not available for this session')
}
console.log(usdc.minAmountFiat, usdc.maxAmountFiat, usdc.minAmountCrypto, usdc.name)
// Use usdc.symbol + usdc.blockchain when calling createOrderSame pattern for Kucoin, Gate, Bybit, KrakPay, Okx.
Currency fields
| Field | Use for |
|---|---|
symbol / blockchain | createOrder({ token, blockchain }) |
minAmountFiat | Minimum fiat amount in the form (currently USD) |
maxAmountFiat | Maximum fiat amount in the form (currently USD) |
minAmountCrypto | Optional crypto-side display |
name, image, blockchainImage | UI labels / icons |
exchangeRateFiat | May be omitted by some providers (e.g. OKX) |
Errors
| Code | When | What to do |
|---|---|---|
SESSION_REQUIRED | Session not loaded | Call loadSession() first |
CLIENT_DESTROYED | Client torn down | Create a new client |
API_ERROR | Network / server failure | Retry |
See Errors.