WalletConnect
The WalletConnectConnector
wraps the WalletConnect Ethereum Provider and supports its configuration options. This is a great option for adding support for many wallets to your app.
import { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect'
Usage
import { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect'
const connector = new WalletConnectConnector({
options: {
qrcode: true,
},
})
Configuration
chains (optional)
Chains supported by app. Defaults to defaultChains
.
import { mainnet, optimism, polygon } from '@wagmi/core/chains'
import { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect'
const connector = new WalletConnectConnector({
chains: [mainnet, optimism, polygon],
options: {
qrcode: true,
},
})
- The above example is using chains from
@wagmi/core/chains
. - Upon connection, the connector will connect to the previously connected chain unless otherwise specified by a
chainId
config on useConnect.
options
Options to pass to the WalletConnect Ethereum Provider.
import { WalletConnectConnector } from '@wagmi/core/connectors/walletConnect'
const connector = new WalletConnectConnector({
options: {
qrcode: true,
rpc: {
1: 'https://eth-mainnet.alchemyapi.io/v2/yourAlchemyId',
},
},
})