From 448c7b295422e08d619856ec41e4fe0aefd5506d Mon Sep 17 00:00:00 2001 From: mohammad motallebi <6781112+mtb-pro@users.noreply.github.com> Date: Sat, 13 Jun 2020 17:12:02 +0430 Subject: [PATCH] Update php-binance-api.php To be able to use the sapi feature by httpRequest --- php-binance-api.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php-binance-api.php b/php-binance-api.php index c8e8f005..3a5f967b 100755 --- a/php-binance-api.php +++ b/php-binance-api.php @@ -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 @@ -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") {