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

# getAssetProofs DAS 方法

> 一次调用获取最多 1,000 个 Solana 压缩 NFT 的 Merkle 证明，以资产 id 为键。查看 getAssetProofs 的参数和代码示例。

以命名参数传入 `ids`。结果是以每个请求 id 为键的对象。

* 可用的方法名：`getAssetProofs`、`get_asset_proofs`、`getAssetProofBatch` 和 `get_asset_proof_batch`。
* 每次调用最多 1,000 个 id。超出会返回 `-32602` 和 `Batch Size Error`。
* 每个值的字段与 [getAssetProof](https://docs.solanatracker.io/cn/solana-rpc/http/getassetproof.md) 相同，包括 `last_indexed_slot`。没有可用证明的 id 映射为 `null`，而不会导致调用失败。
* 费用：每次调用 1 积分，与 id 数量无关。计入套餐的 DAS RPS 限制。

另见 [DAS API 概览](https://docs.solanatracker.io/cn/solana-rpc/das-api.md)。

请求配置和错误处理见 [RPC 快速入门](https://docs.solanatracker.io/cn/solana-rpc/quickstart.md)。计费见[积分与限制](https://docs.solanatracker.io/cn/solana-rpc/credits-and-rate-limits.md)。


## OpenAPI

````yaml getassetproofs post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana RPC HTTP method reference.
servers:
  - url: https://rpc-mainnet.solanatracker.io
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      summary: getAssetProofs
      description: >-
        Get Merkle proofs for up to 1,000 compressed NFTs in one call, keyed by
        asset id. Accepts `getAssetProofs`, `get_asset_proofs`,
        `getAssetProofBatch` and `get_asset_proof_batch`.
      operationId: getassetproofs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  allOf:
                    - type: string
                      description: The JSON-RPC protocol version.
                      enum:
                        - '2.0'
                      example: '2.0'
                id:
                  allOf:
                    - type: string
                      description: A unique identifier for the request.
                      example: '1'
                method:
                  allOf:
                    - type: string
                      description: The name of the RPC method to invoke.
                      enum:
                        - getAssetProofs
                      example: getAssetProofs
                params:
                  allOf:
                    - type: object
                      description: Named parameters.
                      required:
                        - ids
                      properties:
                        ids:
                          type: array
                          description: Compressed NFT asset ids, at most 1,000.
                          items:
                            type: string
                          maxItems: 1000
                          example:
                            - Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss
                            - J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              basic:
                summary: Get two proofs
                value:
                  jsonrpc: '2.0'
                  id: '1'
                  method: getAssetProofs
                  params:
                    ids:
                      - Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss
                      - J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w
      responses:
        '200':
          description: Proofs keyed by asset id.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                  result:
                    allOf:
                      - type: object
                        description: >-
                          Object keyed by each requested id. The value is the
                          proof, or null when no proof is available (not a
                          compressed NFT, or unknown).
                        additionalProperties:
                          oneOf:
                            - $ref: '#/components/schemas/AssetProof'
                            - type: 'null'
              examples:
                proofs:
                  summary: One compressed NFT and one regular NFT
                  value:
                    jsonrpc: '2.0'
                    id: '1'
                    result:
                      Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss:
                        root: 5rMQrAzDE7zUqB8WQoE1GbNQdWu47yZ3Y5qiHEYrTDhs
                        proof:
                          - Bnznh2FK62mukjRVhCn3UikGafn2jHXxLvT5xGM2ZD35
                          - Ebp7crC92YXamejQn6yz5HytwG51yP9LQBQNgpAayzbb
                          - 2Tgacv5YTTQHfthZitxphZZPCuALtAjt4JzZcg3y6CMH
                          - 4zi9eu47ytCDca7v9NvA58pZCWnpusDDi2i2HSzrMPsJ
                          - FBaCTNTo9mWmc1gKQo1rgj9LQ9eQxpsY54MGL7DUQqar
                          - 3QJGEkEzHoJuRbQwMBZWyWh5pidNLHNmdvDBftbE2kVL
                          - AZtuLFe24dXj5g4CSQ6X1nTnBsJdgtEem8Z7pC4ytdAG
                          - BVXHCgXTcLAmRaPXpicVjJiNsKKT8eKuEP4r3nxwc1cz
                          - EuHWZivHwrwDZMTEVXBRzSDAw9NnAAdfCcN9MK9sDyYS
                          - 33z2njBZCtEbpHTNzTzbFfvjX3U4JrGm7QYSoPr5tvcF
                          - BXJosP5Vwf8ydnXnHjtvwhypmvxLbF9EMpVcuAifYeDB
                          - 41X2rWXqpqpJXd8fjntnyRJRyPsmfEvGPntth2Le2Bex
                          - 7cRqjH5sYVnkHDJtPVUBmC6QWwYNstyFkrNFqDQNfjL9
                          - 58kqiwci5NvjyzCm6MKcYtwPgWLPZePLv1zxDLgM7Fzw
                        node_index: 21105
                        leaf: Bjt94wy4oBk5xgbAuAXKvn5n571Vj6bk5aU76qpRi1ht
                        tree_id: FrAzKzPRe6DfhkfMiPQxdDwuMJbBxPqQexNsqhedni9f
                        last_indexed_slot: 386264187
                      J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w: null
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32602
                      message: >-
                        Batch Size Error. Batch size should not be greater than
                        1000.
                    id: 1
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32001
                      message: Unauthorized
                    id: 1
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32005
                      message: Too many requests
                    id: 1
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32603
                      message: Internal error
                    id: 1
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32002
                      message: Service unavailable
                    id: 1
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32003
                      message: Gateway timeout
                    id: 1
      security:
        - ApiKeyQuery: []
components:
  schemas:
    AssetProof:
      type: object
      description: Merkle proof for a compressed NFT leaf.
      properties:
        root:
          type: string
          description: Current tree root.
        proof:
          type: array
          description: >-
            Sibling hashes from the leaf level up to just below the root, one
            per tree level. The full path is returned; trim the tree's canopy
            yourself when building a transaction.
          items:
            type: string
        node_index:
          type: integer
          description: 'Index of the leaf node in the tree: `2^depth + leaf_id`.'
          example: 21105
        leaf:
          type: string
          description: Current leaf hash.
        tree_id:
          type: string
          description: Merkle tree address.
        last_indexed_slot:
          type: integer
          description: Slot of the data the response was read from.
          example: 386264187
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````

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