Skip to content

Commit 57a6af0

Browse files
authored
sapi flag
2 parents 9a8156d + 448c7b2 commit 57a6af0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

php-binance-api.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class API
2929
{
3030
protected $base = 'https://api.binance.com/api/'; // /< REST endpoint for the currency exchange
3131
protected $wapi = 'https://api.binance.com/wapi/'; // /< REST endpoint for the withdrawals
32+
protected $sapi = 'https://api.binance.com/sapi/'; // /< REST endpoint for the supporting network API
3233
protected $stream = 'wss://stream.binance.com:9443/ws/'; // /< Endpoint for establishing websocket connections
3334
protected $api_key; // /< API key that you created in the binance website member area
3435
protected $api_secret; // /< API secret that was given to you when you created the api key
@@ -929,6 +930,12 @@ protected function httpRequest(string $url, string $method = "GET", array $param
929930
unset($params['wapi']);
930931
$base = $this->wapi;
931932
}
933+
934+
if (isset($params['sapi'])) {
935+
unset($params['sapi']);
936+
$base = $this->sapi;
937+
}
938+
932939
$query = http_build_query($params, '', '&');
933940
$signature = hash_hmac('sha256', $query, $this->api_secret);
934941
if ($method === "POST") {

0 commit comments

Comments
 (0)