Skip to content

Commit

Permalink
sapi flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggedsoft authored Jun 13, 2020
2 parents 9a8156d + 448c7b2 commit 57a6af0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class API
{
protected $base = 'https://api.binance.com/api/'; // /< REST endpoint for the currency exchange
protected $wapi = 'https://api.binance.com/wapi/'; // /< REST endpoint for the withdrawals
protected $sapi = 'https://api.binance.com/sapi/'; // /< REST endpoint for the supporting network API
protected $stream = 'wss://stream.binance.com:9443/ws/'; // /< Endpoint for establishing websocket connections
protected $api_key; // /< API key that you created in the binance website member area
protected $api_secret; // /< API secret that was given to you when you created the api key
Expand Down Expand Up @@ -929,6 +930,12 @@ protected function httpRequest(string $url, string $method = "GET", array $param
unset($params['wapi']);
$base = $this->wapi;
}

if (isset($params['sapi'])) {
unset($params['sapi']);
$base = $this->sapi;
}

$query = http_build_query($params, '', '&');
$signature = hash_hmac('sha256', $query, $this->api_secret);
if ($method === "POST") {
Expand Down

0 comments on commit 57a6af0

Please sign in to comment.