Skip to content

Added address name linking mandatory with a default value - #555

Open
ejacquier wants to merge 1 commit into
mainfrom
web3-address-prompt
Open

Added address name linking mandatory with a default value#555
ejacquier wants to merge 1 commit into
mainfrom
web3-address-prompt

Conversation

@ejacquier

Copy link
Copy Markdown
Contributor

Summary

When linking a web3 key via cre account link-key, the interactive "owner label" prompt previously accepted an empty value silently and only failed later, deep in the GraphQL call, with a confusing error. This makes the prompt mandatory up front and gives it a sensible default so most users can just press Enter.

  • Mandatory input: the prompt now rejects empty submissions locally with a label is required, instead of silently proceeding with "" and failing later against the linking API.
  • Smart default: the default label is derived from the authenticated user's email (the part before @), pulled from the JWT access token claims via a new Credentials.GetEmail() method. The prompt shows it inline — Provide a label for your owner address [emmanuel.jacquier]: — and pressing Enter without typing accepts it.
  • Falls back to a plain, still-mandatory prompt (no default) when no email is available, e.g. under CRE_API_KEY auth, where there's no JWT to read a claim from.
  • Added ui.WithDefaultValue and ui.WithValidate options to the shared ui.Input helper so other commands can opt into the same pattern.

@ejacquier
ejacquier requested a review from a team as a code owner July 27, 2026 14:57
@github-actions

Copy link
Copy Markdown

👋 ejacquier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@anirudhwarrier
anirudhwarrier self-requested a review July 27, 2026 15:46
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.

1 participant