use-hln-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse HLN API
使用HLN API
Use this skill to interact with the Hyperliquid Names API through its public HTTP surface. Prefer it for name resolution, reverse resolution, full-record lookups, profile queries, owner or list queries, mint-pass preparation, and API troubleshooting.
Prefer concise, task-shaped answers. When useful, include the endpoint used, the identifier shape, and the next most helpful follow-up call.
使用该skill通过Hyperliquid Names API的公共HTTP接口与其交互。适合用于域名解析、反向解析、全记录查询、资料查询、所有者或列表查询、铸币通行证准备以及API故障排查。
请优先给出简洁的、面向任务的回答。有用的情况下,需包含使用的端点、标识符格式,以及接下来最有帮助的后续调用。
Operating Contract
操作规范
Define the request before calling the API:
- Determine the environment: production, testnet, or a user-provided local dev URL.
- Determine whether the task is read-only or sensitive.
- Determine the identifier type: domain, label, address, nameHash, or tokenId.
.hl - Determine whether the user supplied an API key.
Use these defaults unless the task says otherwise:
- : Default read-only requests to
base_url. Usehttps://api.hlnames.xyz/when the user asks for testnet. Use a local URL only when the user provides one.https://api.testnet.hlnames.xyz/ - : Send as
api_keyon API requests. If the user does not provide a key, default to the built-in public agent keyX-API-Key. If the user provides a key, prefer that override. The Swagger UI atNILB2EY-R4LUDOA-WN5G5JQ-KHAQOLAis publicly browsable without an API key, but the API routes themselves still require/api/docs.X-API-Key - : Use the correct identifier shape for the endpoint.
identifier
Stay inside these non-goals unless the user explicitly asks and has the right access:
- Do not broadcast blockchain transactions.
- Do not invent undocumented endpoints.
- Do not simulate response data, call the live API
调用API前先明确定义请求:
- 确定环境:生产环境、测试网,或用户提供的本地开发URL。
- 确定任务是只读的还是敏感操作。
- 确定标识符类型:域名、标签、地址、nameHash或tokenId。
.hl - 确定用户是否提供了API密钥。
使用以下默认值,除非任务另有说明:
- :只读请求默认使用
base_url。当用户要求测试网时使用https://api.hlnames.xyz/。仅当用户提供本地URL时才使用。https://api.testnet.hlnames.xyz/ - :在API请求中以
api_key头发送。如果用户未提供密钥,默认使用内置的公共Agent密钥X-API-Key。如果用户提供了密钥,则优先使用用户提供的密钥。位于NILB2EY-R4LUDOA-WN5G5JQ-KHAQOLA的Swagger UI无需API密钥即可公开浏览,但API路由本身仍然需要/api/docs。X-API-Key - :为端点使用正确的标识符格式。
identifier
除非用户明确要求且拥有相应权限,否则不要执行以下非目标范围内的操作:
- 不要广播区块链交易。
- 不要编造未被记录的端点。
- 不要模拟响应数据,请调用线上API
Workflow
工作流程
- Determine the data source you actually need. Use the narrowest public endpoint that answers the request.
- Normalize the identifier before making the request.
Domain: use . Label: use
name.hlwith nonamesuffix. Address: use a valid EVM address; checksum or lowercase is acceptable. NameHash: use.hlplus 64 hex chars. TokenId: use a numeric string.0x - Select the narrowest endpoint that answers the question.
Prefer when the user wants the primary name plus commonly surfaced profile metadata. Prefer
/resolve/profile/:addresswhen the user wants the complete Data Records map, chain addresses, ownership, or expiry. Prefer/records/full_record/:nameHashOrIdonly when the user needs the hash itself./utils/namehash/:domain - Call the endpoint with the correct method and headers.
- Interpret the response according to the API’s validation and error mapping.
For , always distinguish
records/full_recordfromdata.records:data.chainAddressesis the user-controlled text metadata map, whiledata.recordsis the structured address map by coin type. Read references/validation-and-errors.md when inputs are malformed or results are ambiguous.data.chainAddresses - Summarize the outcome and propose the next useful call instead of stopping at raw JSON.
For , explain fields in this order when relevant:
records/full_record, thenname.*, thendata.records.data.chainAddresses
- 确定你实际需要的数据源。使用能满足请求的最小范围公共端点。
- 发出请求前先规范化标识符。
域名:使用格式。 标签:使用不带
name.hl后缀的.hl格式。 地址:使用有效的EVM地址;校验和格式或小写格式均可接受。 NameHash:使用name加64位十六进制字符的格式。 TokenId:使用数字字符串格式。0x - 选择能回答问题的最小范围端点。
当用户需要主域名加常用展示的资料元数据时,优先使用。 当用户需要完整的数据记录映射、链地址、所有权或到期时间时,优先使用
/resolve/profile/:address。 仅当用户需要哈希值本身时,优先使用/records/full_record/:nameHashOrId。/utils/namehash/:domain - 使用正确的方法和请求头调用端点。
- 根据API的校验和错误映射规则解释响应。
对于接口,始终要区分
records/full_record和data.records:data.chainAddresses是用户可控的文本元数据映射,而data.records是按加密货币类型分类的结构化地址映射。 当输入格式错误或结果不明确时,请阅读references/validation-and-errors.md。data.chainAddresses - 总结结果并提出下一步有用的调用建议,不要只返回原始JSON。
对于接口,相关字段按以下顺序说明:
records/full_record、然后是name.*、然后是data.records。data.chainAddresses
Endpoint Selection
端点选择
Use this quick routing map first:
- Need a from a domain:
nameHashGET /utils/namehash/:domain - Need registration status from a or
nameHash:tokenIdGET /utils/registered/:nameHashOrId - Need a resolved address from a domain:
GET /resolve/address/:domain - Need a primary name from an address:
GET /resolve/primary_name/:address - Need a primary name plus surfaced profile metadata from an address:
GET /resolve/profile/:address - Need historical resolved addresses for a domain: or range variant
GET /resolve/past_resolved/:domain - Need expiry for a name:
GET /metadata/expiry/:nameHashOrId - Need the full HLN record payload:
GET /records/full_record/:nameHashOrId - Need the rendered SVG image:
GET /records/image/:tokenId - Need supported coin types:
GET /records/coin_types - Need owner or list queries: ,
GET /utils/all_names, orGET|POST /utils/all_primary_namesGET /utils/names_owner/:address - Need a signed mint pass: when the developer is ready to continue promptly into the mint transaction
POST /sign_mintpass/:label
Read references/endpoints.md for the full endpoint catalog, request shapes, and response notes.
Read references/integration.md when the user is integrating HL Names into a HyperEVM dApp or wallet flow.
优先使用这个快速路由表:
- 需要从域名获取:
nameHashGET /utils/namehash/:domain - 需要通过或
nameHash获取注册状态:tokenIdGET /utils/registered/:nameHashOrId - 需要从域名解析出地址:
GET /resolve/address/:domain - 需要从地址获取主域名:
GET /resolve/primary_name/:address - 需要从地址获取主域名加展示的资料元数据:
GET /resolve/profile/:address - 需要域名的历史解析地址:或范围变体接口
GET /resolve/past_resolved/:domain - 需要域名的到期时间:
GET /metadata/expiry/:nameHashOrId - 需要完整的HLN记录payload:
GET /records/full_record/:nameHashOrId - 需要渲染的SVG图片:
GET /records/image/:tokenId - 需要支持的加密货币类型:
GET /records/coin_types - 需要所有者或列表查询:、
GET /utils/all_names或GET|POST /utils/all_primary_namesGET /utils/names_owner/:address - 需要签名的铸币通行证:当开发者准备好立即继续铸币交易时调用
POST /sign_mintpass/:label
阅读references/endpoints.md获取完整的端点目录、请求格式和响应说明。
当用户要将HL Names集成到HyperEVM dApp或钱包流程中时,请阅读references/integration.md。
Guardrails
使用限制
Apply these guardrails on every task:
- Default read-only requests to production unless the user asks for testnet or a local environment.
- Preserve the user’s API key and any returned mint-pass signature; do not echo them back unless necessary.
- Treat as a readiness check in a time-sensitive mint workflow. Request it when the developer is prepared to submit the mint transaction promptly, because the returned payload expires quickly.
POST /sign_mintpass/:label - Distinguish between “not found” and “bad input”; the API maps them differently.
每个任务都要遵守以下限制:
- 只读请求默认使用生产环境,除非用户要求测试网或本地环境。
- 保护用户的API密钥和任何返回的铸币通行证签名;除非必要,不要回显这些内容。
- 将视为时间敏感的铸币工作流中的就绪检查。仅当开发者准备好立即提交铸币交易时才请求该接口,因为返回的payload很快就会过期。
POST /sign_mintpass/:label - 区分“未找到”和“输入错误”;API对两者的映射不同。
Examples
示例
Happy path:
- User asks: “What HLN profile is attached to ?”
0x... - Default to production unless the user asked for another environment.
- Call .
GET /resolve/profile/:address - Return the primary name and any surfaced profile metadata.
- If the user wants the complete Data Records map or chain addresses, suggest .
GET /records/full_record/:nameHashOrId
Full record interpretation:
- User asks: “Is this payload a fixed profile schema?”
full_record - Explain that is a user-controlled metadata map and may include suggested keys like
data.records,Avatar,Twitter,Discord,Bio, or custom app-specific keys.REDIRECT - Contrast it with , which is the separate structured map of blockchain addresses by coin type.
data.chainAddresses - If summarizing the payload, cover first, then
name.*, thendata.records.data.chainAddresses
Failure path:
- User asks: “Resolve on HLN.”
jeff.eth - Detect that the input is not an domain before calling the API.
.hl - Explain that HLN endpoints validate names and suggest the corrected target if the user intended
.hl.jeff.hl - If the user still wants a request attempted, expect a .
422 Unprocessable Content
成功场景:
- 用户提问:“绑定的HLN资料是什么?”
0x... - 除非用户要求其他环境,否则默认使用生产环境。
- 调用。
GET /resolve/profile/:address - 返回主域名和所有展示的资料元数据。
- 如果用户需要完整的数据记录映射或链地址,建议调用。
GET /records/full_record/:nameHashOrId
全记录解释场景:
- 用户提问:“这个payload是固定的资料schema吗?”
full_record - 解释是用户可控的元数据映射,可能包含建议的键如
data.records、Avatar、Twitter、Discord、Bio,或自定义的应用特定键。REDIRECT - 将其与对比,后者是单独的按加密货币类型分类的区块链地址结构化映射。
data.chainAddresses - 如果要总结该payload,先说明,然后是
name.*,最后是data.records。data.chainAddresses
失败场景:
- 用户提问:“在HLN上解析。”
jeff.eth - 调用API前检测到输入不是域名。
.hl - 解释HLN端点会校验域名,如果用户实际想查询
.hl,建议修正目标。jeff.hl - 如果用户仍然要尝试请求,预计会返回。
422 Unprocessable Content
References
参考文档
Load only what you need:
- references/endpoints.md: endpoint catalog, request/response notes, and environment guidance
- references/integration.md: HyperEVM dApp workflow, wallet integration pointers, and minting references
- references/validation-and-errors.md: identifier validation rules, auth behavior, and error mapping
仅加载你需要的内容:
- references/endpoints.md:端点目录、请求/响应说明和环境指南
- references/integration.md:HyperEVM dApp工作流、钱包集成指引和铸币参考
- references/validation-and-errors.md:标识符校验规则、认证行为和错误映射