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

# DAS API

> 通过 OrbitFlare 上统一的数字资产标准（DAS）JSON-RPC 接口，查询 Solana NFT、压缩 NFT、MPL Core 资产和 SPL 代币。

## 概述

数字资产标准（DAS）API 是读取 Solana 资产的统一接口。一组 JSON-RPC 方法即可覆盖所有资产类型，因此你无需自己解码 Token Metadata 账户、重放 Bubblegum 交易或合并代币账户。

DAS API 索引以下内容：

* **NFT 和可编程 NFT**（Metaplex Token Metadata）
* **压缩 NFT**（Bubblegum v1 和 v2），包括 Merkle 证明
* **MPL Core** 资产和合集
* **同质化代币**（SPL Token 和 Token-2022），在可用时附带美元价格
* 主版本 NFT 的**可打印版本**
* **Token-2022 扩展**和代币铭文

## 端点

DAS 方法与标准 Solana RPC 使用同一个端点。将请求连同你的 API key 发送到你的 OrbitFlare RPC URL：

```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": "getAsset",
  "params": {
    "id": "F9Lw3ki3hJ7PF9HQXsBzoY8GyE6sPoEZZdXJBsTTD2rk"
  }
}'
```

DAS 方法以命名对象（`"params": { ... }`）而非位置数组的形式接收参数。

<Note>
  有关如何创建 API key 并在请求中传递它，请参阅[身份验证](/cn/authentication)。
</Note>

## 方法

### 资产

<CardGroup cols={2}>
  <Card title="getAsset" icon="image" href="/cn/das-api/methods/getAsset">
    按 ID 获取单个资产。
  </Card>

  <Card title="getAssetBatch" icon="images" href="/cn/das-api/methods/getAssetBatch">
    在一次调用中按 ID 获取最多 1,000 个资产。
  </Card>

  <Card title="getAssetsByOwner" icon="wallet" href="/cn/das-api/methods/getAssetsByOwner">
    列出某个钱包拥有的资产。
  </Card>

  <Card title="getAssetsByGroup" icon="layer-group" href="/cn/das-api/methods/getAssetsByGroup">
    列出某个合集中的资产。
  </Card>

  <Card title="getAssetsByCreator" icon="paintbrush" href="/cn/das-api/methods/getAssetsByCreator">
    列出由某个地址创建的资产。
  </Card>

  <Card title="getAssetsByAuthority" icon="key" href="/cn/das-api/methods/getAssetsByAuthority">
    列出由某个更新权限控制的资产。
  </Card>

  <Card title="searchAssets" icon="magnifying-glass" href="/cn/das-api/methods/searchAssets">
    按所有者、创作者、合集、接口等条件搜索资产。
  </Card>
</CardGroup>

### 压缩 NFT

<CardGroup cols={2}>
  <Card title="getAssetProof" icon="tree" href="/cn/das-api/methods/getAssetProof">
    获取压缩资产的 Merkle 证明。
  </Card>

  <Card title="getAssetProofBatch" icon="sitemap" href="/cn/das-api/methods/getAssetProofBatch">
    获取多个压缩资产的 Merkle 证明。
  </Card>

  <Card title="getAssetWithProof" icon="link" href="/cn/das-api/methods/getAssetWithProof">
    在一次调用中获取压缩资产及其证明。
  </Card>

  <Card title="getSignaturesForAsset" icon="signature" href="/cn/das-api/methods/getSignaturesForAsset">
    列出涉及某个压缩资产的交易。
  </Card>
</CardGroup>

### 代币和版本

<CardGroup cols={2}>
  <Card title="getTokenAccounts" icon="coins" href="/cn/das-api/methods/getTokenAccounts">
    按所有者或按 mint 列出代币账户。
  </Card>

  <Card title="getNftEditions" icon="clone" href="/cn/das-api/methods/getNftEditions">
    列出某个主版本 NFT 的已打印版本。
  </Card>
</CardGroup>

## 兼容性

DAS API 采用标准的 DAS 方法名称、参数和响应结构。如果你已经在使用其他服务商的 DAS API，只需将客户端指向你的 OrbitFlare 端点，其余代码保持不变。

* 批量方法同时响应两个名称：`getAssetBatch` 和 `getAssets`，`getAssetProofBatch` 和 `getAssetProofs`。
* `getSignaturesForAsset` 也可以通过 `getAssetSignatures` 调用。
* 大多数方法也接受 snake\_case 名称，例如 `get_asset` 或 `get_assets_by_owner`。例外是 `getAssetsByAuthority` 和 `getSignaturesForAsset`。
* `getTokenAccounts` 和 `getNftEditions` 既接受 `owner` 和 `mint`，也接受 `ownerAddress` 和 `mintAddress`。
* 显示选项可以通过 `options` 或 `displayOptions` 发送。

<Info>
  目前尚不支持 `requireFullIndex: true`。设置了该选项的请求会以 `-32602` 被拒绝，而不是在没有该保证的情况下返回结果。请参阅[显示选项](/cn/das-api/display-options)。
</Info>

## 响应

* 单资产方法返回一个[资产对象](/cn/das-api/asset-object)。
* 列表方法返回一页资产对象，附带 `total`、`limit`、页码或游标标记，以及 `last_indexed_slot`。请参阅[分页](/cn/das-api/pagination)。
* `last_indexed_slot` 是索引已处理的最新 slot。可以用它判断响应数据的新鲜程度。

## 错误

| 错误码 | 含义 | 示例消息 |
| - | - | - |
| -32602 | 参数无效 | `Pubkey Validation Err: notakey is invalid` |
| -32602 | limit 或批量过大 | `Pagination Error. Limit should not be greater than 1000.` |
| -32602 | 分页参数冲突 | `Pagination Error. Only one pagination parameter supported per query.` |
| -32602 | 未知参数 | ``unknown field `foo` `` |
| -32601 | 未知方法 | `Method not found` |
| -32000 | 资产不存在 | `Database Error: RecordNotFound Error: Asset Not Found` |
| -32000 | 服务器错误 | 使用指数退避重试 |

## 后续步骤

<CardGroup cols={2}>
  <Card title="资产对象" icon="cube" href="/cn/das-api/asset-object">
    资产响应可能包含的所有字段。
  </Card>

  <Card title="分页" icon="arrow-right-arrow-left" href="/cn/das-api/pagination">
    使用页码、游标或范围浏览大型结果集。
  </Card>
</CardGroup>


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