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

# getAssetProofBatch

> 在 OrbitFlare 上使用 DAS getAssetProofBatch，在一个请求中获取最多 1,000 个 Solana 压缩 NFT 的 Merkle 证明。

## 概述

`getAssetProofBatch` 一次性返回多个压缩资产的 Merkle 证明，适用于连续转移或销毁多个压缩 NFT 的场景。

该方法也可以通过 `getAssetProofs` 调用。

## 参数

<ResponseField name="ids" type="string[]" required>
  压缩资产 ID（base-58）。最多 1,000 个。
</ResponseField>

## 响应

<ResponseField name="result" type="object">
  以资产 ID 为键的对象。每个值是一个证明，字段与 [getAssetProof](/cn/das-api/methods/getAssetProof) 相同；如果未找到该 ID 的证明，则为 `null`。
</ResponseField>

## 代码示例

### 请求

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAssetProofBatch",
  "params": {
    "ids": ["JEKNNLZK6uQaQUEUz9GRoYZ7buHQ4rTN6k3qhX9NG8qU"]
  }
}'
```

### 响应

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "JEKNNLZK6uQaQUEUz9GRoYZ7buHQ4rTN6k3qhX9NG8qU": {
      "last_indexed_slot": 457714577,
      "root": "3wxyaNRvzuZqDd9jtqthCu87spdKuhcpaKVzP1msGyHW",
      "proof": [
        "8mjbWMPrBwYJeEmQbeYLR7mscS4umW4U3kxibuH8hcY1",
        "DV31TLc5BXCnCQMaQ9H6empbG9i69w4AWkjR5RPiyXr8",
        "G6f1pEKetujNm6JXQxD47eBudxLV1irR1U5atpAXBb4q"
      ],
      "node_index": 1671570,
      "leaf": "CcMhrzXFkjyLwZdijjRibgSYw4tUzXYALoCxwms4aMFH",
      "tree_id": "E7fYCRWkNykc8HNZvEMRj5GuNYSwJ3WjA6HuLsh3YHvL"
    }
  },
  "id": 1
}
```

此处的证明数组已做精简。完整的证明在树的每一层都有一个节点。

### TypeScript

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
const RPC_URL = 'https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY';

async function getAssetProofBatch(ids: string[]) {
  const response = await fetch(RPC_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getAssetProofBatch',
      params: { ids },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);

  const missing = ids.filter((id) => result[id] == null);
  if (missing.length) console.warn('No proof for', missing);
  return result;
}
```

## 常见错误

| 错误码 | 消息 | 解决方案 |
| - | - | - |
| -32602 | Batch Size Error. Batch size should not be greater than 1000. | 将 ID 拆分为每批 1,000 个 |
| -32602 | Pubkey Validation Err: ... is invalid | 每个 ID 都必须是有效的 base-58 |


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