Method: Coinbase::Wallet::AsyncClient#auth_headers

Defined in:
lib/coinbase/wallet/client.rb

#auth_headers(method, path, body) ⇒ Object



89
90
91
92
93
94
95
96
97
98
# File 'lib/coinbase/wallet/client.rb', line 89

def auth_headers(method, path, body)
  ts = Time.now.to_i.to_s
  signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'),
                                      @api_secret,
                                      ts + method + path + body.to_s)
  { 'CB-ACCESS-KEY' => @api_key,
    'CB-ACCESS-SIGN' => signature,
    'CB-ACCESS-TIMESTAMP' => ts,
    'CB-VERSION' => API_VERSION }
end