创建用于链接外部钱包的 nonce 挑战
curl --request POST \
--url https://api.qbank.cl/platform/v1/wallet-links/challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
}
'import requests
url = "https://api.qbank.cl/platform/v1/wallet-links/challenges"
payload = {
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain: 'eth', address: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F'})
};
fetch('https://api.qbank.cl/platform/v1/wallet-links/challenges', 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://api.qbank.cl/platform/v1/wallet-links/challenges",
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([
'chain' => 'eth',
'address' => '0x71C7656EC7ab88b098defB751B7401B5f6d8976F'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.qbank.cl/platform/v1/wallet-links/challenges"
payload := strings.NewReader("{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.qbank.cl/platform/v1/wallet-links/challenges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/wallet-links/challenges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}"
response = http.request(request)
puts response.read_body{
"challenge": {
"link_id": "d52e7b91-4c68-4f89-1b23-5d7e9f0a2c46",
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"nonce": "9f2c41d2a887f3e4b219c6d2e8f1a5b7",
"envelope": "CBPay Signature Proof\nDomain: https://api.qbank.cl/platform\nPurpose: wallet_link\nWallet: 0x71C7656EC7ab88b098defB751B7401B5f6d8976F\nAccount: ae8c1f02-3b45-4c67-9d12-8f0e5a6b7c8d\nNonce: 9f2c41d2a887f3e4b219c6d2e8f1a5b7\nIssued: 2026-08-21T14:03:11Z\nExpires: 2026-08-21T14:13:11Z",
"expires_at": "2026-08-21T14:13:11Z"
}
}创建用于链接外部钱包的 nonce 挑战
创建一个 nonce 挑战,用于将外部钱包(custody=client)链接到账户。
客户使用其钱包对 envelope 进行签名(ETH/EVM 为 EIP-191,TRON 为 TIP-191),
并将其发送到 POST /v1/wallet-links/verify。挑战在 10 分钟后过期,且只能使用一次。
特定错误:unsupported_chain、invalid_address、nonce_failed。
POST
/
v1
/
wallet-links
/
challenges
创建用于链接外部钱包的 nonce 挑战
curl --request POST \
--url https://api.qbank.cl/platform/v1/wallet-links/challenges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
}
'import requests
url = "https://api.qbank.cl/platform/v1/wallet-links/challenges"
payload = {
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain: 'eth', address: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F'})
};
fetch('https://api.qbank.cl/platform/v1/wallet-links/challenges', 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://api.qbank.cl/platform/v1/wallet-links/challenges",
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([
'chain' => 'eth',
'address' => '0x71C7656EC7ab88b098defB751B7401B5f6d8976F'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.qbank.cl/platform/v1/wallet-links/challenges"
payload := strings.NewReader("{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.qbank.cl/platform/v1/wallet-links/challenges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/wallet-links/challenges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"eth\",\n \"address\": \"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\"\n}"
response = http.request(request)
puts response.read_body{
"challenge": {
"link_id": "d52e7b91-4c68-4f89-1b23-5d7e9f0a2c46",
"chain": "eth",
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"nonce": "9f2c41d2a887f3e4b219c6d2e8f1a5b7",
"envelope": "CBPay Signature Proof\nDomain: https://api.qbank.cl/platform\nPurpose: wallet_link\nWallet: 0x71C7656EC7ab88b098defB751B7401B5f6d8976F\nAccount: ae8c1f02-3b45-4c67-9d12-8f0e5a6b7c8d\nNonce: 9f2c41d2a887f3e4b219c6d2e8f1a5b7\nIssued: 2026-08-21T14:03:11Z\nExpires: 2026-08-21T14:13:11Z",
"expires_at": "2026-08-21T14:13:11Z"
}
}最后修改于 2026年8月22日
⌘I