Class: MaxExchangeApi::PublicApi
- Defined in:
- lib/max_exchange_api/public_api.rb
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
- #currencies ⇒ Object
- #depth(market, limit: 10, sort_by_price: true) ⇒ Object
- #k(market, limit: 30, period: 1, timestamp: nil) ⇒ Object
- #markets ⇒ Object
- #summary ⇒ Object
- #tickers(market = nil) ⇒ Object
- #timestamp ⇒ Object
- #trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) ⇒ Object
- #vip_levels(level = nil) ⇒ Object
Methods inherited from BaseApi
Constructor Details
This class inherits a constructor from MaxExchangeApi::BaseApi
Instance Method Details
#currencies ⇒ Object
17 18 19 |
# File 'lib/max_exchange_api/public_api.rb', line 17 def currencies send_request(:get, '/currencies', {}) end |
#depth(market, limit: 10, sort_by_price: true) ⇒ Object
25 26 27 |
# File 'lib/max_exchange_api/public_api.rb', line 25 def depth(market, limit: 10, sort_by_price: true) send_request(:get, '/depth', market: market, limit: limit, sort_by_price: sort_by_price) end |
#k(market, limit: 30, period: 1, timestamp: nil) ⇒ Object
21 22 23 |
# File 'lib/max_exchange_api/public_api.rb', line 21 def k(market, limit: 30, period: 1, timestamp: nil) send_request(:get, '/k', market: market, limit: limit, period: period, timestamp: ) end |
#markets ⇒ Object
46 47 48 |
# File 'lib/max_exchange_api/public_api.rb', line 46 def markets send_request(:get, '/markets', {}) end |
#summary ⇒ Object
50 51 52 |
# File 'lib/max_exchange_api/public_api.rb', line 50 def summary send_request(:get, '/summary', {}) end |
#tickers(market = nil) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/max_exchange_api/public_api.rb', line 54 def tickers(market = nil) if market send_request(:get, "/tickers/#{market}", {}) else send_request(:get, '/tickers', {}) end end |
#timestamp ⇒ Object
62 63 64 |
# File 'lib/max_exchange_api/public_api.rb', line 62 def send_request(:get, '/timestamp', {}) end |
#trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/max_exchange_api/public_api.rb', line 29 def trades(market, timestamp: nil, from: nil, to: nil, order_by: 'desc', pagination: true, page: 1, limit: 50, offset: 0) send_request( :get, '/trades', market: market, timestamp: , from: from, to: to, order_by: order_by, pagination: pagination, page: page, limit: limit, offset: offset, ) end |
#vip_levels(level = nil) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/max_exchange_api/public_api.rb', line 9 def vip_levels(level = nil) if level send_request(:get, "/vip_levels/#{level}", {}) else send_request(:get, '/vip_levels', {}) end end |