Skip to content

Connected wallets

A connection is one approved wallet instance after the user has connected — not a row in the availability list. Opening a wallet is Connect wallet (connect). This page is the list that remains afterward.

The SDK holds any number of connections at once, keyed by walletId. Core methods take walletId on each call (getWalletBalance, transfer.getPlan, disconnect, …). In React, WalletsProvider tracks the active wallet for UI.

walletId identifies one connect action (one injected instance, or one WalletConnect session). The same provider can appear more than once (extension + a WalletConnect pairing, or two WalletConnect sessions).

Read

MethodReturns
getConnections({ sort? })All connections. sort: 'connectedAt' (newest first) or 'balanceDesc' (highest USD total first; uses cached balances)
getConnection(walletId)One connection, or null
getConnectionsByProvider(provider)Every instance of that payment-method provider
isConnected(provider)true if any instance of that provider is connected
getAddresses()Flattened { address, chainId, walletId }[]
getConnectionState(){ connections, connectingProviders, errors, isRestoring, pairingUri, pairingDeeplinkUrl }
subscribe(listener)Fires on connection-state changes; returns unsubscribe
ts
const connections = client.wallets.getConnections({ sort: 'connectedAt' });

const off = client.wallets.subscribe(state => {
  state.connections;
  state.isRestoring;
  state.pairingUri;
  state.pairingDeeplinkUrl;
  state.connectingProviders;
  state.errors;
});

getConnectionState() fields:

FieldMeaning
connectionsCurrent WalletConnection[]
connectingProvidersProviders with an in-flight connect
errorsLast error keyed by provider or walletId
isRestoringPrevious connections still rehydrating. Addresses may already exist; sign / send wait for status === 'connected'
pairingUriCurrent WalletConnect URI (QR / copy), or null
pairingDeeplinkUrlSame pairing as a mobile deep link, or null

sortWalletConnections(connections, sort, balances) is also exported if you sort a list yourself.

WalletConnection

FieldMeaning
walletIdInstance id for later calls
providerIntegrationProvider, or null if WalletConnect paired a wallet that is not in the SDK registry
transport'injected' or 'walletconnect'
name / iconDisplay
namespacesPer-namespace slices (eip155 / solana / bip122) with accounts and activeChainId
accountsFlattened accounts across namespaces
connectedAtTimestamp
isRestoredtrue when restored on load rather than freshly approved
status'connected' | 'checking' | 'needsReconnect'. Sign / send require 'connected'
sessionTopic?WalletConnect session topic
expiresAt?WalletConnect session expiry
requiresPopup?Injected privileged actions for this connection run in a popup

Restore

On client start the SDK restores previous connections. getConnectionState().isRestoring is true until that finishes. wallets:restored fires with the restored list.

Balances can be fetched from last-known addresses while restore is still running. Sign / send use status === 'connected'.

ts
client.on('wallets:restored', ({ connections }) => {
  // restore finished
});

const next = await client.wallets.reconnect();
// `{ force: true }` re-prompts popup-routed injected connections

Disconnect

MethodEffect
disconnect(walletId)One instance
disconnectProvider(provider)Every instance of that provider (injected + all WalletConnect topics)
disconnectAll()Every connection
ts
await client.wallets.disconnect(walletId);
await client.wallets.disconnectProvider(IntegrationProvider.MetaMask);
await client.wallets.disconnectAll();

wallets:disconnected includes reason: 'user' | 'provider' | 'session_expired' | 'host'.

Connected wallets persist across restartSession().