如何解决Bitfinex 使用 PHP 和 cURL 提取 API v2 Authenticated Endpoints
我确定我离得很近,但刚刚离开。我正在尝试使用 Bitfinex v2 API 返回我的钱包余额,但我不断收到“无效密钥”错误。
我在那里, 我正在尝试实施 v2 bitfinex withdraw api 通过 cURL 请求,但作为响应,我不断收到 “无效密钥” 错误
这是我的代码
$data =[
"wallet"=>'trading',"method"=>'TRX',"amount"=>'43.00',"address"=>'original destination address'
];
$bodyRequest=['body'=>$data];
$ch = curl_init();
$nonce= (string)number_format(round(microtime(true) * 100000),".","");
$payload =json_encode($data);
$path = "/api/v2/auth/w/withdraw".$nonce.$payload;
$signature =(string)hash_hmac('sha384',utf8_encode($path),utf8_encode($this->secret));
$headers= array(
"content-type: application/json","bfx-apikey: " . $this->key,"bfx-signature: " . $signature,"bfx-nonce: " . $nonce,);
$bodyRequestPayload=json_encode($bodyRequest);
$url = self::API_URL .'/v2/auth/w/withdraw';
curl_setopt_array($ch,array(
CURLOPT_URL => $url,CURLOPT_POST => true,CURLOPT_RETURNTRANSFER => true,CURLOPT_HTTPHEADER => $headers,CURLOPT_SSL_VERIFYPEER => true,CURLOPT_CONNECTTIMEOUT => self::CONNECT_TIMEOUT,CURLOPT_POSTFIELDS=>$bodyRequestPayload,));
$result = curl_exec($ch);
var_dump( $result);
请建议我如何解决这个问题? 提前致谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。