php-binance-api icon indicating copy to clipboard operation
php-binance-api copied to clipboard

User Data Balance Update. change

Open Pinakalada opened this issue 4 years ago • 4 comments

Hi all. php-binance-api.php, string 2380 : if ($type === "outboundAccountInfo") {

but in https://binance-docs.github.io/apidocs/spot/en/#change-log : 2020-09-09 USER DATA STREAM outboundAccountInfo has been deprecated. outboundAccountInfo will be removed in the future. (Exact date unknown) Please use outboundAccountPosition instead. outboundAccountInfo will now only show the balance of non-zero assets and assets that have been reduced to 0.

I suggest changing it to: if ($type === "outboundAccountPosition") {

and string 1438 protected function balanceHandler(array $json)

foreach($balances->B as $coin){ $data['coin'] = $coin->a; $data['free'] = $coin->f; $data['locked'] = $coin->l; }

Pinakalada avatar Mar 27 '21 12:03 Pinakalada

H Pinakalada,

If you would like to contribute, pull requests are welcome :)

thanks for the report

dmzoneill avatar Mar 27 '21 12:03 dmzoneill

@Pinakalada , I fully support you in changing $type === "outboundAccountInfo" to $type === "outboundAccountPosition" as since Jan 1, 2021 the 'Info' has been removed.

But I'm trying to understand your proposal for the foreach($balances->B) ... What is passed to this function is already the array under B : $balances = $this->balanceHandler($json->B); So you will only have an array with items a, f and l in the balanceHandler function. Could you elaborate a bit further on what you are trying to do? https://binance-docs.github.io/apidocs/spot/en/#payload-account-update

ePascalC avatar Apr 04 '21 18:04 ePascalC

This is an example of my code, I process json in controller, bypassing the balanceHandler function.

I only indicated the direction of thought and links to the documentation.

Pinakalada avatar Apr 05 '21 12:04 Pinakalada

@dmzoneill I think we can close this one. Thanks.

ePascalC avatar Apr 06 '21 13:04 ePascalC