web3.eth Migration Guide
Breaking Changes
All the API level interfaces returning or accepting null
in 1.x, use undefined
in 4.x.
Return Values
Returns a BigInt
instead of a number string
web3.eth.getGasPrice
web3.eth.getBalance
Returns a BigInt
instead of a number
web3.eth.getBlockNumber
web3.eth.getBlockTransactionCount
web3.eth.getBlockUncleCount
web3.eth.getTransactionCount
web3.eth.estimateGas
web3.eth.getBlock
- Returns a
BigInt
instead of a number for the following properties:baseFeePerGas
gasLimit
gasUsed
number
size
timestamp
- Returns a
BigInt
instead of a number string for the following properties:difficulty
totalDifficulty