Skip to content

Fixed \Binance\Spot requests#32

Open
victorantoniak wants to merge 21 commits intobinance:masterfrom
victorantoniak:master
Open

Fixed \Binance\Spot requests#32
victorantoniak wants to merge 21 commits intobinance:masterfrom
victorantoniak:master

Conversation

@victorantoniak
Copy link
Copy Markdown

  1. $client = \App\Factory::getClientSpot();
    $client->useServerTime();

fixes the problem
(Timestamp for this request was 1000ms ahead of the server's time)

  1. Any request with API response 400 => Fatal error.

try / cache - doesn't solve the problem

print $e->getMessage()
=>
GuzzleHttp\Exception\ClientException: Client error: POST https://testnet.binance.vision/api/v3/order?quantity=18.52&newOrderRespType=FULL&recvWindow=1000&symbol=LTCUSDT&side=SELL&type=MARKET×tamp=1711824528422&signature=812faf4008cf6cab2b9b86dc88de42e625c19850c3a882ccc47ece53bdebb05c resulted in a 400 Bad Request response: {"code":-2010,"msg":"Account has insufficient balance for requested action."} in D...

Now you will receive json.
Exampe: {"code":-2010,"msg":"Account has insufficient balance for requested action."}

2pd and others added 21 commits June 4, 2022 14:16
* update pipeline config

* change release version
Adds a time offset to the timestamp in the API request to avoid time error:
(Timestamp for this request was 1000ms ahead of the server's time)
Any request with API response 400 => Fatal error.
Now you will receive json.
Exampe: {"code":-2010,"msg":"Account has insufficient balance for requested action."}
@UP7i5CAT
Copy link
Copy Markdown

UP7i5CAT commented Jan 2, 2025

谢谢你,这行代码'http_errors' => false让我拜摆脱了无尽的try-catch异常
Thank you, this line of code 'http_errors' => false saved me from endless try-catch exceptions

Copy link
Copy Markdown

@tim2346 tim2346 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marge change

Comment thread src/Binance/APIClient.php
*
* @var int
*/
private $timeOffset = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge

@tim2346
Copy link
Copy Markdown

tim2346 commented May 27, 2025

Access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants