โ๏ธWallet integration
This page details how a dapp connects to a user's BeraSig wallet.
Install BeraSig Extension
The first thing you need to do is install the BeraSig Extension if you don't have it. You can find it here https://chromewebstore.google.com/detail/berasig/ckedkkegjbflcfblcjklibnedmfjppbj
Connect BeraSig Wallet using ethers
// Connect & get accounts
window.berasig.ethereum.request({method: 'eth_accounts'});
// Alias for connection
window.berasig.ethereum.request({method: 'eth_requestAccounts'});import { BrowserProvider } from 'ethers'
const provider = new BrowserProvider(window.berasig.ethereum)
const accounts = await provider.send('eth_requestAccounts', [])
const network = await provider.getNetwork()
const balance = await provider.getBalance(accounts[0])Connect BeraSig Wallet using rainbowkit
Ensure that you are using the latest versions of RainbowKit, Wagmi, and Viem
pnpm i @rainbow-me/rainbowkit@2 wagmi@2 [email protected]Since Wagmi v2 requires TanStack Query as a peer dependency, install it using the command below:
Here is an example configuration to integrate BerasigWallet with RainbowKit:ja
Last updated
