npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ethereum-js/multicall

v0.0.4

Published

Multicall allows multiple smart contract constant function calls to be grouped into a single call and the results aggregated into a single result

Downloads

27

Readme

npm version downloads

@ethereum-js/multicall

@ethereum-js/multicall is a lightweight library for interacting with the Multicall3 smart contract using both ethers v5 and v6.

Installation

npm:

$ npm install @ethereum-js/multicall

yarn:

$ yarn add @ethereum-js/multicall

Example

ESM

import { RPCs } from "@dapp-builder/rpcs"
import { ethers } from "ethers"
import { Multicall } from "..";

(async () => {
  const provider = new ethers.JsonRpcProvider(await RPCs.getRPC(56))

  const multicall = new Multicall({
    provider: provider,
  });

  const result = await multicall.call([{
    abi: [{
      constant: true,
      inputs: [],
      name: "decimals",
      outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    }],
    contractAddress: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
    method: 'decimals',
    parameters: []
  }])

  console.log(result)
})()

CJS

const { Multicall } = require("@ethereum-js/multicall");
const { JsonRpcProvider } = require("ethers");
const { RPCs } = require("@dapp-builder/rpcs");
(async () => {
  const provider = new JsonRpcProvider(await RPCs.getRPC(56));

  const multicall = new Multicall({
    provider,
  });

  const result = await multicall.call([
    {
      abi: [
        {
          constant: true,
          inputs: [],
          name: "decimals",
          outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
          payable: false,
          stateMutability: "view",
          type: "function",
        },
      ],
      contractAddress: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
      method: "decimals",
      parameters: [],
    },
  ]);

  console.log(result)
})();

Supports

The below networks are supported by default.

| Chain | Chain ID | | ----------------------- | ---------- | | Mainnet | 1 | | Kovan | 3 | | Rinkeby | 4 | | Görli | 5 | | Ropsten | 10 | | Sepolia | 42 | | Optimism | 137 | | Optimism Kovan | 69 | | Optimism Görli | 100 | | Arbitrum | 420 | | Arbitrum Görli | 42161 | | Arbitrum Rinkeby | 421611 | | Polygon | 421613 | | Mumbai | 80001 | | Gnosis Chain (xDai) | 11155111 | | Avalanche | 43114 | | Avalanche Fuji | 43113 | | Fantom Testnet | 4002 | | Fantom Opera | 250 | | BNB Smart Chain | 56 | | BNB Smart Chain Testnet | 97 | | Moonbeam | 1284 | | Moonriver | 1285 | | Moonbase Alpha Testnet | 1287 | | Harmony | 1666600000 | | Cronos | 25 | | Fuse | 122 | | Songbird Canary Network | 19 | | Coston Testnet | 16 | | Boba | 288 | | Aurora | 1313161554 | | Astar | 592 | | OKC | 66 | | Heco Chain | 128 | | Metis | 1088 | | RSK | 30 | | RSK Testnet | 31 | | Evmos | 9001 | | Evmos Testnet | 9000 | | Thundercore | 108 | | Thundercore Testnet | 18 | | Oasis | 26863 | | Celo | 42220 | | Godwoken | 71402 | | Godwoken Testnet | 71401 | | Klatyn | 8217 | | Milkomeda | 2001 | | KCC | 321 | | Etherlite | 111 | | Linea Testnet | 59140 |

Issues

Please raise any issues in the below link.

https://github.com/ethereum-js/multicall/issues

Social Network

Github

https://github.com/ethereum-js

Discord

Coming soon

Telegram

Coming soon