Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gnosis.pm/safe-apps-web3-react

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gnosis.pm/safe-apps-web3-react

Web3-react connector for Safe Apps

  • 1.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Safe Apps Web3-react connector

npm

A connector to be used with web3-react package

Installation

yarn add @gnosis.pm/safe-apps-web3-react

npm install @gnosis.pm/safe-apps-web3-react

Usage

import { SafeAppConnector } from '@gnosis.pm/safe-apps-web3-react';

The connector follows web3-react's connectors API convention. Visit web3-react repo for more details

Helper hook

You can use our helper hook to automatically connect to a safe, it will automatically connect to the Safe if it detects that it's loaded in Safe App context:

import { useSafeAppConnection, SafeAppConnector } from '@gnosis.pm/safe-apps-web3-react';

const safeMultisigConnector = new SafeAppConnector();

const App = () => {
  const triedToConnectToSafe = useSafeAppConnection(safeMultisigConnector);

  React.useEffect(() => {
    if (triedToConnectToSafe) {
      // fallback to other providers
    }
  }, [triedToConnectToSafe]);
};

More scenarios

For the SDK overview documentation, please refer to the safe-apps-sdk documentation

Keywords

FAQs

Package last updated on 16 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc