Getting Started
Installation
Inside your React project directory, run the following:
yarn add wagmi ethers
Or with npm:
npm install wagmi ethers
Quick Start
Wrap your app with the Provider
component.
import { Provider } from 'wagmi'
const App = () => ( <Provider> <YourRoutes /> </Provider>)
💡
Provider
has multiple configuration options: connectors (i.e.
WalletConnect), auto connect, websockets, etc. Check
here for more info.
Use hooks! Every component inside the Provider
is set up with the default InjectedConnector
for connecting wallets and ethers.js Default Provider for fetching data.
import { useAccount } from 'wagmi'
const Page = () => { const [{ data, error, loading }, disconnect] = useAccount({ fetchEns: true, })
return ...}
Continue on to check out the Guides or skip to the API Documentation.
wagmi!