Security News
Python Overtakes JavaScript as Top Programming Language on GitHub
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
@wagmi/connectors
Advanced tools
@wagmi/connectors is a package that provides a set of connectors for integrating with various Ethereum wallets. It is part of the wagmi library, which is designed to make it easier to work with Ethereum in JavaScript and TypeScript applications. The connectors facilitate the connection between your application and different wallet providers, enabling functionalities such as authentication, transaction signing, and more.
MetaMask Connector
This feature allows you to connect your application to the MetaMask wallet. The MetaMaskConnector can be configured with various options, such as supported chains and whether to shim the disconnect functionality.
const { MetaMaskConnector } = require('@wagmi/connectors');
const metaMaskConnector = new MetaMaskConnector({
chains: [/* array of supported chains */],
options: {
shimDisconnect: true,
},
});
WalletConnect Connector
This feature allows you to connect your application to wallets that support WalletConnect. The WalletConnectConnector can be configured with options like whether to display a QR code for connection.
const { WalletConnectConnector } = require('@wagmi/connectors');
const walletConnectConnector = new WalletConnectConnector({
chains: [/* array of supported chains */],
options: {
qrcode: true,
},
});
Coinbase Wallet Connector
This feature allows you to connect your application to the Coinbase Wallet. The CoinbaseWalletConnector can be configured with options such as the name of your application.
const { CoinbaseWalletConnector } = require('@wagmi/connectors');
const coinbaseWalletConnector = new CoinbaseWalletConnector({
chains: [/* array of supported chains */],
options: {
appName: 'MyApp',
},
});
Web3Modal is a library that allows developers to easily integrate multiple wallet providers into their applications. It provides a modal component that lets users choose their preferred wallet. Compared to @wagmi/connectors, Web3Modal offers a more user-friendly interface for selecting wallets but may not provide as much granular control over individual connectors.
Web3-react is a library for managing Ethereum wallet connections in React applications. It provides hooks and connectors for various wallet providers. Compared to @wagmi/connectors, web3-react is more tightly integrated with React and offers a more React-centric API, whereas @wagmi/connectors can be used in any JavaScript or TypeScript environment.
Ethers.js is a library for interacting with the Ethereum blockchain and its ecosystem. While it is not specifically focused on wallet connectors, it provides utilities for connecting to various providers and signing transactions. Compared to @wagmi/connectors, ethers.js offers a broader range of functionalities beyond just wallet connections.
@wagmi/connectors
Collection of connectors for wagmi.
Install the @wagmi/connectors
package.
npm i @wagmi/connectors
Configure your wagmi client with connectors!
import { configureChains, createClient } from 'wagmi'
import { InjectedConnector } from '@wagmi/connectors/injected'
const { chains, provider } = configureChains(...)
const client = createClient({
connectors: [
new InjectedConnector({ chains }),
],
provider,
})
If your bundler supports tree-shaking (most likely), only the used connectors will be included in the bundle, so you don't have to worry about bundle size. 😊
CoinbaseWalletConnector
InjectedConnector
LedgerConnector
MetaMaskConnector
MockConnector
SafeConnector
WalletConnectConnector
Want to add another chain to the list? Make sure you read the contributing guide first.
FAQs
Collection of connectors for Wagmi
We found that @wagmi/connectors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Security News
Python becomes GitHub's top language in 2024, driven by AI and data science projects, while AI-powered security tools are gaining adoption.
Security News
Dutch National Police and FBI dismantle Redline and Meta infostealer malware-as-a-service operations in Operation Magnus, seizing servers and source code.
Research
Security News
Socket is tracking a new trend where malicious actors are now exploiting the popularity of LLM research to spread malware through seemingly useful open source packages.