9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/binance/api/request.rb', line 9
def send!(api_key_type: :none, headers: {}, method: :get, path: '/', params: {}, security_type: :none)
raise Error.new(message: "invalid security type #{security_type}") unless security_types.include?(security_type)
= (api_key_type: api_key_type, security_type: security_type)
if [:trade, :user_data].include?(security_type)
params.merge!(
signature: signed_request_signature(params: params),
timestamp: timestamp
)
end
case method
when :get
response = get(path, headers: , query: params)
when :post
response = post(path, body: params, headers: )
when :put
response = put(path, body: params, headers: )
when :delete
response = delete(path, body: params, headers: )
else
raise Error.new(message: "invalid http method used: #{method}")
end
process!(response: response || '{}')
end
|