Init msafe wallet

To connect and use MSafe wallet, you will need to first initialize an MSafeWallet object.

const msafe = await;

You may also pass in a list of URLs as the allowed origins of the parent frame. For example, if you only want to connect to MSafe production (, the msafe instance can be initialized with:

const msafe = await[
Allowed origins

MSafe enforces an origin check to ensure that any transaction requests initiated by dApp is passed on to a pre-defined allowed origin URL. The origin check is to prevent the potential phishing attacks launched from any unauthorized third-party.

MSafe will maintain a default list of allowed endpoints deployed by MSafe in MSafe-wallet repository. If no additional arguments is provided, the default list will be used. The current default allowlist is:

Mainnet: '',
Testnet: '',
Partner: '',

The default allowlist shall meet most requirements for MSafe integration in production and development.


import { MSafeWallet } from "msafe-wallet";

// check if the dapp is running in msafe
    // get dapp url for msafe
    const url = MSafeWallet.getAppUrl('Mainnet'); 
    // redirect to msafe dapp
const msafe = await;

Last updated