Skip to content

Commit f0f869f

Browse files
authored
feat: add types for unified bridge ui (#5783)
## Explanation <!-- 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? --> Adds `isUnifiedUIEnabled` flag to `ChainConfiguration` feature-flag type and update validators accordingly. This is required as we are adding a feature flag to support the development of a unified bridge/swap UI. ## 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 --> ## Changelog <!-- THIS SECTION IS NO LONGER NEEDED. The process for updating changelogs has changed. Please consult the "Updating changelogs" section of the Contributing doc for more. --> ## 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 0c09d12 commit f0f869f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

packages/bridge-controller/CHANGELOG.md

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

1010
### Added
1111

12+
- Added optional `isUnifiedUIEnabled` flag to chain-level feature-flag `ChainConfiguration` type and updated the validation schema to accept the new flag ([#5783](https://github.com/MetaMask/core/pull/5783))
1213
- Add and export `calcSlippagePercentage`, a utility that calculates the absolute slippage percentage based on the adjusted return and the sent amount ([#5723](https://github.com/MetaMask/core/pull/5723)).
1314
- Error logs for invalid getQuote responses ([#5816](https://github.com/MetaMask/core/pull/5816))
1415

packages/bridge-controller/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export type ChainConfiguration = {
6464
isActiveDest: boolean;
6565
refreshRate?: number;
6666
topAssets?: string[];
67+
isUnifiedUIEnabled?: boolean;
6768
};
6869

6970
export type L1GasFees = {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const validateFeatureFlagsResponse = (
5959
isActiveDest: boolean(),
6060
refreshRate: optional(number()),
6161
topAssets: optional(array(string())),
62+
isUnifiedUIEnabled: optional(boolean()),
6263
});
6364

6465
const PlatformConfigSchema = type({

0 commit comments

Comments
 (0)