Flow Wallet
  • 👋Welcome to Flow Wallet
  • Ecosystem Primers
    • ⭐Flow Reference Wallet Primer
  • FAQ
    • ❓FAQ
  • Features
    • ⛓️Account Linking
    • 🔌WalletConnect
    • 📖Human Readable Transactions
    • 💚Flow Client Library (FCL)
    • 🔓Secure Enclave
    • 🦺Account Recovery
  • Ecosystem Development
    • 🛠️Ecosystem Developer Grants
    • 🔌Integrate Flow EVM with Web3 SDKs
      • Wagmi
      • Rainbowkit
      • Etherjs
      • Web3js
      • Viem
      • Web3-Onboard
      • MIPD
      • Others SDKs
  • Download
    • 📲Download
  • Open Source
    • 💽Open Source
  • Tutorial
    • 🔐Mobile Wallet Backup Guide
    • 💸Move Assets between Flow and EVM
    • 📱Mobile Wallet Restore Guide
    • 💻Extension Wallet Backup Guide
    • 🖥️Extension Wallet Restore Guide
    • 🔁Extension Update Guide
    • 🪙FLOW wallet init token guide
    • 💾Extension Private Key and Seed Phrase Guide
    • ⛵Mobile Wallet Export Log Guide
Powered by GitBook
On this page
  • Config wagmi with Chains and providers
  • Connect injected wallet with Flow EVM
  1. Ecosystem Development
  2. Integrate Flow EVM with Web3 SDKs

Wagmi

Integrate with Wagmi

Config wagmi with Chains and providers

// config.ts file
import { http, cookieStorage, createConfig, createStorage } from 'wagmi'
import { flowMainnet, flowTestnet} from 'wagmi/chains'

export function getConfig() {
  return createConfig({
    chains: [flowMainnet, flowTestnet],
    connectors: [
      injected(),
    ],
    storage: createStorage({
      storage: cookieStorage,
    }),
    ssr: true,
    transports: {
      [flowMainnet.id]: http(),
      [flowTestnet.id]: http(),
    },
  })
}

Connect injected wallet with Flow EVM

// page.ts
import { useAccount, useConnect, useDisconnect, useSignMessage, useVerifyMessage } from 'wagmi'
import { signMessage, getAccount, verifyMessage } from '@wagmi/core'
import { getConfig } from '../config'

function App() {
    const config = getConfig()

    const account = useAccount()
    const { connectors, connect, status, error } = useConnect()

    return (
       <div>
          <h2>Connect</h2>
          {connectors.map((connector) => (
            <button
              key={connector.uid}
              onClick={() => connect({ connector })}
              type="button"
            >
              {connector.name}
            </button>
          ))}
        <div/>
    )
}

PreviousIntegrate Flow EVM with Web3 SDKsNextRainbowkit

Last updated 3 months ago

See more detail on

🔌
https://github.com/Outblock/wagmi-project