Remove unecessary config vars

small_kucoin_fixes
jaredgoldman 2023-04-03 20:12:25 -04:00
parent ca937dff5e
commit 208a8e5d7a
1 changed files with 2 additions and 14 deletions

View File

@ -182,19 +182,7 @@ class Client:
def __init__(self) -> None:
self._pairs: dict[str, KucoinMktPair] = {}
self._bars: list[list[float]] = []
self._key_id: str
self._key_secret: str
self._key_passphrase: str
self._authenticated: bool = False
config: BrokerConfig | None = get_config()
if config and config.key_id and config.key_secret and config.key_passphrase:
self._authenticated = True
self._key_id = config.key_id
self._key_secret = config.key_secret
self._key_passphrase = config.key_passphrase
log.info('User credentials added')
self._config: BrokerConfig | None = get_config()
def _gen_auth_req_headers(
self,
@ -247,7 +235,7 @@ class Client:
Generic request wrapper for Kucoin API
'''
if self._authenticated:
if self._config:
headers = self._gen_auth_req_headers(action, endpoint, api_v)
api_url = f'https://api.kucoin.com/api/{api_v}{endpoint}'