File tree Expand file tree Collapse file tree
packages/bridge-status-controller/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1082,7 +1082,11 @@ export class BridgeStatusController extends StaticIntervalPollingController<Brid
10821082 action_type : MetricsActionType . SWAPBRIDGE_V1 ,
10831083 location :
10841084 eventProperties ?. location ??
1085- ( txMetaId ? this . state . txHistory ?. [ txMetaId ] ?. location : undefined ) ??
1085+ ( txMetaId
1086+ ? // comseyhil jfildsjfkl jilfd
1087+ this . state . txHistory ?. [ txMetaId ] ?. location
1088+ : // comseyhil jfildsjfkl jilfd
1089+ undefined ) ??
10861090 MetaMetricsSwapsEventSource . MainView ,
10871091 ...( eventProperties ?? { } ) ,
10881092 ...( resolvedAbTests &&
Original file line number Diff line number Diff line change 1- import { isEvmTxData } from '@metamask/bridge-controller' ;
1+ import { TxData } from '@metamask/bridge-controller' ;
22
33import type { SubmitStrategyParams , SubmitStepResult } from './types' ;
44import {
@@ -13,7 +13,7 @@ import {
1313 * @yields The approvalMeta and tradeMeta for the batched transaction
1414 */
1515export async function * submitBatchHandler (
16- args : SubmitStrategyParams ,
16+ args : SubmitStrategyParams < TxData > ,
1717) : AsyncGenerator < SubmitStepResult , void , void > {
1818 const {
1919 requireApproval,
@@ -22,19 +22,11 @@ export async function* submitBatchHandler(
2222 isBridgeTx,
2323 addTransactionBatchFn,
2424 } = args ;
25- if ( ! isEvmTxData ( quoteResponse . trade ) ) {
26- throw new Error (
27- 'Failed to submit cross-chain swap transaction: trade is not an EVM transaction' ,
28- ) ;
29- }
3025 const transactionParams = await getAddTransactionBatchParams ( {
3126 messenger,
3227 isBridgeTx,
3328 resetApproval : quoteResponse . resetApproval ,
34- approval :
35- quoteResponse . approval && isEvmTxData ( quoteResponse . approval )
36- ? quoteResponse . approval
37- : undefined ,
29+ approval : quoteResponse . approval ,
3830 trade : quoteResponse . trade ,
3931 quoteResponse,
4032 requireApproval,
Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
22/* eslint-disable @typescript-eslint/explicit-function-return-type */
3- import { isNonEvmChainId } from '@metamask/bridge-controller' ;
3+ import { isEvmTxData , isNonEvmChainId } from '@metamask/bridge-controller' ;
44
55import { submitBatchHandler } from './batch-strategy' ;
66import { submitEvmHandler as defaultSubmitHandler } from './evm-strategy' ;
@@ -25,9 +25,11 @@ const SUBMIT_STRATEGY_REGISTRY: SubmitStrategy[] = [
2525 const { quoteResponse, isStxEnabledOnClient, isDelegatedAccount } =
2626 params ;
2727 return (
28- isStxEnabledOnClient ||
29- quoteResponse . quote . gasIncluded7702 ||
30- isDelegatedAccount
28+ ( isStxEnabledOnClient ||
29+ quoteResponse . quote . gasIncluded7702 ||
30+ isDelegatedAccount ) &&
31+ isEvmTxData ( quoteResponse . trade ) &&
32+ ( quoteResponse . approval ? isEvmTxData ( quoteResponse . approval ) : true )
3133 ) ;
3234 } ,
3335 execute : submitBatchHandler ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type {
33 BridgeClientId ,
44 QuoteMetadata ,
55 QuoteResponse ,
6+ Trade ,
67} from '@metamask/bridge-controller' ;
78import type { TraceCallback } from '@metamask/controller-utils' ;
89import type {
@@ -55,13 +56,13 @@ export type SubmitStepResult =
5556/**
5657 * The parameters for the submission flow
5758 */
58- export type SubmitStrategyParams = {
59+ export type SubmitStrategyParams < TradeType extends Trade = Trade > = {
5960 addTransactionBatchFn : TransactionController [ 'addTransactionBatch' ] ;
6061 isBridgeTx : boolean ;
6162 isDelegatedAccount : boolean ;
6263 isStxEnabledOnClient : boolean ;
6364 messenger : BridgeStatusControllerMessenger ;
64- quoteResponse : QuoteResponse & QuoteMetadata ;
65+ quoteResponse : QuoteResponse < TradeType , TradeType > & QuoteMetadata ;
6566 requireApproval : boolean ;
6667 selectedAccount : AccountsControllerState [ 'internalAccounts' ] [ 'accounts' ] [ string ] ;
6768 traceFn : TraceCallback ;
You can’t perform that action at this time.
0 commit comments