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.
To install ChainPal, run the following command:
npm install -g chain-pal
ChainPal provides several commands to work with blockchain data:
chain-pal convert <value>
- value: The value in hex or decimal format to be converted.
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).
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).
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).
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
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.
chain-pal is-valid <address>
- address: The address to verify.
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.
chain-pal encode-signature <signature>
- signature: Keccak256 function to be encoded. e.g approve(address,uint256)