Module: Bybit::Authentication

Defined in:
lib/bybit/authentication.rb

Overview

HMAC-SHA256 signer for the Bybit V5 REST API. Payload format: timestamp + api_key + recv_window + (query_string OR request_body).

Class Method Summary collapse

Class Method Details

.sign_v5(api_secret, timestamp, api_key, recv_window, payload) ⇒ Object



11
12
13
14
# File 'lib/bybit/authentication.rb', line 11

def sign_v5(api_secret, timestamp, api_key, recv_window, payload)
  msg = "#{timestamp}#{api_key}#{recv_window}#{payload}"
  OpenSSL::HMAC.hexdigest('SHA256', api_secret, msg)
end