Skip to content

Conversation

@2xburnt
Copy link
Contributor

@2xburnt 2xburnt commented Jun 30, 2025

Apologies for such a large PR, This PR does the following

  1. Split out existing methods and types in src/stores/useDashboard.ts into src/lib/chaindata/* and src/lib/types/chaindata.ts
  2. Add chain-registry as a source using the chain-registry npm package. Add env vars to control source selection (see .env.example)
  3. Eliminate use of type passthru/replication of types from chain-registry
  4. Modify ibc to read from github api and chain-registry

----AI summary
This pull request introduces significant changes to support dynamic chain configurations, improve chain data handling, and enhance compatibility with external libraries. Key updates include adding environment variables for chain configuration, introducing multiple chain data loaders, and refactoring code for better type management and library usage.

Environment and Configuration Updates:

  • .env.example: Added environment variables (VITE_CONFIG_SOURCE, VITE_NETWORK_TYPE, VITE_CHAIN_LIST, VITE_COINGECKO_PRICE_API) to support dynamic chain configuration and pricing API integration.

Dependency and Script Enhancements:

  • package.json: Added new dependencies (@chain-registry/client, @chain-registry/types, @chain-registry/utils, chain-registry) and scripts (dev:mainnet, dev:testnet) to facilitate chain registry integration and environment-specific development. [1] [2] [3]

Chain Data Loading and Conversion:

  • src/libs/chaindata/directory.ts: Moved/renamed loadFromDirectory and convertFromDirectory functions from useDashboard.ts to fetch and transform chain data from Cosmos Directory sources.
  • src/libs/chaindata/local.ts: Moved/renamed loadFromLocal and convertFromLocal functions from useDashboard.ts to handle chain data from local configurations.
  • src/libs/chaindata/registry.ts: Introduced loadFromRegistry and related functions to fetch and process chain data from Chain Registry sources.

Price Data Integration:

  • src/libs/chaindata/prices.ts: Moved fetchCoinGeckoPrices and loadPrices functions from useDashboard.ts to integrate CoinGecko API for asset pricing.

Code Refactoring and Type Management:

@liangping
Copy link
Member

@2xburnt thanks for contribution, Do you want to make a call before we merge this PR.
really should be carefully, since it's too big.

@2xburnt
Copy link
Contributor Author

2xburnt commented Jul 8, 2025

@2xburnt thanks for contribution, Do you want to make a call before we merge this PR. really should be carefully, since it's too big.

I am pretty busy this week and out the following week, but we can set something up after I get back in ~2 weeks.

@2xburnt 2xburnt marked this pull request as draft July 23, 2025 22:43
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