faucet: validate address and show readable dispense errors#1860
Open
Gmin2 wants to merge 1 commit into
Open
Conversation
octobocto
requested changes
Jul 3, 2026
octobocto
left a comment
Collaborator
There was a problem hiding this comment.
It's possible to extract the message from connect! Not sure of the exact field, but I think it's ConnectError.from(err).message.
For dispenseErrorMessage, set the correct errors directly in the backend instead! Converting the backend error messages is brittle.
Gmin2
force-pushed
the
faucet-address-validation
branch
from
July 3, 2026 12:24
f14bfa4 to
7f127f3
Compare
Contributor
Author
|
thanks, in 7f127f3 dropped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
two small UX fixes on the faucet form.
address sanity check before sending. an empty or obviously typo'd address (e.g. "notanaddress") used to be sent to the node and come back as a raw 500. now it is caught client-side with an inline message. the check is deliberately loose (bech32 / base58 shape only, no checksum or network), the node stays the source of truth, so it never rejects a valid address.
readable dispense errors. on failure the form showed
Failed to dispense coins: [ConnectError: [internal] dispense coins: -5: ...]. now the connect error is mapped to a short message for the common cases (invalid address, amount out of range, faucet out of funds / rate-limited) with a generic fallback.verified: tsc, biome and prettier clean; helper logic checked against the actual signet error responses (invalid address, wrong-network address, over-limit amount) and against valid/invalid address samples; page renders against signet.