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

chain-pal

v1.0.1

Published

ChainPal is a handy CLI tool for developers working with EVM-like chains. It provides various useful utilities for conversion, address verification, gas estimation, processing transaction data from CSV files, and more.

Downloads

3

Readme

ChainPal

ChainPal is a handy CLI tool for developers working with EVM-like chains. It provides various useful utilities for conversion, address verification, gas estimation, processing transaction data from CSV files, and more.

Installation

To install ChainPal, run the following command:

npm install -g chain-pal

ChainPal provides several commands to work with blockchain data:

Convert a value between hex and decimal and vice versa.

chain-pal convert <value>
  • value: The value in hex or decimal format to be converted.

Convert a value in wei to gwei and ether, considering token decimals

chain-pal convert-unit-wei <value> <decimals>
  • value: The value in wei to be converted.
  • decimals: The number of decimals for the token (default: 18).

Convert a value in gwei to wei and ether, considering token decimals

chain-pal convert-unit-gwei <value> <decimals>
  • value: The value in gwei to be converted.
  • decimals: The number of decimals for the token (default: 18).

Convert a value in ether to wei and gwei, considering token decimals

chain-pal convert-unit-ether <value> <decimals>
  • value: The value in ether to be converted.
  • decimals: The number of decimals for the token (default: 18).

Process a CSV file containing transactions and output the transaction details,

considering the gas price and gas limit for EVM-like chains

chain-pal process-csv <httpEndpoint> <csvFilePath>
  • httpEndpoint: The HTTP endpoint for the JSON-RPC provider. It can be https://ethereum.publicnode.com

  • csvFilePath: The file path of the CSV to be processed.

  • must have the following format:

    | amountWei | from | to | ---------------------- | -------------------------------------------|--------------------------------------------| | 10000000000000000000 | 0x71508f88e558b414f8a65b3b56362bfb7a9652b8 | 0xed1052b6017745d1fab9f0a0b10bc81bba6b5068 |

Checks if an address is a smart contract or not.

chain-pal is-contract <httpEndpoint> <address>

httpEndpoint: The HTTP endpoint for the JSON-RPC provider. It can be https://ethereum.publicnode.com

  • address: The address to be checked.

Verify the validity of an EVM address.

chain-pal is-valid <address>
  • address: The address to verify.

Estimates gas given from, to, and value.

chain-pal estimate-gas <httpEndpoint> <from> <to> <value>
  • httpEndpoint: The HTTP endpoint for the JSON-RPC provider. It can be https://ethereum.publicnode.com
  • from: The source address.
  • to: The target address.
  • value: The transaction value.

Encode a function signature based on the input

chain-pal encode-signature <signature>
  • signature: Keccak256 function to be encoded. e.g approve(address,uint256)