Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Implement transaction batch and fee fetching for BatchSell quotes ([#8805](https://github.com/MetaMask/core/pull/8805))
- add new states `batchSellTrades` and `batchSellTradesLoadingStatus` to contain transaction data and its fetch status
- support transaction batch data fetching with the new `fetchBatchSellTrades` handler. Clients will need to call this whenever the recommended quotes update
- implement `selectBatchSellTrades` selector which returns the ordered list of transactions to submit as a batch, including any transfer transactions required to cover gas costs. This also returns the `totalNetworkFee` provided by the `obtainGaslessBatch` endpoint and its converted values

### Changed

- Bump `@metamask/assets-controller` from `^7.1.1` to `^7.1.2` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/assets-controllers` from `^108.0.0` to `^108.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/profile-sync-controller` from `^28.0.2` to `^28.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/transaction-controller` from `^65.3.0` to `^65.4.0` ([#8796](https://github.com/MetaMask/core/pull/8796))

### Removed

- **BREAKING**: Remove `totalNetworkFee` from the `selectBatchSellQuotes`'s results. Clients should use `selectBatchSellTrades` instead ([#8805](https://github.com/MetaMask/core/pull/8805))

## [72.0.4]

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`BridgeController BatchSell (multiple quote requests) SSE should trigger quote polling if request is valid 1`] = `
exports[`BridgeController BatchSell (multiple quote requests) SSE fetch quotes should trigger quote polling if request is valid 1`] = `
{
"assetExchangeRates": {
"eip155:10/erc20:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984": {
"exchangeRate": undefined,
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down Expand Up @@ -58,7 +60,7 @@ exports[`BridgeController BatchSell (multiple quote requests) SSE should trigger
}
`;

exports[`BridgeController BatchSell (multiple quote requests) SSE should trigger quote polling if request is valid 2`] = `
exports[`BridgeController BatchSell (multiple quote requests) SSE fetch quotes should trigger quote polling if request is valid 2`] = `
[
[
"Unified SwapBridge Input Changed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ exports[`BridgeController SSE should rethrow error from server 1`] = `
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down Expand Up @@ -303,6 +305,8 @@ exports[`BridgeController SSE should trigger quote polling if request is valid 1
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ exports[`BridgeController should handle errors from fetchBridgeQuotes 1`] = `
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down Expand Up @@ -39,6 +41,8 @@ exports[`BridgeController should handle errors from fetchBridgeQuotes 2`] = `
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down Expand Up @@ -829,6 +833,8 @@ exports[`BridgeController updateBridgeQuoteRequestParams should reset minimumBal
exports[`BridgeController updateBridgeQuoteRequestParams should trigger quote polling if request is valid 1`] = `
{
"assetExchangeRates": {},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down Expand Up @@ -864,6 +870,8 @@ exports[`BridgeController updateBridgeQuoteRequestParams should trigger quote po
"usdExchangeRate": "100",
},
},
"batchSellTrades": null,
"batchSellTradesLoadingStatus": null,
"minimumBalanceForRentExemptionInLamports": "0",
"quoteFetchError": null,
"quoteRequest": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export type BridgeControllerTrackUnifiedSwapBridgeEventAction = {
handler: BridgeController['trackUnifiedSwapBridgeEvent'];
};

export type BridgeControllerFetchBatchSellTradesAction = {
type: `BridgeController:fetchBatchSellTrades`;
handler: BridgeController['fetchBatchSellTrades'];
};

/**
* Union of all BridgeController action types.
*/
Expand All @@ -50,4 +55,5 @@ export type BridgeControllerMethodActions =
| BridgeControllerSetLocationAction
| BridgeControllerResetStateAction
| BridgeControllerSetChainIntervalLengthAction
| BridgeControllerTrackUnifiedSwapBridgeEventAction;
| BridgeControllerTrackUnifiedSwapBridgeEventAction
| BridgeControllerFetchBatchSellTradesAction;
Loading
Loading