The information returned with a block doesn't seem to have the block reward. How can I get access to the block reward through ethers?
I don鈥檛 believe that information is available in-protocol. You might need to create a table for each hardfork鈥檚 subsidy reward and block activation number.
If someone else knows otherwise, please feel free to chime in. :)
@lastmjs you can get non-standard information like this with parity's trace module.
For example trace_block rpc call
$ curl --data '{"method":"trace_block","params":["0x2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://parity-node-rpc-url
{"jsonrpc":"2.0","result":[{"action":{"author":"0x36560493644fbb79f1c38d12ff096f7ec5d333b7","rewardType":"block","value":"0x0"},"blockHash":"0x917446bc1058c87ead38089b81fa99aad220b40a5a177f24b1fc069efd38da9a","blockNumber":2,"result":null,"subtraces":0,"traceAddress":[],"transactionHash":null,"transactionPosition":null,"type":"reward"}],"id":1}
Checkout https://openethereum.github.io/wiki/JSONRPC-trace-module#trace_block
Keep in mind the trace_* and debug_* methods are only available in certain backends and can be configured as to how many blocks back can be searched.
To access these in ethers, from the JsonRpcProvider, you can use provider.send("trace_block", [ ]). The result will not be parsed though, so you will need to spelunk into the returned data structure yourself. :)
I think for your purposes, this issue has been resolved. There is no generic solution available, but in certain situations this can be used. :)
So, I'm going to close this issue, but if anyone has further questions, please feel free to re-open. :)
Thanks! :)
Most helpful comment
@lastmjs you can get non-standard information like this with parity's trace module.
For example
trace_blockrpc callCheckout https://openethereum.github.io/wiki/JSONRPC-trace-module#trace_block