JSPM

wagmi

0.0.13
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 354659
  • Score
    100M100P100Q160031F
  • License MIT

React Hooks library for Ethereum

Package Exports

  • wagmi
  • wagmi/package.json

Readme

wagmi

React Hooks library for Ethereum, built on ethers.js.

🚀   Hooks for connecting wallets, signing messages, sending transactions, 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

Documentation

Visit https://wagmi-xyz.vercel.app to view the full documentation.

Usage

  1. Install the dependencies.
pnpm add wagmi ethers
  1. Wrap your app with the Provider component.
import { Provider } from 'wagmi'

const App = () => (
  <Provider>
    <YourRoutes />
  </Provider>
)
  1. Use hooks.
import { useAccount } from 'wagmi'

const App = () => {
  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.

Thanks

License

MIT.


wagmi