Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: if a user searches for what looks like an address, show a link to axelarscan #647

Open
StephenFluin opened this issue Dec 1, 2023 · 3 comments
Assignees

Comments

@StephenFluin
Copy link
Collaborator

Address searches are common, and don't have good results. We should take them to axelarscan when they do this.

@TRIPLE-ADE
Copy link

TRIPLE-ADE commented Dec 14, 2023

@StephenFluin would you mind providing more details about the issue I would like to work on it

@StephenFluin
Copy link
Collaborator Author

@TRIPLE-ADE right now we have a search feature which works via Algolia to find the right content within the documentation. It would be nice that if the docs detect that someone has pasted an address or transaction hash (cosmos or EVm), we offer a manually inserted link to the top of the search results to view the relevant information on axelarscan.io or testnet.axelarscan.io. This will involve writing the JS to detect this type of search, and then inserting the appropriate results into the results, or directly modifying the DOM to add them once the results come back from Algolia.

Let me know if you have more questions!

@semanticentity
Copy link

semanticentity commented Aug 22, 2024

Hi @StephenFluin

Drafting here: #1120

Added:

  • Detection of blockchain addresses and transaction hashes (Cosmos and EVM).
  • Automatic insertion of a link to Axelarscan at the top of the search results when a match is detected.

Pending:

  • Tightening up the regex patterns to ensure they cover all valid address and transaction formats.
  • Considering:
/^(cosmos1|cosmosvaloper1|cosmosvalcons1)[a-z0-9]{38}$/

Explanation:

  • ^: Asserts the position at the start of the string.
  • (cosmos1|cosmosvaloper1|cosmosvalcons1): Matches any of the specified prefixes, which are the common HRPs (human-readable parts) for different types of Cosmos addresses.
    • cosmos1 for standard wallet addresses.
    • cosmosvaloper1 for validator operator addresses.
    • cosmosvalcons1 for validator consensus addresses.
  • [a-z0-9]{38}$: Matches exactly 38 characters following the prefix. These characters are lowercase alphanumeric, as per Bech32 encoding.

Combined Cosmos and EVM regex example:

/^(0x[a-fA-F0-9]{40}|cosmos1[a-z0-9]{38}|cosmosvaloper1[a-z0-9]{38}|cosmosvalcons1[a-z0-9]{38})$/

Questions:

  • Do you foresee any necessary UI changes or adjustments?
  • Should we consider any common address indexing or caching updates for this feature?
  • Are there any other tasks or refinements needed?

Thanks!

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

No branches or pull requests

3 participants