Class: Cryptsy::API2::Markets

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptsy/api2/markets.rb

Instance Method Summary collapse

Constructor Details

#initialize(public_key = nil, private_key = nil) ⇒ Markets

Returns a new instance of Markets.



4
5
6
7
# File 'lib/cryptsy/api2/markets.rb', line 4

def initialize(public_key=nil, private_key=nil)
  @public_key = public_key
  @private_key = private_key
end

Instance Method Details

#fees(market_id) ⇒ Object



29
30
31
# File 'lib/cryptsy/api2/markets.rb', line 29

def fees(market_id)
  Request.send("markets/#{market_id}/fees", {}, @public_key, @private_key)
end

#info(market_id) ⇒ Object



13
14
15
# File 'lib/cryptsy/api2/markets.rb', line 13

def info(market_id)
  Request.send("markets/#{market_id}")
end

#listObject



9
10
11
# File 'lib/cryptsy/api2/markets.rb', line 9

def list
  Request.send("markets")
end

#ohlc(market_id, options = {}) ⇒ Object



45
46
47
# File 'lib/cryptsy/api2/markets.rb', line 45

def ohlc(market_id, options={})
  Request.send("markets/#{market_id}/ohlc", options)
end

#orderbook(market_id, options = {}) ⇒ Object



37
38
39
# File 'lib/cryptsy/api2/markets.rb', line 37

def orderbook(market_id, options={})
  Request.send("markets/#{market_id}/orderbook", options)
end

#ticker(market_id = nil) ⇒ Object



23
24
25
26
27
# File 'lib/cryptsy/api2/markets.rb', line 23

def ticker(market_id=nil)
  path = "markets/ticker"
  path = "markets/#{market_id}/ticker" unless market_id.nil?
  Request.send(path)
end

#tradehistory(market_id, options = {}) ⇒ Object



41
42
43
# File 'lib/cryptsy/api2/markets.rb', line 41

def tradehistory(market_id, options={})
  Request.send("markets/#{market_id}/tradehistory", options)
end

#triggers(market_id) ⇒ Object



33
34
35
# File 'lib/cryptsy/api2/markets.rb', line 33

def triggers(market_id)
  Request.send("markets/#{market_id}/triggers", {}, @public_key, @private_key)
end

#volume(market_id = nil) ⇒ Object



17
18
19
20
21
# File 'lib/cryptsy/api2/markets.rb', line 17

def volume(market_id=nil)
  path = "markets/volume"
  path = "markets/#{market_id}/volume" unless market_id.nil?
  Request.send(path)
end