Module: Binance::Client::REST::Public_API
- Included in:
- Binance::Client::REST
- Defined in:
- lib/binance/client/rest/public_api.rb
Overview
API endpoints that don’t require any type of authentication
Instance Method Summary collapse
- #agg_trades(options) ⇒ Object
- #all_book_tickers ⇒ Object
- #all_prices ⇒ Object
- #depth(options) ⇒ Object
- #exchange_info ⇒ Object
- #klines(options) ⇒ Object
- #ping ⇒ Object
- #products ⇒ Object
- #public_api ⇒ Object
- #time ⇒ Object
- #twenty_four_hour(options) ⇒ Object
Instance Method Details
#agg_trades(options) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/binance/client/rest/public_api.rb', line 42 def agg_trades() response = public_api.get do |req| req.url 'aggTrades' req.params.merge! end response.body end |
#all_book_tickers ⇒ Object
70 71 72 |
# File 'lib/binance/client/rest/public_api.rb', line 70 def all_book_tickers public_api.get('ticker/allBookTickers').body end |
#all_prices ⇒ Object
66 67 68 |
# File 'lib/binance/client/rest/public_api.rb', line 66 def all_prices public_api.get('ticker/allPrices').body end |
#depth(options) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/binance/client/rest/public_api.rb', line 34 def depth() response = public_api.get do |req| req.url 'depth' req.params.merge! end response.body end |
#exchange_info ⇒ Object
26 27 28 |
# File 'lib/binance/client/rest/public_api.rb', line 26 def exchange_info public_api.get('exchangeInfo').body end |
#klines(options) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/binance/client/rest/public_api.rb', line 50 def klines() response = public_api.get do |req| req.url 'klines' req.params.merge! end response.body end |
#ping ⇒ Object
18 19 20 |
# File 'lib/binance/client/rest/public_api.rb', line 18 def ping public_api.get('ping').body end |
#products ⇒ Object
30 31 32 |
# File 'lib/binance/client/rest/public_api.rb', line 30 def products public_api.get('/exchange/public/product').body end |
#public_api ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/binance/client/rest/public_api.rb', line 10 def public_api Faraday.new(url: "#{BASE_URL}/api/v1") do |conn| conn.request :json conn.response :json, content_type: /\bjson$/ conn.adapter Faraday.default_adapter end end |
#time ⇒ Object
22 23 24 |
# File 'lib/binance/client/rest/public_api.rb', line 22 def time public_api.get('time').body end |
#twenty_four_hour(options) ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/binance/client/rest/public_api.rb', line 58 def twenty_four_hour() response = public_api.get do |req| req.url 'ticker/24hr' req.params.merge! end response.body end |