列出钱包当前可接受的回购报价
curl --request GET \
--url https://api.renaiss.xyz/v2/gacha/buyback/offers \
--header 'x-builder-api-key: <api-key>'const options = {method: 'GET', headers: {'x-builder-api-key': '<api-key>'}};
fetch('https://api.renaiss.xyz/v2/gacha/buyback/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/gacha/buyback/offers"
headers = {"x-builder-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"offers": [
{
"cardPackId": "<string>",
"settlementId": "<string>",
"tokenId": "<string>",
"vendingMachineAddress": "<string>",
"buybackTiers": [
{
"buybackPercentage": 123,
"amountInUsdt": "<string>",
"expiresAt": "<string>"
}
]
}
]
}{
"code": "WRONG_REQUEST_PARAMS",
"message": "Bad request - invalid parameters"
}{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_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"
}{
"error": "Internal server error",
"code": "FUNCTION_ERROR"
}抽卡与回购
列出回购报价
查询钱包可通过你的应用回售的卡牌。每份报价都包含各档回购金额和截止时间。
GET
/
v2
/
gacha
/
buyback
/
offers
列出钱包当前可接受的回购报价
curl --request GET \
--url https://api.renaiss.xyz/v2/gacha/buyback/offers \
--header 'x-builder-api-key: <api-key>'const options = {method: 'GET', headers: {'x-builder-api-key': '<api-key>'}};
fetch('https://api.renaiss.xyz/v2/gacha/buyback/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.renaiss.xyz/v2/gacha/buyback/offers"
headers = {"x-builder-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"offers": [
{
"cardPackId": "<string>",
"settlementId": "<string>",
"tokenId": "<string>",
"vendingMachineAddress": "<string>",
"buybackTiers": [
{
"buybackPercentage": 123,
"amountInUsdt": "<string>",
"expiresAt": "<string>"
}
]
}
]
}{
"code": "WRONG_REQUEST_PARAMS",
"message": "Bad request - invalid parameters"
}{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_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"
}{
"error": "Internal server error",
"code": "FUNCTION_ERROR"
}- 展示回购金额前,先刷新钱包的报价。
- 按顺序读取
buybackTiers。第一个未过期档位的amountInUsdt是当前价格。最后一个金额大于零的档位,其expiresAt即为报价截止时间。 - 让钱包签署已核对的报价,再结算回购。
请求
需要开发者密钥
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | WRONG_REQUEST_PARAMS | message | Bad request - invalid parameters字段缺失或格式错误。修正后重新发送, |
401 | API_AUTH_INVALID_CREDENTIAL | error | Invalid authentication credential开发者密钥格式错误、未知、已过期或已撤销。请核对并更换密钥。 |
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_ERROR | error | Internal server error |
500 | FUNCTION_ERROR | error | Internal server error |
500 | OFFER_QUERY_FAILED | error | Internal server error请稍后重新查询。 |
500 | 其他错误码 | error | Internal server error |