获取钱包访问令牌和刷新令牌
curl --request POST \
--url https://api.renaiss.xyz/v2/auth/wallet/verify \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"signature": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
challengeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
message: '<string>',
signature: '<string>'
})
};
fetch('https://api.renaiss.xyz/v2/auth/wallet/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/auth/wallet/verify"
payload = {
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"signature": "<string>"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"tokenType": "Bearer",
"accessToken": "<string>",
"refreshToken": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"refreshExpiresAt": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
]
}Malformed JSON in request body{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error钱包访问令牌
验证钱包签名
提交原始登录消息和钱包的 personal_sign 签名,换取访问令牌和刷新令牌。
POST
/
v2
/
auth
/
wallet
/
verify
获取钱包访问令牌和刷新令牌
curl --request POST \
--url https://api.renaiss.xyz/v2/auth/wallet/verify \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"signature": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
challengeId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
message: '<string>',
signature: '<string>'
})
};
fetch('https://api.renaiss.xyz/v2/auth/wallet/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/auth/wallet/verify"
payload = {
"challengeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"signature": "<string>"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"tokenType": "Bearer",
"accessToken": "<string>",
"refreshToken": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"refreshExpiresAt": "2023-11-07T05:31:56Z",
"scopes": [
"<string>"
]
}Malformed JSON in request body{
"error": "Invalid authentication credential",
"code": "API_AUTH_INVALID_CREDENTIAL"
}{
"error": "Credential is not allowed by this policy",
"code": "API_AUTH_CREDENTIAL_NOT_ALLOWED"
}{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server ErrorchallengeId、原始登录消息和钱包签名。访问令牌有效期为 15 分钟。登录后七天内,可使用一次性刷新令牌续签会话。请勿将令牌写入日志。请求
需要开发者密钥和钱包签名
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | API_AUTH_INVALID_INPUT | error | Invalid authentication inputRequest body is too large字段缺失、格式错误或请求体超过 12 KiB,请修正后重发。 |
400 | 无错误码 | text/plain | Malformed JSON in request body |
401 | API_AUTH_INVALID_CREDENTIAL | error | Invalid authentication credential密钥无效,或 challengeId 未知、过期、已用或属于其他开发者,也可能是消息或签名不匹配。重新获取 nonce 并让钱包签署新消息。 |
401 | API_AUTH_MISSING_CREDENTIAL | error | Required authentication credential is missing请在 x-builder-api-key 请求头中提供开发者密钥。 |
403 | API_AUTH_CREDENTIAL_NOT_ALLOWED | error | Credential is not allowed by this policy此路由只接受开发者密钥。移除 Authorization 请求头及其他凭据,再重新发送。 |
403 | GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API | error | This builder checks out on its own surface, not on the public API此密钥无法用于当前 API。请联系 Renaiss,无需重试。 |
429 | API_AUTH_RATE_LIMITED | error | Authentication rate limit exceeded已达到密钥的请求频率上限。稍候再以较低频率重试。 |
500 | API_AUTH_INVALID_CONFIGURATION | error | Internal server error若钱包认证持续失败,请将 x-request-id 提供给 Renaiss。 |
500 | API_AUTH_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | error | Internal server error |
500 | 无错误码 | text/plain | Internal Server Error |
授权
请求体
application/json