Occasionally calls to fetch_balance() cause a TypeError, occurring with multiple exchanges
See original GitHub issue- OS: Ubuntu 20.04
- Programming Language version: PHP 8.0.10
- CCXT version: 1.55.92
$balances = $exchange->fetch_balance();
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /home/error-test/vendor/ccxt/ccxt/php/bitfinex2.php:587
Stack trace:
#0 /home/error-test/vendor/ccxt/ccxt/php/bitfinex2.php(587): count()
#1 /home/error-test/fetch-balance.php(85): ccxt\bitfinex2->fetch_balance()
#2 {main}
thrown in /home/error-test/vendor/ccxt/ccxt/php/bitfinex2.php on line 587
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /home/error-test/vendor/ccxt/ccxt/php/bitfinex2.php:587
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bittrex fetchBalance() fails · Issue #57 · ccxt/ccxt - GitHub
Using a fresh API key pair: const balance = await market.fetchBalance() produces bittrex ...
Read more >ccxt-dev/ccxt - Gitter
I'd like to do a conditional check before running a particular method based on whether or not it is supported by that particular...
Read more >Exchanges — ccxt 2.4.71 documentation
In terms of the ccxt library, every exchange offers multiple markets within itself. Each market is defined by two or more currencies. The...
Read more >How to use fetchBalance() parameters with ccxt - Stack Overflow
The params argument on fetchBalances() is for passing exchange specific data to the request. As each exchange offers different endpoints, ...
Read more >(intermediate value) is not iterable - You.com | The AI Search ...
TypeError : (intermediate value)(intermediate value)(intermediate value) is not iterable. The error seems to only happen once I pass the destructured ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @kroitor, noted down.
Response below using code similar to that posted above, with fetch_balance() called within a loop.
Note this response is for Coinbase and previous error was for Bitfinex.
no problem, really appreciate the work!