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

@walletconnect/modal

Package Overview
Dependencies
Maintainers
12
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)

  • 2.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
12
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 30 Sep 2024

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