Skip to content

feat: add the 'chain id toggler' instead of the 'chain type toggler'#571

Open
solidovic wants to merge 45 commits intodevelopfrom
feature/si-1638-NEW_chain-toggle-changes-wallet-chain
Open

feat: add the 'chain id toggler' instead of the 'chain type toggler'#571
solidovic wants to merge 45 commits intodevelopfrom
feature/si-1638-NEW_chain-toggle-changes-wallet-chain

Conversation

@solidovic
Copy link
Copy Markdown
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
Copy Markdown

preview-stands Bot commented Jan 19, 2025

Preview stand status

Stand was demolished

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

4 participants