class Cryptoexchange::Exchanges::Axnet::Services::Trades
Public Class Methods
supports_individual_ticker_query?()
click to toggle source
# File lib/cryptoexchange/exchanges/axnet/services/trades.rb, line 6 def supports_individual_ticker_query? true end
Public Instance Methods
adapt(output)
click to toggle source
# File lib/cryptoexchange/exchanges/axnet/services/trades.rb, line 22 def adapt(output) output.collect do |trade| tr = Cryptoexchange::Models::Trade.new tr.trade_id = nil tr.base = trade['token'] tr.target = trade['basetoken'] tr.type = trade['type'] tr.price = trade['price'] tr.amount = trade['amount'] tr.timestamp = trade['timestamp'] tr.payload = trade tr.market = Axnet::Market::NAME tr end end
fetch(market_pair)
click to toggle source
Calls superclass method
Cryptoexchange::Services::Market#fetch
# File lib/cryptoexchange/exchanges/axnet/services/trades.rb, line 11 def fetch(market_pair) output = super(trade_history_url(market_pair)) adapt(output) end
trade_history_url(market_pair)
click to toggle source
# File lib/cryptoexchange/exchanges/axnet/services/trades.rb, line 16 def trade_history_url(market_pair) base = market_pair.base target = market_pair.target "#{Cryptoexchange::Exchanges::Axnet::Market::API_URL}/return24Trades?market=#{base}_#{target}" end