Apply refactoring to root package bfxapi.

This commit is contained in:
Davide Casale
2023-02-17 18:38:07 +01:00
parent d72fcf3981
commit ab66170cf3
29 changed files with 81 additions and 78 deletions

View File

@@ -7,7 +7,10 @@ from .rest_merchant_endpoints import RestMerchantEndpoints
class BfxRestInterface(object):
VERSION = 2
def __init__(self, host: str, API_KEY: Optional[str] = None, API_SECRET: Optional[str] = None):
def __init__(self, host, credentials = None):
API_KEY, API_SECRET = credentials and \
(credentials["API_KEY"], credentials["API_SECRET"]) or (None, None)
self.public = RestPublicEndpoints(host=host)
self.auth = RestAuthenticatedEndpoints(host=host, API_KEY=API_KEY, API_SECRET=API_SECRET)
self.merchant = RestMerchantEndpoints(host=host, API_KEY=API_KEY, API_SECRET=API_SECRET)