feat: add /utils/validate-hash and /utils/network-passphrase endpoints (#216, #219)#381
Merged
Sulex45 merged 3 commits intoJun 29, 2026
Conversation
…ools#219) Returns { network, passphrase } for the currently configured Stellar network, resolving the correct passphrase for testnet and mainnet based on the STELLAR_NETWORK env var. Useful for building and signing transactions. Includes tests.
Contributor
|
Link issues to PR |
…validate-hash-and-network-passphrase
|
@3m1n3nc3 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
Done |
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.
Closes #216
Closes #219
Summary
Adds two local (no Horizon call) developer-utility endpoints under
/utils:GET /utils/validate-hash?hash=...(Transaction Hash Format Validator Endpoint #216) — validates whether a string is acorrectly formatted Stellar transaction hash. Valid = exactly 64 lowercase
hexadecimal characters. Returns
{ input, isValid, reason }, withreasonexplaining wrong length or invalid characters (uppercase hex is rejected).
GET /utils/network-passphrase(Network Passphrase Resolver Endpoint #219) — returns the network passphrase forthe currently configured network. Returns
{ network, passphrase }, resolvingSTELLAR_NETWORK=mainnet→Networks.PUBLICand otherwise →Networks.TESTNET(default testnet).
Both follow the existing
validate-accountconvention and are registered in theroot API endpoint listing.
Example responses
Acceptance criteria
#216
GET /utils/validate-hash?hash=...returns{ input, isValid, reason }reasonfor wrong length / invalid characters#219
GET /utils/network-passphrasereturns{ network, passphrase }STELLAR_NETWORKTesting
tests/utils.validateHash.test.js(7 tests) andtests/utils.networkPassphrase.test.js(3 tests) — all 10 pass.