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 wallet_switchStarknetChain request method #656

Merged
merged 6 commits into from
May 23, 2022

Conversation

dhruvkelawala
Copy link
Contributor

No description provided.

packages/extension/src/inpage/inpage.model.ts Outdated Show resolved Hide resolved
packages/extension/src/inpage/requestMessageHandlers.ts Outdated Show resolved Hide resolved
| {
type: "APPROVE_REQUEST_SWITCH_CUSTOM_NETWORK"
data: { actionHash: string }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this file is getting big - could be split up into smaller features files (for another PR)

packages/extension/src/background/customNetworks.ts Outdated Show resolved Hide resolved
payload: {
id: string
name: string
chainId: string // A 0x-prefixed hexadecimal string
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if we could define a specific typescript type for the 0x-prefixed hex strings to check that is doesn't accept just any string, just a thought

Copy link
Contributor Author

@dhruvkelawala dhruvkelawala May 23, 2022

Choose a reason for hiding this comment

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

Currently we shouldn't do it because chainId for Mainnet is "SN_MAIN" and Goerli it's "SN_GOERLI". Let's see what other custom network implements. They might not go with hexadecimal standards.

@dhruvkelawala dhruvkelawala merged commit 8b61e1d into develop May 23, 2022
@dhruvkelawala dhruvkelawala deleted the feat/add-switch-chain-method branch May 23, 2022 10:08
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