mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
fix all linting for pylint3
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
"""
|
||||
This module is used to house all of the functions which are used
|
||||
to handle the http authentication of the client
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
import time
|
||||
|
||||
def generate_auth_payload(API_KEY, API_SECRET):
|
||||
"""
|
||||
Generate a signed payload
|
||||
|
||||
@return json Oject headers
|
||||
"""
|
||||
nonce = _gen_nonce()
|
||||
authMsg, sig = _gen_signature(API_KEY, API_SECRET, nonce)
|
||||
|
||||
@@ -15,6 +25,9 @@ def generate_auth_payload(API_KEY, API_SECRET):
|
||||
}
|
||||
|
||||
def generate_auth_headers(API_KEY, API_SECRET, path, body):
|
||||
"""
|
||||
Generate headers for a signed payload
|
||||
"""
|
||||
nonce = str(_gen_nonce())
|
||||
signature = "/api/v2/{}{}{}".format(path, nonce, body)
|
||||
h = hmac.new(API_SECRET.encode('utf8'), signature.encode('utf8'), hashlib.sha384)
|
||||
|
||||
Reference in New Issue
Block a user