Skip to content

Commit 7bdab45

Browse files
authored
chore: rename bridgePriceData -> priceData (#5784)
## Explanation Updates the QuoteResponse type to match the bridge-api's response <!-- 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 Fixes https://consensyssoftware.atlassian.net/browse/MMS-2402 <!-- 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 - [ ] 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 b5cb645 commit 7bdab45

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

packages/bridge-controller/CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Changed
11+
12+
- **BREAKING** Rename `QuoteResponse.bridgePriceData` to `priceData` ([#5784](https://github.com/MetaMask/core/pull/5784))
13+
1014
## [22.0.0]
1115

1216
### Changed

packages/bridge-controller/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export type Quote = {
276276
bridges: string[];
277277
steps: Step[];
278278
refuel?: RefuelData;
279-
bridgePriceData?: {
279+
priceData?: {
280280
totalFromAmountUsd?: string;
281281
totalToAmountUsd?: string;
282282
priceImpact?: string;

packages/bridge-controller/tests/mock-quotes-sol-erc20.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"destAmount": "143291269234176100000"
138138
}
139139
],
140-
"bridgePriceData": {
140+
"priceData": {
141141
"totalFromAmountUsd": "124.9200",
142142
"totalToAmountUsd": "123.9469",
143143
"priceImpact": "0.007789785462696144"
@@ -284,7 +284,7 @@
284284
"destAmount": "141450025181571360000"
285285
}
286286
],
287-
"bridgePriceData": {
287+
"priceData": {
288288
"totalFromAmountUsd": "124.9200",
289289
"totalToAmountUsd": "122.3543",
290290
"priceImpact": "0.020538744796669922"

packages/bridge-status-controller/CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Replace `bridgePriceData` with `priceData` from QuoteResponse object ([#5784](https://github.com/MetaMask/core/pull/5784))
13+
1014
## [19.0.0]
1115

1216
### Changed

packages/bridge-status-controller/src/bridge-status-controller.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,7 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
849849
...getTxStatusesFromHistory(historyItem),
850850
...getFinalizedTxProperties(historyItem),
851851
error_message: 'error_message',
852-
price_impact: Number(
853-
historyItem.quote.bridgePriceData?.priceImpact ?? '0',
854-
),
852+
price_impact: Number(historyItem.quote.priceData?.priceImpact ?? '0'),
855853
};
856854
}
857855

0 commit comments

Comments
 (0)