Skip to content

Conversation

Adamj1232
Copy link
Contributor

@Adamj1232 Adamj1232 commented May 11, 2023

Description

This PR adds functionality to to Account Center expanded to allow end users to update their RPC on mainnet.
If the user's primary wallet is on mainnet and disableProtectedRpc is not set to true within the w3o init the button will display to update their RPC.
The RPC endpoint is configurable per chain obj (although this functionality is only enabled on mainnet) and will default to the BN protect RPC

There is also a localstorage set and get that adds a key after/if the user updates their RPC to the defined RPC so the btn will no longer be shown. We could update this to show a green shield in the future if protection is enabled.

interface Chain { /** An optional protected RPC URL - Defaults to Blocknative's private and   * protected RPC to allow users to update the chain RPC within their wallet,   * specifically for private RPCs that protect user transactions  */ protectedRpcUrl?: string ..... } type AccountCenter = { /**  * false by default - This allows removal of the   * Enable Transaction Protection' button within the Account Center   * expanded when set to true  * Can be set as a global for Account Center or per interface (desktop/mobile)  */ hideTransactionProtectionBtn?: boolean ..... }
Screenshot 2023-05-10 at 1 26 49 PM

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation
@vercel
Copy link

vercel bot commented May 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3-onboard-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 19, 2023 4:25pm
- use theme vars - remove rpc specific css vars - adjust spacing - remove unused css classes
@Adamj1232 Adamj1232 requested a review from gesquinca May 12, 2023 17:21
@leightkt
Copy link
Contributor

Button looks good and is working as expected!

leightkt
leightkt previously approved these changes May 12, 2023
@leightkt leightkt dismissed their stale review May 12, 2023 21:55

validation update requested

Copy link
Contributor

@lnbc1QWFyb24 lnbc1QWFyb24 left a comment

Choose a reason for hiding this comment

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

Looks good! Just a small typo in there I think.

Co-authored-by: Aaron <abarnard@protonmail.com>
@Adamj1232 Adamj1232 merged commit 820cf00 into develop May 19, 2023
@Adamj1232 Adamj1232 deleted the feat/private_rpc_flow branch May 19, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants