提交已签名的卖单
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/asks \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
askData: {
salt: '<string>',
deadline: '<string>',
usdcAmount: '<string>',
owner: '<string>',
tokenId: '9007199254740993'
},
askSignature: '<string>'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/asks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-api.renaiss.xyz/v2/marketplace/asks"
payload = {
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "ask",
"orderId": "<string>",
"status": "ACTIVE",
"executed": true,
"executionTxHash": "<string>",
"matchedOrderId": "<string>"
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Invalid wallet action proof",
"code": "API_AUTH_INVALID_ACTION"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server Error订单
提交卖单
提交卖家的订单数据和签名,发布卖单。 调试面板使用测试网请求格式。当前主网字段见本页说明。
POST
/
v2
/
marketplace
/
asks
提交已签名的卖单
curl --request POST \
--url https://dev-api.renaiss.xyz/v2/marketplace/asks \
--header 'Content-Type: application/json' \
--header 'x-builder-api-key: <api-key>' \
--data '
{
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-builder-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '9007199254740993',
askData: {
salt: '<string>',
deadline: '<string>',
usdcAmount: '<string>',
owner: '<string>',
tokenId: '9007199254740993'
},
askSignature: '<string>'
})
};
fetch('https://dev-api.renaiss.xyz/v2/marketplace/asks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-api.renaiss.xyz/v2/marketplace/asks"
payload = {
"tokenId": "9007199254740993",
"askData": {
"salt": "<string>",
"deadline": "<string>",
"usdcAmount": "<string>",
"owner": "<string>",
"tokenId": "9007199254740993"
},
"askSignature": "<string>"
}
headers = {
"x-builder-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"operation": "ask",
"orderId": "<string>",
"status": "ACTIVE",
"executed": true,
"executionTxHash": "<string>",
"matchedOrderId": "<string>"
}Malformed JSON in request body{
"error": "Required authentication credential is missing",
"code": "API_AUTH_MISSING_CREDENTIAL"
}{
"error": "Invalid wallet action proof",
"code": "API_AUTH_INVALID_ACTION"
}{
"error": "Collectible not found",
"code": "COLLECTIBLE_NOT_FOUND"
}Payload Too Large{
"error": "Authentication rate limit exceeded",
"code": "API_AUTH_RATE_LIMITED"
}Internal Server ErrortokenId 和 payload.askData。分别填入 tokenId 和 askData,再附上卖家的 askSignature。在测试网上,请提交此处所示的顶层 tokenId。主网更新前,请将准备响应的 payload.collectibleId 作为主网请求的顶层 collectibleId。签名订单数据应与准备响应保持一致。请求
需要开发者密钥和钱包签名
响应
错误码
在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议,请参阅错误码含义与处理方式。
| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
|---|---|---|---|
400 | ASK_AMOUNT_NOT_POSITIVE | error | Ask amount must be greater than zero价格为零。请提供大于零的价格。 |
400 | ASK_HAS_ALREADY_EXPIRED | error | Ask has already expired卖单在处理期间过期。请调整到期时间并重新准备、签名。 |
400 | ASK_TOKEN_ID_MISMATCH | error | Signed order token ID differs from the submitted token IDAsk token ID does not match the collectible核对 tokenId 与 askData.tokenId 是否指向同一张卡牌。两个字段都应取自同一次准备响应。 |
400 | COLLECTIBLE_ONCHAIN_OWNER_MISMATCH | error | {onchainOwner} is the on chain owner.该钱包不是链上持有人。请使用持有藏品的钱包。 |
400 | INVALID_ASK_SIGNATURE | error | Ask signature is invalid卖单签名无效。请重新准备并由钱包签署新数据。 |
400 | OFFER_EXPIRY_TOO_LONG | error | Offers can expire at most 180 days from now卖单到期时间过远。请缩短有效期并重新准备。 |
400 | WRONG_REQUEST_PARAMS | error | Invalid marketplace request: tokenId: RequiredInvalid marketplace request: Expected object, received array请用 JSON 对象传入必填字段。复制准备响应顶层的 tokenId,并省略 collectibleId。 |
400 | 无错误码 | text/plain | Malformed JSON in request body |
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 | API_AUTH_INVALID_ACTION | error | Invalid wallet action proof钱包签名与准备数据不符或已过期。请重新准备和签名。合约钱包的 isValidSignature 对准备数据的 EIP-712 摘要必须返回 0x1626ba7e。 |
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,无需重试。 |
404 | COLLECTIBLE_NOT_FOUND | error | Collectible not found代币 ID 未知或藏品在该 API 中不可用。请核对 ID,不要用同一 ID 重试。 |
413 | 无错误码 | text/plain | Payload Too Large |
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 | 无错误码 | text/plain | Internal Server Error |
500 | COLLECTIBLE_GET_FAILEDASK_ORDER_INSERT_FAILEDASK_ORDER_UPDATE_FAILEDCREATE_SELL_OFFER_FAILED | error | Internal server error重新提交前,请查询订单和钱包活动。 |
授权
请求体
application/json