-
Notifications
You must be signed in to change notification settings - Fork 7
Feature Support & Comparison
Trevor Clarke edited this page Jul 2, 2019
·
10 revisions
Details about web3.js & ethers.js
- Web3.js: https://web3js.readthedocs.io/en/1.0/web3-eth.html
- Ethers.js: https://docs.ethers.io/ethers.js/html/api-providers.html#network
Feature | Web3.js | Ethers.js | Support in Web3data.js | Notes |
---|---|---|---|---|
getAccount | ✓ | ✓ | ✓ | ✓ |
getHashrate | ✓ | × | × | |
getGasPrice | ✓ | ✓ | ✓ | Web3.js returns "20000000000", ethers returns: "20000000000", use endpoint: https://docs.amberdata.io/reference/transactions#get-gas-predictions using fastest or average |
getAccounts | ✓ | ✓ | × | |
getBlockNumber | ✓ | ✓ | ✓ | Web3.js returns: 7280000, ethers returns: 7280000, use endpoint: https://github.com/amberdata/data-api#get-blocksid using the block.current
|
getBalance | ✓ | ✓ | ✓ | |
getStorageAt | ✓ | ✓ | × | |
getCode | ✓ | ✓ | ✓ | |
getBlock | ✓ | ✓ | ✓ | |
getBlockTransactionCount | ✓ | × | ✓ | |
getUncle | ✓ | × | ✓ | |
getTransaction | ✓ | ✓ | ✓ | |
getPendingTransactions | ✓ | × | ✓ | |
getTransactionFromBlock | ✓ | × | ✓ | |
getTransactionReceipt | ✓ | ✓ | ? | |
getTransactionCount | ✓ | ✓ | ✓ | |
sendTransaction | ✓ | ✓ | × | |
sendSignedTransaction | ✓ | × | × | |
sign | ✓ | ✓ | × | |
signTransaction | ✓ | ✓ | × | |
call | ✓ | ✓ | × | |
estimateGas | ✓ | ✓ | × | |
getPastLogs | ✓ | ✓ | ✓ | Ethersjs - getLogs() |
getWork | ✓ | × | × | |
submitWork | ✓ | × | × | |
getChainId | ✓ | × | ✓ | |
Contract.getPastEvents | ✓ | × | ✓ | |
utils | ✓ | ✓ | ? | |
getEtherPrice | × | ✓ | ✓ |
Feature | Web3.js | Ethers.js | Support in Web3data.js | Notes |
---|---|---|---|---|
Contract.on | ✓ | ✓ | ✓ | |
Contract.once | ✓ | ✓ | ✓ | |
Contract.events.MyEvent | ✓ | ✓^ | ? | Ethers.js - Only available via filters |
Contract.events.allEvents | ✓ | ✓^ | ? | Ethers.js - Only available via filters |