ethers vs @walletconnect/client vs @web3-react/core vs @walletconnect/web3-provider
Web3 and Wallet Integration Comparison
3 Years
ethers@walletconnect/client@web3-react/core@walletconnect/web3-providerSimilar Packages:
What's Web3 and Wallet Integration?

Web3 and Wallet Integration libraries provide tools for connecting decentralized applications (dApps) to blockchain networks and user wallets. These libraries facilitate interactions with smart contracts, manage user accounts, and handle transactions on behalf of users. They are essential for building applications that leverage blockchain technology, allowing for secure and seamless interactions between users and decentralized platforms. @walletconnect/client is a library for connecting dApps to wallets using the WalletConnect protocol, enabling secure and decentralized wallet connections. @walletconnect/web3-provider is a Web3 provider implementation for WalletConnect, allowing dApps to interact with Ethereum and other blockchain networks through WalletConnect-compatible wallets. @web3-react/core is a framework-agnostic library for managing wallet connections in React applications, providing a set of hooks and components for integrating various wallet providers. ethers is a comprehensive Ethereum library that provides tools for interacting with the Ethereum blockchain, including smart contract interaction, wallet management, and utilities for working with Ethereum addresses and transactions.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
ethers2,259,715
8,42412.9 MB6042 months agoMIT
@walletconnect/client82,074
1,569188 kB55-Apache-2.0
@web3-react/core33,811
5,66967.6 kB1752 years agoGPL-3.0-or-later
@walletconnect/web3-provider19,755
1,569876 kB55-Apache-2.0
Feature Comparison: ethers vs @walletconnect/client vs @web3-react/core vs @walletconnect/web3-provider

Wallet Connection

  • ethers:

    ethers provides wallet connection functionality through its Wallet class and integration with various wallet providers. It supports EIP-1559 transactions, gas estimation, and more, making it a comprehensive solution for Ethereum dApp development.

  • @walletconnect/client:

    @walletconnect/client provides the core functionality for establishing a connection between your dApp and WalletConnect-compatible wallets. It handles the QR code generation, session management, and secure communication between the dApp and the wallet.

  • @web3-react/core:

    @web3-react/core provides a set of hooks and components for managing wallet connections in React applications. It supports multiple wallet providers and allows for easy integration and management of wallet connections within your app.

  • @walletconnect/web3-provider:

    @walletconnect/web3-provider acts as a Web3 provider that wraps around the WalletConnect client, allowing dApps to interact with the Ethereum blockchain through the connected wallet. It integrates seamlessly with existing Web3.js or Ethers.js code, making it easy to use.

Smart Contract Interaction

  • ethers:

    ethers provides a rich set of features for interacting with smart contracts, including contract deployment, function calls, event listening, and more. It is a full-featured library that supports both simple and complex contract interactions.

  • @walletconnect/client:

    @walletconnect/client does not provide direct support for smart contract interaction. It focuses on establishing secure connections between dApps and wallets, leaving contract interaction to be handled by the dApp using Web3 or Ethers.js.

  • @web3-react/core:

    @web3-react/core does not handle smart contract interaction directly. It provides the tools to manage wallet connections, while the actual interaction with smart contracts is done using a separate library like Web3.js or Ethers.js.

  • @walletconnect/web3-provider:

    @walletconnect/web3-provider allows dApps to interact with smart contracts by forwarding calls through the connected wallet. It supports all standard Web3 methods, making it compatible with existing smart contract interaction code.

Ease of Integration

  • ethers:

    ethers is straightforward to integrate for Ethereum-related functionality. Its well-documented API and modular design make it easy to use for both simple and complex tasks.

  • @walletconnect/client:

    @walletconnect/client is easy to integrate into any dApp that needs WalletConnect functionality. However, it requires some manual setup to handle the wallet connection flow and integrate with your existing code.

  • @web3-react/core:

    @web3-react/core offers a flexible and customizable integration for React applications. It allows developers to easily integrate multiple wallet providers and manage connections, but may require some configuration to set up.

  • @walletconnect/web3-provider:

    @walletconnect/web3-provider is designed for easy integration with dApps, especially those that already use Web3.js or Ethers.js. It requires minimal setup and provides a familiar interface for developers.

Documentation and Community

  • ethers:

    ethers boasts excellent documentation, a large community, and numerous tutorials and resources. It is one of the most widely used Ethereum libraries, ensuring plenty of support for developers.

  • @walletconnect/client:

    @walletconnect/client has good documentation and an active community, but it is primarily focused on the WalletConnect protocol. Developers may need to refer to additional resources for integrating with specific wallets or dApps.

  • @web3-react/core:

    @web3-react/core has comprehensive documentation and a supportive community. Its framework-agnostic approach and flexibility have made it popular among React developers.

  • @walletconnect/web3-provider:

    @walletconnect/web3-provider is well-documented and has a growing community of developers. It is widely used in the dApp ecosystem, making it easy to find examples and support.

Code Example

  • ethers:

    Ethers.js Example

    import { ethers } from 'ethers';
    
    // Connect to the Ethereum network
    const provider = new ethers.providers.InfuraProvider('mainnet', 'YOUR_INFURA_ID');
    
    // Create a wallet instance
    const wallet = new ethers.Wallet('YOUR_PRIVATE_KEY', provider);
    
    // Interact with a smart contract
    const contract = new ethers.Contract(CONTRACT_ADDRESS, ABI, wallet);
    const result = await contract.someFunction();
    console.log(result);
    
  • @walletconnect/client:

    WalletConnect Integration Example

    import { Client } from '@walletconnect/client';
    
    const connector = new Client({
      bridge: 'https://bridge.walletconnect.org', // Required
      qrcode: true, // Optional
    });
    
    // Create a new session
    connector.createSession().then(() => {
      const uri = connector.uri;
      console.log(`QR Code URI: ${uri}`);
    });
    
    // Subscribe to connection events
    connector.on('connect', (payload) => {
      const { chainId, accounts } = payload.params[0];
      console.log(`Connected to chain ${chainId} with accounts: ${accounts}`);
    });
    
    // Subscribe to disconnection events
    connector.on('disconnect', (error) => {
      if (error) {
        console.error('Connection error:', error);
      }
      console.log('Disconnected from wallet');
    });
    
  • @web3-react/core:

    Web3 React Example

    import { Web3ReactProvider } from '@web3-react/core';
    import { ethers } from 'ethers';
    
    function getLibrary(provider) {
      return new ethers.providers.Web3Provider(provider);
    }
    
    function App() {
      return (
        <Web3ReactProvider getLibrary={getLibrary}>
          {/* Your app components */}
        </Web3ReactProvider>
      );
    }
    
  • @walletconnect/web3-provider:

    WalletConnect Web3 Provider Example

    import WalletConnectProvider from '@walletconnect/web3-provider';
    import { ethers } from 'ethers';
    
    // Create a WalletConnect Provider
    const provider = new WalletConnectProvider({
      infuraId: 'YOUR_INFURA_ID', // Required
    });
    
    // Enable session (triggers QR Code modal)
    await provider.enable();
    
    // Create an ethers provider
    const web3Provider = new ethers.providers.Web3Provider(provider);
    
    // Get signer
    const signer = web3Provider.getSigner();
    const address = await signer.getAddress();
    console.log(`Connected address: ${address}`);
    
How to Choose: ethers vs @walletconnect/client vs @web3-react/core vs @walletconnect/web3-provider
  • ethers:

    Choose ethers if you need a comprehensive and feature-rich library for interacting with the Ethereum blockchain. It provides tools for smart contract interaction, wallet management, and more, making it suitable for both simple and complex dApp development.

  • @walletconnect/client:

    Choose @walletconnect/client if you need a lightweight library for implementing WalletConnect in your dApp. It provides the core functionality for connecting to WalletConnect-compatible wallets and is ideal for projects that require direct integration with the WalletConnect protocol.

  • @web3-react/core:

    Choose @web3-react/core if you are building a React application and need a flexible and framework-agnostic solution for managing wallet connections. This library allows you to integrate multiple wallet providers and offers a customizable approach to wallet management.

  • @walletconnect/web3-provider:

    Choose @walletconnect/web3-provider if you want a simple way to integrate WalletConnect as a Web3 provider in your dApp. This package is particularly useful if you are building on Ethereum and want to enable users to connect their WalletConnect-compatible wallets easily.

README for ethers

The Ethers Project

npm (tag) CI Tests npm bundle size (version) npm (downloads) GitPOAP Badge Twitter Follow


A complete, compact and simple library for Ethereum and ilk, written in TypeScript.

Features

  • Keep your private keys in your client, safe and sound
  • Import and export JSON wallets (Geth, Parity and crowdsale)
  • Import and export BIP 39 mnemonic phrases (12 word backup phrases) and HD Wallets (English as well as Czech, French, Italian, Japanese, Korean, Simplified Chinese, Spanish, Traditional Chinese)
  • Meta-classes create JavaScript objects from any contract ABI, including ABIv2 and Human-Readable ABI
  • Connect to Ethereum nodes over JSON-RPC, INFURA, Etherscan, Alchemy, Ankr or MetaMask
  • ENS names are first-class citizens; they can be used anywhere an Ethereum addresses can be used
  • Small (~144kb compressed; 460kb uncompressed)
  • Tree-shaking focused; include only what you need during bundling
  • Complete functionality for all your Ethereum desires
  • Extensive documentation
  • Large collection of test cases which are maintained and added to
  • Fully written in TypeScript, with strict types for security and safety
  • MIT License (including ALL dependencies); completely open source to do with as you please

Keep Updated

For advisories and important notices, follow @ethersproject on Twitter (low-traffic, non-marketing, important information only) as well as watch this GitHub project.

For more general news, discussions, and feedback, follow or DM me, @ricmoo on Twitter or on the Ethers Discord.

For the latest changes, see the CHANGELOG.

Summaries

Installing

NodeJS

/home/ricmoo/some_project> npm install ethers

Browser (ESM)

The bundled library is available in the ./dist/ folder in this repo.

<script type="module">
    import { ethers } from "./dist/ethers.min.js";
</script>

Documentation

Browse the documentation online:

Providers

Ethers works closely with an ever-growing list of third-party providers to ensure getting started is quick and easy, by providing default keys to each service.

These built-in keys mean you can use ethers.getDefaultProvider() and start developing right away.

However, the API keys provided to ethers are also shared and are intentionally throttled to encourage developers to eventually get their own keys, which unlock many other features, such as faster responses, more capacity, analytics and other features like archival data.

When you are ready to sign up and start using for your own keys, please check out the Provider API Keys in the documentation.

A special thanks to these services for providing community resources:

Extension Packages

The ethers package only includes the most common and most core functionality to interact with Ethereum. There are many other packages designed to further enhance the functionality and experience.

  • MulticallProvider - A Provider which bundles multiple call requests into a single call to reduce latency and backend request capacity
  • MulticoinPlugin - A Provider plugin to expand the support of ENS coin types
  • GanaceProvider - A Provider for in-memory node instances, for fast debugging, testing and simulating blockchain operations
  • Optimism Utilities - A collection of Optimism utilities
  • LedgerSigner - A Signer to interact directly with Ledger Hardware Wallets

License

MIT License (including all dependencies).