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 🙏

© 2025 – Pkg Stats / Ryan Hefner

web3-call

v1.0.6

Published

<!--lint disable awesome-heading awesome-github awesome-toc double-link -->

Readme

Table of Contents

Use the "Table of Contents" menu on the top-left corner to explore the list.

Resources

Official Resources

Get Started

npm install web3-call --save
yarn add web3-call

Example

/*
  Initialize JsonRPCProvider to connect with blockchain. 
  For example: Get account balance and logs it to console. 
*/

// 1_getBalance.ts

import {
  getProvider,
  DEFAULT_RPC,
  getContractNoSigner,
  KAP20ABI,
} from "web3-call";
import type { KAP20 } from "web3-call";

import { ethers } from "ethers";
import { account1, ADDRESS } from "./config";

const main = async () => {
  const provider = getProvider(DEFAULT_RPC.bitkubTestnet);

  const balance = await provider.getBalance(account1);
  console.log(
    `\nKUB Balance of ${account1} --> ${ethers.utils.formatEther(
      balance
    )} KUB\n`
  );
};

main();
/*
  Initialize Contract without signer just for *READ* Smartcontract 
*/
import {
  getProvider,
  DEFAULT_RPC,
  getContractNoSigner,
  KAP20ABI,
} from "web3-call";
import type { KAP20 } from "web3-call";

import { ethers } from "ethers";
import { account1, ADDRESS } from "./config";

const main = async () => {
  const provider = getProvider(DEFAULT_RPC.bitkubTestnet);

  const KAP20Contract =
    getContractNoSigner < KAP20 > (ADDRESS.KUSDC, KAP20ABI, provider);

  const KUSDBalance = await KAP20Contract.balanceOf(account1);

  console.log(
    `\nKUSD Balance of ${account1} --> ${ethers.utils.formatEther(
      KUSDBalance
    )} KUSD\n`
  );
};

main();
/*
  Initialize Contract with signer for *READ* and *Write* to Smartcontract 
  TODO: Create new activity and get logs info returned from Smartcontract. 
*/

import { getProvider, DEFAULT_RPC, getContract, FactoryABI } from "web3-call";
import type { Factory } from "web3-call";
import { ADDRESS, ownerAddress, ownerPrivateKey, RewardType } from "./config";
import { parseEther } from "ethers/lib/utils";

const main = async () => {
  const provider = getProvider(DEFAULT_RPC.bitkubTestnet);

  const FactoryContract =
    getContract <
    Factory >
    (ADDRESS.Factory, ownerPrivateKey, FactoryABI, provider);

  console.log(`\nReading from ${ADDRESS.Factory}\n`);

  const tx = await FactoryContract.createPair(
    Math.floor(Date.now() / 1000), //_startTime ( Now)
    Math.floor((Date.now() + 30 * 60000) / 1000), // _endTime (Now + 30 minutes)
    { from: ownerAddress }
  );
  const txReceipt = await tx.wait();
  console.log(txReceipt);
  const log = FactoryContract.interface.parseLog(txReceipt.logs[1]);
  const newActivityAddress = log.args[0];

  console.log(
    `\New activity address has been created: ${newActivityAddress} \n`
  );
};

main();

More example: Please contact with @ [email protected]