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

# getNftEditions

> 在 OrbitFlare 上使用 DAS getNftEditions，列出某个 Solana 主版本 NFT 的已打印版本，并附带供应量和最大供应量。

## 概述

主版本 NFT 可以打印带编号的副本，每个副本都有自己的 mint。`getNftEditions` 列出某个主版本 mint 的这些印刷版，同时返回主版本的当前供应量和最大供应量。

## 参数

<ResponseField name="mint" type="string" required>
  主版本 NFT 的 mint（base-58）。也可以作为 `mintAddress` 传入。
</ResponseField>

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

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

<ResponseField name="cursor" type="string">
  来自上一次响应的游标。
</ResponseField>

<ResponseField name="before" type="string">
  返回此版本之前的版本。
</ResponseField>

<ResponseField name="after" type="string">
  返回此版本之后的版本。
</ResponseField>

## 响应

<ResponseField name="result" type="object">
  <Expandable title="result 字段">
    <ResponseField name="master_edition_address" type="string">
      主版本账户地址。
    </ResponseField>

    <ResponseField name="supply" type="number">
      目前已打印的版本数量。
    </ResponseField>

    <ResponseField name="max_supply" type="number | null">
      版本的最大数量；如果不限数量则为 `null`。
    </ResponseField>

    <ResponseField name="total" type="number">
      本页中的版本数量。
    </ResponseField>

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

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

    <ResponseField name="editions" type="array">
      <Expandable title="edition 字段">
        <ResponseField name="mint" type="string">
          印刷版的 mint 地址。
        </ResponseField>

        <ResponseField name="edition_address" type="string">
          印刷版的版本账户地址。
        </ResponseField>

        <ResponseField name="edition" type="number">
          版本编号。
        </ResponseField>
      </Expandable>
    </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": "getNftEditions",
  "params": {
    "mint": "MASTER_EDITION_MINT",
    "page": 1,
    "limit": 100
  }
}'
```

### 响应结构

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "total": 2,
    "limit": 100,
    "page": 1,
    "master_edition_address": "MASTER_EDITION_ACCOUNT",
    "supply": 2,
    "max_supply": 10,
    "editions": [
      { "mint": "PRINT_MINT_1", "edition_address": "PRINT_EDITION_ACCOUNT_1", "edition": 1 },
      { "mint": "PRINT_MINT_2", "edition_address": "PRINT_EDITION_ACCOUNT_2", "edition": 2 }
    ]
  },
  "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 getNftEditions(mint: string, page = 1) {
  const response = await fetch(RPC_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getNftEditions',
      params: { mint, page, limit: 1000 },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);

  console.log(`${result.supply} of ${result.max_supply ?? 'unlimited'} printed`);
  return result.editions;
}
```

## 常见错误

| 错误码 | 消息 | 解决方案 |
| - | - | - |
| -32602 | Pubkey Validation Err: ... is invalid | 传入有效的 base-58 mint |
| -32602 | Pagination Error. Limit should not be greater than 1000. | 使用不超过 1,000 的 `limit` |
| -32000 | Edition data not found | 该 mint 不是主版本，或尚未被索引 |


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