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

feat: enable multi discovery strategy #492

Conversation

khanti42
Copy link
Collaborator

@khanti42 khanti42 commented Jan 22, 2025

Description

This PR enhances the Snap by introducing support for multiple account discovery strategies within the same version, now with an improved user interface for better usability. Users can specify the desired strategy via a URL parameter called accountDiscovery. Additionally, the interface dynamically updates to highlight the selected strategy and provides a more user-friendly way to switch between options.

Key Features:

  • Account Discovery Strategies:
    • DEFAULT: The standard account discovery behavior.
    • FORCE_CAIRO_0: Forces discovery using the Cairo 0 strategy.
    • FORCE_CAIRO_1: Forces discovery using the Cairo 1 strategy.
  • Dynamic URL Parameter Integration:
    • Users can directly specify their desired strategy by appending ?accountDiscovery= to the URL.
    • The parameter updates dynamically when the user selects an option, ensuring seamless navigation without requiring external libraries.

See the video below for an example

Screen.Recording.2025-01-22.at.21.46.58.mov

@khanti42 khanti42 requested a review from a team as a code owner January 22, 2025 09:18
@khanti42 khanti42 requested review from Julink-eth and stanleyyconsensys and removed request for a team January 22, 2025 09:18
Copy link
Collaborator

@stanleyyconsensys stanleyyconsensys left a comment

Choose a reason for hiding this comment

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

a small comment on where ther accountDiscovery needed to present on other RPC or not

const account = await invokeSnap<Account>({
method: 'starkNet_addAccount',
params: {
chainId,
accountDiscoveryType: urlParams.get('accountDiscovery'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not do those inject from the invokeSnap function? i guess when force deploy/upgrade, u still need that? or no

@khanti42 khanti42 changed the base branch from feat/enable-multiple-accounts to staging-force-cairo0-cairo1-capability January 22, 2025 20:44
Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
3.8% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
18 New issues
0 Accepted issues

Measures
0 Security Hotspots
2.0% Coverage on New Code
0.6% Duplication on New Code

See analysis details on SonarQube Cloud

@khanti42
Copy link
Collaborator Author

Already deployed to staging can be closed.

@khanti42 khanti42 closed this Jan 30, 2025
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