- Import
CruxScreen
and add it preferably against a stringCRUXPAY_INJECTED_SCREEN
in Route Configuration object - Initialize the
RNCruxUI.CruxUI
object with options object
const cruxui = new RNCruxUI.CruxUI(options);
- Use the
manage
method of thecruxui
object to automatically open the register/manage CRUX ID screen according to the state of the inputs provided.
The options object expects these keys to be defined
cruxRouteName
=> The name of the screen constant against which theCruxScreen
will be hooked up in Route Configuration.cruxClient
=> An instantiated object of rn-sdk's CruxClient class.navigation
=> The Navigation prop of the integrating app.onRegisterSuccess
&onPutAddressSuccess
=> Functions to be called on success ofregisterCruxID
andputAddressMap
functions of cruxClientonClosePress
=> Function to be called onclosing the webview.onError
=> Any error thrown byregisterCruxID
&putAddressMap
will call this functioninputExtension
=> ICruxWebViewInputExtension
These are some params which integrator app needs to send to open the webview of crux-ui-setup
theme
=> The theme of the buttonssuggestedCruxIDSubdomain
=> Any preferred CRUX ID Subdomain that the user woul prefer tp registeravailableCurrencies
=> A map of wallet's currency symbol and corresponding address inIAddress
format