Skip to content
This repository has been archived by the owner on Feb 23, 2022. It is now read-only.

Chore/freeze base url #45

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/binance/client/rest/clients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ def withdraw_client(api_key, secret_key, adapter)
conn.adapter adapter
end
end

def withdraw_sapi_client(api_key, secret_key, adapter)
Faraday.new(url: "#{BASE_URL}/sapi") 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 adapter
end
end
end
end
end
end
1 change: 1 addition & 0 deletions lib/binance/client/rest/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class REST

# Withdraw API Endpoints
withdraw: 'v3/withdraw.html',
withdraw_sapi: 'v1/capital/withdraw/apply',
deposit_history: 'v3/depositHistory.html',
withdraw_history: 'v3/withdrawHistory.html',
deposit_address: 'v3/depositAddress.html',
Expand Down
3 changes: 3 additions & 0 deletions lib/binance/client/rest/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class REST
# #withdraw!
{ name: :withdraw!, client: :withdraw,
action: :post, endpoint: :withdraw },
# #withdraw_sapi!
{ name: :withdraw_sapi!, client: :withdraw_sapi_client,
action: :post, endpoint: :withdraw_sapi },
# #deposit_history
{ name: :deposit_history, client: :withdraw,
action: :get, endpoint: :deposit_history },
Expand Down