Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userData: Uncaught Error: Function name must be a string #229

Closed
Marc008 opened this issue Mar 28, 2019 · 1 comment
Closed

userData: Uncaught Error: Function name must be a string #229

Marc008 opened this issue Mar 28, 2019 · 1 comment

Comments

@Marc008
Copy link

Marc008 commented Mar 28, 2019

Hello,

I plan to add the userData function, but following the example from the doc, I got this error:

PHP Fatal error: Uncaught Error: Function name must be a string in /project/vendor/jaggedsoft/php-binance-api/php-binance-api.php:2094
Stack trace:
#0 /project/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Binance\API->Binance{closure}(Object(Ratchet\RFC6455\Messaging\Message), Object(Ratchet\Client\WebSocket))
#1 /project/vendor/ratchet/pawl/src/WebSocket.php(72): Ratchet\Client\WebSocket->emit('message', Array)
#2 /project/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php(104): Ratchet\Client\WebSocket->Ratchet\Client{closure}(Object(Ratchet\RFC6455\Messaging\Message))
#3 /project/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php(60): Ratchet\RFC6455\Messaging\MessageBuffer->processData('\x81~\x1Ed{"e":"outbo...')
#4 /project/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Ratchet\RFC6455\Messaging\MessageBuffer->onData('\x81~\ in /project/vendor/jaggedsoft/php-binance-api/php-binance-api.php on line 2094

My code is:

$Binance = new Binance\API($key, $secret);

try {
    $Binance->userData($balance_update, $order_update);
} catch (Exception $e) {
    print_r($e->getMessage());
}

$balance_update = function($api, $balances) {
    print_r($balances);
    echo "Balance update".PHP_EOL;
};

$order_update = function($api, $report) {
    echo "Order update".PHP_EOL;
    print_r($report);
};

Platform:

  • Linux 4.9.0-8-amd64 Wrong issue... #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux

php version:

  • PHP 7.0.33-0+deb9u1 (cli) (built: Dec 7 2018 11:36:49) ( NTS )

Any idea what could I be doing wrong?

Thanks in advance.

@Marc008
Copy link
Author

Marc008 commented Jun 4, 2019

I updated the version to:

composer require "jaggedsoft/php-binance-api @dev"
and it's fixed.

@Marc008 Marc008 closed this as completed Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants