def get_client(exchange, authkeys=None): key = None secret = None if authkeys is not None: try: key = codecs.decode(authkeys[exchange]['API_KEY'], 'rot_13') secret = codecs.decode(authkeys[exchange]['API_SECRET'], 'rot_13') except: pass if exchange.lower() == 'surbtc': return SURBTC.Standard(key=key, secret=secret) elif exchange.lower() == 'kraken': return Kraken.Standard(key=key, secret=secret) elif exchange.lower() == 'bitfinex': return Bitfinex.Standard(key=key, secret=secret) elif exchange.lower() == 'cryptomkt': return CryptoMKT.Standard() else: raise
def client(self) -> Bitfinex.Auth: return Bitfinex.Auth(**self.credentials, **self.client_params)
def client_v1(self) -> Bitfinex.Public: return Bitfinex.Public(**self.client_params)
def setUp(self): self.client = Bitfinex.Auth('BAD_KEY', 'BAD_SECRET')
def setUp(self): self.client = Bitfinex.Auth(API_KEY, API_SECRET)
def setUp(self): self.client = Bitfinex.Public()
def test_key_secret(self): self.assertRaises(ValueError, lambda: Bitfinex.Auth())
def test_key_secret(self): with self.assertRaises(TypeError): Bitfinex.Auth()