💳Wallet Methods
To know Web3 wallet relevant methods in Startrail-Sdk-Js
login
login
Authenticate a user and allocate EOA.
Following arguments can be passed to overwrite the configuration originally set at the instantiation.
Arguments
Parameter | Type | Mandatory | Description |
---|---|---|---|
authAction |
| Optional | Client ID of Auth0 account |
lang |
| Optional | Language displayed on the UI |
loginProvider |
| Optional | Login providers for SSO(Single Sign-On) |
Returns
Promise<string[] | false>:
An object containing user information.
Example
Distinct EOAs are assigned for each login provider, regardless of whether the same email is utilized for authentication methods, such as Google and Email Passwordless.
To prevent duplicate registration of accounts with the same email and different EOAs, it is recommended that your application rejects duplicate email registrations on your application side.
getUserInfo
getUserInfo
Get the logging-in user information.
Returns
Promise<UserInfo | false>:
The promise resolves upon the request success and rejects with a specific error code if the request fails.
Value | Type | Description |
---|---|---|
| If selected social login allows email sharing. See more details inLogin Providers | |
name |
| If selected social login knows your name |
profileImage |
| If selected social login knows your profile image |
typeOfLogin |
| Selected social login type |
wallet |
| Selected wallet type |
verifier |
| Web3Auth only feature. It determines your EOA. |
verifierId |
| Web3Auth only feature. Verifier Id of the logged in user if your selected wallets knows it |
isNewUser |
| Web3Auth only feature. Returns if the logged in user is new to Torus wallet which supports Startrail login |
See more details for the Login Providers
Example
signMessage
signMessage
Sign message with the Ethereum private key associated to your wallet
Arguments
Arguments
Parameter | Type | Mandatory | Description |
---|---|---|---|
message |
| Required | A message to be signed |
disableCustomPrefix |
| Optional | Web3Auth only feature to skip singing popup. See more details here |
Returns
Promise<{signature: string, prefix: string | false} | false>:
Example
switchLanguage
switchLanguage
Switch language for Web3Auth wallet UI
Arguments
Arguments
Parameter | Type | Mandatory | Description |
---|---|---|---|
lang |
| Required | Web3Auth only feature to switch language |
Returns
Promise<void | false>
Example
logout
logout
Logout from the wallet.
Returns
Promise<void | false>
The promise resolves upon logout request success and rejects with a specific error code if the request fails.
Example
About Page reload and data persistency
Wallet information is stored in browser session storage under Torus service domain.
As SDK instance is gone at page reload, it's no longer available unless it is instantiated again. User, however, does not require additional login process to trigger its function call since the session between Torus node and Authenticator keeps maintained until sdk.logout function is called
Last updated