class Utils def self.get_bchxrp_price # fetch bch/xrp price from coin market cap 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) end end