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.

Cryptopia fetchOrders requires a symbol param

See original GitHub issue

Is the following message the result of a bug or is there a suggested way to work around it? (it works for other exchanges like Poloniex and Bittrex)

(node:2040) UnhandledPromiseRejectionWarning: Error: cryptopia fetchOrders requires a symbol param

  • OS: Linux
  • Programming Language: JS
  • CCXT version: 1.10.492
  • Exchange: Cryptopia
  • Method: fetchOrders

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rokcarlcommented, Jan 18, 2018

So what I ended up doing is working around it like this:

  1. get a list of currencies in my Cryptopia portfolio using fetch_balance(),
  2. check which one of those currency pairs are an actual market on Cryptopia: exchange.load_markets() and exchange.symbols,
  3. Override the Nonce for Cryptopia as explained here.
  4. Fetch orders for every supported symbol.

The downside of this is of course that if I have an order for a currency that I don’t already hold, this will miss it 😦. That’s too bad because the exchange does show all of them.

Here’s some of my code for this:

  def get_open_orders(self):
    try:
      return self.api.fetch_open_orders()
    except ccxt.errors.ExchangeError as e:
      if "requires a symbol" not in str(e):
        raise e
    # this is an exchange that requires a symbol for orders, e.g. Cryptopia
    currencies = self.get_balance().keys()
    currency_pairs = [(c1, c2) for c1 in currencies for c2 in currencies]
    possible_symbols = ["{}/{}".format(c1, c2) for c1, c2 in currency_pairs]
    supported_symbols = self.supported_symbols()
    symbols = [s for s in possible_symbols if s in supported_symbols]
    order_groups = [self.api.fetch_open_orders(s) for s in symbols]
    orders = [o for og in order_groups for o in og]
    return orders

  def get_balance(self, mode="total", include_low_values=False):
    balance = self.api.fetch_balance()[mode]
    if not include_low_values:
      balance = {k: v for k, v in balance.items() if v > 0.00000001}
    return balance
0reactions
kroitorcommented, Dec 27, 2017

You mean fetchOrders ?

Yes, of course, made a typo… my bad.

Having an easy way to see if an exchange is capable of this would be nice indeed. The same thing with the capability of market order .

Working on it. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

ccxt Documentation - Read the Docs
The ccxt library currently supports the following cryptocurrency exchange markets and trading APIs: country / region logo.
Read more >
python / - ccxt / - async_support - Program Talk
cryptopia.py ... self.options['fetchOrdersRequiresSymbol']: if symbol is None: raise ArgumentsRequired(self.id + ' fetchOrders requires a symbol argument') ...
Read more >
CCXT-REST API Documentation
APIs that manage creation / deletion / retrieving of exchange connections. Most Public Data APIs by most exchanges can be used without providing...
Read more >
Update for Cryptopia Claimants & Common Portal Errors 16 ...
Process, Details. 1. Claims registration, Allows the registration of account holders' details and to make claims for their account balances.
Read more >
▷ Download the PHP library dav-knafo/ccxt +++ One click!
Do I need to create a project on this site? ... You will have to sign up and create API keys on their...
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