Appearance
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
- Create a client with a Swapped Connect
sessionId(from your backend). - Call
loadSession()and confirm the session is active. - 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
| Step | What happens | Docs |
|---|---|---|
| 1. Connect | OAuth popup → user authorizes Coinbase | Connection |
| 2. Balances | Load balances; user picks a currency | Balances |
| 3. Funding (optional) | Include other balances that can fund the withdraw | Funding tokens |
| 4. Network + limits | Pick network; show min / max amount | Networks, Limits |
| 5. Withdraw | startWithdrawal → if 2FA, confirmWithdrawal | Withdrawal, Cooldown |
| 6. Done | Show summary; restartSession() for another payment | Summary |
Session must stay active before startWithdrawal. After a completed payment, call restartSession() before starting another one.
Step-by-step walkthrough: Example.
Methods by topic
| Topic | Methods |
|---|---|
| Connection | ready, isConnected, isInitializing, isPopupOpen, connect, disconnect, ensureSession |
| Balances | getBalances |
| Funding tokens | getFundingTokens, getDefaultFundingTokens, getSelectionAggregatedBalance |
| Networks | getNetworks |
| Limits | getMinWithdrawalAmount, getMaxWithdrawableAmount, validateWithdrawalAmount |
| Withdrawal | startWithdrawal, confirmWithdrawal, cancelWithdrawal, getActiveWithdrawal |
| Cooldown | getCooldown, onCooldownChanged |
| Summary | getCompletedTransactionSummary |
| Events | onConnected, onDisconnected, onSessionEnsured, onSessionExpired, onWithdrawalCompleted, … |
| Errors | How failures surface and what to do |