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(useChains): fix missing endpoints & chain name crash #534

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

Conversation

ArefEghbaliDev
Copy link

🛠 Fix: useChains Hook Issues

This PR fixes two issues related to the useChains hook in CosmosKit:

  1. Community Chains RPC/REST Error

    • Fixed an issue where using useChains with community chains would throw an error due to missing RPC or REST API endpoints in chainRecords.preferredEndpoints.
    • This bug does not occur when running tests but happens when running the example-lite project.
    • Affected chains: 'ethereum', 'rootstock', 'solana', 'ton', 'tron', 'bluechip', 'lorenzo', 'neura', 'paloma', 'unicorn'.
  2. Crash When Using Chain Names in ChainProvider 🔗 Fixes: Uncaught TypeError: Cannot read properties of undefined (reading 'chain_id') when using useChains #515

    • Fixed an issue where passing only chain names (instead of full chain info) to ChainProvider caused a crash.
    • This was due to convertChain returning undefined when receiving a chain name instead of a chain object, resulting in an empty chain in chainRecord.
    • This fix ensures proper handling of chain names, preventing the crash.

@mehrdadpfg
Copy link

cc: @pyramation

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