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

# getAssetsByCreator

> 在 OrbitFlare 上使用 DAS getAssetsByCreator，列出将某个地址列为创作者的 Solana NFT 和压缩 NFT，并可选择仅返回已验证的创作者。

## 概述

`getAssetsByCreator` 列出 `creators` 数组中包含某个地址的资产。设置 `onlyVerified` 后，只返回该创作者已签名验证的资产，从而过滤掉未经知名创作者同意就将其列为创作者的资产。

## 参数

<ResponseField name="creatorAddress" type="string" required>
  创作者地址（base-58）。
</ResponseField>

<ResponseField name="onlyVerified" type="boolean">
  仅返回该创作者已验证的资产。默认为 `false`。
</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">
  返回 ID 在此 ID 之前的资产。
</ResponseField>

<ResponseField name="after" type="string">
  返回 ID 在此 ID 之后的资产。
</ResponseField>

<ResponseField name="sortBy" type="object">
  `{ "sortBy": "id" | "created" | "updated" | "recent_action" | "none", "sortDirection": "asc" | "desc" }`
</ResponseField>

<ResponseField name="options" type="object">
  [显示选项](/cn/das-api/display-options)：`showFungible`、`showUnverifiedCollections`、`showCollectionMetadata`、`showInscription`。也可以作为 `displayOptions` 传入。
</ResponseField>

## 响应

一个列表，包含 `last_indexed_slot`、`total`、`limit`、`page` 或 `cursor`，以及 `items`（[资产对象](/cn/das-api/asset-object)）。

## 代码示例

### 请求

```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": "getAssetsByCreator",
  "params": {
    "creatorAddress": "5XvhfmRjwXkGp3jHGmaKpqeerNYjkuZZBYLVQYdeVcRv",
    "onlyVerified": true,
    "page": 1,
    "limit": 1
  }
}'
```

### 响应

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "last_indexed_slot": 457714578,
    "total": 1,
    "limit": 1,
    "page": 1,
    "items": [
      {
        "interface": "ProgrammableNFT",
        "id": "JEGruwYE13mhX2wi2MGrPmeLiVyZtbBptmVy9vG3pXRC",
        "content": {
          "metadata": { "name": "Mad Lads #6867", "symbol": "MAD" }
        },
        "creators": [
          { "address": "5XvhfmRjwXkGp3jHGmaKpqeerNYjkuZZBYLVQYdeVcRv", "share": 0, "verified": true },
          { "address": "2RtGg6fsFiiF1EQzHqbd66AhW7R5bWeQGpTbv2UMkCdW", "share": 100, "verified": true }
        ]
      }
    ]
  },
  "id": 1
}
```

此处的资产对象已做精简。完整示例请参阅[资产对象](/cn/das-api/asset-object)。

### 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 getAssetsByCreator(creator: 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: 'getAssetsByCreator',
      params: { creatorAddress: creator, onlyVerified: true, page, limit: 1000 },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);
  return result.items;
}
```

## 常见错误

| 错误码 | 消息 | 解决方案 |
| - | - | - |
| -32602 | Pubkey Validation Err: ... is invalid | 传入有效的 base-58 创作者地址 |
| -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.