Appearance
useExchangePaySupportedCurrencies
Load supported deposit currencies for the selected Exchange Pay provider.
When to use
After a provider is selected (via useExchangePayProviders or defaultProvider on ExchangePayContextProvider). Drive the currency picker and amount minimum.
Example
tsx
import { useExchangePaySupportedCurrencies } from '@swapped/connect-sdk/react'
function CurrencyList() {
const { currencies, isLoading, error, refetch } =
useExchangePaySupportedCurrencies()
if (isLoading) return <p>Loading currencies…</p>
if (error) return <p>{error.message}</p>
return (
<div>
<ul>
{currencies.map(currency => (
<li key={`${currency.symbol}-${currency.blockchain}`}>
{currency.name} — min ${currency.minAmountFiat}
</li>
))}
</ul>
<button type="button" onClick={() => void refetch()}>
Refresh
</button>
</div>
)
}Pair with useExchangePayCurrency for selection. Mins are SDK-resolved (ceiled to cents, floored at the client default of $1). exchangeRateFiat may be omitted by some providers (e.g. OKX).
Returns
Returns currencies, isLoading, isRefetching, error, refetch.
Requires ExchangePayContextProvider. The provider argument is no longer passed to this hook — selection owns which exchange to fetch for.
Errors
| Code | When | What to do |
|---|---|---|
REACT_EXCHANGE_PAY_PROVIDER_REQUIRED | Used outside ExchangePayContextProvider | Wrap with the provider |
SESSION_REQUIRED | Session not loaded | loadSession() first |
API_ERROR | Network / server failure | Retry via refetch |
See Errors.