Class: BitstampClient::GenSignature

Inherits:
Object
  • Object
show all
Defined in:
lib/bitstamp_client/services/gen_signature.rb

Class Method Summary collapse

Class Method Details

.call(key:, secret:, nonce:, customer_id:) ⇒ Object



4
5
6
7
8
9
# File 'lib/bitstamp_client/services/gen_signature.rb', line 4

def self.call(key:, secret:, nonce:, customer_id:)
  digest = OpenSSL::Digest.new('sha256')
  data = nonce.to_s + customer_id + key
  hex = OpenSSL::HMAC.hexdigest(digest, secret, data)
  hex.upcase
end