-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add the 'chain id toggler' instead of the 'chain type toggler' #571
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
Open
solidovic
wants to merge
45
commits into
develop
Choose a base branch
from
feature/si-1638-NEW_chain-toggle-changes-wallet-chain
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
8518b14
feat: add the 'chain id toggler' instead of the 'chain type toggler'
solidovic 7bd5d75
feat: remove explicit call the setChainIdInternal
solidovic 17085ec
fix: a flushing when changing the chain id
solidovic 390e46c
feat: use the mutation of useSwitchChain
solidovic 9cda0f1
feat: remove a style fix
solidovic 6be5b82
feat: add abstract logic for SupportL1Chains and SupportL2Chains prov…
solidovic 20546bf
feat(ChainSwitcher): init a iconsMap by useDappStatus().supportedChai…
solidovic a97965f
feat(useAppChainManager): add useMemo
solidovic 646779e
feat(useAppChainManager): add router.events to fix a flushing
solidovic 885b47c
feat(wallet card error): fix a flushing
solidovic f80623e
refactor: simplify and comments
solidovic ad510e8
refactor: naming
solidovic 42b605d
Merge branch 'develop' into feature/si-1638-NEW_chain-toggle-changes-…
solidovic 6369274
revert: remove router.events
solidovic 51d3e13
feat: add 'Switch to <chain>' button to fallback banner
solidovic 109beb3
Merge remote-tracking branch 'origin/feature/si-1638-NEW_chain-toggle…
solidovic 158e087
fix: fix LH and LL checks
solidovic a85b15c
refactor(add): add comments, use isPending from the useSwitchChain, r…
solidovic 129a83c
fix: isTestnet property
solidovic c719c77
refactor(wallet): not use Optimism hardcode
solidovic 7ef2e15
feat: add typing to the DappChainContext
solidovic 4e759e1
fix(wallet): not use Optimism hardcode
solidovic f2ad005
feat(header): not use Optimism hardcode
solidovic 34b1873
feat(icons): not use Optimism hardcode
solidovic 0213838
fix(chain switcher): width for OP Mainnet
solidovic b82b755
refactor(useAppChainManager): remove the dappChainId state
solidovic 93f17c6
fix: banners, naming, remove not actual comments
solidovic e70b11b
refactor: move 'reset internal wagmi state' to the useAppChainManager…
solidovic 0094181
revert: removed isSwitchChainPending
solidovic 957e4f6
fix: isSupportedChain
solidovic 6efe73d
feat(switchChainId): catch and show error
solidovic dad1c5c
Merge branch 'develop' into feature/si-1638-NEW_chain-toggle-changes-…
solidovic 702e516
refactor: use a console.warn instead of ToastError
solidovic 4d16064
refactor: pass wagmiChain and wagmiDefaultChain
solidovic 2bc3453
Merge branch 'develop' into feature/si-1638-NEW_chain-toggle-changes-…
solidovic a0d3ee6
Merge branch 'develop' into feature/si-1638-NEW_chain-toggle-changes-…
solidovic cbddde5
chore: update packages
solidovic 6eaa200
fix: fix the balance loader in the header
solidovic 9858129
feat: resolve PR soneium and soneium minato
solidovic 2b4319b
feat: soneium icon
solidovic bb4399e
revert: server port
solidovic 9eeab3f
feat: force change chain in the wagmi state, add the 'isChainMatched'…
solidovic aa57c6e
fix: fix the isChainMatched flag
solidovic c0cc5bf
fix: safe wallet
solidovic 812cdb7
feat: add a ToastInfo for safe wallet
solidovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { ReactComponent as OptimismLogo } from 'assets/icons/chain-toggler/optimism.svg'; | ||
| import { ReactComponent as EthereumMainnetLogo } from 'assets/icons/chain-toggler/mainnet.svg'; | ||
|
|
||
| import { CHAINS } from 'consts/chains'; | ||
|
|
||
| export enum DAPP_CHAIN_TYPE { | ||
| Ethereum = 'Ethereum', | ||
| Optimism = 'Optimism', | ||
| } | ||
|
|
||
| export type SupportedChainLabels = { | ||
| [key in DAPP_CHAIN_TYPE]: string; | ||
| }; | ||
|
|
||
| export const ETHEREUM_CHAINS = new Set([ | ||
| CHAINS.Mainnet, | ||
| CHAINS.Holesky, | ||
| CHAINS.Sepolia, | ||
| ]); | ||
|
|
||
| export const OPTIMISM_CHAINS = new Set([ | ||
| CHAINS.Optimism, | ||
| CHAINS.OptimismSepolia, | ||
| ]); | ||
|
|
||
| export const getChainTypeByChainId = ( | ||
| chainId: number, | ||
| ): DAPP_CHAIN_TYPE | null => { | ||
|
Jeday marked this conversation as resolved.
|
||
| if (ETHEREUM_CHAINS.has(chainId)) { | ||
| return DAPP_CHAIN_TYPE.Ethereum; | ||
| } else if (OPTIMISM_CHAINS.has(chainId)) { | ||
| return DAPP_CHAIN_TYPE.Optimism; | ||
| } | ||
| return null; | ||
| }; | ||
|
|
||
| export const CHAIN_ICONS_MAP = new Map([ | ||
| [CHAINS.Mainnet, EthereumMainnetLogo], | ||
| [CHAINS.Holesky, EthereumMainnetLogo], | ||
| [CHAINS.Sepolia, EthereumMainnetLogo], | ||
| [CHAINS.Optimism, OptimismLogo], | ||
| [CHAINS.OptimismSepolia, OptimismLogo], | ||
| ]); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './chains'; | ||
| export * from './symbols'; | ||
| export * from './tx'; | ||
| export * from './units'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,4 @@ export { | |
| useLidoSDK, | ||
| useLidoSDKL2, | ||
| SupportL2Chains, | ||
| DAPP_CHAIN_TYPE, | ||
| } from './web3-provider'; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.