Skip to content
Merged
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
37 changes: 0 additions & 37 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,30 +562,6 @@
"count": 1
}
},
"packages/bridge-controller/src/bridge-controller.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 18
},
"@typescript-eslint/naming-convention": {
"count": 4
}
},
"packages/bridge-controller/src/selectors.test.ts": {
"@typescript-eslint/prefer-nullish-coalescing": {
"count": 1
}
},
"packages/bridge-controller/src/selectors.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 25
},
"@typescript-eslint/naming-convention": {
"count": 1
},
"no-negated-condition": {
"count": 1
}
},
"packages/bridge-controller/src/types.ts": {
"@typescript-eslint/naming-convention": {
"count": 12
Expand All @@ -612,11 +588,6 @@
"count": 1
}
},
"packages/bridge-controller/src/utils/caip-formatters.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 2
}
},
"packages/bridge-controller/src/utils/feature-flags.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 3
Expand Down Expand Up @@ -676,14 +647,6 @@
"count": 2
}
},
"packages/bridge-controller/src/utils/quote.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 15
},
"@typescript-eslint/prefer-nullish-coalescing": {
"count": 4
}
},
"packages/bridge-controller/src/utils/slippage.ts": {
"@typescript-eslint/explicit-function-return-type": {
"count": 1
Expand Down
1 change: 1 addition & 0 deletions packages/bridge-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING** Use `gasEstimatesByChainId` instead of `gasEstimates` to remove reference to the global selected network. Clients need to replace gasEstimates with the `gasEstimatesByChainId` state from the GasFeeController when using the `selectBridgeQuotes` selector ([#7826](https://github.com/MetaMask/core/pull/7826))
- Bump `@metamask/transaction-controller` from `^62.13.0` to `^62.14.0` ([#7832](https://github.com/MetaMask/core/pull/7832))

## [65.2.0]
Expand Down
35 changes: 21 additions & 14 deletions packages/bridge-controller/src/bridge-controller.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { BigNumber } from '@ethersproject/bignumber';
import { Contract } from '@ethersproject/contracts';
import { Web3Provider } from '@ethersproject/providers';
Expand Down Expand Up @@ -174,11 +175,11 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
readonly #fetchFn: FetchFunction;

readonly #trackMetaMetricsFn: <
T extends
EventName extends
(typeof UnifiedSwapBridgeEventName)[keyof typeof UnifiedSwapBridgeEventName],
>(
eventName: T,
properties: CrossChainSwapsEventProperties<T>,
eventName: EventName,
properties: CrossChainSwapsEventProperties<EventName>,
) => void;

readonly #trace: TraceCallback;
Expand Down Expand Up @@ -208,11 +209,11 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
customBridgeApiBaseUrl?: string;
};
trackMetaMetricsFn: <
T extends
EventName extends
(typeof UnifiedSwapBridgeEventName)[keyof typeof UnifiedSwapBridgeEventName],
>(
eventName: T,
properties: CrossChainSwapsEventProperties<T>,
eventName: EventName,
properties: CrossChainSwapsEventProperties<EventName>,
) => void;
traceFn?: TraceCallback;
}) {
Expand Down Expand Up @@ -874,12 +875,15 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
};

readonly #getEventProperties = <
T extends
EventName extends
(typeof UnifiedSwapBridgeEventName)[keyof typeof UnifiedSwapBridgeEventName],
>(
eventName: T,
propertiesFromClient: Pick<RequiredEventContextFromClient, T>[T],
): CrossChainSwapsEventProperties<T> => {
eventName: EventName,
propertiesFromClient: Pick<
RequiredEventContextFromClient,
EventName
>[EventName],
): CrossChainSwapsEventProperties<EventName> => {
const baseProperties = {
...propertiesFromClient,
action_type: MetricsActionType.SWAPBRIDGE_V1,
Expand Down Expand Up @@ -1000,14 +1004,17 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
* });
*/
trackUnifiedSwapBridgeEvent = <
T extends
EventName extends
(typeof UnifiedSwapBridgeEventName)[keyof typeof UnifiedSwapBridgeEventName],
>(
eventName: T,
propertiesFromClient: Pick<RequiredEventContextFromClient, T>[T],
eventName: EventName,
propertiesFromClient: Pick<
RequiredEventContextFromClient,
EventName
>[EventName],
) => {
try {
const combinedPropertiesForEvent = this.#getEventProperties<T>(
const combinedPropertiesForEvent = this.#getEventProperties<EventName>(
eventName,
propertiesFromClient,
);
Expand Down
Loading
Loading