> ## 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.

# getSignaturesForAsset

> 在 OrbitFlare 上使用 DAS getSignaturesForAsset，列出铸造、转移、销毁或更新某个 Solana 压缩 NFT 的交易。

## 概述

压缩 NFT 没有自己的账户，因此 `getSignaturesForAddress` 无法显示它的历史记录。`getSignaturesForAsset` 返回更改过该资产的 Bubblegum 交易，每笔交易都附带其指令类型，例如 `MintToCollectionV1`、`Transfer` 或 `Burn`。

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

## 参数

通过 `id`，或同时通过 `tree` 和 `leafIndex` 来指定资产。

<ResponseField name="id" type="string">
  压缩资产 ID（base-58）。
</ResponseField>

<ResponseField name="tree" type="string">
  Merkle 树地址（base-58）。与 `leafIndex` 一起使用。
</ResponseField>

<ResponseField name="leafIndex" type="number">
  在树中的叶子索引。与 `tree` 一起使用。
</ResponseField>

<ResponseField name="page" type="number">
  页码，从 1 开始。请参阅[分页](/cn/das-api/pagination)。
</ResponseField>

<ResponseField name="limit" type="number">
  每页结果数。最大值和默认值均为 1,000。
</ResponseField>

<ResponseField name="sortDirection" type="string">
  `asc` 或 `desc`。
</ResponseField>

## 响应

<ResponseField name="result" type="object">
  <Expandable title="result 字段">
    <ResponseField name="total" type="number">
      本页中的条目数。
    </ResponseField>

    <ResponseField name="limit" type="number">
      使用的每页大小。
    </ResponseField>

    <ResponseField name="page" type="number">
      按页码分页时的页码。
    </ResponseField>

    <ResponseField name="items" type="array">
      `[signature, instruction type]` 对。
    </ResponseField>
  </Expandable>
</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": "getSignaturesForAsset",
  "params": {
    "id": "JEKNNLZK6uQaQUEUz9GRoYZ7buHQ4rTN6k3qhX9NG8qU",
    "page": 1,
    "limit": 100
  }
}'
```

### 响应

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "last_indexed_slot": 457714577,
    "total": 1,
    "limit": 100,
    "page": 1,
    "items": [
      [
        "3eUm7YYq71vcZdgYT3X51xrJeNKaUg5fFfCFaBS2fwP3BPvip2hYxaAaqfNDs3Pj53JPDriQauBtWbz4u7cFN2dw",
        "MintToCollectionV1"
      ]
    ]
  },
  "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 getAssetHistory(id: string) {
  const response = await fetch(RPC_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getSignaturesForAsset',
      params: { id, page: 1, limit: 1000 },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);

  return result.items.map(([signature, type]: [string, string]) => ({ signature, type }));
}
```

## 常见错误

| 错误码 | 消息 | 解决方案 |
| - | - | - |
| -32602 | Must provide either 'id' or both 'tree' and 'leafIndex' | 单独发送 `id`，或同时发送 `tree` 和 `leafIndex` |
| -32602 | Pubkey Validation Err: ... is invalid | 传入有效的 base-58 资产 ID 或树地址 |
| -32602 | Pagination Error. Limit should not be greater than 1000. | 使用不超过 1,000 的 `limit` |


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