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

Change parameters for the useChainSwitch hook #551

Closed
dhruv035 opened this issue Jan 9, 2025 · 15 comments · Fixed by #554
Closed

Change parameters for the useChainSwitch hook #551

dhruv035 opened this issue Jan 9, 2025 · 15 comments · Fixed by #554

Comments

@dhruv035
Copy link

dhruv035 commented Jan 9, 2025

The current use chainSwitch hook uses input parameter chainId to switch to a new network, the parameter should take network as input instead, the chains returned in the useNetwork hook are not all switchable to without this configuration as the id may not be unique
Screenshot 2025-01-09 at 1 49 22 PM
These are the 4 chains I have supported in my Starknet config, and for the devnet and testnet I happen to use the same chainId (default katana config)

@fracek
Copy link
Contributor

fracek commented Jan 9, 2025

I'm not sure I follow, the wallet api call requires a single chainId argument and the library exposes that.

@dhruv035
Copy link
Author

dhruv035 commented Jan 9, 2025

maybe the config should throw an error if chainId is duplicated in the passed networks (might have to rename the issue), is there a way to get the networks supported by the connector?

@fracek
Copy link
Contributor

fracek commented Jan 11, 2025

I agree the config should detect this! I'm open to change that.

Unfortunately the connector doesn't have a method to return a list of supported networks since it's not in the wallet api (correct me if I'm wrong tho).

@mimisavage

This comment was marked as spam.

@Crosstons

This comment was marked as spam.

1 similar comment
@Oladayo-Ahmod

This comment was marked as spam.

@Snehagupta1907

This comment was marked as spam.

@ShantelPeters

This comment was marked as spam.

@wheval

This comment was marked as off-topic.

@bestselection18

This comment was marked as off-topic.

@emmanueldindu

This comment was marked as off-topic.

@bernardev254

This comment was marked as off-topic.

@deeseeker

This comment was marked as off-topic.

@dicethedev

This comment was marked as off-topic.

@Jethrolopwus

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.