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.

quadrigacx fetchBalance error

See original GitHub issue

quadrigacx fetchBalance method error

  • OS: MacOS
  • Programming Language: Node 8.4.0
  • CCXT version: 1.10.456
  • Exchange: quadrigacx
  • Method: fetchBalance

await quadrigacx.fetchBalance()


(node:59361) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'id' of undefined
(node:59361) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ChenLi0830commented, Dec 25, 2017

Hi @kroitor Thank you for the detailed answer! It turns out the error message I saw came from not handling a caught error properly as shown below.

const handleError = (e, exchange) => {
  console.error(e, exchange.id) <--- trying to access id of this string...
    ...
}

(async () => {
  let exchange = 'quadrigacx'
  try {
//    await fetchAll()
    await fetchBalance(exchange)
  } catch (e) {
    api.handleError(e, exchange)
  }
}) ()

I wasn’t even thinking about this part, that’s why I totally missed it and didn’t paste it into the snippet. Anyway, I am really glad for your help. Merry Christmas!

0reactions
kroitorcommented, Dec 25, 2017

Is there an easy way to tell what is required when initiating the exchanges?

Yes. There’s a .requiredCredentials property on each exchange, you can see what is required and what is not.

But, in fact, there’s also the .checkRequiredCredentials() function. Those two things are parts of a mechanism that was implemented as a layer of protection against signing with empty credentials or against forgetting to set them properly, so, I don’t really understand, how you managed to get around that protection…

That .checkRequiredCredentials() function gets called internally and it throws an exception when you forget to set any of required credentials. The commands and the results are shown on the screenshot below:

screen shot 2017-12-25 at 19 20 48

As you can see from the above screenshot, it literally throws an exception, if you forget to set the uid. But because you did not paste the entire code to reproduce the problem, it’s hard to tell, why the above protection layer didn’t work for you as designed.

Please, never paste one line of code. And don’t paste more than 20. You should paste the minimal snippet that I can copy and launch without wasting too much time to recreate your setup. If you put a snippet of 5-10 lines, a full short program, that demonstrates your problem from the very instantiation, up to the breaking point, and if it can be launched right away – you will get your help and answers 10x faster, believe me. If you do that, most often you will find the problem yourself very quickly and will not need any help. The code snippet should only reproduce the problem and should not have anything unnecessary. However, it should be complete. So, if you want somebody to help you, make it easy for them to help you 😉 Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

QuadrigaCX Has Had an Improbable Week
Over 100 bitcoin belonging to collapsed crypto exchange QuadrigaCX has left wallets tied to the exchange, with a majority flowing through a ...
Read more >
ccxt Documentation
You should only use the "proxy" setting if you're having a problem with Access-. ˓→Control-Allow-Origin. # In Python you rarely need to use ......
Read more >
CCXT – CryptoCurrency eXchange Trading Library
A JavaScript / Python / PHP library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
Read more >
teatien-ccxt - CryptoCurrency eXchange Trading Library
id name ver doc acx ACX 2 API anxpro ANXPro * API aofex AOFEX * API
Read more >
Bitcoin Trading Master update for 5 January 2021
... SimulationTrade/UI/js/ccxt-master/examples/js/error-handling.js ... /js/ccxt-master/examples/php/cobinhood-fetch-balance.php (1.44 KiB) ...
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