Without this feature I couldn't use this library for retrieving all block transactions since calling getTransation for all transactions in a block is inefficient.
This is something we have been considering adding. The issue is that only certain backends support it. We have two options:
1) Backends that do not support full blocks, return an error.
2) Backends that do not support full blocks, calls fetchTransaction for each transaction hash.
I'm leaning towards 1, since 2 would likely result in a soft-ban from Etherscan when using the EtherscanProvider.
You can, for now, accomplish this by using the JsonRpcProvider.send directly (however, the block is not parsed):
var provider = new ethers.providers.JsonRpcProvider();
provider.send('eth_getBlockByHash', [ blockHash, true ]).then((block) => {
console.log(block);
});
I'll add this for the v4 release, because it is certainly very useful when processing blocks.
This is available in 4.0.0.-beta.14. Please let me know if you have any issues with it.
Thanks! :)
Most helpful comment
This is available in
4.0.0.-beta.14. Please let me know if you have any issues with it.Thanks! :)