An Ethereum RPC payload formatter that converts between JavaScript values and hex-encoded RPC data. Version 0.2.7 (stable) with irregular releases. Provides bidirectional formatting for all standard Ethereum RPC methods, handling BigNumber, hex, and address conversions. Unlike ethers or web3, it is focused solely on RPC formatting without network transport.
npm install ethjs-formatNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to format RPC inputs and outputs using ethjs-format for the eth_getBalance method.
Use exact method names like 'eth_getBalance', not 'eth_getbalance'.
Use .toString(10) or .toNumber() to convert.
Migrate to ethers.js or web3.js which include built-in formatting.
Use 'eth_getBalance' (capital B) instead.
Check the return type: for methods returning numbers, use .toString(10); for hex strings, use it directly.
Run 'npm install ethjs-format' which includes dependencies, or install manually 'npm install ethjs-util'.