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

Commit

Permalink
add public adapter for public withdraw endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieecarr committed Feb 11, 2018
1 parent 3ae8cf4 commit a8c828b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/binance/client/rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def initialize(api_key: '', secret_key: '',
@library[:signed] = signed_client api_key, secret_key, adapter
# Endpoint requires an api_key and secret_key - for the Withdraw API
@library[:withdraw] = withdraw_client api_key, secret_key, adapter
# Endpoint doesn't require an api_key or secret_key
@library[:public_withdraw] = public_withdraw_client adapter

end

Expand Down Expand Up @@ -75,6 +77,14 @@ def withdraw_client(api_key, secret_key, adapter)
conn.adapter adapter
end
end

def public_withdraw_client(adapter)
Faraday.new(url: "#{BASE_URL}/wapi") do |conn|
conn.request :json
conn.response :json, content_type: /\bjson$/
conn.adapter adapter
end
end

def verified_client(api_key, adapter)
Faraday.new(url: "#{BASE_URL}/api") do |conn|
Expand Down

0 comments on commit a8c828b

Please sign in to comment.