Module: Coinigy::Client::MarketData

Included in:
Coinigy::Client
Defined in:
lib/coinigy/client/market_data.rb

Overview

Access exchange and market data

Instance Method Summary collapse

Instance Method Details

#data(options = {}) ⇒ Object

Trade history, asks and bids for any supported exchange/market type: Can be 'all', 'history', 'asks', 'bids' or 'orders'



17
18
19
# File 'lib/coinigy/client/market_data.rb', line 17

def data(options = {})
  request('data', options.slice('exchange_code', 'exchange_market', 'type'))
end

#exchangesObject

Returns a list of all supported exchanges



6
7
8
# File 'lib/coinigy/client/market_data.rb', line 6

def exchanges
  request('exchanges')
end

#markets(id = nil) ⇒ Object

Returns a list of markets on specified exchange



11
12
13
# File 'lib/coinigy/client/market_data.rb', line 11

def markets(id = nil)
  request('markets', { exchange_code: id })
end

#ticker(options = {}) ⇒ Object

Returns last, high (24h), low (24h), ask, bid for specified market



22
23
24
# File 'lib/coinigy/client/market_data.rb', line 22

def ticker(options = {})
  request('ticker', options.slice('exchange_code', 'exchange_market'))
end