Skip to content

feat(sub-accounts): create sub-account dialog #79

@vipineth

Description

@vipineth

Parent PRD

#75

What to build

Add a "Create Sub-Account" button to the sub-account management view. Clicking it opens a dialog with a single text input for the sub-account name. The name must be 1–16 characters (enforced by the Hyperliquid API schema); the UI validates this live and shows a character counter. Submitting calls exchange.createSubAccount({ name }). On success the dialog closes and the sub-account list refreshes to show the new account. On failure the dialog stays open and shows the error message.

Acceptance criteria

  • "Create Sub-Account" button is visible in the management view header
  • Dialog contains a name input with a live character counter (max 16)
  • Submitting with an empty or >16-char name shows a validation error without making an API call
  • Submitting a valid name shows a loading state on the button
  • On success: dialog closes, list refetches, new sub-account appears in the list
  • On API error: dialog stays open, error message is displayed

Blocked by

User stories addressed

  • User story 2 (create a new sub-account by name)
  • User story 20 (loading, success, error feedback on create)
  • User story 23 (list refreshes after create)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions