@web3-onboard/walletconnect
Wallet module for connecting Wallet Connect to web3-onboard
Install
npm i @web3-onboard/core @web3-onboard/walletconnect
Version 1 of WalletConnect has been deprecated
Version 1 of WalletConnect has been deprecated by the WC team and the WC bridge is not available. If wanting to continue to use WalletConnect V1 a custom bridge URL is required. Support will be completely removed from Web3-Onboard in the future
Options
type WalletConnectOptions = {
handleUri?: (uri: string) => Promise<unknown>
} & (
| {
version: 1
bridge: string
connectFirstChainId?: boolean
qrcodeModalOptions?: {
mobileLinks: string[]
}
}
| {
projectId: string
dappUrl?: string
version?: 2
requiredChains?: number[] | undefined
optionalChains?: number[] | undefined
qrModalOptions?: EthereumProviderOptions['qrModalOptions']
additionalOptionalMethods?: string[] | undefined
}
)
Usage
import Onboard from '@web3-onboard/core'
import walletConnectModule from '@web3-onboard/walletconnect'
const wcV2InitOptions = {
projectId: 'abc123...',
requiredChains: [1, 56],
dappUrl: 'http://YourAwesomeDapp.com'
}
const walletConnect = walletConnectModule(wcV2InitOptions)
const onboard = Onboard({
wallets: [
walletConnect
]
})
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)