Class: Binance::Client::REST::SignRequestMiddleware
- Inherits:
-
Struct
- Object
- Struct
- Binance::Client::REST::SignRequestMiddleware
- Defined in:
- lib/binance/client/rest/sign_request_middleware.rb
Overview
Sign the query string using HMAC(sha-256) and appends to query string
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
5 6 7 |
# File 'lib/binance/client/rest/sign_request_middleware.rb', line 5 def app @app end |
#secret_key ⇒ Object
Returns the value of attribute secret_key
5 6 7 |
# File 'lib/binance/client/rest/sign_request_middleware.rb', line 5 def secret_key @secret_key end |
Instance Method Details
#call(env) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/binance/client/rest/sign_request_middleware.rb', line 6 def call(env) hash = OpenSSL::HMAC.hexdigest( OpenSSL::Digest.new('sha256'), secret_key, env.url.query ) env.url.query = REST.add_query_param(env.url.query, 'signature', hash) app.call env end |