Class: Binance::SDK::Exchange

Inherits:
Object
  • Object
show all
Defined in:
lib/binance/sdk/exchange.rb

Class Method Summary collapse

Class Method Details

.info!Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/binance/sdk/exchange.rb', line 5

def info!
  timestamp = Configuration.timestamp

  params = { recvWindow: 5000, timestamp: timestamp }

  Request.send!(
    api_key_type: :read_info, path: Endpoints.fetch(:exchange_info),
    params: params.delete_if { |key, value| value.nil? },
    security_type: :user_data, api_key: Configuration.api_key, api_secret_key: Configuration.secret_key
  )
end

.long_short_ratio(symbol:, period:, limit: 30) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/binance/sdk/exchange.rb', line 17

def long_short_ratio(symbol:, period:, limit: 30)
  params = { recvWindow: 5000, timestamp: Configuration.timestamp, symbol: symbol, period: period, limit: limit }

  Request.send!(
    api_key_type: :read_info, path: Endpoints.fetch(:long_short_ratio),
    params: params.delete_if { |_, value| value.nil? },
    security_type: :user_data, api_key: Configuration.api_key, api_secret_key: Configuration.secret_key
  )
end

.taker_buy_sell_volume(symbol:, period:, limit: 30) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/binance/sdk/exchange.rb', line 27

def taker_buy_sell_volume(symbol:, period:, limit: 30)
  params = { recvWindow: 5000, timestamp: Configuration.timestamp, symbol: symbol, period: period, limit: limit }

  Request.send!(
    api_key_type: :read_info, path: Endpoints.fetch(:taker_buy_sell_volume),
    params: params.delete_if { |_, value| value.nil? },
    security_type: :user_data, api_key: Configuration.api_key, api_secret_key: Configuration.secret_key
  )
end