Socket
Socket
Sign inDemoInstall

@walletconnect/modal

Package Overview
Dependencies
Maintainers
9
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@walletconnect/modal

#### 🔎 [Examples](https://github.com/WalletConnect/web3modal-examples)


Version published
Weekly downloads
299K
increased by1.18%
Maintainers
9
Weekly downloads
 
Created

What is @walletconnect/modal?

@walletconnect/modal is an npm package that provides a modal interface for connecting to WalletConnect-compatible wallets. It simplifies the process of integrating WalletConnect into web applications by offering a user-friendly modal for wallet selection and connection.

What are @walletconnect/modal's main functionalities?

Initialize WalletConnect Modal

This code initializes the WalletConnect modal with the necessary configuration options such as project ID and relay URL.

const WalletConnectModal = require('@walletconnect/modal');
const walletConnectModal = new WalletConnectModal({
  projectId: 'your_project_id',
  relayUrl: 'wss://relay.walletconnect.org'
});

Open WalletConnect Modal

This code opens the WalletConnect modal, allowing users to select and connect their wallet.

walletConnectModal.open();

Handle Wallet Connection

This code sets up an event listener to handle the wallet connection event, logging the connected accounts and chain ID.

walletConnectModal.on('connect', (error, payload) => {
  if (error) {
    throw error;
  }
  const { accounts, chainId } = payload.params[0];
  console.log('Connected accounts:', accounts);
  console.log('Connected chainId:', chainId);
});

Other packages similar to @walletconnect/modal

Keywords

FAQs

Package last updated on 20 Jun 2023

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