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.

crypto.com fetch_balance() produces ExchangeError

See original GitHub issue
  • OS: Linux
  • Programming Language version: PHP 7.3
  • CCXT version: 1.66.39

Reproduction code:

try {
	$id = "\\ccxt\\cryptocom";
	$exchange = new $id();
	$exchange->apiKey = "XXXX"; // let me know if you need temporary API key, I can make it for testing
	$exchange->secret = "YYYY";
	$exchange->enableRateLimit = true;

	$balance = $exchange->fetchBalance();
} catch (\ccxt\ExchangeError $e) {
	echo '[Exchange Error] ' . $e->getMessage();
	print_r($e);
}

Error:

[Exchange Error] cryptocom

ccxt\BadRequest Object
(
    [message:protected] => cryptocom 
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] =>  /path/to/composer/vendor/ccxt/ccxt/php/cryptocom.php
    [line:protected] => 1801
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] =>  /path/to/composer/vendor/ccxt/ccxt/php/Exchange.php
                    [line] => 1766
                    [function] => handle_errors
                    [class] => ccxt\cryptocom
                    [type] => ->
                )

            [1] => Array
                (
                    [file] =>  /path/to/composer/vendor/ccxt/ccxt/php/Exchange.php
                    [line] => 1522
                    [function] => fetch
                    [class] => ccxt\Exchange
                    [type] => ->
                )

            [2] => Array
                (
                    [file] =>  /path/to/composer/vendor/ccxt/ccxt/php/Exchange.php
                    [line] => 1526
                    [function] => fetch2
                    [class] => ccxt\Exchange
                    [type] => ->
                )

            [3] => Array
                (
                    [function] => request
                    [class] => ccxt\Exchange
                    [type] => ->
                )

            [4] => Array
                (
                    [file] =>  /path/to/composer/vendor/ccxt/ccxt/php/Exchange.php
                    [line] => 2657
                    [function] => call_user_func_array
                )

            [5] => Array
                (
                    [file] =>  /path/to/composer/vendor/ccxt/ccxt/php/cryptocom.php
                    [line] => 765
                    [function] => __call
                    [class] => ccxt\Exchange
                    [type] => ->
                )

            [6] => Array
                (
                    [file] => /path/to/my/script.php
                    [line] => 118
                    [function] => fetch_balance
                    [class] => ccxt\cryptocom
                    [type] => ->
                )

        )

    [previous:Exception:private] => 
)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
c0dehuntercommented, Jan 10, 2022

I see, my manual script patching approach caused the above error. Updating CCXT to 1.66.70 fixed the issue and crypto.com is working well now. Thank you!

1reaction
kroitorcommented, Jan 10, 2022

@c0dehunter you should also update the base files as well, make sure that your runtime CCXT version number in your script is 1.66.70+. (We’ve tested on our side and it should work for you as well).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exchanges — ccxt 2.4.71 documentation
The ccxt library is a collection of available crypto exchanges or exchange ... with the fetchBalance() method as described in the Account Balance...
Read more >
Miscellaneous - Crypto.com Help Center
When you dispose of crypto that you do not hold in your imported accounts in Crypto.com Tax, this error message will pop up....
Read more >
CCXT - 简书
The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for.
Read more >
ccxt-dev/ccxt - Gitter
timeframe = '1m' limit = 100 # max client = ccxt.bitmex() since ... im getting this error when i am trying to fetch...
Read more >
python - fetch_balance method in ccxt won't return all assets
It seems like fetchBalance only returns one currency at a time. ... exchange.load_markets() currency = exchange.currency('USDT') balance ...
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