Skip to content

Commit 74ed83c

Browse files
authored
chore: add isGaslessSwapEnabled swap feature flag (#6573)
## Explanation Adds the isGaslessSwapEnabled to the feature flag schema so `selectBridgeFeatureFlags` can return the value to clients <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-2937 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
1 parent 48a0ff8 commit 74ed83c

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

packages/bridge-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- **BREAKING:** Bump peer dependency `@metamask/assets-controller` from `^74.0.0` to `^75.0.0` ([#6570](https://github.com/MetaMask/core/pull/6570))
1313
- Bump `@metamask/keyring-api` from `^20.1.0` to `^21.0.0` ([#6560](https://github.com/MetaMask/core/pull/6560))
14+
- Add optional `isGaslessSwapEnabled` LaunchDarkly config to feature flags schema ([#6573](https://github.com/MetaMask/core/pull/6573))
1415
- Bump `@metamask/utils` from `^11.4.2` to `^11.8.0` ([#6588](https://github.com/MetaMask/core/pull/6588))
1516

1617
## [42.0.0]

packages/bridge-controller/src/utils/validators.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ describe('validators', () => {
66
{
77
response: {
88
chains: {
9-
'1': { isActiveDest: true, isActiveSrc: true },
9+
'1': {
10+
isActiveDest: true,
11+
isActiveSrc: true,
12+
isGaslessSwapEnabled: true,
13+
},
1014
'10': { isActiveDest: true, isActiveSrc: true },
1115
'137': { isActiveDest: true, isActiveSrc: true },
1216
'324': { isActiveDest: true, isActiveSrc: true },
1317
'42161': { isActiveDest: true, isActiveSrc: true },
14-
'43114': { isActiveDest: true, isActiveSrc: true },
18+
'43114': {
19+
isActiveDest: true,
20+
isActiveSrc: true,
21+
isGaslessSwapEnabled: false,
22+
},
1523
'56': { isActiveDest: true, isActiveSrc: true },
1624
'59144': { isActiveDest: true, isActiveSrc: true },
1725
'8453': { isActiveDest: true, isActiveSrc: true },

packages/bridge-controller/src/utils/validators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export const ChainConfigurationSchema = type({
8787
topAssets: optional(array(string())),
8888
isUnifiedUIEnabled: optional(boolean()),
8989
isSingleSwapBridgeButtonEnabled: optional(boolean()),
90+
isGaslessSwapEnabled: optional(boolean()),
9091
});
9192

9293
export const PriceImpactThresholdSchema = type({

0 commit comments

Comments
 (0)