Skip to main content

Events

Provider (window.zunia)​

EventAudienceData
accountsChangedOrigins that are connected. Also sent when the wallet unlocks.Read getKey again
chainChangedOrigins that are connected{ chainIds } still granted
disconnectOrigins that lost accessnull (all) or { chainIds }
lockedConnected originsnone
keplr_keystorechangeSame as accountsChangednone (Keplr alias)

For older listeners, window also gets zunia_keystorechange, zunia_disconnect, zunia_locked and zunia_chainchanged, plus keplr_keystorechange and keplr_disconnect while the Keplr alias is on.

The worker only delivers these to tabs whose origin is granted. An origin that never connected hears nothing.

Safari​

Safari accepts tabs.sendMessage from the worker and never hands the message to the content script. The Safari build therefore:

  1. Lets the content script open a port named zunia:provider-events once the page has used the provider.
  2. Numbers every event and keeps the last 100 in storage.session.
  3. On reconnect (worker restarted, or the tab came back to the front), sends everything newer than the page's last number.

A visible Safari tab that uses the wallet also pings the worker every 3 seconds so iOS does not stop it after ~8 seconds idle.

SDK session​

EventPayload
statusZuniaSessionStatus
accountsChangedZuniaAccountInfo[]
chainChangedstring[]
pairing{ transport, uri, expiresAt }
verification6-digit string (QR only)
disconnectreason string, such as "user" (your own disconnect()), "revoked" (the extension dropped your site) or "expired" (the relay session ran out)
errorZuniaConnectError