use chain-registry/types #638
Draft
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.
Apologies for such a large PR, This PR does the following
----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/renamedloadFromDirectoryandconvertFromDirectoryfunctions from useDashboard.ts to fetch and transform chain data from Cosmos Directory sources.src/libs/chaindata/local.ts: Moved/renamedloadFromLocalandconvertFromLocalfunctions from useDashboard.ts to handle chain data from local configurations.src/libs/chaindata/registry.ts: IntroducedloadFromRegistryand related functions to fetch and process chain data from Chain Registry sources.Price Data Integration:
src/libs/chaindata/prices.ts: MovedfetchCoinGeckoPricesandloadPricesfunctions from useDashboard.ts to integrate CoinGecko API for asset pricing.Code Refactoring and Type Management:
src/layouts/components/ChainProfile.vue: Refactored type imports and streamlined Vue template syntax for cleaner code. [1] [2]src/modules/[chain]/ibc/connStore.ts: Refactored IBC module to use@chain-registry/clientand improved connection data handling. (src/modules/[chain]/ibc/connStore.tsL5-R65)src/components/dynamic/TextElement.vue: Replacedregistryimport withdefaultimport for compatibility with@leapwallet/name-matcha.src/layouts/components/DefaultLayout.vue: Updated type imports forNetworkTypeto align with the newchaindatastructure.