React Hooks library for Ethereum, built on ethers.js.
- ๐ 20+ hooks for working with wallets, ENS, contracts, transactions, signing, etc.
- ๐ผ Built-in wallet connectors for MetaMask, WalletConnect, and Coinbase Wallet
- ๐ Auto-refresh data on wallet and network changes
- ๐ฆ TypeScript ready
- ๐จ Zero-dependencies (besides ethers.js peer dependency)
- ๐ณ Test suite and documentation
- ๐ MIT License
Visit https://wagmi-xyz.vercel.app to view the full documentation.
- Install the dependencies.
npm add wagmi ethers
- Wrap your app with the
Provider
component.
import { Provider } from 'wagmi'
const App = () => (
<Provider>
<YourRoutes />
</Provider>
)
- Use hooks.
import { useAccount } from 'wagmi'
const Page = () => {
const [{ data, error, loading }, disconnect] = useAccount({
fetchEns: true,
})
return ...
}
Every component inside the Provider
is set up with the default InjectedConnector
for connecting wallets and ethers.js Default Provider for fetching data.
Want to learn more? Check out the guides or browse the API docs.
- Join the discussions on GitHub
- Follow @awkweb on Twitter for project updates
- Sign the guestbook
- Share your project/organization that uses wagmi
- awkweb.eth
- GitHub Sponsors
- Gitcoin Grant
- ricmoo.eth for creating and continued work on ethers.js
- Mirror for creating space to do good work
MIT.
wagmi