Skip to content

Coinbase (Core)

Connect a Coinbase account with OAuth, then withdraw crypto using client.coinbase.

Coinbase is a separate flow from Exchange Pay and from Wallets (Coinbase Wallet is type: wallet). Route to it when the payment method has provider: coinbase and type: exchange_oauth (see Payment methods).

Prerequisites

  1. Create a client with a Swapped Connect sessionId (from your backend).
  2. Call loadSession() and confirm the session is active.
  3. Confirm Coinbase is available in payment methods before showing the connect UI.
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 coinbaseMethod = exchanges.find(
  method =>
    method.provider === IntegrationProvider.Coinbase &&
    method.type === IntegrationProviderType.ExchangeOauth,
);

if (!coinbaseMethod) {
  throw new Error('Coinbase is not available for this session');
}

Flow overview

StepWhat happensDocs
1. ConnectOAuth popup → user authorizes CoinbaseConnection
2. BalancesLoad balances; user picks a currencyBalances
3. Funding (optional)Include other balances that can fund the withdrawFunding tokens
4. Network + limitsPick network; show min / max amountNetworks, Limits
5. WithdrawstartWithdrawal → if 2FA, confirmWithdrawalWithdrawal, Cooldown
6. DoneShow summary; restartSession() for another paymentSummary

Session must stay active before startWithdrawal. After a completed payment, call restartSession() before starting another one.

Step-by-step walkthrough: Example.

Methods by topic

TopicMethods
Connectionready, isConnected, isInitializing, isPopupOpen, connect, disconnect, ensureSession
BalancesgetBalances
Funding tokensgetFundingTokens, getDefaultFundingTokens, getSelectionAggregatedBalance
NetworksgetNetworks
LimitsgetMinWithdrawalAmount, getMaxWithdrawableAmount, validateWithdrawalAmount
WithdrawalstartWithdrawal, confirmWithdrawal, cancelWithdrawal, getActiveWithdrawal
CooldowngetCooldown, onCooldownChanged
SummarygetCompletedTransactionSummary
EventsonConnected, onDisconnected, onSessionEnsured, onSessionExpired, onWithdrawalCompleted, …
ErrorsHow failures surface and what to do