Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 4.42 KB

xumm.on-event-fn.md

File metadata and controls

41 lines (30 loc) · 4.42 KB
description
Events fired by the SDK per environment. For the order of events, see the section per environment after the table with events.

Xumm.on(event, fn)

EventEnvironmentMeaning
retrievedxApp, Web3 (browser)A valid signed in Xumm SDK session has been retrieved.
successxApp, Web3 (browser)A user is succesfully identified and signed in
readyxApp, Web3 (browser)The SDK is ready (final state) so your application can render
retrievingWeb3 (browser)The SDK is trying to retrieve & verify an existing session
logoutWeb3 (browser)The SDK is going to destroy a pending signed in session
loggedoutWeb3 (browser)The SDK destroyed a signed in session, a user can login again.
errorWeb3 (browser)An error occurred, see the browser console for more information
qrxApp (user event)The QR code scan dialog in Xumm has been closed (dismissed or a QR code has been scanned)
From: scanqr.md
payloadxApp (user event)A Sign Request (payload) has been resolved (cancelled / signed / ...)
From: opensignrequest.md
destinationxApp (user event)The "Destination Picker" dialog in Xumm has been closed (dismissed or a destination has been selected)
From: selectdestination.md
networkswitchxApp (user event)The user switched the selected network in Xumm while present in the xApp, while your xApp settings (Xumm Developer Console) indicate the xApp shouldn't reload but receive an event.
network contains getrails.mdkey.

Event order

The following order of events can be expected per environment.

{% hint style="info" %} Note about the ready vs the success event:

The ready event fires if the SDK state is ready for the rendering of your application. This does not have to mean the SDK is signed in: it just means the SDK is ready.

If you want to know a user {% endhint %}

xApp (always auto-signed in)

  1. retrieved - xApps always auto-resolve
  2. success- all information is populated to SDK properties (Promises)
  3. ready - ready to render your application with the correct Xumm SDK state

Web3 (browser) - Signed out & then signing in

  1. retrieving - but the user is signed out
  2. ready - ready to render your application with the correct Xumm SDK state, but the user must still log in
  3. The user signs in
  4. success - all information is populated to SDK properties (Promises)

Web3 (browser) - Already signed in

  1. retrieving - existing session information is being fetched & verified
  2. success - all information is populated to SDK properties (Promises)
  3. retrieved - you are dealing with an already signed in user
  4. ready - ready to render your application with the correct Xumm SDK state