lib/utils.rb in SimBot-0.1.3 vs lib/utils.rb in SimBot-0.1.4
- old
+ new
@@ -4,9 +4,16 @@
factor = rand(1...1.01)
response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=XRP')
hash = JSON.parse (response.body)
return hash['data']['quotes']['XRP']['price'].to_f.round(4) * factor
end
+ def self.get_bchbtc_price
+ # fetch bch/xrp price from coin market cap
+ factor = rand(1...1.01)
+ response = RestClient.get('https://api.coinmarketcap.com/v2/ticker/1831/?convert=BTC')
+ hash = JSON.parse (response.body)
+ return hash['data']['quotes']['BTC']['price'].to_f.round(4) * factor
+ end
def self.get_eoseth_price
# fetch bch/xrp price from coin market cap
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)