Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@walletconnect/modal
Advanced tools
#### 🔎 [Examples](https://github.com/WalletConnect/web3modal-examples)
@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.
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);
});
Web3Modal is a popular library for connecting to various wallet providers in a web application. It offers a modal interface similar to @walletconnect/modal but supports a wider range of wallet providers beyond WalletConnect-compatible wallets.
Torus provides a simple and user-friendly way to integrate blockchain wallets into web applications. It offers a seamless login experience using OAuth providers like Google and Facebook, making it easier for users to get started with blockchain applications.
Fortmatic is a wallet provider that allows users to log in using their phone number or email. It offers a straightforward integration process and a user-friendly interface, making it a good alternative to WalletConnect for certain use cases.
Simplest and most minimal way to implement ui for WalletConnect.
Please follow developer docs to set up WalletConnect Modal locally.
FAQs
#### 🔎 [Examples](https://github.com/WalletConnect/web3modal-examples)
We found that @walletconnect/modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.