Skip to content

Events

Subscribe with client.on. Each call returns an unsubscribe function. You can also use client.wallets.subscribe for the connection state and client.wallets.transfer.on('transferStatus', …) for transfer progress.

For UI state, read getters / connection state (getConnections, getConnectionState). Use events for side effects.

Connection

ListenerEventPayload
wallets:restored{ connections }
wallets:connected{ connection }
wallets:disconnected{ walletId, reason }
wallets:accountsChanged{ walletId, accounts }
wallets:chainChanged{ walletId, chainId }
wallets:pairingUri{ uri, deeplinkUrl, provider } (null when cleared)
wallets:error{ walletId, error }
wallets:balancesUpdated{ balances }
ts
client.on('wallets:connected', ({ connection }) => {
  connection.walletId;
});

client.on('wallets:disconnected', ({ walletId, reason }) => {
  // reason: 'user' | 'provider' | 'session_expired' | 'host'
});

client.on('wallets:pairingUri', ({ uri, deeplinkUrl }) => {
  // QR / open-in-wallet
});

client.on('wallets:balancesUpdated', ({ balances }) => {
  // rate-enriched groups
});

Transfer

EventPayload
wallets:transferStatusWalletTransferStatusEvent — see Submit
ts
client.on('wallets:transferStatus', event => {
  event.status;
  event.hash;
  event.clientTxId;
});

// equivalent
client.wallets.transfer.on('transferStatus', event => {
  /* … */
});

You can also pass onStatus to transfer.submit / transfer.retry for a single call.

Errors

wallets:error fires when a wallet operation fails (for example connect). The thrown ConnectSdkError is the same failure — see Errors.