Module: Binance::Client::REST::Account_API
- Included in:
- Binance::Client::REST
- Defined in:
- lib/binance/client/rest/account_api.rb
Overview
API endpoints that require a timestamp and signature
Instance Method Summary collapse
- #account_api ⇒ Object
- #account_info(options = {}) ⇒ Object
- #account_trade_list(options) ⇒ Object
- #all_orders(options) ⇒ Object
- #cancel_order(options) ⇒ Object
- #create_order(options) ⇒ Object
- #open_orders(options) ⇒ Object
- #query_order(options) ⇒ Object
Instance Method Details
#account_api ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/binance/client/rest/account_api.rb', line 12 def account_api Faraday.new(url: "#{BASE_URL}/api/v3") do |conn| conn.request :json 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 |
#account_info(options = {}) ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/binance/client/rest/account_api.rb', line 63 def account_info( = {}) response = account_api.get do |req| req.url 'account' req.params.merge! end response.body end |
#account_trade_list(options) ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/binance/client/rest/account_api.rb', line 71 def account_trade_list() response = account_api.get do |req| req.url 'myTrades' req.params.merge! end response.body end |
#all_orders(options) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/binance/client/rest/account_api.rb', line 55 def all_orders() response = account_api.get do |req| req.url 'allOrders' req.params.merge! end response.body end |
#cancel_order(options) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/binance/client/rest/account_api.rb', line 39 def cancel_order() response = account_api.delete do |req| req.url 'order' req.params.merge! end response.body end |
#create_order(options) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/binance/client/rest/account_api.rb', line 23 def create_order() response = account_api.post do |req| req.url 'order' req.params.merge! end response.body end |
#open_orders(options) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/binance/client/rest/account_api.rb', line 47 def open_orders() response = account_api.get do |req| req.url 'openOrders' req.params.merge! end response.body end |
#query_order(options) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/binance/client/rest/account_api.rb', line 31 def query_order() response = account_api.get do |req| req.url 'order' req.params.merge! end response.body end |