Skip to content

Payment methods (Core)

After loadSession(), list wallets and exchanges for the session.

Fetch

ts
import {
  createSwappedConnectClient,
  IntegrationProvider,
  IntegrationProviderType,
} from '@swapped/connect-sdk';

const client = createSwappedConnectClient({ sessionId: 'your-session-id' });
await client.loadSession();

const exchanges = await client.paymentMethods.get({ category: 'exchanges' });
const wallets = await client.paymentMethods.get({ category: 'wallets' });
// → Wallets flow (type: wallet)

const binance = exchanges.find(
  method => method.provider === IntegrationProvider.Binance,
);
const coinbase = exchanges.find(
  method => method.provider === IntegrationProvider.Coinbase,
);

if (binance) {
  // → Exchange Pay with IntegrationProvider.Binance
}

if (coinbase) {
  // → Coinbase OAuth withdraw flow (type: exchange_oauth), not Exchange Pay
}

const exchangePayOnly = await client.paymentMethods.get({
  type: IntegrationProviderType.ExchangePay,
});

Use refetch({ category: 'exchanges' }) when you need a fresh list from the API.

Filters

FieldExample
category'exchanges' or 'wallets'
typeIntegrationProviderType.Wallet, IntegrationProviderType.ExchangePay, or [IntegrationProviderType.ExchangePay, IntegrationProviderType.ExchangeOauth]

Next