> ## Documentation Index
> Fetch the complete documentation index at: https://docs.renaiss.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 列出钱包藏品

> 列出钱包在链上持有的卡牌，以及通过你的应用抽中但尚未到账的卡牌。

| 卡牌状态 | 何时出现 |
| - | - |
| `IN_WALLET` | 该地址已在链上持有卡牌，包括买入、转入或通过其他开发者抽中并到账的卡牌。 |
| `IN_BUYBACK_WINDOW` | 钱包通过你的应用抽中了卡牌，且仍在回购期内。 |
| `AWAITING_DELIVERY` | 钱包通过你的应用抽中了卡牌，回购期已结束，卡牌仍由 Renaiss 保管。 |

**抽卡详情。** 仅当该钱包通过你的应用抽中这张卡，且仍是当前抽卡记录时，才会返回 `pull` 详情。其余已持有的卡牌返回 `pull: null`。卖出、回售、转出或兑换后，卡牌会移出收藏。若合约钱包最终无法接收交付，该卡会从列表和统计中移除，也不会退款或生成交付失败动态。

**分页。** 接口先按 `tokenIds` 筛选，再排序、分页并计算 `pagination.total`。[钱包摘要](https://docs.renaiss.xyz/cn/api-reference/wallets/get-collection-value.md)始终统计完整收藏。签名地址和 Safe 钱包需要分别查询。Renaiss 托管钱包的列表为空。

## 请求

需要开发者密钥

## 响应

## 错误码

在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议，请参阅[错误码含义与处理方式](https://docs.renaiss.xyz/cn/api-reference/errors.md)。

| 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` | 其他错误码 | `error` | `Internal server error` |
| `500` | 无错误码 | `text/plain` | `Internal Server Error` |


## OpenAPI

````yaml cn/api-reference/openapi.json GET /v2/users/{walletAddress}/collectibles
openapi: 3.1.1
info:
  version: 1.0.0
  title: Renaiss 开发者 API v2
  description: >-
    在 BNB 智能链（链 ID 56）上使用外部钱包接入抽卡、交易市场和实物兑换。所有已批准且有效的开发者密钥均可准备购买。


    藏品包括钱包可抽取、交易、回售或兑换的物品，例如卡牌。接口路径、字段和描述统一使用 collectible 表示藏品。


    可以匿名浏览目录。准备购买后，请由买家钱包签名。抽卡记录和回购报价需要开发者密钥，购买和回购还需操作签名。私有配送信息及兑换需要钱包访问令牌，由钱包在已注册的合作方来源签署登录消息后签发。抽卡和市场不使用钱包访问令牌。请在后端保管开发者密钥。


    操作钱包可以是 EOA 或已部署的 ERC-1271 合约账户。不支持 EIP-7702 委托账户、ERC-6492 或 ERC-8010 封装签名及
    Renaiss 托管的 Safe（签名验证后才会识别并拒绝该类 Safe）。无法接收 ERC-721 的合约钱包抽卡会返回
    `CONTRACT_WALLET_CANNOT_RECEIVE_NFT`。链上读取失败返回
    `API_AUTH_ERROR`（500）。钱包访问令牌及实物兑换仅支持 EOA。
servers:
  - url: https://api.renaiss.xyz
    description: BNB 智能链主网
  - url: https://dev-api.renaiss.xyz
    description: BNB 测试网
security: []
tags:
  - name: Gacha v2
    description: 使用 EOA 浏览和购买卡包、揭晓藏品、读取购买记录及回购。无需钱包访问令牌。
  - name: Marketplace
    description: 公开浏览藏品，通过外部钱包挂牌、出价、购买或撤单。交易需要开发者授权及钱包操作签名。
  - name: Users
    description: 查询特定钱包的藏品、市场总估值和链上活动。仅需开发者密钥，各接口按相应的可见范围返回记录。
  - name: Redemption
    description: 查询兑换资格、运费报价，准备并提交兑换及跟踪物流。需要开发者密钥及同一钱包的访问令牌。
  - name: Wallet access tokens
    description: >-
      获取、刷新或撤销实物兑换使用的钱包访问令牌。钱包签署一次性登录消息（5 分钟有效）后，API 返回访问令牌（15 分钟）和一次性刷新令牌（7
      天）。先注册精确的合作方前端来源。抽卡和市场无需钱包访问令牌。
paths:
  /v2/users/{walletAddress}/collectibles:
    get:
      tags:
        - Users
      summary: 列出钱包藏品
      description: 列出钱包在链上持有的卡牌，以及通过你的应用抽中但尚未到账的卡牌。
      parameters:
        - schema:
            type: string
            description: 只查询传入的这个钱包地址。
          required: true
          description: 只查询传入的这个钱包地址。
          name: walletAddress
          in: path
        - schema:
            type: string
            enum:
              - pulledAt
              - rixPriceInUsd
              - buybackExpiresAt
            default: pulledAt
            description: >-
              `pulledAt` 表示钱包在当前开发者处抽到藏品的时间；`rixPriceInUsd` 为藏品的 RIX
              估值（FMV）；`buybackExpiresAt` 取 `state.buybackTiers` 中第一个未过期档位的
              `expiresAt`，之后可能还有其他档位。正序或倒序均把缺少相应值的藏品排在末尾。
          required: false
          description: >-
            `pulledAt` 表示钱包在当前开发者处抽到藏品的时间；`rixPriceInUsd` 为藏品的 RIX
            估值（FMV）；`buybackExpiresAt` 取 `state.buybackTiers` 中第一个未过期档位的
            `expiresAt`，之后可能还有其他档位。正序或倒序均把缺少相应值的藏品排在末尾。
          name: sortBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
          name: sortOrder
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          required: false
          name: limit
          in: query
        - schema:
            type:
              - integer
              - 'null'
            minimum: 0
            maximum: 10000
            default: 0
          required: false
          name: offset
          in: query
        - schema:
            type: array
            items:
              type: string
              pattern: ^\d+$
            description: >-
              最多 20 个十进制代币
              ID。可用逗号分隔（`?tokenIds=1,2`）或重复传参。去除首尾空格、空值及重复字符串后检查数量。省略或为空表示不筛选。先筛选再排序和分页，`pagination.total`
              为筛选后的总数。不属于列表的 ID 不返回结果。
          required: false
          name: tokenIds
          in: query
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  collectibles:
                    type: array
                    items:
                      type: object
                      properties:
                        tokenId:
                          type: string
                          description: 藏品的代币 ID。
                        type:
                          type: string
                          enum:
                            - POKEMON
                            - ONE_PIECE
                            - SPORTS
                          description: 藏品类别。
                        name:
                          type: string
                          description: 评级、年份、系列、编号和名称。
                        frontImageUrl:
                          type: string
                          format: uri
                          description: 深色背景下带 Renaiss 边框的评级卡盒照片。
                        rixPriceInUsd:
                          type:
                            - string
                            - 'null'
                          description: >-
                            藏品的公允市价（FMV）估值，由 Renaiss Index（RIX）提供，单位为美分，与
                            renaiss.xyz 显示一致，随市场变化。暂无估值时为 `null`。
                        rixPriceUpdatedAt:
                          type:
                            - string
                            - 'null'
                          format: date-time
                          description: >-
                            `rixPriceInUsd` 中的 RIX 估值（FMV）最近一次更新的时间。无时间记录时返回
                            `null`。
                        state:
                          oneOf:
                            - type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - IN_WALLET
                              required:
                                - status
                            - type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - IN_BUYBACK_WINDOW
                                buybackBaseValueInUSD:
                                  type: string
                                  description: >-
                                    本次抽卡的回购基础价值，以美分计，含加成。每档按其
                                    `buybackPercentage` 支付。
                                buybackBonus:
                                  type:
                                    - object
                                    - 'null'
                                  properties:
                                    originalBuybackBaseValueInUSD:
                                      type: string
                                      description: 加成前的回购基础价值，以美分计，在该组卡牌形成时确定。
                                    bonusBps:
                                      type: integer
                                      description: 加成基点数，例如 2000 表示增加 20%。
                                  required:
                                    - originalBuybackBaseValueInUSD
                                    - bonusBps
                                  description: >-
                                    藏品的回购加成。回购基础价值及 `buybackTiers`
                                    金额已计入加成，不要重复计算。无加成时为 `null`。
                                buybackTiers:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      buybackPercentage:
                                        type: number
                                        description: 相对于卡牌基础价值的百分比，例如 90 表示 90%。
                                      amountInUsdt:
                                        type: string
                                        description: 本档回购价格，以精度为 18 位的 USDT 最小单位表示。
                                      expiresAt:
                                        type: string
                                        description: 本档截止时间。在此时刻该档仍有效。
                                    required:
                                      - buybackPercentage
                                      - amountInUsdt
                                      - expiresAt
                                  description: >-
                                    本次抽卡的全部回购档位，包括已过期档位，按截止时间排序。价格与 `GET
                                    /v2/gacha/buyback/offers` 一致。当前价格为第一个尚未超过
                                    `expiresAt` 的档位的 `amountInUsdt`，截止时刻仍有效。
                              required:
                                - status
                                - buybackBaseValueInUSD
                                - buybackBonus
                                - buybackTiers
                            - type: object
                              properties:
                                status:
                                  type: string
                                  enum:
                                    - AWAITING_DELIVERY
                              required:
                                - status
                          description: >-
                            `IN_WALLET` 表示已在链上持有；`IN_BUYBACK_WINDOW`
                            表示在当前开发者处抽中、仍由 Renaiss 保管，可对 `GET
                            /v2/gacha/buyback/offers`
                            的有效报价签名；`AWAITING_DELIVERY` 表示已抽中且无有效回购报价，但尚未转入钱包。
                        pull:
                          type:
                            - object
                            - 'null'
                          properties:
                            packId:
                              type: string
                              format: uuid
                              description: 抽出该藏品的卡包。
                            packName:
                              type: string
                            permitFundTxHash:
                              type: string
                              description: 本次抽卡的付款交易。
                            pulledAt:
                              type: string
                              format: date-time
                              description: 该笔付款的区块时间。
                          required:
                            - packId
                            - packName
                            - permitFundTxHash
                            - pulledAt
                          description: 该钱包通过当前开发者抽中这张卡时的记录。其余已持有的卡牌返回 `null`。
                      required:
                        - tokenId
                        - type
                        - name
                        - frontImageUrl
                        - rixPriceInUsd
                        - rixPriceUpdatedAt
                        - state
                        - pull
                  pagination:
                    type: object
                    properties:
                      total:
                        type: number
                      limit:
                        type: number
                      offset:
                        type: number
                      hasMore:
                        type: boolean
                    required:
                      - total
                      - limit
                      - offset
                      - hasMore
                required:
                  - collectibles
                  - pagination
        '400':
          description: >-
            请求在执行前被拒绝。


            见[错误码与处理方式](/cn/api-reference/wallets/list-collectibles#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - WRONG_REQUEST_PARAMS
                  message:
                    type: string
                    description: 简短的错误说明。
                required:
                  - code
                  - message
              example:
                code: WRONG_REQUEST_PARAMS
                message: Bad request - invalid parameters
        '401':
          description: >-
            缺少开发者密钥或密钥未通过验证。


            见[错误码与处理方式](/cn/api-reference/wallets/list-collectibles#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                    enum:
                      - API_AUTH_MISSING_CREDENTIAL
                      - API_AUTH_INVALID_CREDENTIAL
                required:
                  - error
                  - code
              example:
                error: Required authentication credential is missing
                code: API_AUTH_MISSING_CREDENTIAL
        '403':
          description: >-
            当前凭据无权执行此请求。


            见[错误码与处理方式](/cn/api-reference/wallets/list-collectibles#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                    enum:
                      - API_AUTH_CREDENTIAL_NOT_ALLOWED
                      - GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API
                required:
                  - error
                  - code
              example:
                error: Credential is not allowed by this policy
                code: API_AUTH_CREDENTIAL_NOT_ALLOWED
        '429':
          description: >-
            该开发者密钥的请求过于频繁。


            见[错误码与处理方式](/cn/api-reference/wallets/list-collectibles#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                    enum:
                      - API_AUTH_RATE_LIMITED
                required:
                  - error
                  - code
              example:
                error: Authentication rate limit exceeded
                code: API_AUTH_RATE_LIMITED
        '500':
          description: >-
            服务端暂时失败，请稍后重试。


            见[错误码与处理方式](/cn/api-reference/wallets/list-collectibles#http-errors)。
          content:
            text/plain:
              schema:
                type: string
              example: Internal Server Error
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                required:
                  - error
                  - code
              example:
                error: Internal server error
                code: FUNCTION_ERROR
      security:
        - builderAuth: []
components:
  securitySchemes:
    builderAuth:
      type: apiKey
      in: header
      name: x-builder-api-key
      description: >-
        已获准使用的开发者 API 密钥，仅在后端保存。抽卡和市场的写入操作还需钱包签名，实物兑换还需钱包签署登录消息后由 API 签发的 Bearer
        令牌。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.