Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class API
protected $baseTestnet = 'https://testnet.binance.vision/api/'; // /< Testnet 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 $fapi = 'https://fapi.binance.com/'; // /< REST endpoint for the futures API
protected $bapi = 'https://www.binance.com/bapi/'; // /< REST endpoint for the internal Binance API
protected $stream = 'wss://stream.binance.com:9443/ws/'; // /< Endpoint for establishing websocket connections
protected $streamTestnet = 'wss://testnet.binance.vision/ws/'; // /< Testnet endpoint for establishing websocket connections
protected $api_key; // /< API key that you created in the binance website member area
Expand Down Expand Up @@ -1272,7 +1274,16 @@ protected function httpRequest(string $url, string $method = "GET", array $param
unset($params['sapi']);
$base = $this->sapi;
}


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

if (isset($params['bapi'])) {
unset($params['bapi']);
$base = $this->bapi;
}
$query = $this->binance_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);
Expand Down