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
  1. Ecosystem Development
  2. Integrate Flow EVM with Web3 SDKs

Web3js

Integrate with Web3js

Connet wallet

// Some code
import Web3 from 'web3';

const WalletConnect = () => {

    // connect wallet
    const connectWallet = async () => {
        // init web3 
        const web3 = new Web3(flowWalletProvider);
        // connect wallet
        await flowWalletProvider.request({ method: 'eth_requestAccounts' });
        const accounts = await web3.eth.getAccounts();
  
        const chainId = await web3.eth.getChainId();
        const balance = await web3.eth.getBalance(accounts[0]);
    
      };
  
  return (
     <div>
       <button onClick={connectWallet}>Connect Wallet</button>
     <div/>
  )
}

PreviousEtherjsNextViem

Last updated 4 months ago

See more detail on

See more detail on

🔌
https://github.com/Outblock/web3js-flow-evm-demo
https://github.com/Outblock/web3js-flow-evm-demo