Class: OKEX::API::Markets
Instance Attribute Summary
Attributes inherited from Base
#config, #key, #secret
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#list(type: :spot) ⇒ Object
7
8
9
10
|
# File 'lib/okex/api/markets.rb', line 7
def list(type: :spot)
raise ArgumentError, "type must be either 'futures' or 'spot'" unless %w(futures spot).include?(type.to_s)
send_request(:get, "/#{type.to_s}/v3/instruments", {})
end
|
#ticker(futures_name, type: :spot) ⇒ Object
17
18
19
20
|
# File 'lib/okex/api/markets.rb', line 17
def ticker(futures_name, type: :spot)
raise ArgumentError, "type must be either 'futures' or 'spot'" unless %w(futures spot).include?(type.to_s)
send_request(:get, "/#{type.to_s}/v3/instruments/#{futures_name}/ticker", {})
end
|
#tickers(type: :spot) ⇒ Object
12
13
14
15
|
# File 'lib/okex/api/markets.rb', line 12
def tickers(type: :spot)
raise ArgumentError, "type must be either 'futures' or 'spot'" unless %w(futures spot).include?(type.to_s)
send_request(:get, "/#{type.to_s}/v3/instruments/ticker", {})
end
|