question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[cryptocom] fetch_my_trades does not work when specifying since=

See original GitHub issue
  • OS: Mac OS X
  • Programming Language version: Python 3.8.9
  • CCXT version: 1.67.21
import time
import ccxt.async_support as ccxt

ONE_HOUR_IN_MS = 1000 * 60 * 60 * 1

def now_milliseconds():
    return int(time.time() * 1000)

params = {
            'apiKey': key,
            'secret': secret,
            'verbose': True,
        }
exchange = ccxt.cryptocom(params)
trades = await exchange.fetch_my_trades(since=now_milliseconds()-ONE_HOUR_IN_MS)
  File "/Volumes/Data/personal/newbot/core/exchange/exchange.py", line 69, in fetch_trades
    trades = await self._exchange.fetch_my_trades(since=self._ts_last_fetch_trades)
  File "/Volumes/Data/personal/newbot/venv/lib/python3.8/site-packages/ccxt/async_support/cryptocom.py", line 1023, in fetch_my_trades
    response = await getattr(self, method)(self.extend(request, query))
  File "/Volumes/Data/personal/newbot/venv/lib/python3.8/site-packages/ccxt/async_support/base/exchange.py", line 103, in fetch2
    return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
  File "/Volumes/Data/personal/newbot/venv/lib/python3.8/site-packages/ccxt/async_support/base/exchange.py", line 168, in fetch
    self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
  File "/Volumes/Data/personal/newbot/venv/lib/python3.8/site-packages/ccxt/async_support/cryptocom.py", line 1725, in handle_errors
    raise Exception(self.id + ' ' + message)
ccxt.base.errors.BadRequest: cryptocom INVALID_DATE_RANGE

For instance, it seems that inserting end_ts along with start_ts fixes the problem (in cryptocom.py).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
oliviera9commented, Jan 14, 2022

Thanks @kroitor. I also contacted Crypto.com to understand if ours is just a workaround to a problem of their API. From the docs, it seems end_ts is not required… Let you know

1reaction
kroitorcommented, Jan 14, 2022

@oliviera9 thx for pointing it out, fixed in CCXT 1.67.66, the new build will arrive in ~20 minutes. Please, let us know if that solves the issue for you or not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manual · ccxt/ccxt Wiki - GitHub
Overview. The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for...
Read more >
Miscellaneous - Crypto.com Help Center
The error messages will pop up when there is a “Buy” transaction within 30 days before or after a “Sell” transaction with a...
Read more >
Python binance fetchMyTrades gives only 3 month of personal ...
I am trying to get my trades earlier than 3 months I do it like this: #I ...
Read more >
Crypto.com boss to answer questions on YouTube after ...
Singapore-based crypto exchange said its chief executive will go live on YouTube on Monday to answer questions around some transactions on ...
Read more >
Crypto.com Buy BTC, ETH, Shib 4+ - App Store
The only cryptocurrency app to buy crypto at true cost. With Crypto.com you can have access to the following features:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found