-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: remove network restrictions from swaps buttons #20529
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
Merged
Merged
Conversation
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
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Skipping sonar cloud because failures are related to intentional code duplication. |
|
Prithpal-Sooriya
approved these changes
Sep 30, 2025
infiniteflower
approved these changes
Sep 30, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
release-7.57.0
Issue or pull request that will be included in release 7.57.0
size-M
skip-sonar-cloud
Only used for bypassing sonar cloud when failures are not relevant to the changes.
team-swaps-and-bridge
Swaps and Bridge team
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.
Description
Problem
Previously, swap buttons were conditionally enabled based on network-specific feature flags (isSwapsAllowed and selectIsSwapsLive), which could prevent users from accessing swap functionality even when their desired networks were technically supported. This created friction in the user experience where swap buttons would be disabled based on the current network's feature flag status. With the introduction of BIP44 support, this approach became unnecessarily restrictive since all networks are now enabled at all times.
Solution
Removed the isSwapsAllowed and selectIsSwapsLive dependencies from swap button enabling logic, allowing swap buttons to be always enabled when basic functionality requirements are met (user can sign transactions and basic functionality is enabled). Users can now always click the swap button regardless of their current network, and the swap flow will appropriately handle routing them to a supported chain for their desired swap operation. This change leverages the BIP44 implementation where all networks are available, providing a more seamless user experience.
Changelog
CHANGELOG entry: Made swaps button enabled at all times, regardless of network
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Removes network-based gating for swaps, simplifies enablement to basic functionality/signing, drops
chainId
prop fromAssetDetailsActions
, and adds ETH mainnet fallback in swap/bridge navigation.selectIsSwapsEnabled
to only checkselectCanSignTransactions
andselectBasicFunctionalityEnabled
(nochainId
/liveness dependency).AssetDetailsActions
: removechainId
prop; internal selector updated toselectIsSwapsEnabled(state)
; all callers (AssetOverview
,Wallet
) stop passingchainId
.Wallet
,Asset
,WalletActions
, andTradeWalletActions
to removeisSwapsAllowed
/network checks; now depends onAppConstants.SWAPS.ACTIVE
(and per-asset checks where applicable).UrlAutocomplete/Result
: removeisSwapsAllowed
fromswapsEnabled
condition.useSwapBridgeNavigation
: when nosourceToken
, fallback to ETH on mainnet instead of returning; minor refactor aroundsourceToken
assignment.chainId
prop; adjust mocks accordingly.Written by Cursor Bugbot for commit 14acbfe. This will update automatically on new commits. Configure here.