Bitfinex API V2 报apikey: invalid code10100,是否为认证BUG?
Bitfinex API V2 报
apikey: invalid(code 10100) 错误排查求助 我已经多方排查,但至今仍未找到Bitfinex API V2报apikey: invalid(code 10100)错误的有效解决方案,特来确认这是否属于Bitfinex API认证系统的BUG。我用PHP编写代码,测试过多种场景(比如将secret和payload编码为UTF-8等),也尝试过StackOverflow上的相关方案,但均无效。附上我的代码,若您发现问题可指出,我会测试验证:
private function nonce(){ return time()*1000; //Also time()*1000*1000 is tested } private function signature($api_path,$body,$nonce){ $str = "/api/$api_path" . $nonce . json_encode($body); return hash_hmac('sha384',$str,$this->secret); //Also UTF-8 encoding $str & secret are tested } public function getTradeFee(string $currency) : array{ $api_path = "v2/auth/r/summary"; $request_path = $this->auth_base_url . $api_path; $body = []; //params are not needed for this path $nonce = $this->nonce(); $headers = [ "Content-Type: application/json" , "bfx-nonce: $nonce" , "bfx-apikey: " . $this->key , //Key is double checked and is correct (With full permissions) "bfx-signature: " . $this->signature($api_path,$body,$nonce) ]; $curl = curl_init($request_path); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $body); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $info = curl_exec($curl); curl_close($curl); $info = json_decode($info); return $info; }
内容的提问来源于stack exchange,提问作者Nima
相关产品推荐
相关产品推荐

