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

Class CBProAuth

cbpro/cbpro_auth.py:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class CBProAuth(AuthBase):
9 # Provided by CBPro: https://docs.pro.coinbase.com/#signing-a-message
10 def __init__(self, api_key, secret_key, passphrase):
11 self.api_key = api_key
12 self.secret_key = secret_key
13 self.passphrase = passphrase
14
15 def __call__(self, request):
16 timestamp = str(time.time())
17 message = ''.join([timestamp, request.method,
18 request.path_url, (request.body or '')])
19 request.headers.update(get_auth_headers(timestamp, message,
20 self.api_key,
21 self.secret_key,
22 self.passphrase))
23 return request
24
25
26def get_auth_headers(timestamp, message, api_key, secret_key, passphrase):

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected