Mobile (WalletConnect)
Events
How Joey mobile signals account changes, network changes and disconnects over WalletConnect.
What Joey sends
| Event | Sent by Joey? | Notes |
|---|---|---|
session_delete |
Yes | See below. |
accountsChanged, chainChanged |
No | Listed in the approved session, but not currently sent. |
connect, disconnect (namespace events) |
No | Listed in the approved session, but not currently sent. |
session_update, session_extend |
No |
Joey ends the session (session_delete, reason USER_DISCONNECTED) when:
- the user disconnects your app under Settings → WalletConnect;
- the user switches account or network in Joey: every session is ended;
- your app sends a new connection proposal: Joey clears older sessions from the same app first.
Handling it
Treat session_delete as "the user disconnected, or changed account or network". Clear your session state, and offer to connect again. The new session's account is in namespaces.xrpl.accounts, formatted as xrpl:<chain>:<address>.
provider.on('session_delete', ({ topic }) => {
clearSession(topic);
showConnectButton();
});
provider.on('display_uri', (uri: string) => {
// Show as a QR code, or open a deep link on mobile (see Deeplinking)
});
Request expiry
If a request's expiryTimestamp has already passed when it reaches Joey, Joey replies with error 8000. If it expires while the user is reviewing it, Joey closes the request without replying.
Event names in wc-client
wc-client re-exports WalletConnect's provider event names as core.typings.EProviderEvents:
PROPOSAL = 'session_proposal', EXTEND = 'session_extend', EXPIRE = 'session_expire',
REQUEST = 'session_request', REQUEST_SENT = 'session_request_sent',
AUTHENTICATE = 'session_authenticate', PROPOSAL_EXPIRE = 'proposal_expire',
REQUEST_EXPIRE = 'session_request_expire', CONNECT = 'session_connect',
PING = 'session_ping', EVENT = 'session_event', UPDATE = 'session_update',
DELETE = 'session_delete', URI = 'display_uri', PROVIDER_ERROR = 'error',
PROVIDER_CONNECT = 'connect', PROVIDER_DISCONNECT = 'disconnect',
PROVIDER_UPDATE = 'update', PROVIDER_DELETE = 'delete',
WC_READY = 'wc_ready', WC_SESSION_SYNC = 'wc_sessionSync'