@metamask/bridge-status-controller 64.4.4 → 65.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _BridgeStatusController_instances, _BridgeStatusController_pollingTokensByTxMetaId, _BridgeStatusController_clientId, _BridgeStatusController_fetchFn, _BridgeStatusController_config, _BridgeStatusController_addTransactionFn, _BridgeStatusController_addTransactionBatchFn, _BridgeStatusController_updateTransactionFn, _BridgeStatusController_estimateGasFeeFn, _BridgeStatusController_trace, _BridgeStatusController_markTxAsFailed, _BridgeStatusController_restartPollingForIncompleteHistoryItems, _BridgeStatusController_addTxToHistory, _BridgeStatusController_startPollingForTxId, _BridgeStatusController_getMultichainSelectedAccount, _BridgeStatusController_handleFetchFailure, _BridgeStatusController_fetchBridgeTxStatus, _BridgeStatusController_fetchIntentOrderStatus, _BridgeStatusController_updateBridgeHistoryFromIntentOrder, _BridgeStatusController_getSrcTxHash, _BridgeStatusController_updateSrcTxHash, _BridgeStatusController_wipeBridgeStatusByChainId, _BridgeStatusController_handleNonEvmTx, _BridgeStatusController_waitForHashAndReturnFinalTxMeta, _BridgeStatusController_waitForTxConfirmation, _BridgeStatusController_handleApprovalTx, _BridgeStatusController_handleEvmTransaction, _BridgeStatusController_handleUSDTAllowanceReset, _BridgeStatusController_calculateGasFees, _BridgeStatusController_handleEvmTransactionBatch, _BridgeStatusController_trackUnifiedSwapBridgeEvent;
12
+ var _BridgeStatusController_instances, _BridgeStatusController_pollingTokensByTxMetaId, _BridgeStatusController_clientId, _BridgeStatusController_fetchFn, _BridgeStatusController_config, _BridgeStatusController_addTransactionFn, _BridgeStatusController_addTransactionBatchFn, _BridgeStatusController_updateTransactionFn, _BridgeStatusController_estimateGasFeeFn, _BridgeStatusController_trace, _BridgeStatusController_markTxAsFailed, _BridgeStatusController_restartPollingForIncompleteHistoryItems, _BridgeStatusController_addTxToHistory, _BridgeStatusController_rekeyHistoryItem, _BridgeStatusController_startPollingForTxId, _BridgeStatusController_getMultichainSelectedAccount, _BridgeStatusController_handleFetchFailure, _BridgeStatusController_fetchBridgeTxStatus, _BridgeStatusController_fetchIntentOrderStatus, _BridgeStatusController_updateBridgeHistoryFromIntentOrder, _BridgeStatusController_getSrcTxHash, _BridgeStatusController_updateSrcTxHash, _BridgeStatusController_wipeBridgeStatusByChainId, _BridgeStatusController_handleNonEvmTx, _BridgeStatusController_waitForHashAndReturnFinalTxMeta, _BridgeStatusController_waitForTxConfirmation, _BridgeStatusController_handleApprovalTx, _BridgeStatusController_handleEvmTransaction, _BridgeStatusController_handleUSDTAllowanceReset, _BridgeStatusController_calculateGasFees, _BridgeStatusController_handleEvmTransactionBatch, _BridgeStatusController_trackUnifiedSwapBridgeEvent;
13
13
  import { formatChainIdToHex, isNonEvmChainId, StatusTypes, UnifiedSwapBridgeEventName, formatChainIdToCaip, isCrossChain, isEvmTxData, isHardwareWallet, MetricsActionType, isBitcoinTrade, isTronTrade, AbortReason } from "@metamask/bridge-controller";
14
14
  import { toHex } from "@metamask/controller-utils";
15
15
  import { StaticIntervalPollingController } from "@metamask/polling-controller";
@@ -21,7 +21,7 @@ import { fetchBridgeTxStatus, getStatusRequestWithSrcTxHash, shouldSkipFetchDueT
21
21
  import { getTxGasEstimates } from "./utils/gas.mjs";
22
22
  import { IntentApiImpl, mapIntentOrderStatusToTransactionStatus } from "./utils/intent-api.mjs";
23
23
  import { getFinalizedTxProperties, getPriceImpactFromQuote, getRequestMetadataFromHistory, getRequestParamFromHistory, getTradeDataFromHistory, getEVMTxPropertiesFromTransactionMeta, getTxStatusesFromHistory, getPreConfirmationPropertiesFromQuote } from "./utils/metrics.mjs";
24
- import { findAndUpdateTransactionsInBatch, getAddTransactionBatchParams, getClientRequest, getStatusRequestParams, handleApprovalDelay, handleMobileHardwareWalletDelay, handleNonEvmTxResponse, generateActionId } from "./utils/transaction.mjs";
24
+ import { findAndUpdateTransactionsInBatch, getAddTransactionBatchParams, getClientRequest, getHistoryKey, getIntentFromQuote, getStatusRequestParams, handleApprovalDelay, handleMobileHardwareWalletDelay, handleNonEvmTxResponse, generateActionId } from "./utils/transaction.mjs";
25
25
  import { IntentOrderStatus } from "./utils/validators.mjs";
26
26
  const metadata = {
27
27
  // We want to persist the bridge status state so that we can show the proper data for the Activity list
@@ -56,15 +56,23 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
56
56
  _BridgeStatusController_estimateGasFeeFn.set(this, void 0);
57
57
  _BridgeStatusController_trace.set(this, void 0);
58
58
  // Mark tx as failed in txHistory if either the approval or trade fails
59
- _BridgeStatusController_markTxAsFailed.set(this, ({ id }) => {
60
- const txHistoryKey = this.state.txHistory[id]
61
- ? id
62
- : Object.keys(this.state.txHistory).find((key) => this.state.txHistory[key].approvalTxId === id);
59
+ _BridgeStatusController_markTxAsFailed.set(this, ({ id: txMetaId, actionId, }) => {
60
+ // Look up by txMetaId first
61
+ let txHistoryKey = this.state.txHistory[txMetaId]
62
+ ? txMetaId
63
+ : undefined;
64
+ // If not found by txMetaId, try looking up by actionId (for pre-submission failures)
65
+ if (!txHistoryKey && actionId && this.state.txHistory[actionId]) {
66
+ txHistoryKey = actionId;
67
+ }
68
+ // If still not found, try looking up by approvalTxId
69
+ txHistoryKey ?? (txHistoryKey = Object.keys(this.state.txHistory).find((key) => this.state.txHistory[key].approvalTxId === txMetaId));
63
70
  if (!txHistoryKey) {
64
71
  return;
65
72
  }
73
+ const key = txHistoryKey;
66
74
  this.update((statusState) => {
67
- statusState.txHistory[txHistoryKey].status.status = StatusTypes.FAILED;
75
+ statusState.txHistory[key].status.status = StatusTypes.FAILED;
68
76
  });
69
77
  });
70
78
  this.resetState = () => {
@@ -152,6 +160,8 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
152
160
  const incompleteHistoryItems = historyItems
153
161
  .filter((historyItem) => historyItem.status.status === StatusTypes.PENDING ||
154
162
  historyItem.status.status === StatusTypes.UNKNOWN)
163
+ // Only poll items with txMetaId (post-submission items)
164
+ .filter((historyItem) => Boolean(historyItem.txMetaId))
155
165
  .filter((historyItem) => {
156
166
  // Check if we are already polling this tx, if so, skip restarting polling for that
157
167
  const pollingToken = __classPrivateFieldGet(this, _BridgeStatusController_pollingTokensByTxMetaId, "f")[historyItem.txMetaId];
@@ -173,15 +183,20 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
173
183
  __classPrivateFieldGet(this, _BridgeStatusController_startPollingForTxId, "f").call(this, bridgeTxMetaId);
174
184
  });
175
185
  });
176
- _BridgeStatusController_addTxToHistory.set(this, (startPollingForBridgeTxStatusArgs) => {
186
+ _BridgeStatusController_addTxToHistory.set(this, (startPollingForBridgeTxStatusArgs, actionId) => {
177
187
  const { bridgeTxMeta, statusRequest, quoteResponse, startTime, slippagePercentage, initialDestAssetBalance, targetContractAddress, approvalTxId, isStxEnabled, accountAddress: selectedAddress, } = startPollingForBridgeTxStatusArgs;
188
+ // Determine the key for this history item:
189
+ // - For pre-submission (non-batch EVM): use actionId
190
+ // - For post-submission or other cases: use bridgeTxMeta.id
191
+ const historyKey = getHistoryKey(actionId, bridgeTxMeta?.id);
178
192
  // Write all non-status fields to state so we can reference the quote in Activity list without the Bridge API
179
193
  // We know it's in progress but not the exact status yet
180
194
  const txHistoryItem = {
181
- txMetaId: bridgeTxMeta.id,
195
+ txMetaId: bridgeTxMeta?.id,
196
+ actionId,
182
197
  originalTransactionId: bridgeTxMeta
183
- .originalTransactionId || bridgeTxMeta.id, // Keep original for intent transactions
184
- batchId: bridgeTxMeta.batchId,
198
+ ?.originalTransactionId || bridgeTxMeta?.id, // Keep original for intent transactions
199
+ batchId: bridgeTxMeta?.batchId,
185
200
  quote: quoteResponse.quote,
186
201
  startTime,
187
202
  estimatedProcessingTimeInSeconds: quoteResponse.estimatedProcessingTimeInSeconds,
@@ -211,8 +226,42 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
211
226
  featureId: quoteResponse.featureId,
212
227
  };
213
228
  this.update((state) => {
214
- // Use the txMeta.id as the key so we can reference the txMeta in TransactionController
215
- state.txHistory[bridgeTxMeta.id] = txHistoryItem;
229
+ // Use actionId as key for pre-submission, or txMeta.id for post-submission
230
+ state.txHistory[historyKey] = txHistoryItem;
231
+ });
232
+ });
233
+ /**
234
+ * Rekeys a history item from actionId to txMeta.id after successful submission.
235
+ * Also updates txMetaId and srcTxHash which weren't available pre-submission.
236
+ *
237
+ * @param actionId - The actionId used as the temporary key for the history item
238
+ * @param txMeta - The transaction meta from the successful submission
239
+ * @param txMeta.id - The transaction meta id to use as the new key
240
+ * @param txMeta.hash - The transaction hash to set on the history item
241
+ */
242
+ _BridgeStatusController_rekeyHistoryItem.set(this, (actionId, txMeta) => {
243
+ const historyItem = this.state.txHistory[actionId];
244
+ if (!historyItem) {
245
+ return;
246
+ }
247
+ this.update((state) => {
248
+ // Update fields that weren't available pre-submission
249
+ const updatedItem = {
250
+ ...historyItem,
251
+ txMetaId: txMeta.id,
252
+ originalTransactionId: historyItem.originalTransactionId ?? txMeta.id,
253
+ status: {
254
+ ...historyItem.status,
255
+ srcChain: {
256
+ ...historyItem.status.srcChain,
257
+ txHash: txMeta.hash ?? historyItem.status.srcChain?.txHash,
258
+ },
259
+ },
260
+ };
261
+ // Add under new key (txMeta.id)
262
+ state.txHistory[txMeta.id] = updatedItem;
263
+ // Remove old key (actionId)
264
+ delete state.txHistory[actionId];
216
265
  });
217
266
  });
218
267
  _BridgeStatusController_startPollingForTxId.set(this, (txId) => {
@@ -246,6 +295,9 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
246
295
  */
247
296
  this.startPollingForBridgeTxStatus = (txHistoryMeta) => {
248
297
  const { bridgeTxMeta } = txHistoryMeta;
298
+ if (!bridgeTxMeta?.id) {
299
+ throw new Error('Cannot start polling: bridgeTxMeta.id is required for polling');
300
+ }
249
301
  __classPrivateFieldGet(this, _BridgeStatusController_addTxToHistory, "f").call(this, txHistoryMeta);
250
302
  __classPrivateFieldGet(this, _BridgeStatusController_startPollingForTxId, "f").call(this, bridgeTxMeta.id);
251
303
  };
@@ -532,10 +584,12 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
532
584
  * @param params.txFee - Optional gas fee parameters from the quote (used when gasIncluded is true)
533
585
  * @param params.txFee.maxFeePerGas - The maximum fee per gas from the quote
534
586
  * @param params.txFee.maxPriorityFeePerGas - The maximum priority fee per gas from the quote
587
+ * @param params.actionId - Optional actionId for pre-submission history (if not provided, one is generated)
535
588
  * @returns The transaction meta
536
589
  */
537
- _BridgeStatusController_handleEvmTransaction.set(this, async ({ transactionType, trade, requireApproval = false, txFee, }) => {
538
- const actionId = generateActionId().toString();
590
+ _BridgeStatusController_handleEvmTransaction.set(this, async ({ transactionType, trade, requireApproval = false, txFee, actionId: providedActionId, }) => {
591
+ // Use provided actionId (for pre-submission history) or generate one
592
+ const actionId = providedActionId ?? generateActionId().toString();
539
593
  const selectedAccount = this.messenger.call('AccountsController:getAccountByAddress', trade.from);
540
594
  if (!selectedAccount) {
541
595
  throw new Error('Failed to submit cross-chain swap transaction: unknown account in trade data');
@@ -763,9 +817,25 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
763
817
  : undefined, quoteResponse.resetApproval, requireApproval);
764
818
  approvalTxId = approvalTxMeta?.id;
765
819
  await handleMobileHardwareWalletDelay(requireApproval);
820
+ // Generate actionId for pre-submission history (non-batch EVM only)
821
+ const actionId = generateActionId().toString();
822
+ // Add pre-submission history keyed by actionId
823
+ // This ensures we have quote data available if transaction fails during submission
824
+ __classPrivateFieldGet(this, _BridgeStatusController_addTxToHistory, "f").call(this, {
825
+ accountAddress: selectedAccount.address,
826
+ statusRequest: {
827
+ ...getStatusRequestParams(quoteResponse),
828
+ srcTxHash: '', // Not available yet
829
+ },
830
+ quoteResponse,
831
+ slippagePercentage: 0,
832
+ isStxEnabled: isStxEnabledOnClient,
833
+ startTime,
834
+ approvalTxId,
835
+ }, actionId);
766
836
  // Pass txFee when gasIncluded is true to use the quote's gas fees
767
837
  // instead of re-estimating (which would fail for max native token swaps)
768
- return await __classPrivateFieldGet(this, _BridgeStatusController_handleEvmTransaction, "f").call(this, {
838
+ const tradeTxMeta = await __classPrivateFieldGet(this, _BridgeStatusController_handleEvmTransaction, "f").call(this, {
769
839
  transactionType: isBridgeTx
770
840
  ? TransactionType.bridge
771
841
  : TransactionType.swap,
@@ -774,24 +844,35 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
774
844
  txFee: quoteResponse.quote.gasIncluded
775
845
  ? quoteResponse.quote.feeData.txFee
776
846
  : undefined,
847
+ actionId,
777
848
  });
849
+ // On success, rekey from actionId to txMeta.id and update srcTxHash
850
+ __classPrivateFieldGet(this, _BridgeStatusController_rekeyHistoryItem, "f").call(this, actionId, tradeTxMeta);
851
+ return tradeTxMeta;
778
852
  });
779
853
  }
780
854
  try {
781
- // Add swap or bridge tx to history
782
- __classPrivateFieldGet(this, _BridgeStatusController_addTxToHistory, "f").call(this, {
783
- accountAddress: selectedAccount.address,
784
- bridgeTxMeta: txMeta, // Only the id field is used by the BridgeStatusController
785
- statusRequest: {
786
- ...getStatusRequestParams(quoteResponse),
787
- srcTxHash: txMeta.hash,
788
- },
789
- quoteResponse,
790
- slippagePercentage: 0, // TODO include slippage provided by quote if using dynamic slippage, or slippage from quote request
791
- isStxEnabled: isStxEnabledOnClient,
792
- startTime,
793
- approvalTxId,
794
- });
855
+ // For non-batch EVM transactions, history was already added/rekeyed above
856
+ // Only add history here for non-EVM and batch EVM transactions
857
+ const isNonBatchEvm = !isNonEvmChainId(quoteResponse.quote.srcChainId) &&
858
+ !isStxEnabledOnClient &&
859
+ !quoteResponse.quote.gasIncluded7702;
860
+ if (!isNonBatchEvm) {
861
+ // Add swap or bridge tx to history
862
+ __classPrivateFieldGet(this, _BridgeStatusController_addTxToHistory, "f").call(this, {
863
+ accountAddress: selectedAccount.address,
864
+ bridgeTxMeta: txMeta, // Only the id field is used by the BridgeStatusController
865
+ statusRequest: {
866
+ ...getStatusRequestParams(quoteResponse),
867
+ srcTxHash: txMeta.hash,
868
+ },
869
+ quoteResponse,
870
+ slippagePercentage: 0, // TODO include slippage provided by quote if using dynamic slippage, or slippage from quote request
871
+ isStxEnabled: isStxEnabledOnClient,
872
+ startTime,
873
+ approvalTxId,
874
+ });
875
+ }
795
876
  if (isNonEvmChainId(quoteResponse.quote.srcChainId)) {
796
877
  // Start polling for bridge tx status
797
878
  __classPrivateFieldGet(this, _BridgeStatusController_startPollingForTxId, "f").call(this, txMeta.id);
@@ -824,11 +905,7 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
824
905
  const isHardwareAccount = Boolean(account) && isHardwareWallet(account);
825
906
  const preConfirmationProperties = getPreConfirmationPropertiesFromQuote(quoteResponse, false, isHardwareAccount);
826
907
  try {
827
- const { intent } = quoteResponse
828
- .quote;
829
- if (!intent) {
830
- throw new Error('submitIntent: missing intent data');
831
- }
908
+ const intent = getIntentFromQuote(quoteResponse);
832
909
  // If backend provided an approval tx for this intent quote, submit it first (on-chain),
833
910
  // then proceed with off-chain intent submission.
834
911
  let approvalTxId;
@@ -1014,7 +1091,7 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
1014
1091
  // Set interval
1015
1092
  this.setIntervalLength(REFRESH_INTERVAL_MS);
1016
1093
  this.messenger.subscribe('TransactionController:transactionFailed', ({ transactionMeta }) => {
1017
- const { type, status, id } = transactionMeta;
1094
+ const { type, status, id: txMetaId, actionId } = transactionMeta;
1018
1095
  if (type &&
1019
1096
  [
1020
1097
  TransactionType.bridge,
@@ -1031,17 +1108,25 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
1031
1108
  __classPrivateFieldGet(this, _BridgeStatusController_markTxAsFailed, "f").call(this, transactionMeta);
1032
1109
  // Track failed event
1033
1110
  if (status !== TransactionStatus.rejected) {
1034
- __classPrivateFieldGet(this, _BridgeStatusController_trackUnifiedSwapBridgeEvent, "f").call(this, UnifiedSwapBridgeEventName.Failed, id, getEVMTxPropertiesFromTransactionMeta(transactionMeta));
1111
+ // Look up history by txMetaId first, then by actionId (for pre-submission failures)
1112
+ let historyKey;
1113
+ if (this.state.txHistory[txMetaId]) {
1114
+ historyKey = txMetaId;
1115
+ }
1116
+ else if (actionId && this.state.txHistory[actionId]) {
1117
+ historyKey = actionId;
1118
+ }
1119
+ __classPrivateFieldGet(this, _BridgeStatusController_trackUnifiedSwapBridgeEvent, "f").call(this, UnifiedSwapBridgeEventName.Failed, historyKey ?? txMetaId, getEVMTxPropertiesFromTransactionMeta(transactionMeta));
1035
1120
  }
1036
1121
  }
1037
1122
  });
1038
1123
  this.messenger.subscribe('TransactionController:transactionConfirmed', (transactionMeta) => {
1039
- const { type, id, chainId } = transactionMeta;
1124
+ const { type, id: txMetaId, chainId } = transactionMeta;
1040
1125
  if (type === TransactionType.swap) {
1041
- __classPrivateFieldGet(this, _BridgeStatusController_trackUnifiedSwapBridgeEvent, "f").call(this, UnifiedSwapBridgeEventName.Completed, id);
1126
+ __classPrivateFieldGet(this, _BridgeStatusController_trackUnifiedSwapBridgeEvent, "f").call(this, UnifiedSwapBridgeEventName.Completed, txMetaId);
1042
1127
  }
1043
1128
  if (type === TransactionType.bridge && !isNonEvmChainId(chainId)) {
1044
- __classPrivateFieldGet(this, _BridgeStatusController_startPollingForTxId, "f").call(this, id);
1129
+ __classPrivateFieldGet(this, _BridgeStatusController_startPollingForTxId, "f").call(this, txMetaId);
1045
1130
  }
1046
1131
  });
1047
1132
  // If you close the extension, but keep the browser open, the polling continues
@@ -1050,7 +1135,7 @@ export class BridgeStatusController extends StaticIntervalPollingController() {
1050
1135
  __classPrivateFieldGet(this, _BridgeStatusController_restartPollingForIncompleteHistoryItems, "f").call(this);
1051
1136
  }
1052
1137
  }
1053
- _BridgeStatusController_pollingTokensByTxMetaId = new WeakMap(), _BridgeStatusController_clientId = new WeakMap(), _BridgeStatusController_fetchFn = new WeakMap(), _BridgeStatusController_config = new WeakMap(), _BridgeStatusController_addTransactionFn = new WeakMap(), _BridgeStatusController_addTransactionBatchFn = new WeakMap(), _BridgeStatusController_updateTransactionFn = new WeakMap(), _BridgeStatusController_estimateGasFeeFn = new WeakMap(), _BridgeStatusController_trace = new WeakMap(), _BridgeStatusController_markTxAsFailed = new WeakMap(), _BridgeStatusController_restartPollingForIncompleteHistoryItems = new WeakMap(), _BridgeStatusController_addTxToHistory = new WeakMap(), _BridgeStatusController_startPollingForTxId = new WeakMap(), _BridgeStatusController_handleFetchFailure = new WeakMap(), _BridgeStatusController_fetchBridgeTxStatus = new WeakMap(), _BridgeStatusController_fetchIntentOrderStatus = new WeakMap(), _BridgeStatusController_getSrcTxHash = new WeakMap(), _BridgeStatusController_updateSrcTxHash = new WeakMap(), _BridgeStatusController_wipeBridgeStatusByChainId = new WeakMap(), _BridgeStatusController_handleNonEvmTx = new WeakMap(), _BridgeStatusController_waitForHashAndReturnFinalTxMeta = new WeakMap(), _BridgeStatusController_waitForTxConfirmation = new WeakMap(), _BridgeStatusController_handleApprovalTx = new WeakMap(), _BridgeStatusController_handleEvmTransaction = new WeakMap(), _BridgeStatusController_handleUSDTAllowanceReset = new WeakMap(), _BridgeStatusController_calculateGasFees = new WeakMap(), _BridgeStatusController_handleEvmTransactionBatch = new WeakMap(), _BridgeStatusController_trackUnifiedSwapBridgeEvent = new WeakMap(), _BridgeStatusController_instances = new WeakSet(), _BridgeStatusController_getMultichainSelectedAccount = function _BridgeStatusController_getMultichainSelectedAccount(accountAddress) {
1138
+ _BridgeStatusController_pollingTokensByTxMetaId = new WeakMap(), _BridgeStatusController_clientId = new WeakMap(), _BridgeStatusController_fetchFn = new WeakMap(), _BridgeStatusController_config = new WeakMap(), _BridgeStatusController_addTransactionFn = new WeakMap(), _BridgeStatusController_addTransactionBatchFn = new WeakMap(), _BridgeStatusController_updateTransactionFn = new WeakMap(), _BridgeStatusController_estimateGasFeeFn = new WeakMap(), _BridgeStatusController_trace = new WeakMap(), _BridgeStatusController_markTxAsFailed = new WeakMap(), _BridgeStatusController_restartPollingForIncompleteHistoryItems = new WeakMap(), _BridgeStatusController_addTxToHistory = new WeakMap(), _BridgeStatusController_rekeyHistoryItem = new WeakMap(), _BridgeStatusController_startPollingForTxId = new WeakMap(), _BridgeStatusController_handleFetchFailure = new WeakMap(), _BridgeStatusController_fetchBridgeTxStatus = new WeakMap(), _BridgeStatusController_fetchIntentOrderStatus = new WeakMap(), _BridgeStatusController_getSrcTxHash = new WeakMap(), _BridgeStatusController_updateSrcTxHash = new WeakMap(), _BridgeStatusController_wipeBridgeStatusByChainId = new WeakMap(), _BridgeStatusController_handleNonEvmTx = new WeakMap(), _BridgeStatusController_waitForHashAndReturnFinalTxMeta = new WeakMap(), _BridgeStatusController_waitForTxConfirmation = new WeakMap(), _BridgeStatusController_handleApprovalTx = new WeakMap(), _BridgeStatusController_handleEvmTransaction = new WeakMap(), _BridgeStatusController_handleUSDTAllowanceReset = new WeakMap(), _BridgeStatusController_calculateGasFees = new WeakMap(), _BridgeStatusController_handleEvmTransactionBatch = new WeakMap(), _BridgeStatusController_trackUnifiedSwapBridgeEvent = new WeakMap(), _BridgeStatusController_instances = new WeakSet(), _BridgeStatusController_getMultichainSelectedAccount = function _BridgeStatusController_getMultichainSelectedAccount(accountAddress) {
1054
1139
  return this.messenger.call('AccountsController:getAccountByAddress', accountAddress);
1055
1140
  }, _BridgeStatusController_updateBridgeHistoryFromIntentOrder = function _BridgeStatusController_updateBridgeHistoryFromIntentOrder(bridgeTxMetaId, intentOrder, historyItem) {
1056
1141
  const { srcChainId } = historyItem.quote;