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

Add ChainName type for wallet network data #13497

Merged
merged 18 commits into from
Nov 20, 2024
Merged

Conversation

wackerow
Copy link
Member

Description

Recently we've been collecting additional information from wallet providers related to the different networks their software supports. This led to the issue of not yet having a clean way to reference network/chain names when adding this data to the code base.

This solution utilizes EIP-155 with a chainid.network endpoint which serves a JSON object with all of their chain data.

  • Adds a script that fetches the JSON object from https://chainid.network/chains.json, and saves it as a TypeScript file (src/data/chains.ts) using the as const keyword
  • A new type ChainName is created from the above TypeScript object using (typeof chains)[number]["name"]
  • Wallet data type has been updated to include a supported_chains field, accepted an array of ChainName
  • This field now supports auto-completion, with a type that restricts the field to a proper network name found in this list.
  • A cronjob has been added to run this script weekly and post a PR with any changes to keep the chains up to date.

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label Jul 26, 2024
Copy link

netlify bot commented Jul 26, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 973d645
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/673e42ec65c4a5000838b958
😎 Deploy Preview https://deploy-preview-13497--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 47 (🔴 down 7 from production)
Accessibility: 92 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 99 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines +30 to +41
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-chains
branch-suffix: timestamp
commit-message: |
Update chains data
base: dev
title: Update chains data
body: Automated update of chains data from https://chainid.network/chains.json
labels: update 🔄
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the Status: Stale This issue is stale because it has been open 30 days with no activity. label Sep 12, 2024
@wackerow wackerow added needs dev approval 🧑‍💻 Approval from a developer is needed before merging and removed Status: Stale This issue is stale because it has been open 30 days with no activity. labels Sep 24, 2024
@corwintines corwintines self-assigned this Nov 20, 2024
@corwintines corwintines merged commit 8b4f673 into dev Nov 20, 2024
6 checks passed
@corwintines corwintines deleted the wallet-network-schema branch November 20, 2024 22:32
@byearthinc-com
Copy link

image😒

This was referenced Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs dev approval 🧑‍💻 Approval from a developer is needed before merging tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants