MCPcopy Create free account
hub / github.com/danpaquin/coinbasepro-python / get_auth_headers

Function get_auth_headers

cbpro/cbpro_auth.py:26–37  ·  view source on GitHub ↗
(timestamp, message, api_key, secret_key, passphrase)

Source from the content-addressed store, hash-verified

24
25
26def get_auth_headers(timestamp, message, api_key, secret_key, passphrase):
27 message = message.encode('ascii')
28 hmac_key = base64.b64decode(secret_key)
29 signature = hmac.new(hmac_key, message, hashlib.sha256)
30 signature_b64 = base64.b64encode(signature.digest()).decode('utf-8')
31 return {
32 'Content-Type': 'Application/JSON',
33 'CB-ACCESS-SIGN': signature_b64,
34 'CB-ACCESS-TIMESTAMP': timestamp,
35 'CB-ACCESS-KEY': api_key,
36 'CB-ACCESS-PASSPHRASE': passphrase
37 }

Callers 2

_connectMethod · 0.90
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected