Skip to content

Wallets (Core)

Connect self-custodial wallets and deposit with client.wallets and client.wallets.transfer.

Wallets is a separate flow from Exchange Pay and Coinbase OAuth. Route to it when the payment method has type: wallet (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. List available wallets before connecting.
ts
import { createSwappedConnectClient } from '@swapped/connect-sdk'

const client = createSwappedConnectClient({
  sessionId: 'your-session-id',
})

await client.loadSession()

const available = await client.wallets.getAvailable()

createSwappedConnectClient accepts optional wallets.balancesCacheTtlMs (default 10 minutes). A manual refresh always loads fresh balances.

Available wallet → connect → walletIdtransfer plansubmit

Flow overview

StepWhat happensDocs
1. AvailabilityPair payment methods with transports on this deviceAvailability
2. ConnectExtension, WalletConnect, or open-in-wallet-appConnect wallet
3. ConnectionsRead connected instances (walletId)Connected wallets
4. BalancesLoad tokens (crypto + fiat) for a walletIdBalances
5. Transfer planHow this token reaches the session (direct / swap / bridge / unavailable)Transfer plan
6. Amount + quoteMin, validation, crypto/fiat, quoteAmount & quote
7. SubmitUser confirms in the wallet; status streamSubmit
8. DoneSummary; restartSession() for another paymentSummary

The session must stay active before transfer.submit. After a completed payment, call restartSession() before starting another one. Connected wallets persist across restartSession().

Every Core action that touches a wallet takes a walletId — the connection instance, not the provider brand. In React, WalletsProvider tracks the active wallet.

TermMeaning
Available walletA payment-method wallet this device can connect. Availability
ConnectionOne approved instance (walletId). Connected wallets
Transfer planHow a token reaches the session (direct / swap / bridge / unavailable). Transfer plan

Step-by-step walkthrough: Example.

Methods by topic

TopicMethods
AvailabilitygetAvailable, watchAvailability, requiresDeepLink, supportsWalletConnect
Connect walletconnect, cancelPairing, getDeepLinkUrl, openDeepLink
Connected walletsgetConnections, getConnection, getConnectionsByProvider, isConnected, getAddresses, getConnectionState, subscribe, disconnect, disconnectProvider, disconnectAll, reconnect
BalancesgetBalances, getWalletBalance, getCachedBalances
Transfer plantransfer.getPlanSync, transfer.getPlan, transfer.prefetchTransferCurrencies
Amount & quotetransfer.getMinAmount, transfer.validateAmount, transfer.getQuote
Submittransfer.submit, transfer.retry
Summarytransfer.getCompletedTransactionSummary, ensureCompletedTransactionFees, ensureCompletedTransactionRates
Eventswallets:connected, wallets:pairingUri, wallets:transferStatus, …
ErrorsHow failures surface

Advanced wallet APIs

Not part of the deposit flow — prefer transfer.submit for sending.

MethodPurpose
signMessage({ walletId, message, namespace? })Sign a message
sendTransaction({ walletId, chainId, to, amount, tokenAddress?, … })Low-level send (human-readable amount)
switchChain(walletId, chainId)Switch the active EVM chain for a connection