class Cryptoexchange::Exchanges::BitboxPrivate::Authentication

Public Instance Methods

headers(payload, timestamp) click to toggle source
# File lib/cryptoexchange/exchanges/bitbox_private/authentication.rb, line 9
def headers(payload, timestamp)
  api_key = HashHelper.dig(Cryptoexchange::Credentials.get(@exchange), 'api_key')
  {
    "X-API-Key" => api_key,
    "X-API-SIGN" => signature(payload),
    "X-API-TIMESTAMP" => timestamp,
    "X-API-NONCE" => "12345"
  }
end
required_credentials() click to toggle source
# File lib/cryptoexchange/exchanges/bitbox_private/authentication.rb, line 19
def required_credentials
  %i(api_key api_secret)
end
signature(payload) click to toggle source
# File lib/cryptoexchange/exchanges/bitbox_private/authentication.rb, line 4
def signature(payload)
  api_secret = HashHelper.dig(Cryptoexchange::Credentials.get(@exchange), 'api_secret')
  OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), api_secret, payload)
end