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

fix: Refactor Token Processing Logic #272

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

0xwitty
Copy link

@0xwitty 0xwitty commented Jan 10, 2025

I've refactored the fetchData function and related token processing logic to improve performance, clarity, and maintainability. Here's a summary of the changes:

  1. Switched to fetch: Replaced the outdated XMLHttpRequest with fetch for cleaner syntax and better performance.
  2. Lisk Token Filtering: Added logic to filter only relevant Lisk chain tokens (1135 and 4202).
  3. Ethereum Token Matching: Ensured tokens are matched on Ethereum Mainnet or Sepolia using chainId and symbol.
  4. Dynamic Explorer Selection: Introduced dynamic selection of explorers (etherscan or blockscout) based on the token's network.
  5. Modular Structure: Improved readability and reusability by breaking the code into helper functions, such as createTableRow.
  6. Modern JavaScript: Utilized modern syntax, including async/await, filter, and object destructuring, for cleaner and more maintainable code.

This resolves the issue while enhancing the overall code quality.

Copy link
Member

@Tschakki Tschakki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @0xwitty ,
thanks for your effort!
Unfortunately, when I build the docs based on your branch the bridged token page shows several errors, and doesn't display the token addresses. Can you fix it?

To reproduce, run npm run build and then npm run serve

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.

2 participants