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: add the 'chain id toggler' instead of the 'chain type toggler' #571

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from

Conversation

solidovic
Copy link
Contributor

@solidovic solidovic commented Dec 24, 2024

Description

  • Migrate from 'chain type' to 'chain id' switcher.
  • Add switchChain button in the Fallback banner
  • Catch switch chain errors

Demo

.env
SUPPORTED_CHAINS=1,10,17000,11155111,11155420

On the wrap page:

Снимок экрана 2024-12-24 в 10 29 03

On the Stake, WQ, Rewards, Settings pages (Testnet, for Prod the chain switcher is locked):

image

The switchChain button in the Fallback banner (testnet widget demo):
On prod will be "Switch to Mainnet"

Снимок экрана 2025-01-20 в 23 23 10

Waiting the wallet (arrow is hidden)
image

Code review notes

Pay attention that the 'wrap/unwrap' page has its own separate 'DappChainContext' context (the Stake, WQ, Rewards, Settings pages have a different common context). This is due to history.

Testing notes

  • L1 and L2 operations
  • tx scan on modals
  • change a chain on the wallet (a widget chain changes automatically)
  • change a chain on the chain switcher (the wallet changes automatically or ask permissions)
  • check the switchChain button in the Fallback banner
  • select not allowed/not adde chain and
    • give permission/add network
    • wait 5000 seconds (you should see a console.warn)

Checklist:

  • Checked the changes locally (MM and TW).
  • Created / updated analytics events.
  • Created / updated the technical documentation (README.md / docs / etc.).
  • Affects / requires changes in other services (Matomo / Sentry / CloudFlare / etc.).

@solidovic solidovic marked this pull request as ready for review January 19, 2025 20:37
@solidovic solidovic requested review from a team as code owners January 19, 2025 20:37
@preview-stands
Copy link

preview-stands bot commented Jan 19, 2025

Preview stand status

Preview stand available on testnet

features/wsteth/shared/wallet/wallet.tsx Outdated Show resolved Hide resolved
modules/web3/web3-provider/use-app-chain-manager.ts Outdated Show resolved Hide resolved
modules/web3/web3-provider/use-app-chain-manager.ts Outdated Show resolved Hide resolved
modules/web3/web3-provider/dapp-chain.tsx Outdated Show resolved Hide resolved
modules/web3/consts/chains.ts Show resolved Hide resolved
features/wsteth/shared/wrap-faq/wrap-faq.tsx Show resolved Hide resolved
modules/web3/web3-provider/use-app-chain-manager.ts Outdated Show resolved Hide resolved
@solidovic solidovic requested review from DiRaiks and Jeday January 21, 2025 10:44
@solidovic solidovic requested a review from Jeday January 22, 2025 18:05
Jeday
Jeday previously approved these changes Jan 23, 2025
shared/wallet/fallback/fallback.tsx Outdated Show resolved Hide resolved
@solidovic solidovic requested a review from Jeday January 23, 2025 08:50
Jeday
Jeday previously approved these changes Jan 23, 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.

3 participants