Module: Binance::Client::REST::Withdraw_API

Included in:
Binance::Client::REST
Defined in:
lib/binance/client/rest/withdraw_api.rb

Overview

API endpoints with require a timestamp and signature, as well as requiring url_encoded parameters

Instance Method Summary collapse

Instance Method Details

#deposit_address(options) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/binance/client/rest/withdraw_api.rb', line 48

def deposit_address(options)
  response = withdraw_api.get do |req|
    req.url 'depositAddress.html'
    req.params.merge! options
  end
  response.body
end

#deposit_history(options = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/binance/client/rest/withdraw_api.rb', line 32

def deposit_history(options = {})
  response = withdraw_api.get do |req|
    req.url 'depositHistory.html'
    req.params.merge! options
  end
  response.body
end

#withdraw(options) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/binance/client/rest/withdraw_api.rb', line 24

def withdraw(options)
  response = withdraw_api.post do |req|
    req.url 'withdraw.html'
    req.params.merge! options
  end
  response.body
end

#withdraw_apiObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/binance/client/rest/withdraw_api.rb', line 13

def withdraw_api
  Faraday.new(url: "#{BASE_URL}/wapi/v3") do |conn|
    conn.request :url_encoded
    conn.response :json, content_type: /\bjson$/
    conn.headers['X-MBX-APIKEY'] = @api_key
    conn.use TimestampRequestMiddleware
    conn.use SignRequestMiddleware, @secret_key
    conn.adapter Faraday.default_adapter
  end
end

#withdraw_history(options = {}) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/binance/client/rest/withdraw_api.rb', line 40

def withdraw_history(options = {})
  response = withdraw_api.get do |req|
    req.url 'withdrawHistory.html'
    req.params.merge! options
  end
  response.body
end