Class: Binance::Api::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/binance/api/account.rb

Class Method Summary collapse

Class Method Details

.info!(recvWindow: 5000) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/binance/api/account.rb', line 5

def info!(recvWindow: 5000)
  timestamp = Configuration.timestamp
  params = { recvWindow: recvWindow, timestamp: timestamp }
  Request.send!(api_key_type: :read_info, path: "/api/v3/account",
                params: params.delete_if { |key, value| value.nil? },
                security_type: :user_data)
end

.trades!(fromId: nil, limit: 500, recvWindow: 5000, symbol: nil) ⇒ Object

Raises:



13
14
15
16
17
18
19
20
21
# File 'lib/binance/api/account.rb', line 13

def trades!(fromId: nil, limit: 500, recvWindow: 5000, symbol: nil)
  raise Error.new(message: "max limit is 500") unless limit <= 500
  raise Error.new(message: "symbol is required") if symbol.nil?
  timestamp = Configuration.timestamp
  params = { fromId: fromId, limit: limit, recvWindow: recvWindow, symbol: symbol, timestamp: timestamp }
  Request.send!(api_key_type: :read_info, path: "/api/v3/myTrades",
                params: params.delete_if { |key, value| value.nil? },
                security_type: :user_data)
end