我正在尝试将二进制api与php集成起来。我想把我的钱包和收入花光。我找不到我需要的url,也找不到端点。
附加问题:我需要时间戳做什么?
$secret = "mySecretKey";
$key = "myApiKey";
$s_time = "timestamp=".time()*1000;
$sign=hash_hmac('SHA256', $s_time, $secret);
$url = "https://api.binance.com/api/v1/balances?".$s_time.'&signature='.$sign;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-MBX-APIKEY:'.$key));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
$result = json_decode($result, true);
echo '<pre>';
var_dump($result);
echo '</pre>';
curl_close($ch);我尝试了许多urls,并查看了二进制文档很长时间,但我只是找不到它。
谢谢你的帮忙!
发布于 2022-11-29 19:51:22
我在他们的API文档中找到的唯一链接是
查询子帐户资产(用于主帐户)
GET /sapi/v3/sub-account/assets (HMAC SHA256) 响应:
{
"balances":[
{
"asset":"ADA",
"free":10000,
"locked":0
},
{
"asset":"BNB",
"free":10003,
"locked":0
},
{
"asset":"BTC",
"free":11467.6399,
"locked":0
},
{
"asset":"ETH",
"free":10004.995,
"locked":0
},
{
"asset":"USDT",
"free":11652.14213,
"locked":0
}
]
}https://stackoverflow.com/questions/74617417
复制相似问题