Wagmi

Overview and initialization for Wagmi.

Overview

@wagmi/core is a comprehensive VanillaJS library that provides all the essential tools for initiating Ethereum-related tasks. Simplifying processes such as "Connect Wallet," showcasing ENS and balance details, message signing, contract interaction, and more has never been easier with this library.

📘

Wagmi native documentation

Initialization:

import { configureChains, createClient } from 'wagmi'
import { goerli, mainnet } from 'wagmi/chains'
import { publicProvider } from 'wagmi/providers/public'
import { VenlyConnector } from '@venly/wagmi-connector'

const { chains, provider } = configureChains(
  [goerli, mainnet],
  [publicProvider()],
)

export const client = createClient({
  connectors: [
    new VenlyConnector({
      chains,
      options: {
        clientId: 'YOUR_CLIENT_ID', //https://docs.venly.io/widget/deep-dive/authentication#client-id
        environment: 'staging', //optional, defaults to production
      },
    }),
  ],
  provider,
  autoConnect: true,
})