Skip to content

Exchange Pay hooks

State hooks for Exchange Pay UI from @swapped/connect-sdk/react. Use event hooks for side effects (navigate, toast).

Selection hooks and createOrder() require ExchangePayContextProvider. Summary and useOnExchangePayOrder* hooks are provider-free.

HookReturns / use for
useExchangePayProvidersAvailable exchanges + selected provider
useExchangePaySupportedCurrenciesToken list + minAmountFiat
useExchangePayCurrencySelected currency
useExchangePayAmountAmount + validation
useExchangePaySelectionFull selection snapshot + canSubmit
useExchangePayOrdercreateOrder(), closeOrder, order, expiredOrder, status, …
Expiry & countdownuseExchangePayOrderExpiry / useExchangePayOrderCountdown
useExchangePayCompletedTransactionSummarySuccess screen data (provider-free)
Event hooksuseOnExchangePayOrder* (provider-free)

Failures: Errors. Walkthrough: Example.