lib/sibit/btc.rb in sibit-0.12.6 vs lib/sibit/btc.rb in sibit-0.13.0

- old
+ new

@@ -68,9 +68,13 @@ raise Sibit::Error, 'Not implemented yet' end # Gets the hash of the latest block. def latest - raise Sibit::Error, 'Not implemented yet' + uri = URI('https://chain.api.btc.com/v3/block/latest') + json = Sibit::Json.new(http: @http, log: @log).get(uri) + hash = json['data']['hash'] + @log.info("The hash of the latest block is #{hash}") + hash end end end