Dear,
Doubt about changing leverage, BTCUSDT
Change Initial Leverage (TRADE)
POST /fapi/v1/leverage (HMAC SHA256)
When trying to change the leverage to 21X, the following PHP code does not get the return response.
{
“leverage”: 21,
“maxNotionalValue”: “1000000”,
“symbol”: “BTCUSDT”
}
Please see my code:
//////////////////////////////////
$key = “XXXXXXXXX”;
$secret = “YYYYYYYYY”;
$timestamp = time()*1000;
$leverage_parametri = ‘symbol=BTCUSDT&leverage=21’;
$sign = hash_hmac(‘sha256’, $leverage_parametri."×tamp=".$timestamp, $secret);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://fapi/binance.com/fapi/v1/leverage?");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $leverage_parametri.”×tamp=".$timestamp."&signature=".$sign);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(“Content-Type: application/x-www-form-urlencoded”,"X-MBX-APIKEY: ".$key));
$ch = curl_exec($ch);
curl_close($ch);
echo $ch;
//////////////////////////////////
What could be wrong?