jaggedsoft/php-binance-api

api->balances(['xxxx']) triggers an error

Opened this issue · 0 comments

Title

  • Bug: Balances of single ticker triggers errors on test net

Short Description:

  • When calling $this->api->balances(['xxxx']), the system throws an error Undefined array key "BTCUSDT".

Platform:

  • Linux + Docker

PHP Version:

  • 8.3.8

Long Description:

  • When calling $this->api->balances(['xxxx']), the system throws an error Undefined array key "BTCUSDT". It does not matter what ticker is being used; the same error prevails. The file php-binance-api.php at line [1554] throws an error. Commenting out this line solves the error, but as a result, a single item for ticker/symbol is not returned, only a list is .

Code:

require 'vendor/autoload.php';
$api = new Binance\API("<api key>", "<secret>", true);
$ticker = $api->balances(['USDT']);

Result:

Warning: Undefined array key "BTCUSDT"