diff --git a/README.md b/README.md index f61b98f..f13cc2d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Exchange original API docs: [https://exchange-docs.crypto.com](https://exchange- ### Changelog +- **0.7.8** - changed keys, removed depth from orderbook (not working, always 150), updated pairs - **0.7.7** - updated pairs by JOB, fixed timeout - **0.7.6** - updated pairs - **0.7.5** - fixed `order.remaining_quantity` rounding diff --git a/activate.sh b/activate.sh index 11e70ef..70314d8 100644 --- a/activate.sh +++ b/activate.sh @@ -3,5 +3,5 @@ find . -type d -name '__pycache__' -delete source ./venv/bin/activate -export CRYPTOCOM_API_KEY=BNJaaRNj6i3PWxWgTi9hLK -export CRYPTOCOM_API_SECRET=uwVCubn3KfF6ergZQ9XE6T +export CRYPTOCOM_API_KEY=avRWFTc4hXxVUkk3j1vUtA +export CRYPTOCOM_API_SECRET=s8t8tsg3YA52E92aU7Yu4F diff --git a/cc-test-reporter b/cc-test-reporter deleted file mode 100755 index cf28768..0000000 Binary files a/cc-test-reporter and /dev/null differ diff --git a/pytest.ini b/pytest.ini index ff60111..cb302fc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,5 +3,5 @@ addopts = --doctest-plus --doctest-rst python_paths = tests env = - CRYPTOCOM_API_KEY = BNJaaRNj6i3PWxWgTi9hLK - CRYPTOCOM_API_SECRET = uwVCubn3KfF6ergZQ9XE6T + CRYPTOCOM_API_KEY = avRWFTc4hXxVUkk3j1vUtA + CRYPTOCOM_API_SECRET = s8t8tsg3YA52E92aU7Yu4F diff --git a/src/cryptocom/exchange/market.py b/src/cryptocom/exchange/market.py index ffdd6d5..427029d 100644 --- a/src/cryptocom/exchange/market.py +++ b/src/cryptocom/exchange/market.py @@ -104,9 +104,8 @@ class Exchange: pair = self.pairs[data['instrument_name']] yield MarketTrade.from_api(pair, trade) - async def listen_orderbook( - self, *pairs: List[Pair], depth: int = 150) -> OrderBook: - channels = [f'book.{pair.name}.{depth}' for pair in pairs] + async def listen_orderbook(self, *pairs: List[Pair]) -> OrderBook: + channels = [f'book.{pair.name}.150' for pair in pairs] async for data in self.api.listen('market', *channels): pair = self.pairs[data['instrument_name']] buys = [ diff --git a/src/cryptocom/exchange/pairs.py b/src/cryptocom/exchange/pairs.py index ed6aac5..f48c4c7 100644 --- a/src/cryptocom/exchange/pairs.py +++ b/src/cryptocom/exchange/pairs.py @@ -52,6 +52,8 @@ ICX_CRO = Pair("ICX_CRO", price_precision=2, quantity_precision=0) ICX_USDT = Pair("ICX_USDT", price_precision=4, quantity_precision=2) KNC_CRO = Pair("KNC_CRO", price_precision=3, quantity_precision=2) KNC_USDT = Pair("KNC_USDT", price_precision=3, quantity_precision=3) +KSM_CRO = Pair("KSM_CRO", price_precision=2, quantity_precision=3) +KSM_USDT = Pair("KSM_USDT", price_precision=3, quantity_precision=3) LINK_BTC = Pair("LINK_BTC", price_precision=7, quantity_precision=2) LINK_CRO = Pair("LINK_CRO", price_precision=2, quantity_precision=2) LINK_USDT = Pair("LINK_USDT", price_precision=3, quantity_precision=2) diff --git a/tests/test_market.py b/tests/test_market.py index f0abdf3..93f05e0 100644 --- a/tests/test_market.py +++ b/tests/test_market.py @@ -96,9 +96,9 @@ async def test_listen_trades(exchange: cro.Exchange): async def test_listen_orderbook(exchange: cro.Exchange): pairs = [cro.pairs.CRO_USDT, cro.pairs.BTC_USDT] orderbooks = [] - depth = 50 + depth = 150 - async for orderbook in exchange.listen_orderbook(*pairs, depth=depth): + async for orderbook in exchange.listen_orderbook(*pairs): orderbooks.append(orderbook) if set(pairs) == set(o.pair for o in orderbooks): break