> For the complete documentation index, see [llms.txt](https://document.sunprotocol.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://document.sunprotocol.io/zhi-neng-he-yue/jie-dian-nft-he-yue.md).

# 节点NFT合约

最大发行量：`500`

### 查询当前总发行量

调用 `totalSupply()`。返回值是已经铸造的 NFT 数量。调用 `MAX_SUPPLY()` 可读取上限 `500`；当前发行量不一定等于最大发行量。

### 查询自己的 Token ID

最直接的方式是调用：

```
getUserID(user)
```

参数 `user` 填写钱包地址，返回该钱包当前持有的全部 Token ID 数组。也可以调用 `getUserNFTNum(user)` 或标准接口 `balanceOf(user)` 查询持有数量。

### 按 Token ID 查询

| 函数                                 | 返回内容                                  |
| ---------------------------------- | ------------------------------------- |
| `ownerOf(tokenId)`                 | 当前持有人地址                               |
| `tokenURI(tokenId)`                | NFT 元数据地址                             |
| `tokenByIndex(index)`              | 全局索引对应的 Token ID，`index` 从 0 开始       |
| `tokenOfOwnerByIndex(user, index)` | 用户第 `index` 个 Token ID，`index` 从 0 开始 |

不存在的 Token ID 或越界索引会导致查询回退。当前实现按顺序铸造，首个 Token ID 为 `1`。

### 查询所有持有人

`getAllHolders()` 返回两个等长数组：`holders` 是去重后的持有人地址，`balances` 是对应持有数量。该函数会遍历全部 NFT，适合链下只读查询，不应把它嵌入需要严格 Gas 上限的链上调用。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://document.sunprotocol.io/zhi-neng-he-yue/jie-dian-nft-he-yue.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
