Skip to content

Conversation

@umutkutlu
Copy link

fixes #105

The official Hyperliquid API docs don't mention this limit, and it
prevents using expiration timestamps in agent names.

- Remove v.maxLength(17) validation from agentName
- Add test for expiration timestamp pattern in agentName
- Update JSDoc example showing expiration usage
@nktkas
Copy link
Owner

nktkas commented Jan 13, 2026

Hyperliquid has a limit on the number of characters in the Agent Wallet name, otherwise the error ApiRequestError: Extra agent name must be between 1 and 16 characters long. will occur (was max 17 before?).
However, unlike the SDK, Hyperliquid does not take valid_until into account when calculating the number of characters.

I think it would be better to ignore the valid_until parameter when counting the number of characters instead of completely removing the max limit.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for agent name expiration timestamps by removing the strict 17-character limit and allowing longer names when they include a valid_until <timestamp> suffix. The change enables time-limited agent approvals while maintaining the base name length constraint for backward compatibility.

Changes:

  • Modified validation logic in approveAgent.ts to extract and validate the base name separately from the valid_until timestamp suffix
  • Added test coverage for the new expiration timestamp feature
  • Updated JSDoc examples to demonstrate the new functionality with expiration timestamps

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/api/exchange/_methods/approveAgent.ts Updated validation to check base name length (excluding valid_until suffix) and added documentation examples showing the new feature
tests/api/exchange/approveAgent.test.ts Added test case validating agent approval with expiration timestamp in the agent name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agentName maxLength(17) blocks expiration timestamps pattern

2 participants