申请向已登记地址提取加密资产
curl --request POST \
--url https://banker.qfex.com/withdraw \
--header 'Content-Type: application/json' \
--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>' \
--data '
{
"amount": 2,
"address": "<string>",
"network": "ARBITRUM_ONE"
}
'import requests
url = "https://banker.qfex.com/withdraw"
payload = {
"amount": 2,
"address": "<string>",
"network": "ARBITRUM_ONE"
}
headers = {
"x-qfex-hmac-signature": "<api-key>",
"x-qfex-nonce": "<api-key>",
"x-qfex-public-key": "<api-key>",
"x-qfex-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-qfex-hmac-signature': '<api-key>',
'x-qfex-nonce': '<api-key>',
'x-qfex-public-key': '<api-key>',
'x-qfex-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2, address: '<string>', network: 'ARBITRUM_ONE'})
};
fetch('https://banker.qfex.com/withdraw', 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/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2,
'address' => '<string>',
'network' => 'ARBITRUM_ONE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://banker.qfex.com/withdraw"
payload := strings.NewReader("{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://banker.qfex.com/withdraw")
.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>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://banker.qfex.com/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}"
response = http.request(request)
puts response.read_body出入金
申请向已登记地址提取加密资产
标准 API 密钥需要 deposit_withdraw 权限。通过 POST /builder/web3/api-key 签发或替换的密钥,在用户拥有所选账户时也支持向已登记地址提取加密资产。这项 Builder 权限不能在开发者设置中选择。所有提现,包括全部 API 密钥及 JWT 会话,必须使用当前已认证用户在所请求网络上登记的目的地址。系统在扣款前检查地址;Arbitrum 匹配不区分大小写,TRON 必须完全一致。款项从用户主账户扣除。请求不具备幂等性;超时后请先核对提现历史,再决定是否重试。
POST
/
withdraw
申请向已登记地址提取加密资产
curl --request POST \
--url https://banker.qfex.com/withdraw \
--header 'Content-Type: application/json' \
--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>' \
--data '
{
"amount": 2,
"address": "<string>",
"network": "ARBITRUM_ONE"
}
'import requests
url = "https://banker.qfex.com/withdraw"
payload = {
"amount": 2,
"address": "<string>",
"network": "ARBITRUM_ONE"
}
headers = {
"x-qfex-hmac-signature": "<api-key>",
"x-qfex-nonce": "<api-key>",
"x-qfex-public-key": "<api-key>",
"x-qfex-timestamp": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-qfex-hmac-signature': '<api-key>',
'x-qfex-nonce': '<api-key>',
'x-qfex-public-key': '<api-key>',
'x-qfex-timestamp': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2, address: '<string>', network: 'ARBITRUM_ONE'})
};
fetch('https://banker.qfex.com/withdraw', 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/withdraw",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2,
'address' => '<string>',
'network' => 'ARBITRUM_ONE'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://banker.qfex.com/withdraw"
payload := strings.NewReader("{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://banker.qfex.com/withdraw")
.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>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://banker.qfex.com/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 2,\n \"address\": \"<string>\",\n \"network\": \"ARBITRUM_ONE\"\n}"
response = http.request(request)
puts response.read_body授权
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 时间戳,即自纪元起的秒数。
请求体
application/json
响应
提现请求已接受并已扣款,响应体为空;链上结算可能仍在等待处理或需要人工审核。