Giter Club home page Giter Club logo

chain-pal's Introduction

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)

chain-pal's People

Contributors

cromaniuc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.