Skip to content

Commit b24ed44

Browse files
authored
feat: add quickBuy and dappSwap FeatureIds (MetaMask#8598)
## Explanation Adds missing `QuoteWarning` and `FeatureId` enums. Clients already pass these in so the `ts-expect-error` suppressions will need to be removed <!-- 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 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Low runtime risk since this is type-only expansion, but *medium integration risk* because it’s a breaking public API change that may require downstream clients to update/remove type suppressions. > > **Overview** > Updates `bridge-controller` public typings to recognize additional values used by external swap quote consumers. > > Adds `FeatureId.QUICK_BUY`/`FeatureId.DAPP_SWAP` and extends `QuoteWarning` with `market_closed` and `quote_expired`, and documents both as **BREAKING** changes in the package changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f371dc6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent bda1365 commit b24ed44

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

packages/bridge-controller/CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Added
11+
12+
- **BREAKING:** Add `quickBuy` and `dappSwap` FeatureIds for external swap quote consumers ([#8598](https://github.com/MetaMask/core/pull/8598))
13+
- **BREAKING:** Add `market_closed` and `quote_expired` QuoteWarning ([#8598](https://github.com/MetaMask/core/pull/8598))
14+
1015
### Changed
1116

1217
- Bump `@metamask/transaction-controller` from `^64.3.0` to `^64.4.0` ([#8585](https://github.com/MetaMask/core/pull/8585))

packages/bridge-controller/src/utils/metrics/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export type QuoteWarning =
8989
| 'insufficient_gas_balance'
9090
| 'insufficient_gas_for_selected_quote'
9191
| 'insufficient_balance'
92+
| 'market_closed'
9293
| 'price_impact'
94+
| 'quote_expired'
9395
| 'tx_alert';
9496

9597
/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export enum FeeType {
3333

3434
export enum FeatureId {
3535
PERPS = 'perps',
36+
QUICK_BUY = 'quickBuy',
37+
DAPP_SWAP = 'dappSwap',
3638
}
3739

3840
export enum ActionTypes {

0 commit comments

Comments
 (0)