Skip to content

Commit

Permalink
fix generate signatue
Browse files Browse the repository at this point in the history
If send data type "e-mail" then binance return: [Signature for this request is not valid.]

When using the Binance Corporate API

If need to add functions for working with the Binance Corporate API, just tell me how to name the functions correctly =)

Now:
sub_accounts() - [/sapi/v1/sub-account/list]
sub_account_assets() - [...]
sub_account_deposit_address - [...]
sub_account_deposits [...]
sub_account_transfer_universal [...]
  • Loading branch information
Max Grim authored and dmzoneill committed May 5, 2021
1 parent 0958e2e commit 4f968eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ protected function httpRequest(string $url, string $method = "GET", array $param
}

$query = http_build_query($params, '', '&');
$query = str_replace([ '%40' ], [ '@' ], $query);//if send data type "e-mail" then binance return: [Signature for this request is not valid.]
$signature = hash_hmac('sha256', $query, $this->api_secret);
if ($method === "POST") {
$endpoint = $base . $url;
Expand Down

0 comments on commit 4f968eb

Please sign in to comment.