blockcypher / explorer

Block explorer showcasing the BlockCypher APIs.
https://live.blockcypher.com
Apache License 2.0
1.09k stars 726 forks source link

Add support for next block on block overview page #26

Closed mflaxman closed 9 years ago

mflaxman commented 9 years ago

@matthieu would it be hard to add next_block (the hash) to this API call?

https://api.blockcypher.com/v1/btc/main/blocks/300000

If not I can do something hackey (height+1), but this will fail on the latest block. To solve that, I can either: 1) Make a separate API call to determine if this is the latest block (slow). Another solution here would be if you returned is_latest_block with the API call above. 2) Just always show it and then if you click it and it's more recent than we have, you get an error message "this is the latest block hash. Sorry we can't see into the future.". Kind of a bad UX.

matthieu commented 9 years ago

Unfortunately yes, it'd be a bit of a pain. But I've added a 'depth' property on the block that does what your is_latest_block idea would do, but gives you a number. The latest has a depth of 0.

mflaxman commented 9 years ago

Awesome!

mflaxman commented 9 years ago

This was implemented :)

ghost commented 9 years ago

Awesome!