获取加密资产充值地址
curl --request GET \
--url https://banker.qfex.com/address \
--header 'x-qfex-hmac-signature: <api-key>' \
--header 'x-qfex-nonce: <api-key>' \
--header 'x-qfex-public-key: <api-key>' \
--header 'x-qfex-timestamp: <api-key>'import requests
url = "https://banker.qfex.com/address"
headers = {
"x-qfex-hmac-signature": "<api-key>",
"x-qfex-nonce": "<api-key>",
"x-qfex-public-key": "<api-key>",
"x-qfex-timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-qfex-hmac-signature': '<api-key>',
'x-qfex-nonce': '<api-key>',
'x-qfex-public-key': '<api-key>',
'x-qfex-timestamp': '<api-key>'
}
};
fetch('https://banker.qfex.com/address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://banker.qfex.com/address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-qfex-hmac-signature: <api-key>",
"x-qfex-nonce: <api-key>",
"x-qfex-public-key: <api-key>",
"x-qfex-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://banker.qfex.com/address"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-qfex-hmac-signature", "<api-key>")
req.Header.Add("x-qfex-nonce", "<api-key>")
req.Header.Add("x-qfex-public-key", "<api-key>")
req.Header.Add("x-qfex-timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://banker.qfex.com/address")
.header("x-qfex-hmac-signature", "<api-key>")
.header("x-qfex-nonce", "<api-key>")
.header("x-qfex-public-key", "<api-key>")
.header("x-qfex-timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://banker.qfex.com/address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-qfex-hmac-signature"] = '<api-key>'
request["x-qfex-nonce"] = '<api-key>'
request["x-qfex-public-key"] = '<api-key>'
request["x-qfex-timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"network": "ARBITRUM_ONE",
"asset": "USDC"
}出入金
获取加密资产充值地址
API 密钥需要 view_balance 权限。返回现有充值地址,或在首次调用时创建地址,不会轮换现有地址。ARBITRUM_ONE 用于充值 USDC;TRON 用于充值 USDT。POST /address/rotate 要求 deposit_withdraw 权限。
GET
/
address
获取加密资产充值地址
curl --request GET \
--url https://banker.qfex.com/address \
--header 'x-qfex-hmac-signature: <api-key>' \
--header 'x-qfex-nonce: <api-key>' \
--header 'x-qfex-public-key: <api-key>' \
--header 'x-qfex-timestamp: <api-key>'import requests
url = "https://banker.qfex.com/address"
headers = {
"x-qfex-hmac-signature": "<api-key>",
"x-qfex-nonce": "<api-key>",
"x-qfex-public-key": "<api-key>",
"x-qfex-timestamp": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'x-qfex-hmac-signature': '<api-key>',
'x-qfex-nonce': '<api-key>',
'x-qfex-public-key': '<api-key>',
'x-qfex-timestamp': '<api-key>'
}
};
fetch('https://banker.qfex.com/address', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://banker.qfex.com/address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-qfex-hmac-signature: <api-key>",
"x-qfex-nonce: <api-key>",
"x-qfex-public-key: <api-key>",
"x-qfex-timestamp: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://banker.qfex.com/address"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-qfex-hmac-signature", "<api-key>")
req.Header.Add("x-qfex-nonce", "<api-key>")
req.Header.Add("x-qfex-public-key", "<api-key>")
req.Header.Add("x-qfex-timestamp", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://banker.qfex.com/address")
.header("x-qfex-hmac-signature", "<api-key>")
.header("x-qfex-nonce", "<api-key>")
.header("x-qfex-public-key", "<api-key>")
.header("x-qfex-timestamp", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://banker.qfex.com/address")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-qfex-hmac-signature"] = '<api-key>'
request["x-qfex-nonce"] = '<api-key>'
request["x-qfex-public-key"] = '<api-key>'
request["x-qfex-timestamp"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"network": "ARBITRUM_ONE",
"asset": "USDC"
}授权
HMACSignature & Nonce & PublicKey & TimestampFundingSession
HMAC-SHA256 签名,以十六进制编码。
唯一请求 nonce,以十六进制编码,最长 100 个字符。
QFEX API 认证要求以下请求头:
- x-qfex-public-key:您的 API 公开密钥。
- x-qfex-hmac-signature:请求的 HMAC 签名,使用十六进制编码。
- x-qfex-nonce:本次请求唯一的 nonce,使用十六进制编码,最长 100 个字符。
- x-qfex-timestamp:请求的 Unix 时间戳。
以上四个请求头均为必需项。可选择发送 x-qfex-requested-account-id(UUID)以使用子账户,详见下方签名生成说明。
签名生成:
- 生成密码学安全的随机 nonce(十六进制编码,最长 100 个字符),并获取当前 Unix 时间戳。
- 构造字符串
${nonce}:${unix_ts},使用私密密钥计算 HMAC-SHA256。 - 将 HMAC 结果编码为十六进制,得到签名。
- 发送所需认证请求头。nonce 在 15 分钟窗口内必须唯一。
重要:发送至 x-qfex-hmac-signature 请求头之前,签名本身必须先进行十六进制编码。
可选请求头:x-qfex-requested-account-id(UUID)用于选择子账户;省略时使用主账户。
Unix 时间戳,即自纪元起的秒数。
查询参数
可用选项:
ARBITRUM_ONE, TRON