Class: Bitex::MarketData

Inherits:
Object
  • Object
show all
Defined in:
lib/bitex/market.rb

Overview

Public market data for a specie, do not use directly, use BitcoinMarketData and LitecoinMarketData instead.

Direct Known Subclasses

BitcoinMarketData, LitecoinMarketData

Class Method Summary collapse

Class Method Details

.last_24_hoursObject

Returns a list of lists with aggregated transaction data for each hour from the last 24 hours.



30
31
32
# File 'lib/bitex/market.rb', line 30

def self.last_24_hours
  api_get('/market/last_24_hours')
end

.last_30_daysObject

Returns a list of lists with aggregated transaction data for each day from the last 30 days.



44
45
46
# File 'lib/bitex/market.rb', line 44

def self.last_30_days
  api_get('/market/last_30_days')
end

.last_7_daysObject

Returns a list of lists with aggregated transaction data for each 4 hour period from the last 7 days.



37
38
39
# File 'lib/bitex/market.rb', line 37

def self.last_7_days
  api_get('/market/last_7_days')
end

.order_bookObject

The species order book as a Hash with two keys: bids and asks. Each of them is a list of list consisting of [price, quantity]



16
17
18
# File 'lib/bitex/market.rb', line 16

def self.order_book
  api_get('/market/order_book').symbolize_keys
end

.tickerObject

The species currency ticker conveniently formatted as a ruby Hash with symbolized keys.



9
10
11
# File 'lib/bitex/market.rb', line 9

def self.ticker
  api_get('/market/ticker').symbolize_keys
end

.transactionsObject

The species transactions for the past hour as a list of lists, each composed of [unix_timestamp, transaction_id, price, quantity]



23
24
25
# File 'lib/bitex/market.rb', line 23

def self.transactions
  api_get('/market/transactions')
end