Class: Binance::Session
- Inherits:
-
Object
- Object
- Binance::Session
- Includes:
- Utils::Faraday::Middleware
- Defined in:
- lib/binance/session.rb
Overview
Session has the http request connection
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Session
constructor
A new instance of Session.
- #limit_request(method: :get, path: '/', params: {}) ⇒ Object
- #public_request(path: '/', params: {}) ⇒ Object
- #sign_request(method, path, params: {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Session
Returns a new instance of Session.
12 13 14 15 16 17 18 19 |
# File 'lib/binance/session.rb', line 12 def initialize( = {}) @base_url = [:base_url] || 'https://api.binance.com' @auth = Authentication.new([:key], [:secret], [:private_key], [:private_key_pass_phrase]) @logger = [:logger] @show_weight_usage = [:show_weight_usage] || false @show_header = [:show_header] || false @timeout = [:timeout] end |
Instance Method Details
#limit_request(method: :get, path: '/', params: {}) ⇒ Object
25 26 27 |
# File 'lib/binance/session.rb', line 25 def limit_request(method: :get, path: '/', params: {}) process_request(limit_conn, method, path, params) end |
#public_request(path: '/', params: {}) ⇒ Object
21 22 23 |
# File 'lib/binance/session.rb', line 21 def public_request(path: '/', params: {}) process_request(public_conn, :get, path, params) end |
#sign_request(method, path, params: {}) ⇒ Object
29 30 31 |
# File 'lib/binance/session.rb', line 29 def sign_request(method, path, params: {}) process_request(signed_conn, method, path, params) end |