lib/utils.rb in SimBot-0.1.38 vs lib/utils.rb in SimBot-0.1.39

- old
+ new

@@ -134,9 +134,17 @@ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1765/?convert=ETH') hash = JSON.parse (response.body) return hash['data']['quotes']['ETH']['price'].to_f.round(4) end + # fetch eos/eth price from coin market cap + # @return [float] rate + def self.ethusd_price + response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1027/?convert=USD') + hash = JSON.parse (response.body) + return hash['data']['quotes']['USD']['price'].to_f.round(4) + end + # fetch binance order book # @return [float] rate def self.binance_order_book response = RestClient.get('https://api.binance.com/api/v1/depth?symbol=BCCBTC&limit=500') hash = JSON.parse(response.body)