0.5.1-develop.0 • Published 4 years ago

@arkane-network/safe-apps-web3modal v0.5.1-develop.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Safe Apps Web3Modal

This is a wrapper around web3modal that adds Safe Apps support.

If the app using the wrapper is run as a Safe App the connect method will automatically connect to the Safe App.

How to use

  • Install the package and its dependencies
npm i @gnosis.pm/safe-apps-web3modal @gnosis.pm/safe-apps-sdk web3modal 

yarn add @gnosis.pm/safe-apps-web3modal @gnosis.pm/safe-apps-sdk web3modal 
  • Use SafeAppWeb3Modal
import { SafeAppWeb3Modal } from 'safe-apps-web3modal';
const modal = new SafeAppWeb3Modal(web3modalOptions);
  • Check if it can auto-connect to immediately connect
if (await modal.canAutoConnect()) {
    provider = await modal.requestProvider();
}