jaggedsoft / php-binance-api

PHP Binance API is an asynchronous PHP library for the Binance API designed to be easy to use. https://github.com/binance-exchange/php-binance-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return null in USDT transfer

rajneshsharma opened this issue · comments

Title
Return null in USDT transfer

Short Description:
I m using transfer in testing mode with following endpoint but return null
https://testnet.binance.vision/sapi/v1/asset/transfer?amount=1&asset=USDT&type=MAIN_UMFUTURE&signature=6567483b2265e7c2a8d6ebcf6cd62475b3b921a94c1cafa049f59aa399d98c90&timestamp=1631189373527.7

Platform:

  • linux

php version:

  • 7.4.

Long descrption
If im using sapi/v1/asset/transfer?amount=1&asset=USDT&type=MAIN_UMFUTURE&signature=6567483b2265e7c2a8d6ebcf6cd62475b3b921a94c1cafa049f59aa399d98c90&timestamp=1631189373527.7

Then return duplicate signature

code

<?
$apikey		= "my apikey";
$apisecret	= "my apisecret";

//1499827319559
$timestamp = time()*1000; //get current timestamp in milliseconds

$str = "asset=$asset&amount=$amount&type=$type&amp;timestamp=$timestamp";
	

$signature = hash_hmac('sha256', $str, $apisecret);

$url = "https://testnet.binance.vision/sapi/v1/asset/transfer?signature=".$signature;

//$url = "https://testnet.binance.vision/api/v1/asset/transfer?signature=".$signature;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-MBX-APIKEY:'.$apikey));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str."&signature=".$signature);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);

echo '<pre>';
var_dump($response);
echo '</pre>';
exit
**result**

{
"result":"result"
}


thank you

Hi @rajneshsharma
You don't seem to ask any question linked to this API , so we won't be able to help you.
Please find a general forum for the finance API and ask your question there.