Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

🦊MetaMask

It’s strongly recommend to check that currently active EOA in MetaMask is equal to the one user logged in or signed up with before requesting signing action because MetaMask are always open to users’ action regardless of Startrail-sdk-js state. ie. It is possible for users to change the EOA account on MetaMask whenever they like.

For Mobile Users

Users are directed to the internal browser within the MetaMask app if they already have the native app installed; otherwise, they are redirected to the app store page.

When users attempt to connect to the MetaMask browser app using the login function, irrespective of whether the native browser app is installed or not, a "false" value is returned. Please handle this scenario appropriately on the client side.

Signing out and switching accounts (v2.3.1+)

logout() disconnects your site from MetaMask: the SDK revokes the accounts permission the extension granted when the site first connected. The next login() therefore opens MetaMask's connect window with its account list, so the user can pick another account. login({ forceLogin: true }) does both in one call while a user is signed in.

Switch MetaMask account
await sdk.logout()                      // the site is disconnected from MetaMask
const eoas = await sdk.login()          // MetaMask asks for the account again
// or, in one call:
const eoas2 = await sdk.login({ forceLogin: true })

Where MetaMask cannot revoke a permission — MetaMask Mobile and older extension releases — the SDK requests it explicitly on the next login(), which opens the account picker as well. Before v2.3.1, logout() only cleared the SDK's state and MetaMask reconnected the previous account silently.

UI

Condition to happen

The first time a user connects to the web application (URL) with MetaMask, and — from SDK v2.3.1 — after every logout(), which disconnects the site.

Impact

Popup request opens up for users.

When to happen in your web-application

When users login to Metamask.

Condition to happen

For the first time user connects Metamask to Polygon or Amoy network.

Impact

Popup request opens up for users.

When to happen in your web-application

Whenever uses sign for blockchain tx such as create SRR or transfer ownership.

Condition to happen

sdk.signMessage is invoked / sdk.signMessage

Impact / 影響

Popup request opens up for users

When to happen in your web-application

When user signs the message sdk.signMessage()

Network Error

When network error occurs, please go to Settings > Networks on MetaMask, select active network, and change New RPC URL to the live one selected from the list below.

RPC endpoint and chainId

Last updated

Was this helpful?