Module: Binance::Client::REST::Public_API

Defined in:
lib/binance/client/rest/public_api.rb

Overview

API endpoints that don’t require any type of authentication

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(_base) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/binance/client/rest/public_api.rb', line 10

def self.extended(_base)
  REST.api[:public] = lambda do
    Faraday.new(url: "#{BASE_URL}/api") do |conn|
      conn.request :json
      conn.response :json, content_type: /\bjson$/
      conn.adapter Faraday.default_adapter
    end
  end
end

Instance Method Details

#agg_trades(options) ⇒ Object



48
49
50
# File 'lib/binance/client/rest/public_api.rb', line 48

def agg_trades(options)
  request :public, :get, 'aggTrades', options
end

#all_book_tickersObject

Ensure backwards compatibility



74
75
76
# File 'lib/binance/client/rest/public_api.rb', line 74

def all_book_tickers
  request :public, :get, 'bookTicker'
end

#all_pricesObject

Ensure backwards compatibility



65
66
67
# File 'lib/binance/client/rest/public_api.rb', line 65

def all_prices
  request :public, :get, 'price'
end

#book_ticker(options) ⇒ Object



69
70
71
# File 'lib/binance/client/rest/public_api.rb', line 69

def book_ticker(options)
  request :public, :get, 'bookTicker', options
end

#depth(options) ⇒ Object



36
37
38
# File 'lib/binance/client/rest/public_api.rb', line 36

def depth(options)
  request :public, :get, 'depth', options
end

#exchange_infoObject



28
29
30
# File 'lib/binance/client/rest/public_api.rb', line 28

def exchange_info
  request :public, :get, 'exchangeInfo'
end

#historical_trades(options) ⇒ Object



44
45
46
# File 'lib/binance/client/rest/public_api.rb', line 44

def historical_trades(options)
  request :public, :get, 'historicalTrades', options
end

#klines(options) ⇒ Object



52
53
54
# File 'lib/binance/client/rest/public_api.rb', line 52

def klines(options)
  request :public, :get, 'klines', options
end

#pingObject



20
21
22
# File 'lib/binance/client/rest/public_api.rb', line 20

def ping
  request :public, :get, 'ping'
end

#price(options) ⇒ Object



60
61
62
# File 'lib/binance/client/rest/public_api.rb', line 60

def price(options)
  request :public, :get, 'price', options
end

#productsObject



32
33
34
# File 'lib/binance/client/rest/public_api.rb', line 32

def products
  request :public, :get, 'products'
end

#timeObject



24
25
26
# File 'lib/binance/client/rest/public_api.rb', line 24

def time
  request :public, :get, 'time'
end

#trades(options) ⇒ Object



40
41
42
# File 'lib/binance/client/rest/public_api.rb', line 40

def trades(options)
  request :public, :get, 'trades', options
end

#twenty_four_hour(options) ⇒ Object



56
57
58
# File 'lib/binance/client/rest/public_api.rb', line 56

def twenty_four_hour(options)
  request :public, :get, '24hr', options
end