feat(cli): wrap transaction hashes in clickable StellarExpert links - #2
Open
Opulencechuks wants to merge 4 commits into
Open
feat(cli): wrap transaction hashes in clickable StellarExpert links#2Opulencechuks wants to merge 4 commits into
Opulencechuks wants to merge 4 commits into
Conversation
📊 Coverage Report❌ Coverage below thresholds
|
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.
Clickable StellarExpert Links for Transaction Hashes in CLI
Description
This pull request implements automatic terminal-level hyperlink wrapping for all 64-character Stellar transaction hashes printed to standard output or standard error by the
momo-clitool.When terminal software that supports the OSC 8 hyperlink specification encounters these transaction hashes, they will be formatted as colorized, clickable links pointing directly to the correct transaction page on StellarExpert (resolving to either the
publicortestnetexplorer depending on the activeSTELLAR_NETWORKenvironment variable).Proposed Changes
src/scripts/momo-cli.tsprocess.stdout.writeandprocess.stderr.writeto scan output chunks (both string and raw buffer data) using a regular expression that detects 64-character hexadecimal transaction hashes (/\b([0-9a-fA-F]{64})\b/g).\x1b]8;;https://stellar.expert/explorer/<network>/tx/<hash>\x1b\\\x1b[36m\x1b[1m<hash>\x1b[0m\x1b]8;;\x1b\\momo-cli(Bash Wrapper)Verification & Acceptance Criteria
stringandUint8Arraychunks gracefully without throwing encoding or parsing errors.