Module: Binance::Client::REST::Withdraw_API
- Defined in:
- lib/binance/client/rest/withdraw_api.rb
Overview
Public: A Module containing all of the Withdraw API endpoints
Class Method Summary collapse
-
.extended(base) ⇒ Object
Internal: Create Lambda that returns a new Faraday client instance and add it to the REST class instance variable @api.
Instance Method Summary collapse
-
#account_status(options) ⇒ Object
Public: Retrieve current account status.
-
#deposit_address(options) ⇒ Object
Public: Retrieve the deposit address for a specific asset.
-
#deposit_history(options = {}) ⇒ Object
Public: Retrieve the deposit history for the authenticated account.
-
#withdraw(options) ⇒ Object
Public: Withdraw the specified asset to the given address using the authenticated account.
-
#withdraw_history(options = {}) ⇒ Object
Public: Retrieve the withdraw history for the authenticated account.
Class Method Details
.extended(base) ⇒ Object
Internal: Create Lambda that returns a new Faraday client instance and add it to the REST class instance variable @api. This is called while a new instance of the REST class is created.
base - The base class that is being extended into.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 17 def self.extended(base) REST.api[:withdraw] = lambda do Faraday.new(url: "#{BASE_URL}/wapi") do |conn| conn.request :url_encoded conn.response :json, content_type: /\bjson$/ conn.headers['X-MBX-APIKEY'] = base.api_key conn.use TimestampRequestMiddleware conn.use SignRequestMiddleware, base.secret_key conn.adapter base.adapter end end end |
Instance Method Details
#account_status(options) ⇒ Object
Public: Retrieve current account status
options - The Hash which hosts various REST query params.
:recvWindow - The Number of how long a request is valid for in
milliseconds (optional).
Returns a Hash with the request response
100 101 102 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 100 def account_status() request :withdraw, :get, 'accountStatus', end |
#deposit_address(options) ⇒ Object
Public: Retrieve the deposit address for a specific asset
options - The Hash which hosts various REST query params.
:asset - The String of which asset to retrieve (optional).
:recvWindow - The Number of how long a request is valid for in
milliseconds (optional).
Returns a Hash with the request response
89 90 91 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 89 def deposit_address() request :withdraw, :get, 'depositAddress', end |
#deposit_history(options = {}) ⇒ Object
Public: Retrieve the deposit history for the authenticated account
options - The Hash which hosts various REST query params.
:asset - The String of which asset to retrieve (optional).
:status - The Number of which status to retrieve (optional).
:startTime - The Timestamp of when to start the history in
milliseconds (optional).
:endTime - The Timestamp of when to end the history in
milliseconds (optional).
:recvWindow - The Number of how long a request is valid for in
milliseconds (optional).
Returns a Hash with the request response
60 61 62 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 60 def deposit_history( = {}) request :withdraw, :get, 'depositHistory', end |
#withdraw(options) ⇒ Object
Public: Withdraw the specified asset to the given address using the authenticated account
options - The Hash which hosts various REST query params.
:asset - The String of which asset to withdraw.
:address - The String of where to send the asset to.
:addressTag - The String secondary address identifier (optional).
:amount - The String decimal value of how much to withdraw.
:name - The String description of the address
:recvWindow - The Number of how long a request is valid for in
milliseconds (optional).
Returns a Hash with the request response
43 44 45 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 43 def withdraw() request :withdraw, :post, 'withdraw', end |
#withdraw_history(options = {}) ⇒ Object
Public: Retrieve the withdraw history for the authenticated account
options - The Hash which hosts various REST query params.
:asset - The String of which asset to retrieve (optional).
:status - The Number of which status to retrieve (optional).
:startTime - The Timestamp of when to start the history in
milliseconds (optional).
:endTime - The Timestamp of when to end the history in
milliseconds (optional).
:recvWindow - The Number of how long a request is valid for in
milliseconds (optional).
Returns a Hash with the request response
77 78 79 |
# File 'lib/binance/client/rest/withdraw_api.rb', line 77 def withdraw_history( = {}) request :withdraw, :get, 'withdrawHistory', end |