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

Option to select xverse as default browser wallet in settings #774

Conversation

victorkirov
Copy link
Member

@victorkirov victorkirov commented Jan 25, 2024

🔘 PR Type

What kind of change does this PR introduce?

  • Enhancement

📜 Background

When a user connects to an extension wallet, if there are multiple wallets implementing the sats connect interface, then the last wallet loaded would get all event messages. A user may want to force Xverse as the priority wallet to intercept these messages if the app using sats connect is using the default providers.

🔄 Changes

This adds a new setting toggle to set Xverse as the priority sats-connect wallet.

Note that the setting is stored in chrome storage so that it's available from the content-script directly without having to send messages around.

🖼 Screenshot / 📹 Video

image

✅ Review checklist

Please ensure the following are true before merging:

  • Code Style is consistent with the project guidelines.
  • Code is readable and well-commented.
  • No unnecessary or debugging code has been added.
  • Security considerations have been taken into account.
  • The change has been manually tested and works as expected.
  • Breaking changes and their impacts have been considered and documented.
  • Code does not introduce new technical debt or issues.

});
});
}

removeItem(key: string): Promise<any> {
removeItem(key: string): Promise<void> {
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried changing this and the setItem one to boolean, but the seedVault stuff started to complain. Checking the rest of the code, nothing was actually using the return value, so I removed it.

});
});
}

getItem<T = any>(key: string): Promise<T> {
getItem<T = any, D = undefined>(key: string, defaultValue?: D): Promise<T | D> {
Copy link
Member Author

Choose a reason for hiding this comment

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

By default, the storage interface returns an empty object if the key is not present, resulting in a response of undefined. The Seed Vault expects null though, so I had to add this default value.

@teebszet teebszet removed their request for review January 30, 2024 08:14
@victorkirov victorkirov requested review from m-aboelenein and removed request for m-aboelenein February 1, 2024 08:32
Copy link

github-actions bot commented Feb 1, 2024

@m-aboelenein m-aboelenein merged commit cf3f366 into develop Feb 1, 2024
5 checks passed
@m-aboelenein m-aboelenein deleted the victor/eng-3649-option-to-select-xverse-as-default-browser-wallet-in-the branch February 1, 2024 14:23
@DuskaT021
Copy link
Contributor

@m-aboelenein merged before it was tested!

@m-aboelenein
Copy link
Member

@m-aboelenein merged before it was tested!

I tested this one, and the change is pretty minimal we can retest with the RC

@DuskaT021 DuskaT021 added the 0.29.1 0.29.1 label Feb 2, 2024
This was referenced Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.29.1 0.29.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants