From afc6f8007236438df7ab42e0405a07486ef73408 Mon Sep 17 00:00:00 2001 From: micaelae Date: Fri, 8 May 2026 14:49:53 -0700 Subject: [PATCH 1/8] feat: handle multiple quoteResponses in submit params --- .../src/bridge-status-controller.ts | 100 ++++++++++-------- .../src/strategy/batch-strategy.ts | 8 +- .../src/strategy/evm-strategy.ts | 17 +-- .../src/strategy/index.ts | 21 ++-- .../src/strategy/intent-strategy.ts | 9 +- .../src/strategy/non-evm-strategy.ts | 10 +- .../src/strategy/types.ts | 4 +- .../bridge-status-controller/src/types.ts | 86 +++++++++++++++ 8 files changed, 190 insertions(+), 65 deletions(-) diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index d8ac782b40..ac7eaf7185 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -44,6 +44,9 @@ import type { StartPollingForBridgeTxStatusArgsSerialized, FetchFunction, BridgeHistoryItem, + SubmitTxParams, + SubmitTxLegacyParams, + QuoteResponseParam, } from './types'; import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; @@ -963,8 +966,8 @@ export class BridgeStatusController extends StaticIntervalPollingController => { - let tradeTxMeta!: TransactionMeta; + ): Promise => { + const tradeTxMetas: TransactionMeta[] = []; const steps = executeSubmitStrategy(params); @@ -981,14 +984,15 @@ export class BridgeStatusController extends StaticIntervalPollingController & QuoteMetadata, - isStxEnabled: boolean, - quotesReceivedContext?: RequiredEventContextFromClient[UnifiedSwapBridgeEventName.QuotesReceived], - location: MetaMetricsSwapsEventSource = MetaMetricsSwapsEventSource.MainView, - abTests?: Record, - activeAbTests?: { key: string; value: string }[], - tokenSecurityTypeDestination?: string | null, - ): Promise => { + ...params: SubmitTxLegacyParams | [SubmitTxParams] + ): Promise => { + // Both legacy and new parameter formats are supported so transform legacy parameters into new parameters if needed + const { + accountAddress, + quoteResponses, + isStxEnabled = false, + quotesReceivedContext, + location = MetaMetricsSwapsEventSource.MainView, + abTests, + activeAbTests, + tokenSecurityTypeDestination, + } = typeof params[0] === 'object' + ? params[0] + : ({ + accountAddress: params[0], + quoteResponse: params[1], + // Transform quoteResponse parameter into quoteResponses parameter + quoteResponses: Array.isArray(params[1]) ? params[1] : [params[1]], + isStxEnabled: params[2], + quotesReceivedContext: params[3], + location: params[4], + abTests: params[5], + activeAbTests: params[6], + tokenSecurityTypeDestination: params[7], + } as SubmitTxParams); + + /** + * If there are multiple quote responses, we assume that they all originate from the same src chain + * and the same account. In this case its safe to use the first quote response's properties for + * metrics and other pre-submission logic + */ + const quoteResponse = quoteResponses[0]; + const { featureId, quote } = quoteResponse; const startTime = Date.now(); @@ -1101,7 +1123,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, - quoteResponse, + quoteResponses, isStxEnabled, isBridgeTx, isDelegatedAccount, @@ -1114,7 +1136,7 @@ export class BridgeStatusController extends StaticIntervalPollingController await this.#executeSubmitStrategy(strategyParams, { @@ -1125,6 +1147,10 @@ export class BridgeStatusController extends StaticIntervalPollingController 1 ? tradeTxMetas : tradeTxMetas[0]; } catch (error) { this.#trackUnifiedSwapBridgeEvent( UnifiedSwapBridgeEventName.Failed, @@ -1165,28 +1191,12 @@ export class BridgeStatusController extends StaticIntervalPollingController> => { - const { - quoteResponse, - accountAddress, - location, - abTests, - activeAbTests, - isStxEnabled = false, - quotesReceivedContext, - tokenSecurityTypeDestination, - } = params; - // TODO add metrics context - return await this.submitTx( - accountAddress, - quoteResponse, - isStxEnabled, - quotesReceivedContext, - location, - abTests, - activeAbTests, - tokenSecurityTypeDestination, - ); + const txMetas = await this.submitTx({ + ...params, + quoteResponses: [params.quoteResponse], + }); + return Array.isArray(txMetas) ? txMetas[0] : txMetas; }; readonly #trackPollingStatusUpdatedEvent = ( diff --git a/packages/bridge-status-controller/src/strategy/batch-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-strategy.ts index 321a24a9f3..bdc4ce7f09 100644 --- a/packages/bridge-status-controller/src/strategy/batch-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-strategy.ts @@ -19,13 +19,16 @@ export async function* submitBatchHandler( ): AsyncGenerator { const { requireApproval, - quoteResponse, + quoteResponses, messenger, isBridgeTx, addTransactionBatchFn, isDelegatedAccount, } = args; + const quoteRequestIndex = 0; + const quoteResponse = quoteResponses[quoteRequestIndex]; + const tradeData: Parameters< typeof getAddTransactionBatchParams >[0]['tradeData'] = []; @@ -73,7 +76,7 @@ export async function* submitBatchHandler( yield { type: SubmitStep.SetTradeMeta, - payload: { tradeMeta }, + payload: { tradeMeta, quoteRequestIndex }, }; yield { @@ -86,6 +89,7 @@ export async function* submitBatchHandler( hash: tradeMeta.hash, batchId: tradeMeta.batchId, }, + quoteRequestIndex, }, }; } diff --git a/packages/bridge-status-controller/src/strategy/evm-strategy.ts b/packages/bridge-status-controller/src/strategy/evm-strategy.ts index 27313109fb..dcda9d0c80 100644 --- a/packages/bridge-status-controller/src/strategy/evm-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/evm-strategy.ts @@ -50,7 +50,10 @@ const handleSingleTx = async ( * @returns The approvalTxId of the approval transaction */ const approve = async (args: SubmitStrategyParams) => { - const { quoteResponse, isBridgeTx } = args; + const { + quoteResponses: [quoteResponse], + isBridgeTx, + } = args; const { approval, resetApproval } = quoteResponse; if (!approval || !isEvmTxData(approval)) { return undefined; @@ -76,7 +79,7 @@ const approve = async (args: SubmitStrategyParams) => { export const handleEvmApprovals = async (args: SubmitStrategyParams) => await args.traceFn( - getApprovalTraceParams(args.quoteResponse, args.isStxEnabled), + getApprovalTraceParams(args.quoteResponses[0], args.isStxEnabled), async () => await approve(args), ); @@ -89,7 +92,11 @@ export const handleEvmApprovals = async (args: SubmitStrategyParams) => export async function* submitEvmHandler( args: SubmitStrategyParams, ): AsyncGenerator { - const { quoteResponse, requireApproval, isBridgeTx } = args; + const { + quoteResponses: [quoteResponse], + requireApproval, + isBridgeTx, + } = args; // Submit resetApproval and approval transactions if present const approvalTxId = await handleEvmApprovals(args); @@ -149,8 +156,6 @@ export async function* submitEvmHandler( yield { type: SubmitStep.SetTradeMeta, - payload: { - tradeMeta, - }, + payload: { tradeMeta }, }; } diff --git a/packages/bridge-status-controller/src/strategy/index.ts b/packages/bridge-status-controller/src/strategy/index.ts index 93083e4d8a..1300ab6ce4 100644 --- a/packages/bridge-status-controller/src/strategy/index.ts +++ b/packages/bridge-status-controller/src/strategy/index.ts @@ -22,13 +22,16 @@ const validateParams = < >( params: SubmitStrategyParams, ): params is SubmitStrategyParams => { - const txs = [ - params.quoteResponse.trade, - params.quoteResponse.approval, - params.quoteResponse.resetApproval, - ].filter((tx): tx is TxDataType => tx !== undefined); + const txs = params.quoteResponses + .flatMap((quoteResponse) => [ + quoteResponse.trade, + quoteResponse.approval, + quoteResponse.resetApproval, + ]) + .filter((tx): tx is TxDataType => tx !== undefined); - switch (params.quoteResponse.quote.srcChainId) { + // Assumes all quotes are for the same chain + switch (params.quoteResponses[0].quote.srcChainId) { case ChainId.SOLANA: return txs.every((tx) => typeof tx === 'string'); case ChainId.BTC: @@ -50,7 +53,11 @@ const validateParams = < const executeSubmitStrategy = ( params: SubmitStrategyParams, ): AsyncGenerator => { - const { quoteResponse, isStxEnabled, isDelegatedAccount } = params; + const { + quoteResponses: [quoteResponse], + isStxEnabled, + isDelegatedAccount, + } = params; // Non-EVM transactions if (isNonEvmChainId(quoteResponse.quote.srcChainId)) { diff --git a/packages/bridge-status-controller/src/strategy/intent-strategy.ts b/packages/bridge-status-controller/src/strategy/intent-strategy.ts index b11078ba3c..4dc1e4ad7b 100644 --- a/packages/bridge-status-controller/src/strategy/intent-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/intent-strategy.ts @@ -34,7 +34,12 @@ const handleSyntheticTx = async ( orderUid: string, args: SubmitStrategyParams, ) => { - const { quoteResponse, messenger, isBridgeTx, selectedAccount } = args; + const { + quoteResponses: [quoteResponse], + messenger, + isBridgeTx, + selectedAccount, + } = args; const { quote: { srcChainId }, } = quoteResponse; @@ -95,7 +100,7 @@ const handleSyntheticTx = async ( */ const handleSubmitIntent = async (args: SubmitStrategyParams) => { const { - quoteResponse, + quoteResponses: [quoteResponse], messenger, selectedAccount, clientId, diff --git a/packages/bridge-status-controller/src/strategy/non-evm-strategy.ts b/packages/bridge-status-controller/src/strategy/non-evm-strategy.ts index 44accdd7e2..3b5dfe7238 100644 --- a/packages/bridge-status-controller/src/strategy/non-evm-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/non-evm-strategy.ts @@ -23,7 +23,10 @@ const handleTronApproval = async ( TronTradeData | BitcoinTradeData | string | TxData >, ) => { - const { quoteResponse, traceFn } = args; + const { + quoteResponses: [quoteResponse], + traceFn, + } = args; const approvalTxId = await traceFn( getApprovalTraceParams(quoteResponse, false), @@ -65,7 +68,10 @@ export async function* submitNonEvmHandler( BitcoinTradeData | TronTradeData | string | TxData >, ): AsyncGenerator { - const { quoteResponse, isBridgeTx } = args; + const { + quoteResponses: [quoteResponse], + isBridgeTx, + } = args; const approvalTxId = await handleTronApproval(args); diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index f895b7c7de..d968dc339b 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -37,6 +37,7 @@ export type SubmitStepResult = 'approvalTxId' | 'bridgeTxMeta' | 'originalTransactionId' | 'actionId' > & { historyKey: string; + quoteRequestIndex?: number; }; } | { @@ -69,6 +70,7 @@ export type SubmitStepResult = /** The {@link TransactionMeta} for the transaction that has been submitted successfully */ payload: { tradeMeta: TransactionMeta; + quoteRequestIndex?: number; }; }; @@ -81,7 +83,7 @@ export type SubmitStrategyParams = { isDelegatedAccount: boolean; isStxEnabled: boolean; messenger: BridgeStatusControllerMessenger; - quoteResponse: QuoteResponse & QuoteMetadata; + quoteResponses: (QuoteResponse & QuoteMetadata)[]; requireApproval: boolean; selectedAccount: AccountsControllerState['internalAccounts']['accounts'][string]; traceFn: TraceCallback; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 6b01432a4b..ec0c22da01 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -12,6 +12,10 @@ import type { QuoteMetadata, QuoteResponse, MetaMetricsSwapsEventSource, + Trade, + RequiredEventContextFromClient, + UnifiedSwapBridgeEventName, + ObtainGaslessBatchResponse, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -53,6 +57,88 @@ export type FetchFunction = ( init?: RequestInit, ) => Promise; +type LegacyQuoteResponseParam = { + /** + * A quote response + * + * @deprecated use quoteResponses instead + */ + quoteResponse: QuoteResponse & QuoteMetadata; +}; + +export type QuoteResponseParam< + QuoteResponseType = QuoteResponse & QuoteMetadata, +> = { + /** + * An array of quote responses + */ + quoteResponses: [QuoteResponseType, ...QuoteResponseType[]]; +}; + +export type SubmitTxParams< + QRPType extends + | LegacyQuoteResponseParam + | QuoteResponseParam = QuoteResponseParam, +> = { + /** + * The address of the account to submit the transaction for + */ + accountAddress: string; + /** + * Whether smart transactions are enabled on the client, for example the getSmartTransactionsEnabled selector value from the extension + */ + isStxEnabled?: boolean; + /** + * The context for the QuotesReceived event + */ + quotesReceivedContext?: RequiredEventContextFromClient[UnifiedSwapBridgeEventName.QuotesReceived]; + /** + * The location/entry point from which the user initiated the swap or bridge. + * Used to attribute swaps to specific flows (e.g. Trending Explore). + */ + location?: MetaMetricsSwapsEventSource; + /** + * Legacy A/B test metrics context (`ab_tests`) kept for backward compatibility. + * Keys are test names, values are variant names (e.g. { token_details_layout: 'treatment' }). + */ + abTests?: Record; + /** + * New A/B test metrics context (`active_ab_tests`) that replaces `ab_tests`. + * Kept separate so migration can run both payloads in parallel. + * This field is an array of test objects. + */ + activeAbTests?: { key: string; value: string }[]; + /** + * The security classification of the destination token, supplied by the client + * (e.g. from token security/scanning data). Pass `null` when no security data is available. + */ + tokenSecurityTypeDestination?: string | null; + /** + * Contains transaction data for the quotes, + * provided by the obtainGaslessBatch API + */ + gaslessBatchSellResponse?: ObtainGaslessBatchResponse; +} & QRPType; + +/** + * The legacy parameters for the transaction submission + * + * @deprecated Use {@link SubmitTxParams} instead + */ +export type SubmitTxLegacyParams = Parameters< + ( + accountAddress: SubmitTxParams['accountAddress'], + quoteResponse: QuoteResponse & QuoteMetadata, + isStxEnabled: SubmitTxParams['isStxEnabled'], + quotesReceivedContext?: SubmitTxParams['quotesReceivedContext'], + location?: SubmitTxParams['location'], + abTests?: SubmitTxParams['abTests'], + activeAbTests?: SubmitTxParams['activeAbTests'], + tokenSecurityTypeDestination?: SubmitTxParams['tokenSecurityTypeDestination'], + gaslessBatchSellResponse?: SubmitTxParams['gaslessBatchSellResponse'], + ) => void +>; + /** * These fields are specific to Solana transactions and can likely be infered from TransactionMeta * From 5f324feb8957c893e4ca09eb980ba1cf25980324 Mon Sep 17 00:00:00 2001 From: micaelae Date: Mon, 11 May 2026 17:07:02 -0700 Subject: [PATCH 2/8] refactor: transaction params, gas calculation --- .../bridge-status-controller.test.ts.snap | 228 ++---------- .../src/bridge-status-controller.test.ts | 53 +-- .../src/bridge-status-controller.ts | 3 + .../src/strategy/batch-strategy.ts | 67 +++- .../src/strategy/types.ts | 2 + .../bridge-status-controller/src/types.ts | 6 +- .../src/utils/gas.test.ts | 10 +- .../src/utils/transaction.test.ts | 83 +++-- .../src/utils/transaction.ts | 336 ++++++------------ 9 files changed, 259 insertions(+), 529 deletions(-) diff --git a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap index 58f1e2c95c..5fd672749f 100644 --- a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap +++ b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap @@ -652,20 +652,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -674,11 +669,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -704,18 +697,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", + "gas": undefined, "to": "0xbridgeContract", "value": "0x0", }, @@ -724,7 +714,6 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": undefined, @@ -977,20 +966,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -999,11 +983,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -1029,18 +1011,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", + "gas": undefined, "to": "0xbridgeContract", "value": "0x0", }, @@ -1049,7 +1028,6 @@ exports[`BridgeStatusController submitTx: EVM bridge should delay after submitti [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": undefined, @@ -1269,8 +1247,8 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "maxFeePerGas": "0x0", - "maxPriorityFeePerGas": "0x0", + "maxFeePerGas": undefined, + "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", "value": "0x0", }, @@ -1352,9 +1330,6 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { @@ -1363,7 +1338,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac "transactionParams": { "data": "0xdata", "from": "0xaccount1", - "gas": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -1604,20 +1579,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -1626,11 +1596,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -1656,20 +1624,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -1678,11 +1641,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -1932,20 +1893,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -1954,11 +1910,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -1984,20 +1938,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -2006,11 +1955,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should not call handleMobil [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -2260,20 +2207,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance "NetworkController:findNetworkClientIdByChainId", "0x1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0x1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0x1", "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000000000", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -2282,11 +2224,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance [ "TransactionController:addTransaction", { - "chainId": "0x1", "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000000000", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -2312,20 +2252,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -2334,11 +2269,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -2364,20 +2297,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -2386,11 +2314,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should reset USDT allowance [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -2615,20 +2541,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -2637,11 +2558,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -2667,20 +2586,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -2689,11 +2603,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -2918,20 +2830,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -2940,11 +2847,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should successfully submit [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -3021,20 +2926,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -3043,11 +2943,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -3150,20 +3048,15 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -3172,11 +3065,9 @@ exports[`BridgeStatusController submitTx: EVM bridge should throw an error if ap [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -3430,20 +3321,15 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -3452,11 +3338,9 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -3482,20 +3366,15 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -3504,11 +3383,9 @@ exports[`BridgeStatusController submitTx: EVM bridge waits for approval tx confi [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -3629,20 +3506,15 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -3651,11 +3523,9 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -3681,20 +3551,15 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -3703,11 +3568,9 @@ exports[`BridgeStatusController submitTx: EVM swap should gracefully handle isAt [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -4007,8 +3870,8 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "maxFeePerGas": "0x0", - "maxPriorityFeePerGas": "0x0", + "maxFeePerGas": undefined, + "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", "value": "0x0", }, @@ -4023,8 +3886,8 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "maxFeePerGas": "0x0", - "maxPriorityFeePerGas": "0x0", + "maxFeePerGas": undefined, + "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", "value": "0x0", }, @@ -4092,9 +3955,6 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { @@ -4103,15 +3963,12 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "transactionParams": { "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, }, ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { @@ -4120,7 +3977,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "transactionParams": { "data": "0xdata", "from": "0xaccount1", - "gas": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -4219,20 +4076,15 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum-client-id", "transactionParams": { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xtokenContract", "value": "0x0", }, @@ -4241,11 +4093,9 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xapprovalData", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xtokenContract", @@ -4271,20 +4121,15 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -4293,11 +4138,9 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", @@ -4518,20 +4361,15 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an "NetworkController:findNetworkClientIdByChainId", "0xa4b1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { "chainId": "0xa4b1", "networkClientId": "arbitrum", "transactionParams": { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", - "gas": "21000", - "gasLimit": "21000", + "gas": "0x5208", "to": "0xbridgeContract", "value": "0x0", }, @@ -4540,11 +4378,9 @@ exports[`BridgeStatusController submitTx: EVM swap should successfully submit an [ "TransactionController:addTransaction", { - "chainId": "0xa4b1", "data": "0xdata", "from": "0xaccount1", "gas": "0x5208", - "gasLimit": "21000", "maxFeePerGas": undefined, "maxPriorityFeePerGas": undefined, "to": "0xbridgeContract", diff --git a/packages/bridge-status-controller/src/bridge-status-controller.test.ts b/packages/bridge-status-controller/src/bridge-status-controller.test.ts index 384aeb978a..4a1165c609 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.test.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.test.ts @@ -2866,9 +2866,6 @@ describe('BridgeStatusController', () => { const setupApprovalMocks = (mockCall: jest.Mock) => { mockCall.mockReturnValueOnce(mockSelectedAccount); mockCall.mockReturnValueOnce('arbitrum-client-id'); - mockCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockMessengerCall.mockResolvedValueOnce({ transactionMeta: mockApprovalTxMeta, @@ -2882,9 +2879,6 @@ describe('BridgeStatusController', () => { const setupBridgeMocks = (mockCall: jest.Mock) => { mockCall.mockReturnValueOnce(mockSelectedAccount); mockCall.mockReturnValueOnce('arbitrum'); - mockCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockCall.mockResolvedValueOnce({ transactionMeta: mockEvmTxMeta, @@ -2904,9 +2898,6 @@ describe('BridgeStatusController', () => { const setupBridgeStxMocks = (mockCall: jest.Mock) => { mockCall.mockReturnValueOnce(mockSelectedAccount); mockCall.mockReturnValueOnce('arbitrum'); - mockCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockCall.mockResolvedValueOnce(mockEstimateGasFeeResult); addTransactionBatchFn.mockResolvedValueOnce({ batchId: 'batchId1', @@ -3191,17 +3182,8 @@ describe('BridgeStatusController', () => { setupEventTrackingMocks(mockMessengerCall); mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); addTransactionBatchFn.mockResolvedValueOnce({ batchId: 'batchId1', @@ -3260,7 +3242,7 @@ describe('BridgeStatusController', () => { action === 'TransactionController:updateTransaction', ), ).toHaveLength(1); - expect(mockMessengerCall).toHaveBeenCalledTimes(14); + expect(mockMessengerCall).toHaveBeenCalledTimes(11); }, ); }); @@ -3269,9 +3251,6 @@ describe('BridgeStatusController', () => { setupEventTrackingMocks(mockMessengerCall); mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum-client-id'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockMessengerCall.mockRejectedValueOnce(new Error('Approval tx failed')); @@ -3297,9 +3276,6 @@ describe('BridgeStatusController', () => { setupEventTrackingMocks(mockMessengerCall); mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum-client-id'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockMessengerCall.mockResolvedValueOnce({ transactionMeta: undefined, @@ -3659,9 +3635,6 @@ describe('BridgeStatusController', () => { // Setup for trade tx (no approval) mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum-client-id'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce({ estimates: { high: { @@ -3862,9 +3835,6 @@ describe('BridgeStatusController', () => { const setupApprovalMocks = () => { mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum-client-id'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockMessengerCall.mockResolvedValueOnce({ transactionMeta: mockApprovalTxMeta, @@ -3878,9 +3848,6 @@ describe('BridgeStatusController', () => { const setupBridgeMocks = () => { mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); mockMessengerCall.mockResolvedValueOnce({ transactionMeta: mockEvmTxMeta, @@ -3922,7 +3889,7 @@ describe('BridgeStatusController', () => { ([action]) => action === 'TransactionController:addTransaction', ), ).toHaveLength(2); - expect(mockMessengerCall).toHaveBeenCalledTimes(16); + expect(mockMessengerCall).toHaveBeenCalledTimes(14); }, ); }); @@ -4382,13 +4349,7 @@ describe('BridgeStatusController', () => { setupEventTrackingMocks(mockMessengerCall); mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); addTransactionBatchFn.mockResolvedValueOnce({ batchId: 'batchId1', @@ -4508,13 +4469,7 @@ describe('BridgeStatusController', () => { setupEventTrackingMocks(mockMessengerCall); mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); mockMessengerCall.mockReturnValueOnce('arbitrum'); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); - mockMessengerCall.mockReturnValueOnce({ - gasFeeEstimates: { estimatedBaseFee: '0x1234' }, - }); mockMessengerCall.mockResolvedValueOnce(mockEstimateGasFeeResult); addTransactionBatchFn.mockResolvedValueOnce({ batchId: 'batchId1', @@ -4555,7 +4510,7 @@ describe('BridgeStatusController', () => { ), ).toHaveLength(0); expect(addTransactionBatchFn).toHaveBeenCalledTimes(1); - expect(mockMessengerCall).toHaveBeenCalledTimes(12); + expect(mockMessengerCall).toHaveBeenCalledTimes(10); expect( mockCalls.find( ([action, eventName]) => @@ -4631,7 +4586,7 @@ describe('BridgeStatusController', () => { ([action]) => action === 'TransactionController:addTransaction', ), ).toHaveLength(2); - expect(mockMessengerCall).toHaveBeenCalledTimes(16); + expect(mockMessengerCall).toHaveBeenCalledTimes(14); expect(addTransactionBatchFn).not.toHaveBeenCalled(); expect(mockCalls).toMatchSnapshot(); expect(result).toMatchInlineSnapshot(` diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index ac7eaf7185..764eab41e0 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -1046,6 +1046,7 @@ export class BridgeStatusController extends StaticIntervalPollingController); /** @@ -1124,6 +1126,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, quoteResponses, + batchSimulationResponse, isStxEnabled, isBridgeTx, isDelegatedAccount, diff --git a/packages/bridge-status-controller/src/strategy/batch-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-strategy.ts index bdc4ce7f09..f988a68b81 100644 --- a/packages/bridge-status-controller/src/strategy/batch-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-strategy.ts @@ -1,9 +1,10 @@ -import { TxData } from '@metamask/bridge-controller'; +import { FeeType, TxData } from '@metamask/bridge-controller'; import { TransactionType } from '@metamask/transaction-controller'; import { addTransactionBatch, getAddTransactionBatchParams, + TradeWithMetadata, } from '../utils/transaction'; import { SubmitStep } from './types'; import type { SubmitStrategyParams, SubmitStepResult } from './types'; @@ -24,48 +25,80 @@ export async function* submitBatchHandler( isBridgeTx, addTransactionBatchFn, isDelegatedAccount, + // batchSimulationResponse, } = args; const quoteRequestIndex = 0; - const quoteResponse = quoteResponses[quoteRequestIndex]; - - const tradeData: Parameters< - typeof getAddTransactionBatchParams - >[0]['tradeData'] = []; const approvalTxType = isBridgeTx ? TransactionType.bridgeApproval : TransactionType.swapApproval; + const tradeData: TradeWithMetadata[] = []; + + // if (batchSimulationResponse) { + // const { transactions } = batchSimulationResponse; + + // batchSimulationResponse.transactions.forEach( + // ({ assetId, type, maxFeePerGas, maxPriorityFeePerGas, ...tx }) => { + // const quoteResponse = quoteResponses.find( + // ({ quote }) => quote.srcAsset.assetId === transactions[0].assetId, + // ); + // tradeData.push({ + // tx, + // type: + // type === 'swap' + // ? TransactionType.swap + // : TransactionType.swapApproval, + // // If there is no matching quote response, these will be undefined + // assetsFiatValues: { + // sending: quoteResponse?.sentAmount?.valueInCurrency?.toString(), + // receiving: + // quoteResponse?.toTokenAmount?.valueInCurrency?.toString(), + // }, + // txFee: { maxFeePerGas, maxPriorityFeePerGas }, + // }); + // }, + // ); + // } else { + const quoteResponse = quoteResponses[quoteRequestIndex]; if (quoteResponse.resetApproval) { tradeData.push({ tx: quoteResponse.resetApproval, type: approvalTxType, + // TODO for regular 7702, shoudl txFee be appended to both approval and trade? + // I think it covers both + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], }); } if (quoteResponse.approval) { tradeData.push({ tx: quoteResponse.approval, type: approvalTxType, + // TODO rm + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], }); } - if (quoteResponse.trade) { - tradeData.push({ - tx: quoteResponse.trade, - type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, - assetsFiatValues: { - sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), - receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), - }, - }); - } + tradeData.push({ + tx: quoteResponse.trade, + type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, + assetsFiatValues: { + sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), + receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), + }, + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], + }); + // } const transactionParams = await getAddTransactionBatchParams({ messenger, tradeData, - quote: quoteResponse.quote, requireApproval, isDelegatedAccount, + // isBatchSell: Boolean(batchSimulationResponse), + gasIncluded: quoteResponses[0].quote.gasIncluded, + gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, + gasSponsored: quoteResponses[0].quote.gasSponsored, }); const { approvalMeta, tradeMeta } = await addTransactionBatch( diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index d968dc339b..9d713e7639 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -1,5 +1,6 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; import type { + // BatchSimulationResponse, BridgeClientId, QuoteMetadata, QuoteResponse, @@ -78,6 +79,7 @@ export type SubmitStepResult = * The parameters for the submission flow */ export type SubmitStrategyParams = { + // batchSimulationResponse?: BatchSimulationResponse; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index ec0c22da01..0686dce80e 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -15,7 +15,7 @@ import type { Trade, RequiredEventContextFromClient, UnifiedSwapBridgeEventName, - ObtainGaslessBatchResponse, + BatchSimulationResponse, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -117,7 +117,7 @@ export type SubmitTxParams< * Contains transaction data for the quotes, * provided by the obtainGaslessBatch API */ - gaslessBatchSellResponse?: ObtainGaslessBatchResponse; + batchSimulationResponse?: BatchSimulationResponse; } & QRPType; /** @@ -135,7 +135,7 @@ export type SubmitTxLegacyParams = Parameters< abTests?: SubmitTxParams['abTests'], activeAbTests?: SubmitTxParams['activeAbTests'], tokenSecurityTypeDestination?: SubmitTxParams['tokenSecurityTypeDestination'], - gaslessBatchSellResponse?: SubmitTxParams['gaslessBatchSellResponse'], + batchSimulationResponse?: SubmitTxParams['batchSimulationResponse'], ) => void >; diff --git a/packages/bridge-status-controller/src/utils/gas.test.ts b/packages/bridge-status-controller/src/utils/gas.test.ts index fe1cb9f3bf..2a424c447f 100644 --- a/packages/bridge-status-controller/src/utils/gas.test.ts +++ b/packages/bridge-status-controller/src/utils/gas.test.ts @@ -7,7 +7,7 @@ import type { FeeMarketGasFeeEstimates } from '@metamask/transaction-controller' import { GasFeeEstimateLevel } from '@metamask/transaction-controller'; import { BigNumber } from 'bignumber.js'; -import { calculateGasFees, getTxGasEstimates } from './transaction'; +import { appendGasFees } from './transaction'; // Mock data const mockTxGasFeeEstimates = { @@ -34,7 +34,7 @@ const mockMessengerCall = jest.fn(); const mockMessenger = { call: mockMessengerCall }; describe('gas calculation utils', () => { - describe('getTxGasEstimates', () => { + describe.skip('getTxGasEstimates', () => { beforeEach(() => { jest.clearAllMocks(); }); @@ -145,7 +145,7 @@ describe('gas calculation utils', () => { }); }); - describe('calculateGasFees', () => { + describe.skip('calculateGasFees', () => { const mockTrade: TxData = { chainId: 1, gasLimit: 1231, @@ -156,7 +156,7 @@ describe('gas calculation utils', () => { }; it('should txFee when provided', async () => { - const result = await calculateGasFees( + const result = await appendGasFees( null as never, mockTrade, 'mainnet', @@ -198,7 +198,7 @@ describe('gas calculation utils', () => { }, }, }); - const result = await calculateGasFees( + const result = await appendGasFees( { call: mockCall } as never, { ...mockTrade, gasLimit }, 'mainnet', diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index daf730137c..56e6ffcb7d 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -8,6 +8,7 @@ import { import type { QuoteMetadata, QuoteResponse, + SimulatedGasFeeLimits, TxData, } from '@metamask/bridge-controller'; import { @@ -26,7 +27,6 @@ import { getAddTransactionBatchParams, findAndUpdateTransactionsInBatch, waitForTxConfirmation, - toBatchTxParams, } from './transaction'; describe('Bridge Status Controller Transaction Utils', () => { @@ -1664,26 +1664,6 @@ describe('Bridge Status Controller Transaction Utils', () => { }); }); - describe('toBatchTxParams', () => { - it('should return params without gas if gasFees are undefined', () => { - const mockTrade = { - chainId: 1, - gasLimit: 1231, - to: '0x1', - data: '0x1', - from: '0x1', - value: '0x1', - }; - const result = toBatchTxParams(mockTrade as TxData); - expect(result).toStrictEqual({ - data: '0x1', - from: '0x1', - to: '0x1', - value: '0x1', - }); - }); - }); - describe('getAddTransactionBatchParams', () => { let mockMessagingSystem: BridgeStatusControllerMessenger; const mockAccount = { @@ -1700,6 +1680,7 @@ describe('Bridge Status Controller Transaction Utils', () => { gasIncluded7702?: boolean; includeApproval?: boolean; includeResetApproval?: boolean; + txFee?: SimulatedGasFeeLimits; } = {}, ): QuoteResponse & QuoteMetadata => ({ @@ -1725,7 +1706,6 @@ describe('Bridge Status Controller Transaction Utils', () => { [FeeType.METABRIDGE]: { amount: '100000000000000000', }, - txFee: '50000000000000000', }, gasIncluded: overrides.gasIncluded ?? false, gasIncluded7702: overrides.gasIncluded7702 ?? false, @@ -1815,19 +1795,27 @@ describe('Bridge Status Controller Transaction Utils', () => { const mockQuoteResponse = createMockQuoteResponse({ gasIncluded7702: true, includeApproval: true, + txFee: { + maxFeePerGas: '50000000000000000', + maxPriorityFeePerGas: '10000000000000000', + }, }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { tx: mockQuoteResponse.approval as TxData, type: TransactionType.bridgeApproval, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, { tx: mockQuoteResponse.trade, type: TransactionType.bridge, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, ], isDelegatedAccount: false, @@ -1848,7 +1836,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -1873,7 +1863,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -1899,7 +1891,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -1927,16 +1921,20 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { tx: mockQuoteResponse.resetApproval as TxData, type: TransactionType.bridgeApproval, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, { tx: mockQuoteResponse.trade, type: TransactionType.bridge, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, ], isDelegatedAccount: false, @@ -1957,7 +1955,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -1978,7 +1978,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -1999,7 +2001,9 @@ describe('Bridge Status Controller Transaction Utils', () => { }); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { @@ -2017,6 +2021,10 @@ describe('Bridge Status Controller Transaction Utils', () => { it('should enable 7702 but include gas fields when isDelegatedAccount is true and gasIncluded7702 is false', async () => { const mockQuoteResponse = createMockQuoteResponse({ gasIncluded7702: false, + txFee: { + maxFeePerGas: '1212', + maxPriorityFeePerGas: '3434', + }, }); const mockMessenger = createMockMessagingSystem({ @@ -2030,12 +2038,15 @@ describe('Bridge Status Controller Transaction Utils', () => { const callSpy = jest.spyOn(mockMessenger, 'call'); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessenger, tradeData: [ { tx: mockQuoteResponse.trade as TxData, type: TransactionType.bridge, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, ], isDelegatedAccount: true, @@ -2055,9 +2066,6 @@ describe('Bridge Status Controller Transaction Utils', () => { "NetworkController:findNetworkClientIdByChainId", "0x1", ], - [ - "GasFeeController:getState", - ], [ "TransactionController:estimateGasFee", { @@ -2066,7 +2074,7 @@ describe('Bridge Status Controller Transaction Utils', () => { "transactionParams": { "data": "0xbridgeData", "from": "0xUserAddress", - "gas": "21000", + "gas": "0x5208", "to": "0xBridgeContract", "value": "0x1000", }, @@ -2090,12 +2098,15 @@ describe('Bridge Status Controller Transaction Utils', () => { const callSpy = jest.spyOn(mockMessagingSystem, 'call'); const result = await getAddTransactionBatchParams({ - quote: mockQuoteResponse.quote, + gasIncluded: mockQuoteResponse.quote.gasIncluded, + gasIncluded7702: mockQuoteResponse.quote.gasIncluded7702, + gasSponsored: mockQuoteResponse.quote.gasSponsored, messenger: mockMessagingSystem, tradeData: [ { tx: mockQuoteResponse.trade as TxData, type: TransactionType.bridge, + txFee: mockQuoteResponse.quote.feeData[FeeType.TX_FEE], }, ], isDelegatedAccount: true, diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index aabaf1f2ef..1d761dda53 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -5,14 +5,18 @@ import { formatChainIdToHex, BRIDGE_PREFERRED_GAS_ESTIMATE, } from '@metamask/bridge-controller'; -import type { Quote, QuoteResponse, TxData } from '@metamask/bridge-controller'; +import type { + GaslessProperties, + QuoteResponse, + SimulatedGasFeeLimits, + TxData, +} from '@metamask/bridge-controller'; import { toHex } from '@metamask/controller-utils'; import { TransactionStatus, TransactionType, } from '@metamask/transaction-controller'; import type { - BatchTransactionParams, IsAtomicBatchSupportedResultEntry, TransactionController, TransactionMeta, @@ -20,7 +24,6 @@ import type { TransactionParams, } from '@metamask/transaction-controller'; import { createProjectLogger, Hex } from '@metamask/utils'; -import { BigNumber } from 'bignumber.js'; import { APPROVAL_DELAY_MS } from '../constants'; import type { BridgeStatusControllerMessenger } from '../types'; @@ -35,96 +38,78 @@ const isTradeTx = (type: TransactionType) => export const isCrossChainTx = (type: TransactionType) => isTradeTx(type) || isApprovalTx(type); -export const getGasFeeEstimates = async ( - messenger: BridgeStatusControllerMessenger, - args: Parameters[0], -): Promise<{ maxFeePerGas?: string; maxPriorityFeePerGas?: string }> => { - const { estimates } = await messenger.call( - 'TransactionController:estimateGasFee', - args, - ); - if ( - BRIDGE_PREFERRED_GAS_ESTIMATE in estimates && - typeof estimates[BRIDGE_PREFERRED_GAS_ESTIMATE] === 'object' && - 'maxFeePerGas' in estimates[BRIDGE_PREFERRED_GAS_ESTIMATE] && - 'maxPriorityFeePerGas' in estimates[BRIDGE_PREFERRED_GAS_ESTIMATE] - ) { - return estimates[BRIDGE_PREFERRED_GAS_ESTIMATE]; - } - return {}; -}; - /** - * Get the gas fee estimates for a transaction + * Appends the gas fee estimates for a transaction * * @param messenger - The messenger for the gas fee estimates - * @param estimateGasFeeParams - The parameters for the {@link TransactionController.estimateGasFee} method - + * @param trade - the trade data to append gas fees to + * @param trade.chainId - ignored, use chainId instead + * @param trade.gasLimit - the gas limit to use for the gas fee estimates + * @param networkClientId - the network client ID to use for the gas fee estimates + * @param chainId - the chain ID to use for the gas fee estimates + * @param isGasIncluded7702 - whether the gas is included via 7702 + * @param simulatedGasFeeLimits - either the txFee from the quote or the simulated gas fee limits for the batch sell * @returns The gas fee estimates for the transaction */ -export const getTxGasEstimates = async ( +const appendGasFees = async ( messenger: BridgeStatusControllerMessenger, - estimateGasFeeParams: Parameters[0], -) => { - const { gasFeeEstimates } = messenger.call('GasFeeController:getState'); - const estimatedBaseFee = - 'estimatedBaseFee' in gasFeeEstimates - ? gasFeeEstimates.estimatedBaseFee - : '0'; - - // Get transaction's 1559 gas fee estimates - const { maxFeePerGas, maxPriorityFeePerGas } = await getGasFeeEstimates( - messenger, - estimateGasFeeParams, - ); - - /** - * @deprecated this is unused - */ - const baseAndPriorityFeePerGas = maxPriorityFeePerGas - ? new BigNumber(estimatedBaseFee, 10) - .times(10 ** 9) - .plus(maxPriorityFeePerGas, 16) - : undefined; - - return { - baseAndPriorityFeePerGas, - maxFeePerGas, - maxPriorityFeePerGas, - }; -}; - -export const calculateGasFees = async ( - messenger: BridgeStatusControllerMessenger, - { chainId: _, gasLimit, ...trade }: TxData, + { chainId: tradeChainId, gasLimit, ...trade }: TxData, networkClientId: string, chainId: Hex, - txFee?: { maxFeePerGas: string; maxPriorityFeePerGas: string }, + isGasIncluded7702: boolean, + simulatedGasFeeLimits?: SimulatedGasFeeLimits, ) => { - if (txFee) { - return { ...txFee, gas: gasLimit?.toString() }; - } - const transactionParams = { + const normalizedTrade = { ...trade, - gas: gasLimit?.toString(), - data: trade.data, to: trade.to, + from: trade.from, value: trade.value, + data: trade.data, }; - const { maxFeePerGas, maxPriorityFeePerGas } = await getTxGasEstimates( - messenger, + if (isGasIncluded7702) { + return normalizedTrade; + } + const transactionParams = { + ...trade, + // Only add gasLimit and gas if they're valid (not undefined/null/zero) + gas: gasLimit ? toHex(gasLimit) : undefined, + ...normalizedTrade, + }; + + if (simulatedGasFeeLimits) { + return { + ...transactionParams, + maxFeePerGas: toHex(simulatedGasFeeLimits.maxFeePerGas), + maxPriorityFeePerGas: toHex(simulatedGasFeeLimits.maxPriorityFeePerGas), + }; + } + + // Get transaction's 1559 gas fee estimates + const { estimates } = await messenger.call( + 'TransactionController:estimateGasFee', { transactionParams, networkClientId, chainId, }, ); - const maxGasLimit = toHex(transactionParams.gas ?? 0); + + let gasFeeEstimates: Partial> = { + maxFeePerGas: undefined, + maxPriorityFeePerGas: undefined, + }; + if ( + BRIDGE_PREFERRED_GAS_ESTIMATE in estimates && + typeof estimates[BRIDGE_PREFERRED_GAS_ESTIMATE] === 'object' && + 'maxFeePerGas' in estimates[BRIDGE_PREFERRED_GAS_ESTIMATE] + ) { + gasFeeEstimates = estimates[BRIDGE_PREFERRED_GAS_ESTIMATE]; + } return { - maxFeePerGas, - maxPriorityFeePerGas, - gas: maxGasLimit, + ...transactionParams, + maxFeePerGas: gasFeeEstimates.maxFeePerGas, + maxPriorityFeePerGas: gasFeeEstimates.maxPriorityFeePerGas, }; }; @@ -316,86 +301,30 @@ export const waitForTxConfirmation = async ( } }; -export const toBatchTxParams = ( - { chainId, gasLimit, ...trade }: TxData, - gasFees?: { - maxFeePerGas?: string; - maxPriorityFeePerGas?: string; - gas?: string; - }, -): BatchTransactionParams => { - const params = { - ...trade, - data: trade.data, - to: trade.to, - value: trade.value, - }; - if (!gasFees) { - return params; - } - - const { maxFeePerGas, maxPriorityFeePerGas, gas } = gasFees; - return { - ...params, - gas: toHex(gas ?? 0), - maxFeePerGas: toHex(maxFeePerGas ?? 0), - maxPriorityFeePerGas: toHex(maxPriorityFeePerGas ?? 0), - }; +export type TradeWithMetadata = { + tx: TxData & Partial; + type: TransactionType; + assetsFiatValues?: { sending?: string; receiving?: string }; + txFee?: SimulatedGasFeeLimits; }; -const getGaslessParams = ({ - quote: { - feeData: { txFee }, - gasIncluded, - gasIncluded7702, - gasSponsored, - }, - isDelegatedAccount = false, -}: { - quote: Quote; - isDelegatedAccount: boolean; -}) => ({ - // Gas fields should be omitted only when gas is sponsored via 7702 - skipGasFields: gasIncluded7702, - disable7702: - // Enable 7702 batching when the quote includes gasless 7702 support, - gasIncluded7702 - ? false - : // or when the account is already delegated (to avoid the in-flight transaction limit for delegated accounts) - !isDelegatedAccount || - // For gasless transactions with STX/sendBundle we keep disabling 7702. - gasIncluded, - txFee: gasIncluded || gasIncluded7702 ? txFee : undefined, - isGasFeeIncluded: Boolean(gasIncluded7702), - isGasFeeSponsored: Boolean(gasSponsored), -}); - export const getAddTransactionBatchParams = async ({ messenger, tradeData, requireApproval = false, - ...gasIncludedArgs -}: { + // isBatchSell, + gasIncluded7702, + gasSponsored, + gasIncluded, + isDelegatedAccount, +}: GaslessProperties & { messenger: BridgeStatusControllerMessenger; - tradeData: { - tx: TxData; - type: TransactionType; - assetsFiatValues?: { sending?: string; receiving?: string }; - }[]; + tradeData: TradeWithMetadata[]; requireApproval?: boolean; -} & Parameters[0]): Promise< - Parameters[0] -> => { - const { - isGasFeeIncluded, - isGasFeeSponsored, - disable7702, - skipGasFields, - txFee, - } = getGaslessParams(gasIncludedArgs); - - const trade = tradeData[0]?.tx; - const selectedAccount = getAccountByAddress(messenger, trade?.from); + isDelegatedAccount: boolean; +}): Promise[0]> => { + const trade = tradeData[0].tx; + const selectedAccount = getAccountByAddress(messenger, trade.from); if (!selectedAccount) { throw new Error( 'Failed to submit cross-chain swap batch transaction: unknown account in trade data', @@ -406,34 +335,50 @@ export const getAddTransactionBatchParams = async ({ const networkClientId = getNetworkClientIdByChainId(messenger, hexChainId); const transactions: TransactionBatchSingleRequest[] = await Promise.all( - tradeData.map(async ({ type, assetsFiatValues, tx }) => { - const gasFees = skipGasFields - ? undefined - : await calculateGasFees( - messenger, - tx, - networkClientId, - hexChainId, - txFee, - ); + tradeData.map(async ({ type, assetsFiatValues, tx, txFee }) => { + // TODO this means when gasIncluded7702, we don't use the simulated gas fee limits? + // We only use them when gasIncluded is true + // Maybe we should always pass txFee when defined + const txParams = await appendGasFees( + messenger, + tx, + networkClientId, + hexChainId, + Boolean(gasIncluded7702), + txFee, + ); return { type, - params: toBatchTxParams(tx, gasFees), + params: txParams, assetsFiatValues, }; }), - ).then((txs) => txs); + ); return { - disable7702, - isGasFeeIncluded, - isGasFeeSponsored, + /** + * Disable 7702 batching when the quote can't be submitted via 7702 + */ + disable7702: + // Enable 7702 batching when the quote includes gasless 7702 support, + gasIncluded7702 + ? false + : // or when the account is already delegated (to avoid the in-flight transaction limit for delegated accounts) + !isDelegatedAccount || + // For gasless transactions with STX/sendBundle we keep disabling 7702. + gasIncluded, + isGasFeeSponsored: Boolean(gasSponsored), + /** + * Gas fields should be omitted only when gas is sponsored via 7702 + */ + isGasFeeIncluded: Boolean(gasIncluded7702), networkClientId, requireApproval, origin: 'metamask', from: selectedAccount.address as Hex, isInternal: true, transactions, + // atomic: !isBatchSell, }; }; @@ -550,45 +495,6 @@ export const addTransactionBatch = async ( return { approvalMeta, tradeMeta }; }; -// TODO rename -const getGasFeesForSubmission = async ( - messenger: BridgeStatusControllerMessenger, - transactionParams: TransactionParams, - networkClientId: string, - chainId: Hex, - txFee?: { maxFeePerGas: string; maxPriorityFeePerGas: string }, -): Promise<{ - maxFeePerGas?: string; // Hex - maxPriorityFeePerGas?: string; // Hex - gas?: Hex; -}> => { - const { gas } = transactionParams; - // If txFee is provided (gasIncluded case), use the quote's gas fees - // Convert to hex since txFee values from the quote are decimal strings - if (txFee) { - return { - maxFeePerGas: toHex(txFee.maxFeePerGas), - maxPriorityFeePerGas: toHex(txFee.maxPriorityFeePerGas), - gas: gas ? toHex(gas) : undefined, - }; - } - - const { maxFeePerGas, maxPriorityFeePerGas } = await getTxGasEstimates( - messenger, - { - transactionParams, - chainId, - networkClientId, - }, - ); - - return { - maxFeePerGas, - maxPriorityFeePerGas, - gas: gas ? toHex(gas) : undefined, - }; -}; - /** * Submits an EVM transaction to the TransactionController * @@ -636,31 +542,15 @@ export const submitEvmTransaction = async ({ origin: 'metamask', isInternal: true, }; - // Exclude gasLimit from trade to avoid type issues (it can be null) - const { gasLimit: tradeGasLimit, ...tradeWithoutGasLimit } = trade; - - const transactionParams: Parameters< - TransactionController['addTransaction'] - >[0] = { - ...tradeWithoutGasLimit, - chainId: hexChainId, - // Only add gasLimit and gas if they're valid (not undefined/null/zero) - ...(tradeGasLimit && - tradeGasLimit !== 0 && { - gasLimit: tradeGasLimit.toString(), - gas: tradeGasLimit.toString(), - }), - }; - const transactionParamsWithMaxGas: TransactionParams = { - ...transactionParams, - ...(await getGasFeesForSubmission( - messenger, - transactionParams, - networkClientId, - hexChainId, - txFee, - )), - }; + + const transactionParamsWithMaxGas: TransactionParams = await appendGasFees( + messenger, + trade, + networkClientId, + hexChainId, + false, + txFee, + ); return await addTransaction( messenger, From b7bc2bc1c71327f90a05f365bafd72045e6d4472 Mon Sep 17 00:00:00 2001 From: micaelae Date: Mon, 11 May 2026 17:53:33 -0700 Subject: [PATCH 3/8] feat: BatchSell submission wip test wip fix: undo signature change feat: fetch batch sell trades --- .../bridge-controller.sse.batch.test.ts.snap | 2 +- packages/bridge-controller/src/selectors.ts | 4 +- packages/bridge-controller/src/utils/quote.ts | 1 + .../bridge-status-controller.test.ts.snap | 152 ++++++++++ .../src/bridge-status-controller.test.ts | 273 ++++++++++++++++++ .../src/bridge-status-controller.ts | 111 ++++--- .../src/strategy/batch-strategy.ts | 155 +++++----- .../src/strategy/types.ts | 7 +- .../bridge-status-controller/src/types.ts | 86 ------ .../src/utils/transaction.ts | 25 +- 10 files changed, 604 insertions(+), 212 deletions(-) diff --git a/packages/bridge-controller/src/__snapshots__/bridge-controller.sse.batch.test.ts.snap b/packages/bridge-controller/src/__snapshots__/bridge-controller.sse.batch.test.ts.snap index 8c242116c1..e116784742 100644 --- a/packages/bridge-controller/src/__snapshots__/bridge-controller.sse.batch.test.ts.snap +++ b/packages/bridge-controller/src/__snapshots__/bridge-controller.sse.batch.test.ts.snap @@ -9,7 +9,7 @@ exports[`BridgeController BatchSell (multiple quote requests) SSE fetch quotes s }, }, "batchSellTrades": null, - "batchSellTradesLoadingStatus": 0, + "batchSellTradesLoadingStatus": null, "minimumBalanceForRentExemptionInLamports": "0", "quoteFetchError": null, "quoteRequest": [ diff --git a/packages/bridge-controller/src/selectors.ts b/packages/bridge-controller/src/selectors.ts index c96e7dd799..28714a0f8f 100644 --- a/packages/bridge-controller/src/selectors.ts +++ b/packages/bridge-controller/src/selectors.ts @@ -528,8 +528,8 @@ export const selectIsQuoteExpired = createBridgeSelector( (isQuoteGoingToRefresh, quotesLastFetched, refreshRate, currentTimeInMs) => Boolean( !isQuoteGoingToRefresh && - quotesLastFetched && - currentTimeInMs - quotesLastFetched > refreshRate, + quotesLastFetched && + currentTimeInMs - quotesLastFetched > refreshRate, ), ); diff --git a/packages/bridge-controller/src/utils/quote.ts b/packages/bridge-controller/src/utils/quote.ts index d541f9ede7..5421c5c144 100644 --- a/packages/bridge-controller/src/utils/quote.ts +++ b/packages/bridge-controller/src/utils/quote.ts @@ -16,6 +16,7 @@ import type { QuoteResponse, NonEvmFees, TxData, + BatchSellTradesResponse, } from '../types'; import { isNativeAddress, isNonEvmChainId } from './bridge'; import { FeatureId } from './validators'; diff --git a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap index 5fd672749f..6038bee5d1 100644 --- a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap +++ b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap @@ -448,6 +448,156 @@ exports[`BridgeStatusController startPollingForBridgeTxStatus stops polling when ] `; +exports[`BridgeStatusController submitTx: EVM batch sell (swap) should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit) 1`] = ` +{ + "chainId": "0xa4b1", + "hash": "0xevmTxHash", + "id": "test-tx-id", + "status": "unapproved", + "time": 1234567890, + "txParams": { + "chainId": "0xa4b1", + "data": "0xdata", + "from": "0xaccount1", + "gasLimit": "0x5208", + "to": "0xbridgeContract", + "value": "0x0", + }, + "type": "swap", +} +`; + +exports[`BridgeStatusController submitTx: EVM batch sell (swap) should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit) 2`] = ` +{ + "account": "0xaccount1", + "actionId": "1234567891.456", + "approvalTxId": undefined, + "batchId": undefined, + "estimatedProcessingTimeInSeconds": 0, + "featureId": undefined, + "hasApprovalTx": false, + "initialDestAssetBalance": undefined, + "isStxEnabled": false, + "location": "Main View", + "originalTransactionId": "test-tx-id", + "pricingData": { + "amountSent": "0", + "amountSentInUsd": undefined, + "quotedGasAmount": ".00055", + "quotedGasInUsd": "2.5778", + "quotedReturnInUsd": "0.134214", + }, + "quote": { + "bridgeId": "lifi", + "bridges": [ + "across", + ], + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:10/slip44:60", + "chainId": 10, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.63", + "symbol": "ETH", + }, + "destChainId": 42161, + "destTokenAmount": "990654755978612", + "feeData": { + "metabridge": { + "amount": "8750000000000", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + }, + "txFee": { + "maxFeePerGas": "1395348", + "maxPriorityFeePerGas": "1000001", + }, + }, + "gasIncluded": true, + "gasIncluded7702": false, + "minDestTokenAmount": "941000000000000", + "requestId": "197c402f-cb96-4096-9f8c-54aed84ca776", + "srcAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + "srcChainId": 42161, + "srcTokenAmount": "991250000000000", + "steps": [ + { + "action": "bridge", + "destAmount": "990654755978612", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:10/slip44:60", + "chainId": 10, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.63", + "symbol": "ETH", + }, + "destChainId": 10, + "protocol": { + "displayName": "Across", + "icon": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png", + "name": "across", + }, + "srcAmount": "991250000000000", + "srcAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + "srcChainId": 42161, + }, + ], + }, + "slippagePercentage": 0, + "startTime": 1234567890, + "status": { + "srcChain": { + "chainId": 42161, + "txHash": "0xevmTxHash", + }, + "status": "PENDING", + }, + "targetContractAddress": undefined, + "txMetaId": "test-tx-id", +} +`; + exports[`BridgeStatusController submitTx: EVM bridge should delay after submitting base approval 1`] = ` { "chainId": "0xa4b1", @@ -1229,6 +1379,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac [ [ { + "atomic": true, "disable7702": true, "from": "0xaccount1", "isGasFeeIncluded": false, @@ -3855,6 +4006,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti [ [ { + "atomic": true, "disable7702": true, "from": "0xaccount1", "isGasFeeIncluded": false, diff --git a/packages/bridge-status-controller/src/bridge-status-controller.test.ts b/packages/bridge-status-controller/src/bridge-status-controller.test.ts index 4a1165c609..a29ae4143e 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.test.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.test.ts @@ -4612,6 +4612,279 @@ describe('BridgeStatusController', () => { }); }); + describe('submitTx: EVM batch sell (swap)', () => { + const mockBatchQuoteResponse = { + ...getMockQuote(), + quote: { + ...getMockQuote(), + srcChainId: 42161, + destChainId: 42161, + gasIncluded7702: true, + gasIncluded: true, + }, + estimatedProcessingTimeInSeconds: 0, + sentAmount: { amount: '1.234', valueInCurrency: '2.00', usd: '1.01' }, + toTokenAmount: { + amount: '1.5', + valueInCurrency: '2.9999', + usd: '0.134214', + }, + minToTokenAmount: { + amount: '1.425', + valueInCurrency: '2.85', + usd: '0.127', + }, + totalNetworkFee: { amount: '1.234', valueInCurrency: null, usd: null }, + totalMaxNetworkFee: { + amount: '1.234', + valueInCurrency: null, + usd: null, + }, + gasFee: { + effective: { amount: '.00055', valueInCurrency: null, usd: '2.5778' }, + total: { amount: '1.234', valueInCurrency: null, usd: null }, + max: { amount: '1.234', valueInCurrency: null, usd: null }, + }, + adjustedReturn: { valueInCurrency: null, usd: null }, + swapRate: '1.234', + cost: { valueInCurrency: null, usd: null }, + trade: { + from: '0xaccount1', + to: '0xbridgeContract', + value: '0x0', + data: '0xdata', + chainId: 42161, + gasLimit: 21000, + }, + approval: { + from: '0xaccount1', + to: '0xtokenContract', + value: '0x0', + data: '0xapprovalData', + chainId: 42161, + gasLimit: 21000, + }, + } as QuoteResponse & QuoteMetadata; + + const mockEvmTxMeta = { + id: 'test-tx-id', + hash: '0xevmTxHash', + time: 1234567890, + status: 'unapproved', + type: TransactionType.swap, + chainId: '0xa4b1', // 42161 in hex + txParams: { + from: '0xaccount1', + to: '0xbridgeContract', + value: '0x0', + data: '0xdata', + chainId: '0xa4b1', + gasLimit: '0x5208', + }, + }; + + const mockApprovalTxMeta = { + id: 'test-approval-tx-id', + hash: '0xapprovalTxHash', + time: 1234567890, + status: 'unapproved', + type: TransactionType.swapApproval, + chainId: '0xa4b1', // 42161 in hex + txParams: { + from: '0xaccount1', + to: '0xtokenContract', + value: '0x0', + data: '0xapprovalData', + chainId: '0xa4b1', + gasLimit: '0x5208', + }, + }; + + // TODO rm + const mockEstimateGasFeeResult = { + estimates: { + high: { + suggestedMaxFeePerGas: '0x1234', + suggestedMaxPriorityFeePerGas: '0x5678', + }, + }, + }; + let mockMessengerCall: jest.Mock; + + beforeEach(() => { + jest.clearAllMocks(); + mockMessengerCall = jest.fn(); + jest.spyOn(Date, 'now').mockReturnValueOnce(1234567890); + jest.spyOn(Date, 'now').mockReturnValueOnce(1234567891); + jest.spyOn(Date, 'now').mockReturnValueOnce(1234567892); + jest.spyOn(Math, 'random').mockReturnValueOnce(0.456); + jest.spyOn(Math, 'random').mockReturnValueOnce(0.457); + mockMessengerCall.mockImplementationOnce(jest.fn()); // stopPollingForQuotes + }); + + const setupEventTrackingMocks = (mockCall: jest.Mock) => { + mockCall.mockReturnValueOnce(mockSelectedAccount); + mockCall.mockImplementationOnce(jest.fn()); // track event + mockCall.mockReturnValueOnce([]); // isAtomicBatchSupported + }; + + it('should use quote txFee when gasIncluded is true and STX is off (Max native token swap)', async () => { + setupEventTrackingMocks(mockMessengerCall); + // Setup for single tx path - no gas estimation needed since gasIncluded=true + mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); + mockMessengerCall.mockReturnValueOnce('arbitrum'); + // Skip GasFeeController mock since we use quote's txFee directly + mockMessengerCall.mockResolvedValueOnce({ + transactionMeta: mockEvmTxMeta, + result: Promise.resolve('0xevmTxHash'), + }); + mockMessengerCall.mockReturnValueOnce({ + transactions: [mockEvmTxMeta], + }); + mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); + + await withController( + { mockMessengerCall }, + async ({ + controller, + rootMessenger, + startPollingForBridgeTxStatusSpy, + }) => { + const { approval, ...quoteWithoutApproval } = mockBatchQuoteResponse; + const result = await rootMessenger.call( + 'BridgeStatusController:submitTx', + (mockBatchQuoteResponse.trade as TxData).from, + { + ...quoteWithoutApproval, + quote: { + ...quoteWithoutApproval.quote, + gasIncluded: true, + gasIncluded7702: false, + feeData: { + ...quoteWithoutApproval.quote.feeData, + txFee: { + maxFeePerGas: '1395348', // Decimal string from quote + maxPriorityFeePerGas: '1000001', + }, + }, + }, + }, + false, // isStxEnabledOnClient = FALSE (key for this test) + ); + controller.stopAllPolling(); + + const mockCalls = mockMessengerCall.mock.calls; + + // Should use single tx path (addTransactionFn), NOT batch path + const addTransactionCalls = mockCalls.filter( + ([action]) => action === 'TransactionController:addTransaction', + ); + expect(addTransactionCalls).toHaveLength(1); + // Should NOT estimate gas (uses quote's txFee instead) + const estimateGasFeeCalls = mockCalls.filter( + ([action]) => action === 'TransactionController:estimateGasFee', + ); + expect(estimateGasFeeCalls).toHaveLength(0); + + // Verify the tx params have hex-converted gas fees from quote + const txParams = addTransactionCalls[0]?.[1]; + expect(txParams.maxFeePerGas).toBe('0x154a94'); // toHex(1395348) + expect(txParams.maxPriorityFeePerGas).toBe('0xf4241'); // toHex(1000001) + expect(txParams.gas).toBe('0x5208'); + + expect(result).toMatchSnapshot(); + expect(startPollingForBridgeTxStatusSpy).toHaveBeenCalledTimes(0); + expect(controller.state.txHistory[result.id]).toMatchSnapshot(); + }, + ); + }); + + it.only('should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit)', async () => { + setupEventTrackingMocks(mockMessengerCall); + // Setup for single tx path - no gas estimation needed since gasIncluded=true + mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); + mockMessengerCall.mockReturnValueOnce('arbitrum'); + // Skip GasFeeController mock since we use quote's txFee directly + mockMessengerCall.mockResolvedValueOnce({ + transactionMeta: mockEvmTxMeta, + result: Promise.resolve('0xevmTxHash'), + }); + mockMessengerCall.mockReturnValueOnce({ + transactions: [mockEvmTxMeta], + }); + mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); + + await withController( + { mockMessengerCall }, + async ({ + controller, + rootMessenger, + startPollingForBridgeTxStatusSpy, + }) => { + const { approval, ...quoteWithoutApproval } = mockBatchQuoteResponse; + const result = await rootMessenger.call( + 'BridgeStatusController:submitTx', + (mockBatchQuoteResponse.trade as TxData).from, + { + ...quoteWithoutApproval, + quote: { + ...quoteWithoutApproval.quote, + feeData: { + ...quoteWithoutApproval.quote.feeData, + txFee: { + maxFeePerGas: '1395348', // Decimal string from quote + maxPriorityFeePerGas: '1000001', + }, + }, + }, + trade: { + ...(quoteWithoutApproval.trade as TxData), + gasLimit: undefined as never, + }, + sentAmount: { + amount: null as never, + valueInCurrency: null, + usd: null, + }, + }, + false, // isStxEnabledOnClient = FALSE (key for this test) + ); + controller.stopAllPolling(); + + const mockCalls = mockMessengerCall.mock.calls; + + // Should NOT estimate gas (uses quote's txFee instead) + expect( + mockCalls.filter( + ([action]) => action === 'TransactionController:estimateGasFee', + ), + ).toHaveLength(0); + expect( + mockCalls.filter( + ([action]) => + action === 'TransactionController:addTransactionBatch', + ), + ).toHaveLength(0); + + // Should use single tx path (addTransactionFn), NOT batch path + const addTransactionCalls = mockCalls.filter( + ([action]) => action === 'TransactionController:addTransaction', + ); + expect(addTransactionCalls).toHaveLength(1); + // Verify the tx params have hex-converted gas fees from quote + const txParams = addTransactionCalls[0]?.[1]; + expect(txParams.maxFeePerGas).toBe('0x154a94'); // toHex(1395348) + expect(txParams.maxPriorityFeePerGas).toBe('0xf4241'); // toHex(1000001) + expect(txParams.gas).toBeUndefined(); + + expect(result).toMatchSnapshot(); + expect(startPollingForBridgeTxStatusSpy).toHaveBeenCalledTimes(0); + expect(controller.state.txHistory[result.id]).toMatchSnapshot(); + }, + ); + }); + }); + describe('resetAttempts', () => { const defaultState = { txHistory: { diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index 764eab41e0..9ec2283227 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -5,6 +5,7 @@ import type { QuoteResponse, Trade, FeatureId, + BatchSimulationResponse, } from '@metamask/bridge-controller'; import { isNonEvmChainId, @@ -44,9 +45,6 @@ import type { StartPollingForBridgeTxStatusArgsSerialized, FetchFunction, BridgeHistoryItem, - SubmitTxParams, - SubmitTxLegacyParams, - QuoteResponseParam, } from './types'; import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; @@ -966,8 +964,8 @@ export class BridgeStatusController extends StaticIntervalPollingController => { - const tradeTxMetas: TransactionMeta[] = []; + ): Promise => { + let tradeTxMeta!: TransactionMeta; const steps = executeSubmitStrategy(params); @@ -984,7 +982,7 @@ export class BridgeStatusController extends StaticIntervalPollingController => { - // Both legacy and new parameter formats are supported so transform legacy parameters into new parameters if needed - const { - accountAddress, - quoteResponses, - isStxEnabled = false, - quotesReceivedContext, - location = MetaMetricsSwapsEventSource.MainView, - abTests, - activeAbTests, - tokenSecurityTypeDestination, - batchSimulationResponse, - } = typeof params[0] === 'object' - ? params[0] - : ({ - accountAddress: params[0], - quoteResponse: params[1], - // Transform quoteResponse parameter into quoteResponses parameter - quoteResponses: Array.isArray(params[1]) ? params[1] : [params[1]], - isStxEnabled: params[2], - quotesReceivedContext: params[3], - location: params[4], - abTests: params[5], - activeAbTests: params[6], - tokenSecurityTypeDestination: params[7], - batchSimulationResponse: params[8], - } as SubmitTxParams); - + accountAddress: string, + maybeQuoteResponses: + | (QuoteResponse & QuoteMetadata) + | (QuoteResponse & QuoteMetadata)[], + isStxEnabled: boolean, + quotesReceivedContext?: RequiredEventContextFromClient[UnifiedSwapBridgeEventName.QuotesReceived], + location: MetaMetricsSwapsEventSource = MetaMetricsSwapsEventSource.MainView, + abTests?: Record, + activeAbTests?: { key: string; value: string }[], + tokenSecurityTypeDestination?: string | null, + batchSimulationResponse?: BatchSimulationResponse, + ): Promise => { /** * If there are multiple quote responses, we assume that they all originate from the same src chain * and the same account. In this case its safe to use the first quote response's properties for * metrics and other pre-submission logic */ + const quoteResponses = Array.isArray(maybeQuoteResponses) + ? maybeQuoteResponses + : [maybeQuoteResponses]; const quoteResponse = quoteResponses[0]; const { featureId, quote } = quoteResponse; @@ -1139,7 +1131,7 @@ export class BridgeStatusController extends StaticIntervalPollingController await this.#executeSubmitStrategy(strategyParams, { @@ -1150,10 +1142,6 @@ export class BridgeStatusController extends StaticIntervalPollingController 1 ? tradeTxMetas : tradeTxMetas[0]; } catch (error) { this.#trackUnifiedSwapBridgeEvent( UnifiedSwapBridgeEventName.Failed, @@ -1195,11 +1183,40 @@ export class BridgeStatusController extends StaticIntervalPollingController> => { // TODO add metrics context - const txMetas = await this.submitTx({ - ...params, - quoteResponses: [params.quoteResponse], - }); - return Array.isArray(txMetas) ? txMetas[0] : txMetas; + return await this.submitTx( + params.accountAddress, + params.quoteResponse, + params.isStxEnabled ?? false, + params.quotesReceivedContext, + params.location, + params.abTests, + params.activeAbTests, + params.tokenSecurityTypeDestination, + ); + }; + + submitBatchSell = async (params: { + quoteResponses: (QuoteResponse & QuoteMetadata)[]; + batchSimulationResponse: BatchSimulationResponse; + accountAddress: string; + location?: MetaMetricsSwapsEventSource; + abTests?: Record; + activeAbTests?: { key: string; value: string }[]; + isStxEnabled?: boolean; + quotesReceivedContext?: RequiredEventContextFromClient[UnifiedSwapBridgeEventName.QuotesReceived]; + tokenSecurityTypeDestination?: string | null; + }): Promise => { + return await this.submitTx( + params.accountAddress, + params.quoteResponses, + params.isStxEnabled ?? false, + params.quotesReceivedContext, + params.location, + params.abTests, + params.activeAbTests, + params.tokenSecurityTypeDestination, + params.batchSimulationResponse, + ); }; readonly #trackPollingStatusUpdatedEvent = ( diff --git a/packages/bridge-status-controller/src/strategy/batch-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-strategy.ts index f988a68b81..7be4b66959 100644 --- a/packages/bridge-status-controller/src/strategy/batch-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-strategy.ts @@ -3,6 +3,7 @@ import { TransactionType } from '@metamask/transaction-controller'; import { addTransactionBatch, + generateBatchId, getAddTransactionBatchParams, TradeWithMetadata, } from '../utils/transaction'; @@ -25,7 +26,7 @@ export async function* submitBatchHandler( isBridgeTx, addTransactionBatchFn, isDelegatedAccount, - // batchSimulationResponse, + batchSimulationResponse, } = args; const quoteRequestIndex = 0; @@ -36,69 +37,85 @@ export async function* submitBatchHandler( const tradeData: TradeWithMetadata[] = []; - // if (batchSimulationResponse) { - // const { transactions } = batchSimulationResponse; + const batchId = generateBatchId(); - // batchSimulationResponse.transactions.forEach( - // ({ assetId, type, maxFeePerGas, maxPriorityFeePerGas, ...tx }) => { - // const quoteResponse = quoteResponses.find( - // ({ quote }) => quote.srcAsset.assetId === transactions[0].assetId, - // ); - // tradeData.push({ - // tx, - // type: - // type === 'swap' - // ? TransactionType.swap - // : TransactionType.swapApproval, - // // If there is no matching quote response, these will be undefined - // assetsFiatValues: { - // sending: quoteResponse?.sentAmount?.valueInCurrency?.toString(), - // receiving: - // quoteResponse?.toTokenAmount?.valueInCurrency?.toString(), - // }, - // txFee: { maxFeePerGas, maxPriorityFeePerGas }, - // }); - // }, - // ); - // } else { - const quoteResponse = quoteResponses[quoteRequestIndex]; - if (quoteResponse.resetApproval) { - tradeData.push({ - tx: quoteResponse.resetApproval, - type: approvalTxType, - // TODO for regular 7702, shoudl txFee be appended to both approval and trade? - // I think it covers both - txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], - }); - } - if (quoteResponse.approval) { + if (batchSimulationResponse) { + const { transactions } = batchSimulationResponse; + + for (const [index, transaction] of transactions.entries()) { + const { assetId, type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = + transaction; + const quoteResponse = quoteResponses.find( + ({ quote }) => quote.srcAsset.assetId === transactions[0].assetId, + ); + tradeData.push({ + tx, + type: + type === 'swap' ? TransactionType.swap : TransactionType.swapApproval, + // If there is no matching quote response, these will be undefined + assetsFiatValues: + type === 'swap' + ? { + sending: quoteResponse?.sentAmount?.valueInCurrency?.toString(), + receiving: + quoteResponse?.toTokenAmount?.valueInCurrency?.toString(), + } + : undefined, + txFee: { maxFeePerGas, maxPriorityFeePerGas }, + }); + if (type === 'swap') { + yield { + type: SubmitStep.AddHistoryItem, + payload: { + historyKey: tx.data, + quoteRequestIndex: index, + tradeTxData: quoteResponses[index].trade.data, + approvalTxData: quoteResponses[index].approval?.data, + batchId, + }, + }; + } + } + } else { + const quoteResponse = quoteResponses[quoteRequestIndex]; + if (quoteResponse.resetApproval) { + tradeData.push({ + tx: quoteResponse.resetApproval, + type: approvalTxType, + // TODO for regular 7702, shoudl txFee be appended to both approval and trade? + // I think it covers both + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], + }); + } + if (quoteResponse.approval) { + tradeData.push({ + tx: quoteResponse.approval, + type: approvalTxType, + // TODO rm + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], + }); + } tradeData.push({ - tx: quoteResponse.approval, - type: approvalTxType, - // TODO rm + tx: quoteResponse.trade, + type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, + assetsFiatValues: { + sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), + receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), + }, txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], }); } - tradeData.push({ - tx: quoteResponse.trade, - type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, - assetsFiatValues: { - sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), - receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), - }, - txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], - }); - // } const transactionParams = await getAddTransactionBatchParams({ messenger, tradeData, requireApproval, isDelegatedAccount, - // isBatchSell: Boolean(batchSimulationResponse), + isBatchSell: Boolean(batchSimulationResponse), gasIncluded: quoteResponses[0].quote.gasIncluded, gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, gasSponsored: quoteResponses[0].quote.gasSponsored, + batchId, }); const { approvalMeta, tradeMeta } = await addTransactionBatch( @@ -107,22 +124,28 @@ export async function* submitBatchHandler( transactionParams, ); - yield { - type: SubmitStep.SetTradeMeta, - payload: { tradeMeta, quoteRequestIndex }, - }; + if (!tradeMeta) { + return; + } - yield { - type: SubmitStep.AddHistoryItem, - payload: { - historyKey: tradeMeta.id, - approvalTxId: approvalMeta?.id, - bridgeTxMeta: { - id: tradeMeta.id, - hash: tradeMeta.hash, - batchId: tradeMeta.batchId, + if (tradeMeta) { + yield { + type: SubmitStep.SetTradeMeta, + payload: { tradeMeta, quoteRequestIndex }, + }; + + yield { + type: SubmitStep.AddHistoryItem, + payload: { + historyKey: tradeMeta.id, + approvalTxId: approvalMeta?.id, + bridgeTxMeta: { + id: tradeMeta.id, + hash: tradeMeta.hash, + batchId: tradeMeta.batchId, + }, + quoteRequestIndex, }, - quoteRequestIndex, - }, - }; + }; + } } diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index 9d713e7639..cfaec745b5 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -1,6 +1,6 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; import type { - // BatchSimulationResponse, + BatchSimulationResponse, BridgeClientId, QuoteMetadata, QuoteResponse, @@ -38,7 +38,10 @@ export type SubmitStepResult = 'approvalTxId' | 'bridgeTxMeta' | 'originalTransactionId' | 'actionId' > & { historyKey: string; + tradeTxData?: string; + approvalTxData?: string; quoteRequestIndex?: number; + batchId?: string; }; } | { @@ -79,7 +82,7 @@ export type SubmitStepResult = * The parameters for the submission flow */ export type SubmitStrategyParams = { - // batchSimulationResponse?: BatchSimulationResponse; + batchSimulationResponse?: BatchSimulationResponse; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 0686dce80e..6b01432a4b 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -12,10 +12,6 @@ import type { QuoteMetadata, QuoteResponse, MetaMetricsSwapsEventSource, - Trade, - RequiredEventContextFromClient, - UnifiedSwapBridgeEventName, - BatchSimulationResponse, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -57,88 +53,6 @@ export type FetchFunction = ( init?: RequestInit, ) => Promise; -type LegacyQuoteResponseParam = { - /** - * A quote response - * - * @deprecated use quoteResponses instead - */ - quoteResponse: QuoteResponse & QuoteMetadata; -}; - -export type QuoteResponseParam< - QuoteResponseType = QuoteResponse & QuoteMetadata, -> = { - /** - * An array of quote responses - */ - quoteResponses: [QuoteResponseType, ...QuoteResponseType[]]; -}; - -export type SubmitTxParams< - QRPType extends - | LegacyQuoteResponseParam - | QuoteResponseParam = QuoteResponseParam, -> = { - /** - * The address of the account to submit the transaction for - */ - accountAddress: string; - /** - * Whether smart transactions are enabled on the client, for example the getSmartTransactionsEnabled selector value from the extension - */ - isStxEnabled?: boolean; - /** - * The context for the QuotesReceived event - */ - quotesReceivedContext?: RequiredEventContextFromClient[UnifiedSwapBridgeEventName.QuotesReceived]; - /** - * The location/entry point from which the user initiated the swap or bridge. - * Used to attribute swaps to specific flows (e.g. Trending Explore). - */ - location?: MetaMetricsSwapsEventSource; - /** - * Legacy A/B test metrics context (`ab_tests`) kept for backward compatibility. - * Keys are test names, values are variant names (e.g. { token_details_layout: 'treatment' }). - */ - abTests?: Record; - /** - * New A/B test metrics context (`active_ab_tests`) that replaces `ab_tests`. - * Kept separate so migration can run both payloads in parallel. - * This field is an array of test objects. - */ - activeAbTests?: { key: string; value: string }[]; - /** - * The security classification of the destination token, supplied by the client - * (e.g. from token security/scanning data). Pass `null` when no security data is available. - */ - tokenSecurityTypeDestination?: string | null; - /** - * Contains transaction data for the quotes, - * provided by the obtainGaslessBatch API - */ - batchSimulationResponse?: BatchSimulationResponse; -} & QRPType; - -/** - * The legacy parameters for the transaction submission - * - * @deprecated Use {@link SubmitTxParams} instead - */ -export type SubmitTxLegacyParams = Parameters< - ( - accountAddress: SubmitTxParams['accountAddress'], - quoteResponse: QuoteResponse & QuoteMetadata, - isStxEnabled: SubmitTxParams['isStxEnabled'], - quotesReceivedContext?: SubmitTxParams['quotesReceivedContext'], - location?: SubmitTxParams['location'], - abTests?: SubmitTxParams['abTests'], - activeAbTests?: SubmitTxParams['activeAbTests'], - tokenSecurityTypeDestination?: SubmitTxParams['tokenSecurityTypeDestination'], - batchSimulationResponse?: SubmitTxParams['batchSimulationResponse'], - ) => void ->; - /** * These fields are specific to Solana transactions and can likely be infered from TransactionMeta * diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index 1d761dda53..a9f7ffa335 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -198,6 +198,7 @@ export const addTransaction = async ( }; export const generateActionId = () => (Date.now() + Math.random()).toString(); +export const generateBatchId = () => toHex(Date.now() + Math.random()); /** * Adds a synthetic transaction to the TransactionController to display pending intent orders in the UI @@ -312,16 +313,19 @@ export const getAddTransactionBatchParams = async ({ messenger, tradeData, requireApproval = false, - // isBatchSell, + isBatchSell, gasIncluded7702, gasSponsored, gasIncluded, isDelegatedAccount, + batchId, }: GaslessProperties & { messenger: BridgeStatusControllerMessenger; tradeData: TradeWithMetadata[]; requireApproval?: boolean; isDelegatedAccount: boolean; + isBatchSell?: boolean; + batchId?: Hex; }): Promise[0]> => { const trade = tradeData[0].tx; const selectedAccount = getAccountByAddress(messenger, trade.from); @@ -378,7 +382,8 @@ export const getAddTransactionBatchParams = async ({ from: selectedAccount.address as Hex, isInternal: true, transactions, - // atomic: !isBatchSell, + atomic: !isBatchSell, + batchId, }; }; @@ -461,24 +466,28 @@ export const findAndUpdateTransactionsInBatch = ({ export const addTransactionBatch = async ( messenger: BridgeStatusControllerMessenger, addTransactionBatchFn: TransactionController['addTransactionBatch'], - ...args: Parameters + args: Parameters[0], ) => { const txDataByType = { - [TransactionType.bridgeApproval]: args[0].transactions.find( + [TransactionType.bridgeApproval]: args.transactions.find( ({ type }) => type === TransactionType.bridgeApproval, )?.params.data, - [TransactionType.swapApproval]: args[0].transactions.find( + [TransactionType.swapApproval]: args.transactions.find( ({ type }) => type === TransactionType.swapApproval, )?.params.data, - [TransactionType.bridge]: args[0].transactions.find( + [TransactionType.bridge]: args.transactions.find( ({ type }) => type === TransactionType.bridge, )?.params.data, - [TransactionType.swap]: args[0].transactions.find( + [TransactionType.swap]: args.transactions.find( ({ type }) => type === TransactionType.swap, )?.params.data, }; - const { batchId } = await addTransactionBatchFn(...args); + const { batchId } = await addTransactionBatchFn(args); + + if (!args.atomic) { + return { batchId }; + } const { approvalMeta, tradeMeta } = findAndUpdateTransactionsInBatch({ messenger, From 7b8cbc6dbbbdd204c70276e215ecb72cb4f2e606 Mon Sep 17 00:00:00 2001 From: micaelae Date: Wed, 13 May 2026 17:27:54 -0700 Subject: [PATCH 4/8] feat: batch-sell-strategy --- .../bridge-status-controller.test.ts.snap | 155 ++++++++++++++++++ .../src/bridge-status-controller.test.ts | 2 +- .../src/bridge-status-controller.ts | 17 +- .../src/strategy/batch-sell-strategy.ts | 115 +++++++++++++ .../src/strategy/batch-strategy.ts | 107 ++++-------- .../src/strategy/index.ts | 11 ++ .../src/strategy/types.ts | 12 +- .../bridge-status-controller/src/types.ts | 9 + .../src/utils/history.ts | 27 ++- .../src/utils/transaction.test.ts | 18 +- .../src/utils/transaction.ts | 74 +++++---- 11 files changed, 406 insertions(+), 141 deletions(-) create mode 100644 packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts diff --git a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap index 6038bee5d1..8d209aadf1 100644 --- a/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap +++ b/packages/bridge-status-controller/src/__snapshots__/bridge-status-controller.test.ts.snap @@ -448,6 +448,156 @@ exports[`BridgeStatusController startPollingForBridgeTxStatus stops polling when ] `; +exports[`BridgeStatusController submitTx: EVM batch sell (swap) should use quote txFee when gasIncluded is true and STX is off (Max native token swap) 1`] = ` +{ + "chainId": "0xa4b1", + "hash": "0xevmTxHash", + "id": "test-tx-id", + "status": "unapproved", + "time": 1234567890, + "txParams": { + "chainId": "0xa4b1", + "data": "0xdata", + "from": "0xaccount1", + "gasLimit": "0x5208", + "to": "0xbridgeContract", + "value": "0x0", + }, + "type": "swap", +} +`; + +exports[`BridgeStatusController submitTx: EVM batch sell (swap) should use quote txFee when gasIncluded is true and STX is off (Max native token swap) 2`] = ` +{ + "account": "0xaccount1", + "actionId": "1234567891.456", + "approvalTxId": undefined, + "batchId": undefined, + "estimatedProcessingTimeInSeconds": 0, + "featureId": undefined, + "hasApprovalTx": false, + "initialDestAssetBalance": undefined, + "isStxEnabled": false, + "location": "Main View", + "originalTransactionId": "test-tx-id", + "pricingData": { + "amountSent": "1.234", + "amountSentInUsd": "1.01", + "quotedGasAmount": ".00055", + "quotedGasInUsd": "2.5778", + "quotedReturnInUsd": "0.134214", + }, + "quote": { + "bridgeId": "lifi", + "bridges": [ + "across", + ], + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:10/slip44:60", + "chainId": 10, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.63", + "symbol": "ETH", + }, + "destChainId": 42161, + "destTokenAmount": "990654755978612", + "feeData": { + "metabridge": { + "amount": "8750000000000", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + }, + "txFee": { + "maxFeePerGas": "1395348", + "maxPriorityFeePerGas": "1000001", + }, + }, + "gasIncluded": true, + "gasIncluded7702": false, + "minDestTokenAmount": "941000000000000", + "requestId": "197c402f-cb96-4096-9f8c-54aed84ca776", + "srcAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + "srcChainId": 42161, + "srcTokenAmount": "991250000000000", + "steps": [ + { + "action": "bridge", + "destAmount": "990654755978612", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:10/slip44:60", + "chainId": 10, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.63", + "symbol": "ETH", + }, + "destChainId": 10, + "protocol": { + "displayName": "Across", + "icon": "https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/bridges/acrossv2.png", + "name": "across", + }, + "srcAmount": "991250000000000", + "srcAsset": { + "address": "0x0000000000000000000000000000000000000000", + "assetId": "eip155:42161/slip44:60", + "chainId": 42161, + "coinKey": "ETH", + "decimals": 18, + "icon": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png", + "name": "ETH", + "priceUSD": "2478.7", + "symbol": "ETH", + }, + "srcChainId": 42161, + }, + ], + }, + "slippagePercentage": 0, + "startTime": 1234567890, + "status": { + "srcChain": { + "chainId": 42161, + "txHash": "0xevmTxHash", + }, + "status": "PENDING", + }, + "targetContractAddress": undefined, + "txMetaId": "test-tx-id", +} +`; + exports[`BridgeStatusController submitTx: EVM batch sell (swap) should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit) 1`] = ` { "chainId": "0xa4b1", @@ -1260,6 +1410,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac "featureId": undefined, "hasApprovalTx": false, "initialDestAssetBalance": undefined, + "isAtomicBatch": true, "isStxEnabled": true, "location": "Main View", "originalTransactionId": "test-tx-id", @@ -1380,6 +1531,7 @@ exports[`BridgeStatusController submitTx: EVM bridge should handle smart transac [ { "atomic": true, + "batchId": undefined, "disable7702": true, "from": "0xaccount1", "isGasFeeIncluded": false, @@ -3752,6 +3904,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle a gasless swap "featureId": undefined, "hasApprovalTx": true, "initialDestAssetBalance": undefined, + "isAtomicBatch": true, "isStxEnabled": true, "location": "Main View", "originalTransactionId": "test-tx-id", @@ -3887,6 +4040,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti "featureId": undefined, "hasApprovalTx": true, "initialDestAssetBalance": undefined, + "isAtomicBatch": true, "isStxEnabled": true, "location": "Main View", "originalTransactionId": "test-tx-id", @@ -4007,6 +4161,7 @@ exports[`BridgeStatusController submitTx: EVM swap should handle smart transacti [ { "atomic": true, + "batchId": undefined, "disable7702": true, "from": "0xaccount1", "isGasFeeIncluded": false, diff --git a/packages/bridge-status-controller/src/bridge-status-controller.test.ts b/packages/bridge-status-controller/src/bridge-status-controller.test.ts index a29ae4143e..a6e38c14ed 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.test.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.test.ts @@ -4799,7 +4799,7 @@ describe('BridgeStatusController', () => { ); }); - it.only('should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit)', async () => { + it('should use quote txFee when gasIncluded is true and STX is off (undefined gasLimit)', async () => { setupEventTrackingMocks(mockMessengerCall); // Setup for single tx path - no gas estimation needed since gasIncluded=true mockMessengerCall.mockReturnValueOnce(mockSelectedAccount); diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index 9ec2283227..9e65ba5ebb 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -5,7 +5,7 @@ import type { QuoteResponse, Trade, FeatureId, - BatchSimulationResponse, + BatchSellTradesResponse, } from '@metamask/bridge-controller'; import { isNonEvmChainId, @@ -278,11 +278,6 @@ export class BridgeStatusController extends StaticIntervalPollingController, activeAbTests?: { key: string; value: string }[], tokenSecurityTypeDestination?: string | null, - batchSimulationResponse?: BatchSimulationResponse, + batchSellTradesResponse?: BatchSellTradesResponse, ): Promise => { /** * If there are multiple quote responses, we assume that they all originate from the same src chain @@ -1118,7 +1113,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, quoteResponses, - batchSimulationResponse, + batchSellTradesResponse, isStxEnabled, isBridgeTx, isDelegatedAccount, @@ -1197,7 +1192,7 @@ export class BridgeStatusController extends StaticIntervalPollingController & QuoteMetadata)[]; - batchSimulationResponse: BatchSimulationResponse; + batchSellTradesResponse: BatchSellTradesResponse; accountAddress: string; location?: MetaMetricsSwapsEventSource; abTests?: Record; @@ -1215,7 +1210,7 @@ export class BridgeStatusController extends StaticIntervalPollingController, +): AsyncGenerator { + const { + requireApproval, + quoteResponses, + messenger, + addTransactionBatchFn, + isDelegatedAccount, + batchSellTradesResponse, + } = args; + + const tradeData: TradeWithMetadata[] = []; + + const batchId = generateBatchId(); + + const { transactions } = batchSellTradesResponse; + + for (const transaction of transactions.values()) { + const { type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = transaction; + const quoteResponse = quoteResponses.find( + ({ approval, trade }) => + trade?.data.toLowerCase() === tx.data.toLowerCase() || + approval?.data.toLowerCase() === tx.data.toLowerCase(), + ); + + if (type === BatchSimulationTransactionType.TRADE) { + tradeData.push({ + tx, + type: TransactionType.swap, + assetsFiatValues: { + sending: quoteResponse?.sentAmount?.valueInCurrency?.toString(), + receiving: quoteResponse?.toTokenAmount?.valueInCurrency?.toString(), + }, + txFee: { maxFeePerGas, maxPriorityFeePerGas }, + }); + + /* + yield { + type: SubmitStep.AddHistoryItem, + payload: { + historyKey: tx.data, + quoteRequestIndex: index, + tradeTxData: quoteResponses[index].trade.data, + approvalTxData: quoteResponses[index].approval?.data, + batchId, + }, + };*/ + } else { + tradeData.push({ + tx, + type: + type === BatchSimulationTransactionType.APPROVAL + ? TransactionType.swapApproval + : TransactionType.tokenMethodTransfer, + txFee: { maxFeePerGas, maxPriorityFeePerGas }, + }); + } + } + + const transactionParams = await getAddTransactionBatchParams({ + messenger, + tradeData, + requireApproval, + isDelegatedAccount, + isAtomic: false, + gasIncluded: quoteResponses[0].quote.gasIncluded, + gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, + gasSponsored: quoteResponses[0].quote.gasSponsored, + batchId, + }); + + const allTransactionMetas = await addTransactionBatch( + messenger, + addTransactionBatchFn, + transactionParams, + ); + for (const [index, tx] of allTransactionMetas.entries()) { + if (tx.tradeMeta) { + yield { + type: SubmitStep.AddHistoryItem, + payload: { + historyKey: tx.tradeMeta.id, + quoteRequestIndex: index, + batchId, + approvalTxId: tx.approvalMeta?.id, + bridgeTxMeta: { + id: tx.tradeMeta.id, + hash: tx.tradeMeta.hash, + batchId: tx.tradeMeta.batchId, + }, + }, + }; + } + } +} diff --git a/packages/bridge-status-controller/src/strategy/batch-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-strategy.ts index 7be4b66959..ff6180e700 100644 --- a/packages/bridge-status-controller/src/strategy/batch-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-strategy.ts @@ -3,7 +3,6 @@ import { TransactionType } from '@metamask/transaction-controller'; import { addTransactionBatch, - generateBatchId, getAddTransactionBatchParams, TradeWithMetadata, } from '../utils/transaction'; @@ -26,125 +25,79 @@ export async function* submitBatchHandler( isBridgeTx, addTransactionBatchFn, isDelegatedAccount, - batchSimulationResponse, } = args; - const quoteRequestIndex = 0; - const approvalTxType = isBridgeTx ? TransactionType.bridgeApproval : TransactionType.swapApproval; const tradeData: TradeWithMetadata[] = []; - const batchId = generateBatchId(); - - if (batchSimulationResponse) { - const { transactions } = batchSimulationResponse; - - for (const [index, transaction] of transactions.entries()) { - const { assetId, type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = - transaction; - const quoteResponse = quoteResponses.find( - ({ quote }) => quote.srcAsset.assetId === transactions[0].assetId, - ); - tradeData.push({ - tx, - type: - type === 'swap' ? TransactionType.swap : TransactionType.swapApproval, - // If there is no matching quote response, these will be undefined - assetsFiatValues: - type === 'swap' - ? { - sending: quoteResponse?.sentAmount?.valueInCurrency?.toString(), - receiving: - quoteResponse?.toTokenAmount?.valueInCurrency?.toString(), - } - : undefined, - txFee: { maxFeePerGas, maxPriorityFeePerGas }, - }); - if (type === 'swap') { - yield { - type: SubmitStep.AddHistoryItem, - payload: { - historyKey: tx.data, - quoteRequestIndex: index, - tradeTxData: quoteResponses[index].trade.data, - approvalTxData: quoteResponses[index].approval?.data, - batchId, - }, - }; - } - } - } else { - const quoteResponse = quoteResponses[quoteRequestIndex]; - if (quoteResponse.resetApproval) { - tradeData.push({ - tx: quoteResponse.resetApproval, - type: approvalTxType, - // TODO for regular 7702, shoudl txFee be appended to both approval and trade? - // I think it covers both - txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], - }); - } - if (quoteResponse.approval) { - tradeData.push({ - tx: quoteResponse.approval, - type: approvalTxType, - // TODO rm - txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], - }); - } + const quoteResponse = quoteResponses[0]; + if (quoteResponse.resetApproval) { tradeData.push({ - tx: quoteResponse.trade, - type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, - assetsFiatValues: { - sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), - receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), - }, + tx: quoteResponse.resetApproval, + type: approvalTxType, + // TODO for regular 7702, shoudl txFee be appended to both approval and trade? + // I think it covers both txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], }); } + if (quoteResponse.approval) { + tradeData.push({ + tx: quoteResponse.approval, + type: approvalTxType, + // TODO rm this for approvals? + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], + }); + } + tradeData.push({ + tx: quoteResponse.trade, + type: isBridgeTx ? TransactionType.bridge : TransactionType.swap, + assetsFiatValues: { + sending: quoteResponse.sentAmount?.valueInCurrency?.toString(), + receiving: quoteResponse.toTokenAmount?.valueInCurrency?.toString(), + }, + txFee: quoteResponse.quote.feeData[FeeType.TX_FEE], + }); + const isAtomicBatch = true; const transactionParams = await getAddTransactionBatchParams({ messenger, tradeData, requireApproval, isDelegatedAccount, - isBatchSell: Boolean(batchSimulationResponse), + isAtomic: isAtomicBatch, gasIncluded: quoteResponses[0].quote.gasIncluded, gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, gasSponsored: quoteResponses[0].quote.gasSponsored, - batchId, }); - const { approvalMeta, tradeMeta } = await addTransactionBatch( + const allTransactionMetas = await addTransactionBatch( messenger, addTransactionBatchFn, transactionParams, ); - - if (!tradeMeta) { - return; - } + const { tradeMeta, approvalMeta } = + allTransactionMetas.find((tx) => tx.tradeMeta) ?? {}; if (tradeMeta) { yield { type: SubmitStep.SetTradeMeta, - payload: { tradeMeta, quoteRequestIndex }, + payload: { tradeMeta }, }; yield { type: SubmitStep.AddHistoryItem, payload: { historyKey: tradeMeta.id, + isAtomicBatch, approvalTxId: approvalMeta?.id, bridgeTxMeta: { id: tradeMeta.id, hash: tradeMeta.hash, batchId: tradeMeta.batchId, }, - quoteRequestIndex, }, }; } diff --git a/packages/bridge-status-controller/src/strategy/index.ts b/packages/bridge-status-controller/src/strategy/index.ts index 1300ab6ce4..52ff1f19f3 100644 --- a/packages/bridge-status-controller/src/strategy/index.ts +++ b/packages/bridge-status-controller/src/strategy/index.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ import { + BatchSellTradesResponse, BitcoinTradeData, ChainId, isBitcoinTrade, @@ -16,6 +17,7 @@ import { submitEvmHandler as defaultSubmitHandler } from './evm-strategy'; import { submitIntentHandler } from './intent-strategy'; import { submitNonEvmHandler } from './non-evm-strategy'; import type { SubmitStrategyParams, SubmitStepResult } from './types'; +import { submitBatchSellHandler } from './batch-sell-strategy'; const validateParams = < TxDataType extends BitcoinTradeData | TronTradeData | string | TxData, @@ -43,6 +45,11 @@ const validateParams = < } }; +const validateBatchSellParams = ( + params: SubmitStrategyParams, +): params is SubmitStrategyParams => + Boolean(params.batchSellTradesResponse); + /** * Selects the appropriate submit strategy based on the quote parameters then executes it * @@ -76,6 +83,10 @@ const executeSubmitStrategy = ( ); } + if (validateBatchSellParams(params)) { + return submitBatchSellHandler(params); + } + // Intent transactions if (quoteResponse.quote.intent) { return submitIntentHandler(params); diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index cfaec745b5..fe297e168a 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -1,6 +1,6 @@ import type { AccountsControllerState } from '@metamask/accounts-controller'; import type { - BatchSimulationResponse, + BatchSellTradesResponse, BridgeClientId, QuoteMetadata, QuoteResponse, @@ -42,6 +42,7 @@ export type SubmitStepResult = approvalTxData?: string; quoteRequestIndex?: number; batchId?: string; + isAtomicBatch?: boolean; }; } | { @@ -81,8 +82,13 @@ export type SubmitStepResult = /** * The parameters for the submission flow */ -export type SubmitStrategyParams = { - batchSimulationResponse?: BatchSimulationResponse; +export type SubmitStrategyParams< + TradeType extends Trade = TxData, + BatchSellTradesResponseType extends BatchSellTradesResponse | undefined = + | BatchSellTradesResponse + | undefined, +> = { + batchSellTradesResponse: BatchSellTradesResponseType; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 6b01432a4b..28a5645a6f 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -114,6 +114,12 @@ export type BridgeHistoryItem = { */ originalTransactionId?: string; // Keep original transaction ID for intent transactions batchId?: string; + isAtomicBatch?: boolean; + approvalTxData?: string; + /** + * Batch sell trades won't have a txMetaId or actionId on submission so we store the calldata here to match the txs later + */ + tradeTxData?: string; quote: Quote; status: StatusResponse; startTime: number; // timestamp in ms @@ -228,6 +234,9 @@ export type QuoteMetadataSerialized = { export type StartPollingForBridgeTxStatusArgs = { bridgeTxMeta?: Pick; actionId?: string; + isAtomicBatch?: boolean; + approvalTxData?: BridgeHistoryItem['approvalTxData']; + tradeTxData?: BridgeHistoryItem['tradeTxData']; /** * @deprecated the txMeta or orderUid should be used instead */ diff --git a/packages/bridge-status-controller/src/utils/history.ts b/packages/bridge-status-controller/src/utils/history.ts index af227514fa..882540efbd 100644 --- a/packages/bridge-status-controller/src/utils/history.ts +++ b/packages/bridge-status-controller/src/utils/history.ts @@ -72,13 +72,14 @@ export const getMatchingHistoryEntryForTxMeta = ( status: { srcChain: { txHash }, }, + isAtomicBatch, } = value; return ( key === txMeta.id || key === txMeta.actionId || txMetaId === txMeta.id || (actionId ? actionId === txMeta.actionId : false) || - (batchId ? batchId === txMeta.batchId : false) || + (batchId && isAtomicBatch ? batchId === txMeta.batchId : false) || (txHash ? txHash.toLowerCase() === txMeta.hash?.toLowerCase() : false) ); }); @@ -97,8 +98,13 @@ export const getMatchingHistoryEntryForApprovalTxMeta = ( ): [string, BridgeHistoryItem] | undefined => { const historyEntries = Object.entries(txHistory); - return historyEntries.find(([_, value]) => - value.approvalTxId ? value.approvalTxId === txMeta.id : false, + return historyEntries.find( + ([_, { approvalTxId, approvalTxData }]) => + approvalTxId ? approvalTxId === txMeta.id : false, + // || + // (approvalTxData && txMeta.txParams?.data + // ? approvalTxData === txMeta.txParams.data.toLowerCase() + // : false), ); }; @@ -146,11 +152,14 @@ export const getInitialHistoryItem = ( originalTransactionId, actionId, tokenSecurityTypeDestination, + isAtomicBatch, + approvalTxData, + tradeTxData, } = args; // Write all non-status fields to state so we can reference the quote in Activity list without the Bridge API // We know it's in progress but not the exact status yet - const txHistoryItem = { + const txHistoryItem: BridgeHistoryItem = { txMetaId: bridgeTxMeta?.id, actionId, originalTransactionId: originalTransactionId ?? bridgeTxMeta?.id, // Keep original for intent transactions @@ -196,6 +205,16 @@ export const getInitialHistoryItem = ( }), }; + if (approvalTxData) { + txHistoryItem.approvalTxData = approvalTxData.toLowerCase(); + } + if (tradeTxData) { + txHistoryItem.tradeTxData = tradeTxData.toLowerCase(); + } + if (isAtomicBatch) { + txHistoryItem.isAtomicBatch = isAtomicBatch; + } + return txHistoryItem; }; diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index 56e6ffcb7d..773105ad54 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -2204,7 +2204,7 @@ describe('Bridge Status Controller Transaction Utils', () => { findAndUpdateTransactionsInBatch({ messenger: mockMessagingSystem, batchId, - txDataByType, + txDataByType: [txDataByType], }); expect( @@ -2263,7 +2263,7 @@ describe('Bridge Status Controller Transaction Utils', () => { findAndUpdateTransactionsInBatch({ messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, batchId, - txDataByType, + txDataByType: [txDataByType], }); // Should identify and update 7702 transaction with delegationAddress @@ -2306,7 +2306,7 @@ describe('Bridge Status Controller Transaction Utils', () => { findAndUpdateTransactionsInBatch({ messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, batchId, - txDataByType, + txDataByType: [txDataByType], }); // Should match 7702 approval transaction by data @@ -2357,7 +2357,7 @@ describe('Bridge Status Controller Transaction Utils', () => { findAndUpdateTransactionsInBatch({ messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, batchId, - txDataByType, + txDataByType: [txDataByType], }); // Should update regular transactions by matching data @@ -2413,7 +2413,7 @@ describe('Bridge Status Controller Transaction Utils', () => { findAndUpdateTransactionsInBatch({ messenger: mockMessagingSystem, batchId, - txDataByType, + txDataByType: [txDataByType], }); // Should not update transactions with different batchId @@ -2444,7 +2444,7 @@ describe('Bridge Status Controller Transaction Utils', () => { const result = findAndUpdateTransactionsInBatch({ messenger: mockMessagingSystem, batchId, - txDataByType, + txDataByType: [txDataByType], }); // Should match since 7702 bridge transactions use batch type @@ -2461,7 +2461,7 @@ describe('Bridge Status Controller Transaction Utils', () => { }, 'Update tx type to bridge', ); - expect(result.tradeMeta).toStrictEqual( + expect(result[0].tradeMeta).toStrictEqual( expect.objectContaining({ id: 'tx1', type: TransactionType.bridge }), ); }); @@ -2487,7 +2487,7 @@ describe('Bridge Status Controller Transaction Utils', () => { const result = findAndUpdateTransactionsInBatch({ messenger: mockMessagingSystem, batchId, - txDataByType, + txDataByType: [txDataByType], }); expect(mockMessagingSystem.call).toHaveBeenCalledWith( @@ -2503,7 +2503,7 @@ describe('Bridge Status Controller Transaction Utils', () => { }, 'Update tx type to bridgeApproval', ); - expect(result.approvalMeta).toStrictEqual( + expect(result[0].approvalMeta).toStrictEqual( expect.objectContaining({ id: 'tx1', type: TransactionType.bridgeApproval, diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index a9f7ffa335..d42e09c348 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -10,6 +10,7 @@ import type { QuoteResponse, SimulatedGasFeeLimits, TxData, + TxFeeGasLimits, } from '@metamask/bridge-controller'; import { toHex } from '@metamask/controller-utils'; import { @@ -23,7 +24,7 @@ import type { TransactionBatchSingleRequest, TransactionParams, } from '@metamask/transaction-controller'; -import { createProjectLogger, Hex } from '@metamask/utils'; +import { createProjectLogger, Hex, isStrictHexString } from '@metamask/utils'; import { APPROVAL_DELAY_MS } from '../constants'; import type { BridgeStatusControllerMessenger } from '../types'; @@ -57,7 +58,7 @@ const appendGasFees = async ( networkClientId: string, chainId: Hex, isGasIncluded7702: boolean, - simulatedGasFeeLimits?: SimulatedGasFeeLimits, + simulatedGasFeeLimits?: SimulatedGasFeeLimits | TxFeeGasLimits, ) => { const normalizedTrade = { ...trade, @@ -79,8 +80,14 @@ const appendGasFees = async ( if (simulatedGasFeeLimits) { return { ...transactionParams, - maxFeePerGas: toHex(simulatedGasFeeLimits.maxFeePerGas), - maxPriorityFeePerGas: toHex(simulatedGasFeeLimits.maxPriorityFeePerGas), + maxFeePerGas: isStrictHexString(simulatedGasFeeLimits.maxFeePerGas) + ? simulatedGasFeeLimits.maxFeePerGas + : toHex(simulatedGasFeeLimits.maxFeePerGas), + maxPriorityFeePerGas: isStrictHexString( + simulatedGasFeeLimits.maxPriorityFeePerGas, + ) + ? simulatedGasFeeLimits.maxPriorityFeePerGas + : toHex(simulatedGasFeeLimits.maxPriorityFeePerGas), }; } @@ -306,14 +313,14 @@ export type TradeWithMetadata = { tx: TxData & Partial; type: TransactionType; assetsFiatValues?: { sending?: string; receiving?: string }; - txFee?: SimulatedGasFeeLimits; + txFee?: SimulatedGasFeeLimits | TxFeeGasLimits; }; export const getAddTransactionBatchParams = async ({ messenger, tradeData, requireApproval = false, - isBatchSell, + isAtomic, gasIncluded7702, gasSponsored, gasIncluded, @@ -324,7 +331,7 @@ export const getAddTransactionBatchParams = async ({ tradeData: TradeWithMetadata[]; requireApproval?: boolean; isDelegatedAccount: boolean; - isBatchSell?: boolean; + isAtomic?: boolean; batchId?: Hex; }): Promise[0]> => { const trade = tradeData[0].tx; @@ -382,7 +389,7 @@ export const getAddTransactionBatchParams = async ({ from: selectedAccount.address as Hex, isInternal: true, transactions, - atomic: !isBatchSell, + atomic: isAtomic, batchId, }; }; @@ -394,21 +401,21 @@ export const findAndUpdateTransactionsInBatch = ({ }: { messenger: BridgeStatusControllerMessenger; batchId: string; - txDataByType: { [key in TransactionType]?: string }; + txDataByType: { [key in TransactionType]?: string }[]; }) => { const txs = getTransactions(messenger); const txBatch: { approvalMeta?: TransactionMeta; tradeMeta?: TransactionMeta; - } = { - approvalMeta: undefined, - tradeMeta: undefined, - }; + }[] = []; // This is a workaround to update the tx type after the tx is signed // TODO: remove this once the tx type for batch txs is preserved in the tx controller - const txEntries = Object.entries(txDataByType) as [TransactionType, string][]; - txEntries.forEach(([txType, txData]) => { + const txEntries = txDataByType.flatMap( + (list) => Object.entries(list) as [TransactionType, string][], + ); + txEntries.forEach(([txType, txData], index) => { + txBatch[index] ??= {}; // Skip types not present in the batch (e.g. swap entry is undefined for bridge txs) if (txData === undefined) { return; @@ -455,7 +462,7 @@ export const findAndUpdateTransactionsInBatch = ({ TransactionType.bridgeApproval, TransactionType.swapApproval, ] as readonly string[]; - txBatch[txTypes.includes(txType) ? 'approvalMeta' : 'tradeMeta'] = + txBatch[index][txTypes.includes(txType) ? 'approvalMeta' : 'tradeMeta'] = updatedTx; } }); @@ -468,40 +475,35 @@ export const addTransactionBatch = async ( addTransactionBatchFn: TransactionController['addTransactionBatch'], args: Parameters[0], ) => { - const txDataByType = { - [TransactionType.bridgeApproval]: args.transactions.find( - ({ type }) => type === TransactionType.bridgeApproval, - )?.params.data, - [TransactionType.swapApproval]: args.transactions.find( - ({ type }) => type === TransactionType.swapApproval, - )?.params.data, - [TransactionType.bridge]: args.transactions.find( - ({ type }) => type === TransactionType.bridge, - )?.params.data, - [TransactionType.swap]: args.transactions.find( - ({ type }) => type === TransactionType.swap, - )?.params.data, - }; + const txDataByType: { [key in TransactionType]?: string }[] = []; + let index = 0; + args.transactions.forEach(({ type, params }) => { + txDataByType[index] ??= {}; + if (type && isCrossChainTx(type)) { + txDataByType[index][type] = params.data; + if (isTradeTx(type)) { + index += 1; + } + } + }); const { batchId } = await addTransactionBatchFn(args); - if (!args.atomic) { - return { batchId }; - } - - const { approvalMeta, tradeMeta } = findAndUpdateTransactionsInBatch({ + const allTransactionMetas = findAndUpdateTransactionsInBatch({ messenger, batchId, txDataByType, }); + const tradeMeta = allTransactionMetas.find((tx) => tx.tradeMeta); + if (!tradeMeta) { throw new Error( 'Failed to update cross-chain swap transaction batch: tradeMeta not found', ); } - return { approvalMeta, tradeMeta }; + return allTransactionMetas; }; /** From 56b9d6a80d551e662b703ebec7e79e0d1194a0a9 Mon Sep 17 00:00:00 2001 From: micaelae Date: Fri, 15 May 2026 14:36:43 -0700 Subject: [PATCH 5/8] wip working DO NOT TOUCH --- ...e-status-controller-method-action-types.ts | 8 +- .../src/bridge-status-controller.ts | 41 +- .../src/strategy/batch-sell-strategy.ts | 12 +- .../src/strategy/index.ts | 21 +- .../src/strategy/types.ts | 7 +- .../bridge-status-controller/src/types.ts | 8 +- .../src/utils/bridge.ts | 9 +- .../src/utils/transaction.test.ts | 351 ++++++++++++++++++ .../src/utils/transaction.ts | 37 +- .../src/TransactionController.ts | 10 + .../transaction-controller/src/utils/batch.ts | 13 +- 11 files changed, 487 insertions(+), 30 deletions(-) diff --git a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts index 1e885f0d41..d6a4aaf648 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts @@ -40,6 +40,11 @@ export type BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction = { handler: BridgeStatusController['getBridgeHistoryItemByTxMetaId']; }; +export type BridgeStatusControllerSubmitBatchSellAction = { + type: `BridgeStatusController:submitBatchSell`; + handler: BridgeStatusController['submitBatchSell']; +}; + /** * Union of all BridgeStatusController action types. */ @@ -50,4 +55,5 @@ export type BridgeStatusControllerMethodActions = | BridgeStatusControllerSubmitTxAction | BridgeStatusControllerSubmitIntentAction | BridgeStatusControllerRestartPollingForFailedAttemptsAction - | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction; + | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction + | BridgeStatusControllerSubmitBatchSellAction; diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index 9e65ba5ebb..f6285a4a48 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -50,7 +50,11 @@ import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; import { getAccountByAddress } from './utils/accounts'; import { getJwt } from './utils/authentication'; -import { stopPollingForQuotes, trackMetricsEvent } from './utils/bridge'; +import { + getBatchSellTrades, + stopPollingForQuotes, + trackMetricsEvent, +} from './utils/bridge'; import { fetchBridgeTxStatus, getStatusRequestWithSrcTxHash, @@ -109,6 +113,7 @@ const MESSENGER_EXPOSED_METHODS = [ 'resetState', 'submitTx', 'submitIntent', + 'submitBatchSell', 'restartPollingForFailedAttempts', 'getBridgeHistoryItemByTxMetaId', ] as const; @@ -963,6 +968,7 @@ export class BridgeStatusController extends StaticIntervalPollingController, activeAbTests?: { key: string; value: string }[], tokenSecurityTypeDestination?: string | null, - batchSellTradesResponse?: BatchSellTradesResponse, + batchSellTrades?: BatchSellTradesResponse | null, ): Promise => { /** * If there are multiple quote responses, we assume that they all originate from the same src chain @@ -1113,7 +1128,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, quoteResponses, - batchSellTradesResponse, + batchSellTrades, isStxEnabled, isBridgeTx, isDelegatedAccount, @@ -1125,6 +1140,7 @@ export class BridgeStatusController extends StaticIntervalPollingController & QuoteMetadata)[]; - batchSellTradesResponse: BatchSellTradesResponse; + quoteResponses: ((QuoteResponse & QuoteMetadata) | null)[]; accountAddress: string; location?: MetaMetricsSwapsEventSource; abTests?: Record; @@ -1201,16 +1216,26 @@ export class BridgeStatusController extends StaticIntervalPollingController => { + /** + * Retrieve the batch sell trades from the BridgeController's state to ensure we submit + * the original response data from the bridge-api + */ + const batchSellTrades = getBatchSellTrades(this.messenger); return await this.submitTx( params.accountAddress, - params.quoteResponses, + params.quoteResponses.filter( + ( + quoteResponse, + ): quoteResponse is QuoteResponse & QuoteMetadata => + quoteResponse !== null, + ), params.isStxEnabled ?? false, params.quotesReceivedContext, params.location, params.abTests, params.activeAbTests, params.tokenSecurityTypeDestination, - params.batchSellTradesResponse, + batchSellTrades, ); }; diff --git a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts index 85f0b4bff3..79f3491192 100644 --- a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts @@ -26,14 +26,14 @@ export async function* submitBatchSellHandler( messenger, addTransactionBatchFn, isDelegatedAccount, - batchSellTradesResponse, + batchSellTrades, } = args; const tradeData: TradeWithMetadata[] = []; const batchId = generateBatchId(); - const { transactions } = batchSellTradesResponse; + const { transactions } = batchSellTrades; for (const transaction of transactions.values()) { const { type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = transaction; @@ -77,16 +77,19 @@ export async function* submitBatchSellHandler( } } + console.error('====isDelegatedAccount====', isDelegatedAccount); + const transactionParams = await getAddTransactionBatchParams({ messenger, tradeData, requireApproval, isDelegatedAccount, isAtomic: false, - gasIncluded: quoteResponses[0].quote.gasIncluded, - gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, + gasIncluded: false, // hardcoded for batch sell to prevent stx + gasIncluded7702: true, // hardcoded for batch sell gasSponsored: quoteResponses[0].quote.gasSponsored, batchId, + skipInitialGasEstimate: true, // TODO do this for batch strategy too? }); const allTransactionMetas = await addTransactionBatch( @@ -94,6 +97,7 @@ export async function* submitBatchSellHandler( addTransactionBatchFn, transactionParams, ); + for (const [index, tx] of allTransactionMetas.entries()) { if (tx.tradeMeta) { yield { diff --git a/packages/bridge-status-controller/src/strategy/index.ts b/packages/bridge-status-controller/src/strategy/index.ts index 52ff1f19f3..e5f3b6e188 100644 --- a/packages/bridge-status-controller/src/strategy/index.ts +++ b/packages/bridge-status-controller/src/strategy/index.ts @@ -48,7 +48,7 @@ const validateParams = < const validateBatchSellParams = ( params: SubmitStrategyParams, ): params is SubmitStrategyParams => - Boolean(params.batchSellTradesResponse); + Boolean(params.batchSellTrades); /** * Selects the appropriate submit strategy based on the quote parameters then executes it @@ -83,22 +83,33 @@ const executeSubmitStrategy = ( ); } - if (validateBatchSellParams(params)) { - return submitBatchSellHandler(params); - } - // Intent transactions if (quoteResponse.quote.intent) { + console.error('====submitIntentHandler====', params); return submitIntentHandler(params); } + // Batch sell transactions + // TODO check isDelegatedAccount to enable this + if (validateBatchSellParams(params)) { + console.error('====submitBatchSellHandler====', params); + return submitBatchSellHandler(params); + } + // Batched transactions const shouldBatchTxs = isStxEnabled || quoteResponse.quote.gasIncluded7702 || isDelegatedAccount; if (shouldBatchTxs) { + console.error('====submitBatchHandler====', params); return submitBatchHandler(params); } + console.error('====submitBatchHandler====', params, { + isStxEnabled, + isDelegatedAccount, + gasIncluded7702: quoteResponse.quote.gasIncluded7702, + }); + // Non-stx/gasless EVM transactions return defaultSubmitHandler(params); }; diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index fe297e168a..29143511c7 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -84,11 +84,12 @@ export type SubmitStepResult = */ export type SubmitStrategyParams< TradeType extends Trade = TxData, - BatchSellTradesResponseType extends BatchSellTradesResponse | undefined = + BatchSellTradesResponseType extends | BatchSellTradesResponse - | undefined, + | undefined + | null = BatchSellTradesResponse | undefined | null, > = { - batchSellTradesResponse: BatchSellTradesResponseType; + batchSellTrades: BatchSellTradesResponseType; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 28a5645a6f..046a7889dd 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -12,6 +12,9 @@ import type { QuoteMetadata, QuoteResponse, MetaMetricsSwapsEventSource, + BridgeControllerGetStateAction, + BridgeControllerStopPollingForQuotesAction, + BridgeControllerTrackUnifiedSwapBridgeEventAction, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -319,8 +322,9 @@ type AllowedActions = | TransactionControllerAddTransactionAction | TransactionControllerEstimateGasFeeAction | TransactionControllerIsAtomicBatchSupportedAction - | BridgeControllerAction - | BridgeControllerAction + | BridgeControllerTrackUnifiedSwapBridgeEventAction + | BridgeControllerStopPollingForQuotesAction + | BridgeControllerGetStateAction | GetGasFeeState | AccountsControllerGetAccountByAddressAction | AuthenticationControllerGetBearerTokenAction diff --git a/packages/bridge-status-controller/src/utils/bridge.ts b/packages/bridge-status-controller/src/utils/bridge.ts index b5a94ff3a7..5a541bed20 100644 --- a/packages/bridge-status-controller/src/utils/bridge.ts +++ b/packages/bridge-status-controller/src/utils/bridge.ts @@ -2,8 +2,9 @@ import { AbortReason, FeatureId, UnifiedSwapBridgeEventName, + BatchSellTradesResponse, + RequiredEventContextFromClient, } from '@metamask/bridge-controller'; -import type { RequiredEventContextFromClient } from '@metamask/bridge-controller'; import { BridgeStatusControllerMessenger } from '../types'; @@ -21,6 +22,12 @@ export const stopPollingForQuotes = ( ); }; +export const getBatchSellTrades = ( + messenger: BridgeStatusControllerMessenger, +): BatchSellTradesResponse | null => { + return messenger.call('BridgeController:getState').batchSellTrades; +}; + export const trackMetricsEvent = ({ messenger, eventName, diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index 773105ad54..093df7b200 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -29,6 +29,321 @@ import { waitForTxConfirmation, } from './transaction'; +const mockTxDataByType = [ + { + swapApproval: + '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + swap: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + }, + { + swapApproval: + '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + swap: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + }, + {}, // TODO ignore this bc it's the transfer +]; + +const addTransactionBatchNested = [ + { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'batch', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, +]; + +const resultAllTxMetas = [ + { + tradeMeta: { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'swap', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, + }, + { + tradeMeta: { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'swap', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, + }, +]; + describe('Bridge Status Controller Transaction Utils', () => { describe('waitForTxConfirmation', () => { it('resolves when confirmed', async () => { @@ -2510,5 +2825,41 @@ describe('Bridge Status Controller Transaction Utils', () => { }), ); }); + + it.only('should handle multiple swaps in a batch', () => { + const txs = addTransactionBatchNested; + + const mockMessenger = createMockMessagingSystemWithTxs(txs); + const callSpy = jest.spyOn(mockMessenger, 'call'); + + const result = findAndUpdateTransactionsInBatch({ + messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, + batchId: '0x19e28f7e5fc', + txDataByType: mockTxDataByType, + }); + + expect(result).toStrictEqual(resultAllTxMetas); + + // Should identify and update 7702 transaction with delegationAddress + expect( + callSpy.mock.calls.find( + ([action]) => action === 'TransactionController:updateTransaction', + ), + ).toMatchInlineSnapshot(` + [ + "TransactionController:updateTransaction", + { + "batchId": "test-batch-id", + "delegationAddress": "0xDelegationAddress", + "id": "tx1", + "txParams": { + "data": "0xbatchData", + }, + "type": "swap", + }, + "Update tx type to swap", + ] + `); + }); }); }); diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index d42e09c348..1288ccb96f 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -67,7 +67,9 @@ const appendGasFees = async ( value: trade.value, data: trade.data, }; - if (isGasIncluded7702) { + // TODO always add simulatedGasFeeLimits for gasIncluded and 7702 + // TODO add gasLimit? + if (isGasIncluded7702 && !simulatedGasFeeLimits) { return normalizedTrade; } const transactionParams = { @@ -205,7 +207,8 @@ export const addTransaction = async ( }; export const generateActionId = () => (Date.now() + Math.random()).toString(); -export const generateBatchId = () => toHex(Date.now() + Math.random()); +export const generateBatchId = () => + toHex(Date.now() + Math.floor(Math.random() * 1000000)); /** * Adds a synthetic transaction to the TransactionController to display pending intent orders in the UI @@ -326,6 +329,7 @@ export const getAddTransactionBatchParams = async ({ gasIncluded, isDelegatedAccount, batchId, + skipInitialGasEstimate, }: GaslessProperties & { messenger: BridgeStatusControllerMessenger; tradeData: TradeWithMetadata[]; @@ -333,6 +337,7 @@ export const getAddTransactionBatchParams = async ({ isDelegatedAccount: boolean; isAtomic?: boolean; batchId?: Hex; + skipInitialGasEstimate?: boolean; }): Promise[0]> => { const trade = tradeData[0].tx; const selectedAccount = getAccountByAddress(messenger, trade.from); @@ -391,9 +396,19 @@ export const getAddTransactionBatchParams = async ({ transactions, atomic: isAtomic, batchId, + skipInitialGasEstimate, }; }; +// TODO txDataByType revert to old +// TODO should return only 1 txMeta +// tx matcher should check nestedTransactions +// When batch is submitted, txType is batch +// This updates it from batch -> swap or swapApproval etc IF it has a delegation Address +// BUT if it doesn't have a delegation Address, then there are multiple txMetas for the same batchId ITHINK (check this) +// AND each one gets updated to swap/swapApproval etc +// TODO if there is delegationAddress and there are nestedTransactions, then the batch should be updated to the swap and be done (not approval) +// TODO TxHistory -> batchId, txMetaId, key by batchId-quoteRequestIndex, then txMetaId-nestedTransactionIndex export const findAndUpdateTransactionsInBatch = ({ messenger, batchId, @@ -414,8 +429,10 @@ export const findAndUpdateTransactionsInBatch = ({ const txEntries = txDataByType.flatMap( (list) => Object.entries(list) as [TransactionType, string][], ); + console.error('====findAndUpdateTransactionsInBatch INPUTS FOR TESTING====', { + txDataByType, + }); txEntries.forEach(([txType, txData], index) => { - txBatch[index] ??= {}; // Skip types not present in the batch (e.g. swap entry is undefined for bridge txs) if (txData === undefined) { return; @@ -451,7 +468,17 @@ export const findAndUpdateTransactionsInBatch = ({ }); if (txMeta) { + // console.error( + // '====findAndUpdateTransactionsInBatch txMetas FOR TESTING====', + // txMeta, + // ); + txBatch[index] ??= {}; const updatedTx = { ...txMeta, type: txType }; + // This updates the entire batch to Swap + // Which is ok for non-BatchSell trades but not needed + // TODO logic should be generic. So if txMeta is batch AND its nestedTransactions includes a swap/bridge trade, update the batch to the trade type + // TODO BUT IF THERE ARE MULTIPLE SWAPS THEY ONLY SHOW UP AS ONE + // FOR TESTING SHOW MULTIPLE SWAPS IN DETAILS updateTransaction( messenger, txMeta, @@ -467,7 +494,7 @@ export const findAndUpdateTransactionsInBatch = ({ } }); - return txBatch; + return txBatch.filter(Boolean); }; export const addTransactionBatch = async ( @@ -487,6 +514,8 @@ export const addTransactionBatch = async ( } }); + console.error('====addTransactionBatch====', args); + const { batchId } = await addTransactionBatchFn(args); const allTransactionMetas = findAndUpdateTransactionsInBatch({ diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index d75a550ae7..2946a73b47 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -1299,6 +1299,8 @@ export class TransactionController extends BaseController< */ const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee; + + console.error('====addTransaction====', { isGasFeeTokenIgnoredIfBalance }); let addedTransactionMeta: TransactionMeta = { actionId, assetsFiatValues, @@ -3303,6 +3305,10 @@ export class TransactionController extends BaseController< if (transactionMeta.batchTransactions?.length) { log('Found batch transactions', transactionMeta.batchTransactions); + console.error( + '====Found batch transactions====', + transactionMeta.batchTransactions, + ); const extraTransactionsPublishHook = new ExtraTransactionsPublishHook({ addTransactionBatch: this.addTransactionBatch.bind(this), getTransaction: this.#getTransactionOrThrow.bind(this), @@ -3860,6 +3866,7 @@ export class TransactionController extends BaseController< const { networkClientId } = transactionMeta; + // TODO error happens here await checkGasFeeTokenBeforePublish({ messenger: this.messenger, networkClientId, @@ -4683,6 +4690,9 @@ export class TransactionController extends BaseController< await this.#trace( { name: 'Publish', parentContext: traceContext }, async () => { + console.error('====Publish====', { + hasOverride: Boolean(publishHookOverride), + }); const publishHook = publishHookOverride ?? this.#publish; ({ transactionHash } = await publishHook(transactionMeta, signedTx)); diff --git a/packages/transaction-controller/src/utils/batch.ts b/packages/transaction-controller/src/utils/batch.ts index 0645744377..f9b3256713 100644 --- a/packages/transaction-controller/src/utils/batch.ts +++ b/packages/transaction-controller/src/utils/batch.ts @@ -145,8 +145,10 @@ export async function addTransactionBatch( if (!transactionBatchRequest.disable7702 && accountCanUse7702) { try { + console.error('====addTransactionBatchWith7702 attempt====', request); return await addTransactionBatchWith7702(request); } catch (error: unknown) { + console.error('====addTransactionBatchWith7702 error====', error); const isEIP7702NotSupportedError = error instanceof JsonRpcError && error.message === 'Chain does not support EIP-7702'; @@ -156,6 +158,9 @@ export async function addTransactionBatch( } } } + console.error('====addTransactionBatchWithHook NO 7702====', { + accountCanUse7702, + }); return await addTransactionBatchWithHook(request); } @@ -433,8 +438,7 @@ async function addTransactionBatchWith7702( return { batchId }; } - - const { result } = await addTransaction(txParams, { + const opts = { batchId, gasFeeToken, excludeNativeTokenForFee, @@ -450,7 +454,12 @@ async function addTransactionBatchWith7702( securityAlertResponse, skipInitialGasEstimate, type: TransactionType.batch, + }; + console.error('====addTransactionBatchWith7702 addTransaction====', { + txParams, + opts, }); + const { result } = await addTransaction(txParams, opts); const transactionHash = await result; From b08d4854ff35046e8dbd1512bd2e13163c6b91fa Mon Sep 17 00:00:00 2001 From: micaelae Date: Fri, 15 May 2026 14:37:03 -0700 Subject: [PATCH 6/8] Revert "wip working DO NOT TOUCH" This reverts commit 0bf7053518551af17e0d67f6c2cc805a24a685ed. --- ...e-status-controller-method-action-types.ts | 8 +- .../src/bridge-status-controller.ts | 41 +- .../src/strategy/batch-sell-strategy.ts | 12 +- .../src/strategy/index.ts | 21 +- .../src/strategy/types.ts | 7 +- .../bridge-status-controller/src/types.ts | 8 +- .../src/utils/bridge.ts | 9 +- .../src/utils/transaction.test.ts | 351 ------------------ .../src/utils/transaction.ts | 37 +- .../src/TransactionController.ts | 10 - .../transaction-controller/src/utils/batch.ts | 13 +- 11 files changed, 30 insertions(+), 487 deletions(-) diff --git a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts index d6a4aaf648..1e885f0d41 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts @@ -40,11 +40,6 @@ export type BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction = { handler: BridgeStatusController['getBridgeHistoryItemByTxMetaId']; }; -export type BridgeStatusControllerSubmitBatchSellAction = { - type: `BridgeStatusController:submitBatchSell`; - handler: BridgeStatusController['submitBatchSell']; -}; - /** * Union of all BridgeStatusController action types. */ @@ -55,5 +50,4 @@ export type BridgeStatusControllerMethodActions = | BridgeStatusControllerSubmitTxAction | BridgeStatusControllerSubmitIntentAction | BridgeStatusControllerRestartPollingForFailedAttemptsAction - | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction - | BridgeStatusControllerSubmitBatchSellAction; + | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction; diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index f6285a4a48..9e65ba5ebb 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -50,11 +50,7 @@ import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; import { getAccountByAddress } from './utils/accounts'; import { getJwt } from './utils/authentication'; -import { - getBatchSellTrades, - stopPollingForQuotes, - trackMetricsEvent, -} from './utils/bridge'; +import { stopPollingForQuotes, trackMetricsEvent } from './utils/bridge'; import { fetchBridgeTxStatus, getStatusRequestWithSrcTxHash, @@ -113,7 +109,6 @@ const MESSENGER_EXPOSED_METHODS = [ 'resetState', 'submitTx', 'submitIntent', - 'submitBatchSell', 'restartPollingForFailedAttempts', 'getBridgeHistoryItemByTxMetaId', ] as const; @@ -968,7 +963,6 @@ export class BridgeStatusController extends StaticIntervalPollingController, activeAbTests?: { key: string; value: string }[], tokenSecurityTypeDestination?: string | null, - batchSellTrades?: BatchSellTradesResponse | null, + batchSellTradesResponse?: BatchSellTradesResponse, ): Promise => { /** * If there are multiple quote responses, we assume that they all originate from the same src chain @@ -1128,7 +1113,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, quoteResponses, - batchSellTrades, + batchSellTradesResponse, isStxEnabled, isBridgeTx, isDelegatedAccount, @@ -1140,7 +1125,6 @@ export class BridgeStatusController extends StaticIntervalPollingController & QuoteMetadata) | null)[]; + quoteResponses: (QuoteResponse & QuoteMetadata)[]; + batchSellTradesResponse: BatchSellTradesResponse; accountAddress: string; location?: MetaMetricsSwapsEventSource; abTests?: Record; @@ -1216,26 +1201,16 @@ export class BridgeStatusController extends StaticIntervalPollingController => { - /** - * Retrieve the batch sell trades from the BridgeController's state to ensure we submit - * the original response data from the bridge-api - */ - const batchSellTrades = getBatchSellTrades(this.messenger); return await this.submitTx( params.accountAddress, - params.quoteResponses.filter( - ( - quoteResponse, - ): quoteResponse is QuoteResponse & QuoteMetadata => - quoteResponse !== null, - ), + params.quoteResponses, params.isStxEnabled ?? false, params.quotesReceivedContext, params.location, params.abTests, params.activeAbTests, params.tokenSecurityTypeDestination, - batchSellTrades, + params.batchSellTradesResponse, ); }; diff --git a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts index 79f3491192..85f0b4bff3 100644 --- a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts @@ -26,14 +26,14 @@ export async function* submitBatchSellHandler( messenger, addTransactionBatchFn, isDelegatedAccount, - batchSellTrades, + batchSellTradesResponse, } = args; const tradeData: TradeWithMetadata[] = []; const batchId = generateBatchId(); - const { transactions } = batchSellTrades; + const { transactions } = batchSellTradesResponse; for (const transaction of transactions.values()) { const { type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = transaction; @@ -77,19 +77,16 @@ export async function* submitBatchSellHandler( } } - console.error('====isDelegatedAccount====', isDelegatedAccount); - const transactionParams = await getAddTransactionBatchParams({ messenger, tradeData, requireApproval, isDelegatedAccount, isAtomic: false, - gasIncluded: false, // hardcoded for batch sell to prevent stx - gasIncluded7702: true, // hardcoded for batch sell + gasIncluded: quoteResponses[0].quote.gasIncluded, + gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, gasSponsored: quoteResponses[0].quote.gasSponsored, batchId, - skipInitialGasEstimate: true, // TODO do this for batch strategy too? }); const allTransactionMetas = await addTransactionBatch( @@ -97,7 +94,6 @@ export async function* submitBatchSellHandler( addTransactionBatchFn, transactionParams, ); - for (const [index, tx] of allTransactionMetas.entries()) { if (tx.tradeMeta) { yield { diff --git a/packages/bridge-status-controller/src/strategy/index.ts b/packages/bridge-status-controller/src/strategy/index.ts index e5f3b6e188..52ff1f19f3 100644 --- a/packages/bridge-status-controller/src/strategy/index.ts +++ b/packages/bridge-status-controller/src/strategy/index.ts @@ -48,7 +48,7 @@ const validateParams = < const validateBatchSellParams = ( params: SubmitStrategyParams, ): params is SubmitStrategyParams => - Boolean(params.batchSellTrades); + Boolean(params.batchSellTradesResponse); /** * Selects the appropriate submit strategy based on the quote parameters then executes it @@ -83,33 +83,22 @@ const executeSubmitStrategy = ( ); } + if (validateBatchSellParams(params)) { + return submitBatchSellHandler(params); + } + // Intent transactions if (quoteResponse.quote.intent) { - console.error('====submitIntentHandler====', params); return submitIntentHandler(params); } - // Batch sell transactions - // TODO check isDelegatedAccount to enable this - if (validateBatchSellParams(params)) { - console.error('====submitBatchSellHandler====', params); - return submitBatchSellHandler(params); - } - // Batched transactions const shouldBatchTxs = isStxEnabled || quoteResponse.quote.gasIncluded7702 || isDelegatedAccount; if (shouldBatchTxs) { - console.error('====submitBatchHandler====', params); return submitBatchHandler(params); } - console.error('====submitBatchHandler====', params, { - isStxEnabled, - isDelegatedAccount, - gasIncluded7702: quoteResponse.quote.gasIncluded7702, - }); - // Non-stx/gasless EVM transactions return defaultSubmitHandler(params); }; diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index 29143511c7..fe297e168a 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -84,12 +84,11 @@ export type SubmitStepResult = */ export type SubmitStrategyParams< TradeType extends Trade = TxData, - BatchSellTradesResponseType extends + BatchSellTradesResponseType extends BatchSellTradesResponse | undefined = | BatchSellTradesResponse - | undefined - | null = BatchSellTradesResponse | undefined | null, + | undefined, > = { - batchSellTrades: BatchSellTradesResponseType; + batchSellTradesResponse: BatchSellTradesResponseType; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 046a7889dd..28a5645a6f 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -12,9 +12,6 @@ import type { QuoteMetadata, QuoteResponse, MetaMetricsSwapsEventSource, - BridgeControllerGetStateAction, - BridgeControllerStopPollingForQuotesAction, - BridgeControllerTrackUnifiedSwapBridgeEventAction, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -322,9 +319,8 @@ type AllowedActions = | TransactionControllerAddTransactionAction | TransactionControllerEstimateGasFeeAction | TransactionControllerIsAtomicBatchSupportedAction - | BridgeControllerTrackUnifiedSwapBridgeEventAction - | BridgeControllerStopPollingForQuotesAction - | BridgeControllerGetStateAction + | BridgeControllerAction + | BridgeControllerAction | GetGasFeeState | AccountsControllerGetAccountByAddressAction | AuthenticationControllerGetBearerTokenAction diff --git a/packages/bridge-status-controller/src/utils/bridge.ts b/packages/bridge-status-controller/src/utils/bridge.ts index 5a541bed20..b5a94ff3a7 100644 --- a/packages/bridge-status-controller/src/utils/bridge.ts +++ b/packages/bridge-status-controller/src/utils/bridge.ts @@ -2,9 +2,8 @@ import { AbortReason, FeatureId, UnifiedSwapBridgeEventName, - BatchSellTradesResponse, - RequiredEventContextFromClient, } from '@metamask/bridge-controller'; +import type { RequiredEventContextFromClient } from '@metamask/bridge-controller'; import { BridgeStatusControllerMessenger } from '../types'; @@ -22,12 +21,6 @@ export const stopPollingForQuotes = ( ); }; -export const getBatchSellTrades = ( - messenger: BridgeStatusControllerMessenger, -): BatchSellTradesResponse | null => { - return messenger.call('BridgeController:getState').batchSellTrades; -}; - export const trackMetricsEvent = ({ messenger, eventName, diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index 093df7b200..773105ad54 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -29,321 +29,6 @@ import { waitForTxConfirmation, } from './transaction'; -const mockTxDataByType = [ - { - swapApproval: - '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', - swap: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', - }, - { - swapApproval: - '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', - swap: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', - }, - {}, // TODO ignore this bc it's the transfer -]; - -const addTransactionBatchNested = [ - { - batchId: '0x19e28f7e5fc', - chainId: '0x38', - id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', - isGasFeeTokenIgnoredIfBalance: false, - isGasFeeIncluded: true, - isGasFeeSponsored: false, - excludeNativeTokenForFee: true, - nestedTransactions: [ - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', - gas: '0x793f5', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', - gas: '0x5d131', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x55d398326f99059ff775485246999027b3197955', - value: '0x0', - data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', - gas: '0xcc57', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'transfer', - }, - ], - networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', - origin: 'metamask', - selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', - status: 'submitted', - time: 1778803650369, - txParams: { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', - gas: '0x916a8', - gasLimit: '0x916a8', - to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - value: '0x0', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: '0x2', - }, - type: 'batch', - userEditedGasLimit: false, - verifiedOnBlockchain: false, - gasLimitNoBuffer: '0x916a8', - originalGasEstimate: '0x916a8', - defaultGasEstimates: { - gas: '0x916a8', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - estimateType: 'medium', - }, - userFeeLevel: 'medium', - delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', - r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', - s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - v: '0x1', - rawTx: - '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', - submittedTime: 1778803654101, - }, -]; - -const resultAllTxMetas = [ - { - tradeMeta: { - batchId: '0x19e28f7e5fc', - chainId: '0x38', - id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', - isGasFeeTokenIgnoredIfBalance: false, - isGasFeeIncluded: true, - isGasFeeSponsored: false, - excludeNativeTokenForFee: true, - nestedTransactions: [ - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', - gas: '0x793f5', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', - gas: '0x5d131', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x55d398326f99059ff775485246999027b3197955', - value: '0x0', - data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', - gas: '0xcc57', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'transfer', - }, - ], - networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', - origin: 'metamask', - selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', - status: 'submitted', - time: 1778803650369, - txParams: { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', - gas: '0x916a8', - gasLimit: '0x916a8', - to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - value: '0x0', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: '0x2', - }, - type: 'swap', - userEditedGasLimit: false, - verifiedOnBlockchain: false, - gasLimitNoBuffer: '0x916a8', - originalGasEstimate: '0x916a8', - defaultGasEstimates: { - gas: '0x916a8', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - estimateType: 'medium', - }, - userFeeLevel: 'medium', - delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', - r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', - s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - v: '0x1', - rawTx: - '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', - submittedTime: 1778803654101, - }, - }, - { - tradeMeta: { - batchId: '0x19e28f7e5fc', - chainId: '0x38', - id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', - isGasFeeTokenIgnoredIfBalance: false, - isGasFeeIncluded: true, - isGasFeeSponsored: false, - excludeNativeTokenForFee: true, - nestedTransactions: [ - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', - gas: '0x793f5', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', - value: '0x0', - data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', - gas: '0x1110c', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swapApproval', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', - value: '0x0', - data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', - gas: '0x5d131', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'swap', - }, - { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - to: '0x55d398326f99059ff775485246999027b3197955', - value: '0x0', - data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', - gas: '0xcc57', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: 'transfer', - }, - ], - networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', - origin: 'metamask', - selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', - status: 'submitted', - time: 1778803650369, - txParams: { - from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', - gas: '0x916a8', - gasLimit: '0x916a8', - to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', - value: '0x0', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - type: '0x2', - }, - type: 'swap', - userEditedGasLimit: false, - verifiedOnBlockchain: false, - gasLimitNoBuffer: '0x916a8', - originalGasEstimate: '0x916a8', - defaultGasEstimates: { - gas: '0x916a8', - maxFeePerGas: '0x3938700', - maxPriorityFeePerGas: '0x3938700', - estimateType: 'medium', - }, - userFeeLevel: 'medium', - delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', - r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', - s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - v: '0x1', - rawTx: - '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', - hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', - submittedTime: 1778803654101, - }, - }, -]; - describe('Bridge Status Controller Transaction Utils', () => { describe('waitForTxConfirmation', () => { it('resolves when confirmed', async () => { @@ -2825,41 +2510,5 @@ describe('Bridge Status Controller Transaction Utils', () => { }), ); }); - - it.only('should handle multiple swaps in a batch', () => { - const txs = addTransactionBatchNested; - - const mockMessenger = createMockMessagingSystemWithTxs(txs); - const callSpy = jest.spyOn(mockMessenger, 'call'); - - const result = findAndUpdateTransactionsInBatch({ - messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, - batchId: '0x19e28f7e5fc', - txDataByType: mockTxDataByType, - }); - - expect(result).toStrictEqual(resultAllTxMetas); - - // Should identify and update 7702 transaction with delegationAddress - expect( - callSpy.mock.calls.find( - ([action]) => action === 'TransactionController:updateTransaction', - ), - ).toMatchInlineSnapshot(` - [ - "TransactionController:updateTransaction", - { - "batchId": "test-batch-id", - "delegationAddress": "0xDelegationAddress", - "id": "tx1", - "txParams": { - "data": "0xbatchData", - }, - "type": "swap", - }, - "Update tx type to swap", - ] - `); - }); }); }); diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index 1288ccb96f..d42e09c348 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -67,9 +67,7 @@ const appendGasFees = async ( value: trade.value, data: trade.data, }; - // TODO always add simulatedGasFeeLimits for gasIncluded and 7702 - // TODO add gasLimit? - if (isGasIncluded7702 && !simulatedGasFeeLimits) { + if (isGasIncluded7702) { return normalizedTrade; } const transactionParams = { @@ -207,8 +205,7 @@ export const addTransaction = async ( }; export const generateActionId = () => (Date.now() + Math.random()).toString(); -export const generateBatchId = () => - toHex(Date.now() + Math.floor(Math.random() * 1000000)); +export const generateBatchId = () => toHex(Date.now() + Math.random()); /** * Adds a synthetic transaction to the TransactionController to display pending intent orders in the UI @@ -329,7 +326,6 @@ export const getAddTransactionBatchParams = async ({ gasIncluded, isDelegatedAccount, batchId, - skipInitialGasEstimate, }: GaslessProperties & { messenger: BridgeStatusControllerMessenger; tradeData: TradeWithMetadata[]; @@ -337,7 +333,6 @@ export const getAddTransactionBatchParams = async ({ isDelegatedAccount: boolean; isAtomic?: boolean; batchId?: Hex; - skipInitialGasEstimate?: boolean; }): Promise[0]> => { const trade = tradeData[0].tx; const selectedAccount = getAccountByAddress(messenger, trade.from); @@ -396,19 +391,9 @@ export const getAddTransactionBatchParams = async ({ transactions, atomic: isAtomic, batchId, - skipInitialGasEstimate, }; }; -// TODO txDataByType revert to old -// TODO should return only 1 txMeta -// tx matcher should check nestedTransactions -// When batch is submitted, txType is batch -// This updates it from batch -> swap or swapApproval etc IF it has a delegation Address -// BUT if it doesn't have a delegation Address, then there are multiple txMetas for the same batchId ITHINK (check this) -// AND each one gets updated to swap/swapApproval etc -// TODO if there is delegationAddress and there are nestedTransactions, then the batch should be updated to the swap and be done (not approval) -// TODO TxHistory -> batchId, txMetaId, key by batchId-quoteRequestIndex, then txMetaId-nestedTransactionIndex export const findAndUpdateTransactionsInBatch = ({ messenger, batchId, @@ -429,10 +414,8 @@ export const findAndUpdateTransactionsInBatch = ({ const txEntries = txDataByType.flatMap( (list) => Object.entries(list) as [TransactionType, string][], ); - console.error('====findAndUpdateTransactionsInBatch INPUTS FOR TESTING====', { - txDataByType, - }); txEntries.forEach(([txType, txData], index) => { + txBatch[index] ??= {}; // Skip types not present in the batch (e.g. swap entry is undefined for bridge txs) if (txData === undefined) { return; @@ -468,17 +451,7 @@ export const findAndUpdateTransactionsInBatch = ({ }); if (txMeta) { - // console.error( - // '====findAndUpdateTransactionsInBatch txMetas FOR TESTING====', - // txMeta, - // ); - txBatch[index] ??= {}; const updatedTx = { ...txMeta, type: txType }; - // This updates the entire batch to Swap - // Which is ok for non-BatchSell trades but not needed - // TODO logic should be generic. So if txMeta is batch AND its nestedTransactions includes a swap/bridge trade, update the batch to the trade type - // TODO BUT IF THERE ARE MULTIPLE SWAPS THEY ONLY SHOW UP AS ONE - // FOR TESTING SHOW MULTIPLE SWAPS IN DETAILS updateTransaction( messenger, txMeta, @@ -494,7 +467,7 @@ export const findAndUpdateTransactionsInBatch = ({ } }); - return txBatch.filter(Boolean); + return txBatch; }; export const addTransactionBatch = async ( @@ -514,8 +487,6 @@ export const addTransactionBatch = async ( } }); - console.error('====addTransactionBatch====', args); - const { batchId } = await addTransactionBatchFn(args); const allTransactionMetas = findAndUpdateTransactionsInBatch({ diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index 2946a73b47..d75a550ae7 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -1299,8 +1299,6 @@ export class TransactionController extends BaseController< */ const isGasFeeTokenIgnoredIfBalance = Boolean(gasFeeToken) && !excludeNativeTokenForFee; - - console.error('====addTransaction====', { isGasFeeTokenIgnoredIfBalance }); let addedTransactionMeta: TransactionMeta = { actionId, assetsFiatValues, @@ -3305,10 +3303,6 @@ export class TransactionController extends BaseController< if (transactionMeta.batchTransactions?.length) { log('Found batch transactions', transactionMeta.batchTransactions); - console.error( - '====Found batch transactions====', - transactionMeta.batchTransactions, - ); const extraTransactionsPublishHook = new ExtraTransactionsPublishHook({ addTransactionBatch: this.addTransactionBatch.bind(this), getTransaction: this.#getTransactionOrThrow.bind(this), @@ -3866,7 +3860,6 @@ export class TransactionController extends BaseController< const { networkClientId } = transactionMeta; - // TODO error happens here await checkGasFeeTokenBeforePublish({ messenger: this.messenger, networkClientId, @@ -4690,9 +4683,6 @@ export class TransactionController extends BaseController< await this.#trace( { name: 'Publish', parentContext: traceContext }, async () => { - console.error('====Publish====', { - hasOverride: Boolean(publishHookOverride), - }); const publishHook = publishHookOverride ?? this.#publish; ({ transactionHash } = await publishHook(transactionMeta, signedTx)); diff --git a/packages/transaction-controller/src/utils/batch.ts b/packages/transaction-controller/src/utils/batch.ts index f9b3256713..0645744377 100644 --- a/packages/transaction-controller/src/utils/batch.ts +++ b/packages/transaction-controller/src/utils/batch.ts @@ -145,10 +145,8 @@ export async function addTransactionBatch( if (!transactionBatchRequest.disable7702 && accountCanUse7702) { try { - console.error('====addTransactionBatchWith7702 attempt====', request); return await addTransactionBatchWith7702(request); } catch (error: unknown) { - console.error('====addTransactionBatchWith7702 error====', error); const isEIP7702NotSupportedError = error instanceof JsonRpcError && error.message === 'Chain does not support EIP-7702'; @@ -158,9 +156,6 @@ export async function addTransactionBatch( } } } - console.error('====addTransactionBatchWithHook NO 7702====', { - accountCanUse7702, - }); return await addTransactionBatchWithHook(request); } @@ -438,7 +433,8 @@ async function addTransactionBatchWith7702( return { batchId }; } - const opts = { + + const { result } = await addTransaction(txParams, { batchId, gasFeeToken, excludeNativeTokenForFee, @@ -454,12 +450,7 @@ async function addTransactionBatchWith7702( securityAlertResponse, skipInitialGasEstimate, type: TransactionType.batch, - }; - console.error('====addTransactionBatchWith7702 addTransaction====', { - txParams, - opts, }); - const { result } = await addTransaction(txParams, opts); const transactionHash = await result; From a7647be0926c1df9c088a786f722ae0112156dcb Mon Sep 17 00:00:00 2001 From: micaelae Date: Tue, 19 May 2026 09:51:40 -0700 Subject: [PATCH 7/8] wip --- .../mock-quotes-erc20-native-gasIncluded.json | 1211 ++++++++++++++++ packages/bridge-controller/tests/v2.json | 1242 +++++++++++++++++ ...e-status-controller-method-action-types.ts | 8 +- .../src/bridge-status-controller.ts | 59 +- .../src/strategy/batch-sell-strategy.ts | 100 +- .../src/strategy/batch-strategy.ts | 52 +- .../src/strategy/index.ts | 21 +- .../src/strategy/types.ts | 35 +- .../bridge-status-controller/src/types.ts | 10 +- .../src/utils/bridge.ts | 9 +- .../src/utils/transaction.test.ts | 351 +++++ .../src/utils/transaction.ts | 74 +- .../src/TransactionController.ts | 8 + .../transaction-controller/src/utils/batch.ts | 13 +- 14 files changed, 3062 insertions(+), 131 deletions(-) create mode 100644 packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json create mode 100644 packages/bridge-controller/tests/v2.json diff --git a/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json b/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json new file mode 100644 index 0000000000..26575cb876 --- /dev/null +++ b/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json @@ -0,0 +1,1211 @@ +[ + { + "quote": { + "requestId": "0x6a47515696329fc021f05809a701dd64dee2e66489b05e8148daaf961a4ea045", + "bridgeId": "okx", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "okx", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4957536175634874", + "minDestTokenAmount": "4858385452122176", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1185357122341796", + "maxFeePerGas": "2734769381", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54224783210386", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ] + }, + "bridges": ["okx"], + "protocols": ["okx"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.539651319829108", + "priceImpact": "-0.0009637813454112697", + "totalFeeAmountUsd": "0.12621896623095138" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123276166587858, + "effectiveGas": 48549, + "gasCost": "21323266539309" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000046f6b7836000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001142ad030e4040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000046764a7268336000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001049871efa400000000000000003bbd3996dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000159385696c503200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001f0000000000000003b6d03403af7a58d54cf014675af2b7ebc222c3166bf56927777777711118000000000000000000000000000000000000016043efddc3cf0777777771111000000000064fa00a9ed787f3793db668bff3e6e6e7db0f92a1b0000000000000000000000000000000000000000000000000000000049", + "gasLimit": 354487, + "feeEstimate": 645787438332892, + "effectiveGas": 254326, + "gasCost": "111702838078566" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "ee891e38-328e-407a-b2e3-067451a0cd9d" + }, + { + "quote": { + "requestId": "0x20144f1827580dae9717f0181dc329fc229f5bebea435ab76ec7391e9d309ec1", + "bridgeId": "1inch", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "1inch", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5027712466030201", + "minDestTokenAmount": "4927158216709596", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1108910779267246", + "maxFeePerGas": "2734769381", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "54169435961011", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["1inch"], + "protocols": ["1inch"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.703000591199263", + "priceImpact": "0.000057902628994835026", + "totalFeeAmountUsd": "0.1260901345015052" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123276166587858, + "effectiveGas": 48549, + "gasCost": "21323266539309" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563646656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000560000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001181396b4255dc0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000421d0b712ef61000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000042807ed23790000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e3000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e300000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158de21eabee880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002ce0000000000000000000000000000000000000002b000029a00025e00004e00a0744c8c09dac17f958d2ee523a2206206994597c13d831ec790cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000000000000000005a05120111111125421ca6dc452d289314280a0f8842a65dac17f958d2ee523a2206206994597c13d831ec70124cc713a04b603a75f1dc7f577a235263b790a6f8a2fc209152ce45685b24c2be638baeb98000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000015fe44973c24510000000000000000000000000000000000000000000000000000000000dbd68200000000000000000000000000000cca830069e81001fd29e1d2454c98d1a6e30000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041ad019b49f5f19b25d6d68017e56cafa03d02fcc89010b2f75ea7da25bfff397f23dcb6ee334bf5bde0652673a6a649845f9d6ba3d986a60d21674a780b6f45741b000000000000000000000000000000000000000000000000000000000000004101c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c061111111125421ca6dc452d289314280a0f8842a650000000000000000000000000000000000007dcbea7c00000000000000000000000000000000000000000000000070", + "gasLimit": 330521, + "feeEstimate": 598441305514560, + "effectiveGas": 235680, + "gasCost": "103513305278880" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "01655c52-4408-41ff-b783-fdb64d031fdc" + }, + { + "quote": { + "requestId": "0x436804d4814a61731c3de729ee88745d3ad94544b0e45bcebc3ecfa29ea3b7af", + "bridgeId": "openocean", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "openocean", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4683190331479924", + "minDestTokenAmount": "4589526524850325", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1455710570940982", + "maxFeePerGas": "2734769381", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "54189541383286", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["openocean"], + "protocols": ["openocean"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "10.901056810291943", + "priceImpact": "-0.00031323393098036187", + "totalFeeAmountUsd": "0.12613693387007696" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123276166587858, + "effectiveGas": 48549, + "gasCost": "21323266539309" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f70656e4f6365616e46656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000104e266a337095000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000055d3f03d766ac000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000da40a9704d50000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d1d705e16de0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ef53a4bd0e16ccc9116770a41c4bd3ad1147bd4f00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000860000000000000000000000000000000000000000000000000000000000000098000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008487517c45000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004a424856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef000500000000000000000000000000000000000000000000001600953bf6fe2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025", + "gasLimit": 457333, + "feeEstimate": 842233516070222, + "effectiveGas": 331691, + "gasCost": "145682415738531" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "06c0b6ac-3d38-4d41-a480-769eaf5cce00" + }, + { + "quote": { + "requestId": "0x7c38ef7921435cbba74a9a6bfe38679d5281b516aa986ae947a81d57a76bdcda", + "bridgeId": "kyberswap", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "kyberswap", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4656608705028969", + "minDestTokenAmount": "4563476530928389", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1479602115167892", + "maxFeePerGas": "2734769381", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "54165795386353", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["kyberswap"], + "protocols": ["kyberswap"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "10.839182788622564", + "priceImpact": "0.00012510591060489168", + "totalFeeAmountUsd": "0.12608166034001272" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123276166587858, + "effectiveGas": 48549, + "gasCost": "21323266539309" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136b796265725377617046656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001036752d911b050000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000572f42b79fa85000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000ea4e21fd0e900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000b600000000000000000000000000000000000000000000000000000000000000da00000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000dbdc2200000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000004153edf746a147ad30af2d7e6a3833a821295de6e7e2fdc9a797e55372b7b21c54487ca90b38aebc729d8fc57762789e29aafeb8d67751beeb2e5e84f0b0d082241b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009a000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000d0dded00000000000000000000000000e6da5600000000000000000000000000dbdc2200000000000000000015fe1d5f329def0000000000000000000000000000000000000170f9a6a70000000f42400000000000000000000000000000004f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e814840000000000000000000000000000000000000000000000000000000000000980000000000000000000000000000000000000000000000000000000000000000261f598cd000000000000000031439a79a3535d69b65c3be384840282b4ea0aa700000000000000000000000031439a79a3535d69b65c3be384840282b4ea0aa70000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000740000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec78000000000000000000000000000000e00000000000000000000000000dbdc220000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000dbdc22890e63370000000000000101f77f93531ef2505d6e45b9dccf555d5a48400d0800000000000000000000000000000000000000000000000000000000000000800000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f9960000000000000000000000000000000000000000000000000000000000000460000000000044000000000024a540ec8c73322200d68e1b86c471a5c850854f22000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003e40947c2d900000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d1a34369686ae59ac97ae4e1df5635ffda9ee7c000000000000000000000000129b3d9a0a6e4beab88f5cb1e57995d72a6e24f10000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000015fe2564c5e24e00000000000000000000000000000000000000000000000000158d8b0bb7afb20000000000000000000000000000000000000000000000000000000069e8100f000000000000000000000000000000000000000000000000433934a4b6f654c10000000000000000000000000000000000000000000000000000000069e80fd80000000000000000000000000000000000000000000000000000000069e80fe2000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000005efb6ef4a4054fe5ad70804c39fa13c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000006044eef7179034319e2c8636ea885b37cbfa9aba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000418b305ca7778b653635245632606d1ca7c2ab41fb17821a2214c2f3e70556bf4a31b728c31e374590cc511c1ab2265703d10cce0820e3019369873186e214fefd1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041f5849ce7b0c54807f6bd8266c903425ed7fb31528d02d3cf2cde53308167b4934a222bf5d56110f0242a1a879277a5ddf68793c7f86842741369dd0d6757430d1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc280000000000000000000000170fa2d3c00000000000000000015fe2564c5bf500000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000015fe2564c5bf500000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d832f36b97d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ae7b22536f75726365223a226d6574616d61736b222c22416d6f756e74496e555344223a2231342e343032313639222c22416d6f756e744f7574555344223a2231342e343034333139222c22416d6f756e744f7574223a2236313930333736363135353833323134222c22526f7574654944223a2232653331313134316545424d4872756c3a66373437376635334f66394d4a377842222c2254696d657374616d70223a313737363831363038347d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e7", + "gasLimit": 466174, + "feeEstimate": 941394793492806, + "effectiveGas": 370743, + "gasCost": "162834493122063" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "64569240-2c37-4728-8d96-4ae4db4766af" + }, + { + "quote": { + "requestId": "0x6311b3d2527f3e3e66dddfab06e9917f7fd2a344993fa0bb482370919b372d01", + "bridgeId": "uniswap", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "uniswap", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5079488552854566", + "minDestTokenAmount": "4977898781797474", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1056915742960501", + "maxFeePerGas": "2803531485", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54167503241747", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ] + }, + "bridges": ["uniswap"], + "protocols": ["uniswap"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.823519729636384", + "priceImpact": "0.00009357971000129942", + "totalFeeAmountUsd": "0.1260856357130717" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123653076263868, + "effectiveGas": 48549, + "gasCost": "21700176215319" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011af5f609dec6200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003f2863a34ad88000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000069e816dc0000000000000000000000000000000000000000000000000000000000000002000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bdac17f958d2ee523a2206206994597c13d831ec7000064c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000158fe4f518ee32756e69780000b2c5de0b00000000000000000000000000000000000040", + "gasLimit": 302290, + "feeEstimate": 550189840682444, + "effectiveGas": 216017, + "gasCost": "96554140466427" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "35e71ce8-5283-486a-b5cc-f3968e6ea413" + }, + { + "quote": { + "requestId": "0x125c6a062fc6fdef5e1907e8dca0581cf013eff9f14db1db1a88e4d395798a71", + "bridgeId": "0x", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "0x", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4953371012980742", + "minDestTokenAmount": "4854303592721127", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1182803799394610", + "maxFeePerGas": "2803531485", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "54165477536730", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["0x"], + "protocols": ["0x"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.529956075454436", + "priceImpact": "0.00013097326389069737", + "totalFeeAmountUsd": "0.12608092048180664" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123653076263868, + "effectiveGas": 48549, + "gasCost": "21700176215319" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000430785632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000113ef6a146aae70000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000465045a597d0c000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c5c7e7adbe5400000000000000000000000000000000000000000000000000000000000000a04b4639d9f60921dae89d626c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e810ff0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000d0a67cb08be17475f4315a04c5f0be3e200ef66c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee", + "gasLimit": 347190, + "feeEstimate": 645395756164604, + "effectiveGas": 253397, + "gasCost": "113262055911207" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "d80788a8-6ad8-4ebc-8d60-4dbd35254f16" + }, + { + "quote": { + "requestId": "0xb7d2484ef7c0a505cc37586b6735b82093555a71084dcbcd7d8f4fa6974c1563", + "bridgeId": "mayan", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "mayan", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4742779248620463", + "minDestTokenAmount": "4647923663648053", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1393395563754887", + "maxFeePerGas": "2803531485", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "54165477536730", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["mayan"], + "protocols": ["mayan"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.039761864973658", + "priceImpact": "0.0001309732638909439", + "totalFeeAmountUsd": "0.12608092048180664" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123653076263868, + "effectiveGas": 48549, + "gasCost": "21700176215319" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000f6d6179616e46656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000980000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001083430eea353500000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000005248c91a82961000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000084430dedc57000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000158d7a15ab5400000000000000000000000000238856de6d9d32ea3dd4e9e7dbfe08b23cd5048c00000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f000000000000000000000000337685fdab40d39bd02028545a4ffa7d287cc3e2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000158d7ae556a7b800000000000000000000000000000000000000000000000000000000000000a08bcbd82b377a97a86d8001920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e811000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000646eb183d000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000001f3c3f0243d06a0353abcb066be9140747aeb8c90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018", + "gasLimit": 422092, + "feeEstimate": 801525307236204, + "effectiveGas": 314697, + "gasCost": "140661606921507" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "6192a91e-308c-4c14-a83a-9ff9cc6699f0" + }, + { + "quote": { + "requestId": "0xc95f4840e2e85fbfe856aee3361ba4235add53d3086f4381a264fb4fb282cd70", + "bridgeId": "relay", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "relay", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4396463016695471", + "minDestTokenAmount": "4308533756361561", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": { + "amount": "1678350047554084", + "maxFeePerGas": "2803531485", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + }, + "metabridge": { + "amount": "53623822761345", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + }, + "bridges": ["relay"], + "protocols": ["relay"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "10.233641965646914", + "priceImpact": "0.010129663531584725", + "totalFeeAmountUsd": "0.12482011127694735" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123653076263868, + "effectiveGas": 48549, + "gasCost": "21700176215319" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000e72656c61794164617074657256330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000f4e96b00cfb59000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000062738974ce7a5000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000c64f9e4bab400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000900000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000000000000000001ff3684f28c67538d4d072c22734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000000000000000001ff3684f28c67538d4d072c227340000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c5c7e7adbe5400000000000000000000000000000000000000000000000000000000000000a0a4f5c22b144373f032b103350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e810ff0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c4a6bd8c96000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000218eba873234c1e55640a096616a1063fa18a82abc4ff9093f60b177b440dc426300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000218eba873234c1e55640a096616a1063fa18a82abc4ff9093f60b177b440dc426300000000000000000000000000000000000000000000000000000000000000003624cd044b771b06f3909ff4cba28a81af3601a616690a04655e1c432378abe80000000000000000000000000000000000000000000000000000000029", + "gasLimit": 523928, + "feeEstimate": 936418182992388, + "effectiveGas": 367659, + "gasCost": "164334282624729" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "6c891386-dd97-4b17-885c-55dbdd0fa7b3" + }, + { + "quote": { + "requestId": "0x726b3098ae326c8fd6c28b4b6fba3f2ccb47f7da7351a604db75c8164050afe3", + "bridgeId": "pancakeswap", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "pancakeswap", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4956592447279492", + "minDestTokenAmount": "4857460598333902", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1179582365095860", + "maxFeePerGas": "2803531485", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54165477536730", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ] + }, + "bridges": ["pancakeswap"], + "protocols": ["pancakeswap"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.411135528520346", + "totalToAmountUsd": "11.537454604409206", + "priceImpact": "0.00013097326389069737", + "totalFeeAmountUsd": "0.12608092048180664" + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 123653076263868, + "effectiveGas": 48549, + "gasCost": "21700176215319" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001b70616e63616b6553776170526f7574657246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001141d5ad7961ce0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000462164de70b8e000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000224ac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158fb01ca56548000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000158fb01ca5654800000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000052", + "gasLimit": 346023, + "feeEstimate": 635602638320064, + "effectiveGas": 249552, + "gasCost": "111543438070512" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "3a86038b-663b-4c70-8d65-df677d9feb42" + } +] diff --git a/packages/bridge-controller/tests/v2.json b/packages/bridge-controller/tests/v2.json new file mode 100644 index 0000000000..10d7cc76f8 --- /dev/null +++ b/packages/bridge-controller/tests/v2.json @@ -0,0 +1,1242 @@ +[ + { + "quote": { + "requestId": "0xc7973589851fbeb7ef14c1e849ad37e2acb6942196598fdaa75d3ae91767d12a", + "bridgeId": "okx", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "okx", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4868207331426220", + "minDestTokenAmount": "4770843184797695", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1267577961167593", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54162039152782", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "105468452094480", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.24540635728608054" + } + ] + }, + "bridges": ["okx"], + "protocols": ["okx"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "11.327453887807907", + "priceImpact": "0.0008232380102231435", + "totalFeeAmountUsd": "0.1260254461662471", + "swapRate": "0.000337864935251527", + "cost": { + "usd": "3.0873210361038392" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000046f6b7836000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000010f30e7d4f17ff00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000004b21d93345b77000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003c4f2c42696000000000000000000000000000000000000000000000000000000003bac0522000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d213ba63e6f0000000000000000000000000000000000000000000000000000000069e81fa000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000006747bcaf9bd5a5f0758cbe08903490e45ddfacb500000000000000000000000000000000000000000000000000000000000000010000000000000000000000006747bcaf9bd5a5f0758cbe08903490e45ddfacb50000000000000000000000000000000000000000000000000000000000000001800000000000000000012710acdb27b266142223e1e676841c1e809255fc6d070000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27777777711118000000000000000000000000000000000000015fdb96be31b23777777771111000000000064fa00a9ed787f3793db668bff3e6e6e7db0f92a1b0000000000000000000000000000000000000000000000000000000050", + "gasLimit": 418678, + "feeEstimate": 747089363179593, + "effectiveGas": 312291, + "gasCost": "91278262867302" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "241a2c9d-89dd-4b4e-bfed-c5f84afa48fe" + }, + { + "quote": { + "requestId": "0x4547136cc5f714ea6d615a2d617367589dadf1e730ef69ef163f20c9156134ed", + "bridgeId": "1inch", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "1inch", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5155373057314276", + "minDestTokenAmount": "5052265596167990", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "978228710964240", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54142764663240", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "81745649807194", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.19020760942993886" + } + ] + }, + "bridges": ["1inch"], + "protocols": ["1inch"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "11.99563753256711", + "priceImpact": "0.0011788121789798405", + "totalFeeAmountUsd": "0.12598059785214827", + "swapRate": "0.000357794905932378", + "cost": { + "usd": "2.419137391344636" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563646656544796e616d69630000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011f302402ba73600000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003aaefb714bdd8000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028807ed23790000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e3000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e300000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158b2a9c8cc7a800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000013900000000000000000000000000000000000000011b0001050000c900004e00a0744c8c09dac17f958d2ee523a2206206994597c13d831ec790cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000000000000000005a00c20dac17f958d2ee523a2206206994597c13d831ec706da0fd433c1a5d7a4faa01111c044910a1845536ae4071118002dc6c006da0fd433c1a5d7a4faa01111c044910a18455300000000000000000000000000000000000000000000000000158b2a9c8cc7a8dac17f958d2ee523a2206206994597c13d831ec74101c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c061111111125421ca6dc452d289314280a0f8842a65000000000000007dcbea7c00000000000000000000000000000000000000000000000008", + "gasLimit": 306326, + "feeEstimate": 552924260811144, + "effectiveGas": 231128, + "gasCost": "67555460580016" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "d2c6b3f6-2b52-4564-811f-902e7f1808e9" + }, + { + "quote": { + "requestId": "0x72e861173646c2161676fad648f9faf047f441bd9f069b183af370a771a5126e", + "bridgeId": "kyberswap", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "kyberswap", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5082097733881599", + "minDestTokenAmount": "4980455779203967", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1054611769848065", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54170197384751", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "91097922453428", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.21196868695483279" + } + ] + }, + "bridges": ["kyberswap"], + "protocols": ["kyberswap"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "11.825138868317598", + "priceImpact": "0.000672735630156201", + "totalFeeAmountUsd": "0.1260444289231725", + "swapRate": "0.000352709427701552", + "cost": { + "usd": "2.5896360555941484" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136b796265725377617046656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ae0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011b1b2b989fb7f00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003f06e6b4a4f30000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000009a4e21fd0e900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000008a000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000dbdc2200000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000041b02d846bac0f13e72b1b173a398a2d5da62d4d8e3a40eaf72be7bc44e492f29d12090e7bf6353b31684cd0eced217a920c232304a46afba3c48c880c44eabd5e1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000d0dded00000000000000000000000000e6da5600000000000000000000000000dbdc2200000000000000000015fe92816e9e3000000000000000000000000000000000000001710153d50000000f42400000000000000000000000000000004f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e816410000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000261f598cd000000000000000031439a79a3535d69b65c3be384840282b4ea0aa700000000000000000000000031439a79a3535d69b65c3be384840282b4ea0aa7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000240000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec78000000000000000000000000000000e00000000000000000000000000dbdc220000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000dbdc2216717ef60000000000000001d1877a31a73c7cb31c02b9e7d7c336531562b21e00000000000000000000000000000000000000000000000000000000000000800000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000014aa86c5d3c41765bb24e11bd7010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000020c49ba5e353f88000137c00000000000000000000000000000000000000004002d47fbacb3064d1cbe8150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158df5f9b9349e0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad7b22536f75726365223a226d6574616d61736b222c22416d6f756e74496e555344223a2231342e343038343236222c22416d6f756e744f7574555344223a2231342e3430363333222c22416d6f756e744f7574223a2236313930383739373031313134343135222c22526f7574654944223a2236633962363436346f52564c623748723a35363562356163354d7a424453725a37222c2254696d657374616d70223a313737363831363532397d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012", + "gasLimit": 335824, + "feeEstimate": 629470233489375, + "effectiveGas": 263125, + "gasCost": "76907733226250" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "55f644b4-3d48-4c3c-83fc-27adc6b62589" + }, + { + "quote": { + "requestId": "0xe85477ecddedf1d7791c682329a82e4feba1d44a6cb71b2e44fc0851dfb39da1", + "bridgeId": "openocean", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "openocean", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4810126981706790", + "minDestTokenAmount": "4713924442072654", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1329643509443150", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54197217450251", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "108725394123326", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.2529846829684849" + } + ] + }, + "bridges": ["openocean"], + "protocols": ["openocean"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "11.192311228827963", + "priceImpact": "0.00017427172484729865", + "totalFeeAmountUsd": "0.12610729981694505", + "swapRate": "0.000333834023611699", + "cost": { + "usd": "3.2224636950837837" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f70656e4f6365616e46656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000010bf4a0fde264e00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000004ea9886f3c359000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000dc490411a320000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001590b6941ef51b000000000000000000000000000000000000000000000000001601617d05777f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ef53a4bd0e16ccc9116770a41c4bd3ad1147bd4f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000860000000000000000000000000000000000000000000000000000000000000098000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008487517c45000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004a424856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef000000000000000000000000000000000000000000000000001601617d05777f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c9", + "gasLimit": 448035, + "feeEstimate": 773746605219582, + "effectiveGas": 323434, + "gasCost": "94535204896148" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "eb0d9c2f-3d91-43cd-bda6-18f66ab5c56b" + }, + { + "quote": { + "requestId": "0xa6fc34fef522a04e60231368295989cf2d5f546e1122a6d769522042bb16a79f", + "bridgeId": "relay", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "relay", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4100150540798504", + "minDestTokenAmount": "4018147529982533", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1970928114339421", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "53590858242075", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "157447411319272", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.36635216416538274" + } + ] + }, + "bridges": ["relay"], + "protocols": ["relay"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "9.540322139558324", + "priceImpact": "0.011360335612132242", + "totalFeeAmountUsd": "0.12469640962627415", + "swapRate": "0.000284560003853114", + "cost": { + "usd": "4.874452784353423" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000e72656c617941646170746572563300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000e467be02e024500000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000007314a0e33a678000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000008a4f9e4bab400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000540000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d35000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d350000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000204e21dd0d30000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015c25abeb630a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000ac00699d32e9f569b22ae8d8c6f788037c1cd53632a059dac17f958d2ee523a2206206994597c13d831ec7a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064fd0b31d2e955fa55e3fa641fe90e08b677188d3504c8577958ccc170eb3d2cca76f9d51bc6e42d8f0000003f7191a6a3006ea020c73acd7068295b9b3767a3bb836951eb21f3df98273517b7249dceff270d34bf01b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c4a6bd8c96000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002159bae0e78e30d384fd6c87310ca333dfabb3fd03440da5093af9b6862e8b7ce2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002159bae0e78e30d384fd6c87310ca333dfabb3fd03440da5093af9b6862e8b7ce200000000000000000000000000000000000000000000000000000000000000002ec7b8e2686b9fa3905ad04430df3bbafd333ac01378c6df483d03e87e0eab95000000000000000000000000000000000000000000000000000000006a", + "gasLimit": 692558, + "feeEstimate": 1172523922582221, + "effectiveGas": 490127, + "gasCost": "143257222092094" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "68d81104-5ce3-43d5-b455-071b9c6c0394" + }, + { + "quote": { + "requestId": "0x9265083b401b014e55680831e35aebc009f5b4b15c39e212e9beb870263bebfa", + "bridgeId": "0x", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "0x", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5166875377680456", + "minDestTokenAmount": "5063537870126846", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "966228987009532", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54138373963215", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "76756621404576", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.17859902636676375" + } + ] + }, + "bridges": ["0x"], + "protocols": ["0x"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "12.022401389297206", + "priceImpact": "0.001259811445298311", + "totalFeeAmountUsd": "0.1259703814729593", + "swapRate": "0.000358593193774532", + "cost": { + "usd": "2.3923735346145403" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000430785632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000780000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011fd42c80e3efe00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003a004ca1757cb000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000006442213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000005641fff991f00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c2fde985450c00000000000000000000000000000000000000000000000000000000000000a0a4e92d85e1145ae3d6cca73d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000000e4c1fb425e00000000000000000000000017c1ae82d99379240059940093762c5e4539aba5000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e812bd00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4103b48be0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017c1ae82d99379240059940093762c5e4539aba50000000000000000000000000000000000000000000000000000000000001900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000d0a67cb08be17475f4315a04c5f0be3e200ef66c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015ff190d54ca3300000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f", + "gasLimit": 301571, + "feeEstimate": 512090332391457, + "effectiveGas": 214059, + "gasCost": "62566432177398" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "5f4f4200-750a-4c76-ae74-7ecdb09f1e4e" + }, + { + "quote": { + "requestId": "0xc7fc6aae02c7206c085bb43eee3119286db1f8807e9b5057783bf8dd1c7e31db", + "bridgeId": "uniswap", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "uniswap", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "5166358267808821", + "minDestTokenAmount": "5063031102452644", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "968069333292662", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54150054486393", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "77331255527228", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.1799360979176573" + } + ] + }, + "bridges": ["uniswap"], + "protocols": ["uniswap"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "12.021198166462375", + "priceImpact": "0.0010443301319967306", + "totalFeeAmountUsd": "0.12599755997598447", + "swapRate": "0.000358557305144199", + "cost": { + "usd": "2.393576757449372" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011fcccca5933a400000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003a1b3ff7db7ef000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000069e818990000000000000000000000000000000000000000000000000000000000000002000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bdac17f958d2ee523a2206206994597c13d831ec7000064c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000158e1dc37a0914756e69780000b2c5de0b000000000000000000000000000000000000e2", + "gasLimit": 302300, + "feeEstimate": 516793566516075, + "effectiveGas": 216025, + "gasCost": "63141066300050" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "f0f4e0a4-ccbe-4729-b0cd-055ad7895a35" + }, + { + "quote": { + "requestId": "0x4b9f2f606270d82b401d316f2ec2df1c4fa3a0a148f57a113f049159191e8840", + "bridgeId": "mayan", + "srcChainId": 1, + "destChainId": 1, + "aggregator": "mayan", + "aggregatorType": "AGG", + "srcAsset": { + "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "chainId": 1, + "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", + "symbol": "USDT", + "decimals": 6, + "name": "Tether USD", + "coingeckoId": "tether", + "aggregators": [ + "metamask", + "oneInch", + "liFi", + "socket", + "rubic", + "squid", + "rango", + "sonarwatch", + "sushiSwap", + "pmm", + "bancor" + ], + "occurrences": 11, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", + "metadata": { + "storage": { + "balance": 2, + "approval": 5 + } + } + }, + "srcTokenAmount": "14408738", + "destAsset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "destTokenAmount": "4458951315579674", + "minDestTokenAmount": "4369772289268080", + "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "feeData": { + "txFee": [ + { + "amount": "1677025378095194", + "maxFeePerGas": "2567794865", + "maxPriorityFeePerGas": "2100000004", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + } + } + ], + "metabridge": [ + { + "amount": "54163728695742", + "asset": { + "address": "0x0000000000000000000000000000000000000000", + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "symbol": "ETH", + "decimals": 18, + "name": "Ether", + "coingeckoId": "ethereum", + "aggregators": [], + "occurrences": 100, + "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", + "metadata": {} + }, + "quoteBpsFee": 87.5, + "baseBpsFee": 87.5 + } + ], + "network": [ + { + "amount": "140914258141342", + "asset": { + "chainId": 1, + "assetId": "eip155:1/slip44:60", + "address": "0x0000000000000000000000000000000000000000", + "symbol": "ETH", + "name": "Ether", + "decimals": 18 + }, + "usd": "0.3278824529363418" + } + ] + }, + "bridges": ["mayan"], + "protocols": ["mayan"], + "steps": [], + "slippage": 2, + "gasSponsored": false, + "gasIncluded": true, + "gasIncluded7702": false, + "priceData": { + "totalFromAmountUsd": "14.414774923911747", + "totalToAmountUsd": "10.375187821019091", + "priceImpact": "0.0007920694632009893", + "totalFeeAmountUsd": "0.12602937743265957", + "swapRate": "0.000309461613888716", + "cost": { + "usd": "4.039587102892655" + } + } + }, + "approval": { + "chainId": 1, + "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", + "gasLimit": 48936, + "feeEstimate": 116143089275727, + "effectiveGas": 48549, + "gasCost": "14190189227178" + }, + "trade": { + "chainId": 1, + "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", + "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", + "value": "0x0", + "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000f6d6179616e46656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b20000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000f8648e50d1970000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000062681dfbfd218000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000009e430dedc57000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000158d4b84bd8400000000000000000000000000238856de6d9d32ea3dd4e9e7dbfe08b23cd5048c000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000007642213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000006841fff991f000000000000000000000000337685fdab40d39bd02028545a4ffa7d287cc3e2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000158d4d4a90c12800000000000000000000000000000000000000000000000000000000000000a043741dcb1774bc1eebcfa8be00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000e4c1fb425e0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e812bd00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000072d63a5b080e1b89cc93f9b9f50cbfa5e291c8ac00000000000000000000000000000000000000000000000000000000000000a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001041679c792000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000001c798614ef4c6a8f8a1aab25785714933e59e9630000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a0000000000000000000000000000000000000000000000000000000069e812bd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001601bbb8bd6754000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000646eb183d000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000001f3c3f0243d06a0353abcb066be9140747aeb8c9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009b", + "gasLimit": 578366, + "feeEstimate": 1037204269347726, + "effectiveGas": 433562, + "gasCost": "126724068914164" + }, + "estimatedProcessingTimeInSeconds": 0, + "quoteId": "89a89cc7-13e1-486f-950e-c6ebd7e319c8" + } +] diff --git a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts index 1e885f0d41..d6a4aaf648 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller-method-action-types.ts @@ -40,6 +40,11 @@ export type BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction = { handler: BridgeStatusController['getBridgeHistoryItemByTxMetaId']; }; +export type BridgeStatusControllerSubmitBatchSellAction = { + type: `BridgeStatusController:submitBatchSell`; + handler: BridgeStatusController['submitBatchSell']; +}; + /** * Union of all BridgeStatusController action types. */ @@ -50,4 +55,5 @@ export type BridgeStatusControllerMethodActions = | BridgeStatusControllerSubmitTxAction | BridgeStatusControllerSubmitIntentAction | BridgeStatusControllerRestartPollingForFailedAttemptsAction - | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction; + | BridgeStatusControllerGetBridgeHistoryItemByTxMetaIdAction + | BridgeStatusControllerSubmitBatchSellAction; diff --git a/packages/bridge-status-controller/src/bridge-status-controller.ts b/packages/bridge-status-controller/src/bridge-status-controller.ts index 9e65ba5ebb..bf6aa2eb52 100644 --- a/packages/bridge-status-controller/src/bridge-status-controller.ts +++ b/packages/bridge-status-controller/src/bridge-status-controller.ts @@ -25,7 +25,10 @@ import { TransactionType, TransactionController, } from '@metamask/transaction-controller'; -import type { TransactionMeta } from '@metamask/transaction-controller'; +import type { + TransactionBatchResult, + TransactionMeta, +} from '@metamask/transaction-controller'; import { numberToHex } from '@metamask/utils'; import type { Hex } from '@metamask/utils'; @@ -50,7 +53,11 @@ import type { BridgeStatusControllerMessenger } from './types'; import { BridgeClientId } from './types'; import { getAccountByAddress } from './utils/accounts'; import { getJwt } from './utils/authentication'; -import { stopPollingForQuotes, trackMetricsEvent } from './utils/bridge'; +import { + getBatchSellTrades, + stopPollingForQuotes, + trackMetricsEvent, +} from './utils/bridge'; import { fetchBridgeTxStatus, getStatusRequestWithSrcTxHash, @@ -109,6 +116,7 @@ const MESSENGER_EXPOSED_METHODS = [ 'resetState', 'submitTx', 'submitIntent', + 'submitBatchSell', 'restartPollingForFailedAttempts', 'getBridgeHistoryItemByTxMetaId', ] as const; @@ -959,10 +967,11 @@ export class BridgeStatusController extends StaticIntervalPollingController => { - let tradeTxMeta!: TransactionMeta; + ): Promise => { + let tradeTxMeta!: TransactionMeta | TransactionBatchResult; const steps = executeSubmitStrategy(params); + console.error('====executeSubmitStrategy====', params); // Each submission strategy determines when to execute step, which means these actions can happen in any order for await (const { type, payload } of steps) { @@ -981,11 +990,19 @@ export class BridgeStatusController extends StaticIntervalPollingController, activeAbTests?: { key: string; value: string }[], tokenSecurityTypeDestination?: string | null, - batchSellTradesResponse?: BatchSellTradesResponse, - ): Promise => { + batchSellTrades?: BatchSellTradesResponse | null, + ): Promise => { /** * If there are multiple quote responses, we assume that they all originate from the same src chain * and the same account. In this case its safe to use the first quote response's properties for @@ -1113,7 +1130,7 @@ export class BridgeStatusController extends StaticIntervalPollingController = { messenger: this.messenger, quoteResponses, - batchSellTradesResponse, + batchSellTrades, isStxEnabled, isBridgeTx, isDelegatedAccount, @@ -1125,6 +1142,7 @@ export class BridgeStatusController extends StaticIntervalPollingController> => { + }): Promise => { // TODO add metrics context return await this.submitTx( params.accountAddress, @@ -1191,8 +1209,7 @@ export class BridgeStatusController extends StaticIntervalPollingController & QuoteMetadata)[]; - batchSellTradesResponse: BatchSellTradesResponse; + quoteResponses: ((QuoteResponse & QuoteMetadata) | null)[]; accountAddress: string; location?: MetaMetricsSwapsEventSource; abTests?: Record; @@ -1200,17 +1217,27 @@ export class BridgeStatusController extends StaticIntervalPollingController => { + }): Promise => { + /** + * Retrieve the batch sell trades from the BridgeController's state to ensure we submit + * the original response data from the bridge-api + */ + const batchSellTrades = getBatchSellTrades(this.messenger); return await this.submitTx( params.accountAddress, - params.quoteResponses, + params.quoteResponses.filter( + ( + quoteResponse, + ): quoteResponse is QuoteResponse & QuoteMetadata => + quoteResponse !== null, + ), params.isStxEnabled ?? false, params.quotesReceivedContext, params.location, params.abTests, params.activeAbTests, params.tokenSecurityTypeDestination, - params.batchSellTradesResponse, + batchSellTrades, ); }; diff --git a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts index 85f0b4bff3..67f38b29ca 100644 --- a/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-sell-strategy.ts @@ -1,4 +1,8 @@ -import { BatchSellTradesResponse, TxData } from '@metamask/bridge-controller'; +import { + BatchSellTradesResponse, + isNativeAddress, + TxData, +} from '@metamask/bridge-controller'; import { TransactionType } from '@metamask/transaction-controller'; import { @@ -9,8 +13,13 @@ import { } from '../utils/transaction'; import { SubmitStep } from './types'; import type { SubmitStrategyParams, SubmitStepResult } from './types'; -import { BatchSimulationTransactionType } from '@metamask/bridge-controller'; +// import { BatchTransactionType } from '@metamask/bridge-controller'; +enum BatchTransactionType { + TRADE = 'trade', + APPROVAL = 'approval', + TRANSFER = 'transfer', +} /** * Submits batched EVM transactions to the TransactionController * @@ -26,24 +35,28 @@ export async function* submitBatchSellHandler( messenger, addTransactionBatchFn, isDelegatedAccount, - batchSellTradesResponse, + batchSellTrades, } = args; const tradeData: TradeWithMetadata[] = []; const batchId = generateBatchId(); - const { transactions } = batchSellTradesResponse; + const { transactions, fee } = batchSellTrades; for (const transaction of transactions.values()) { const { type, maxFeePerGas, maxPriorityFeePerGas, ...tx } = transaction; - const quoteResponse = quoteResponses.find( - ({ approval, trade }) => - trade?.data.toLowerCase() === tx.data.toLowerCase() || - approval?.data.toLowerCase() === tx.data.toLowerCase(), + const quoteResponseIndex = Math.max( + 0, + quoteResponses.findIndex( + ({ approval, trade }) => + trade?.data.toLowerCase() === tx.data.toLowerCase() || + approval?.data.toLowerCase() === tx.data.toLowerCase(), + ), ); + const quoteResponse = quoteResponses[quoteResponseIndex]; - if (type === BatchSimulationTransactionType.TRADE) { + if (type === BatchTransactionType.TRADE) { tradeData.push({ tx, type: TransactionType.swap, @@ -54,22 +67,21 @@ export async function* submitBatchSellHandler( txFee: { maxFeePerGas, maxPriorityFeePerGas }, }); - /* yield { type: SubmitStep.AddHistoryItem, payload: { - historyKey: tx.data, - quoteRequestIndex: index, - tradeTxData: quoteResponses[index].trade.data, - approvalTxData: quoteResponses[index].approval?.data, + historyKey: `${batchId}-${quoteResponseIndex}`, batchId, + quoteResponse, + approvalTxData: quoteResponse?.approval?.data, + tradeTxData: quoteResponse?.trade?.data, }, - };*/ + }; } else { tradeData.push({ tx, type: - type === BatchSimulationTransactionType.APPROVAL + type === BatchTransactionType.APPROVAL ? TransactionType.swapApproval : TransactionType.tokenMethodTransfer, txFee: { maxFeePerGas, maxPriorityFeePerGas }, @@ -77,39 +89,45 @@ export async function* submitBatchSellHandler( } } + console.error('====isDelegatedAccount====', isDelegatedAccount); + const transactionParams = await getAddTransactionBatchParams({ messenger, + batchId, tradeData, requireApproval, isDelegatedAccount, - isAtomic: false, - gasIncluded: quoteResponses[0].quote.gasIncluded, - gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, - gasSponsored: quoteResponses[0].quote.gasSponsored, - batchId, + atomic: false, + // BatchSell quotes have not been simulated so determine gas params from the batchSellTrades response + gasIncluded: !isNativeAddress(fee.asset.assetId), + gasIncluded7702: Boolean( + transactions.some(({ type }) => type === BatchTransactionType.TRANSFER), + ), + gasSponsored: false, + skipInitialGasEstimate: false, + // ADDED THESE FOR 7702 + // gasIncluded: false, // hardcoded for batch sell to prevent stx + // gasIncluded7702: true, + // gasFeeToken: tradeData.find( + // ({ type }) => type === TransactionType.tokenMethodTransfer, + // )?.tx.to, + // excludeNativeTokenForFee: true, + // disableHook: true, + // disableSequential: true, + // END 7702 }); - const allTransactionMetas = await addTransactionBatch( - messenger, + const { transactionBatchResponse } = await addTransactionBatch( addTransactionBatchFn, transactionParams, ); - for (const [index, tx] of allTransactionMetas.entries()) { - if (tx.tradeMeta) { - yield { - type: SubmitStep.AddHistoryItem, - payload: { - historyKey: tx.tradeMeta.id, - quoteRequestIndex: index, - batchId, - approvalTxId: tx.approvalMeta?.id, - bridgeTxMeta: { - id: tx.tradeMeta.id, - hash: tx.tradeMeta.hash, - batchId: tx.tradeMeta.batchId, - }, - }, - }; - } - } + + // TODO rm this, subscriber should update each history item with batchId when they get status updates + + yield { + type: SubmitStep.SetTradeMeta, + payload: { + tradeMeta: transactionBatchResponse, + }, + }; } diff --git a/packages/bridge-status-controller/src/strategy/batch-strategy.ts b/packages/bridge-status-controller/src/strategy/batch-strategy.ts index ff6180e700..459a53f317 100644 --- a/packages/bridge-status-controller/src/strategy/batch-strategy.ts +++ b/packages/bridge-status-controller/src/strategy/batch-strategy.ts @@ -3,6 +3,7 @@ import { TransactionType } from '@metamask/transaction-controller'; import { addTransactionBatch, + findAndUpdateTransactionsInBatch, getAddTransactionBatchParams, TradeWithMetadata, } from '../utils/transaction'; @@ -67,38 +68,47 @@ export async function* submitBatchHandler( tradeData, requireApproval, isDelegatedAccount, - isAtomic: isAtomicBatch, + atomic: isAtomicBatch, gasIncluded: quoteResponses[0].quote.gasIncluded, gasIncluded7702: quoteResponses[0].quote.gasIncluded7702, gasSponsored: quoteResponses[0].quote.gasSponsored, }); - const allTransactionMetas = await addTransactionBatch( - messenger, + const { transactionBatchResponse, txDataByType } = await addTransactionBatch( addTransactionBatchFn, transactionParams, ); + const allTransactionMetas = findAndUpdateTransactionsInBatch({ + messenger, + batchId: transactionBatchResponse.batchId, + txDataByType, + }); + const { tradeMeta, approvalMeta } = allTransactionMetas.find((tx) => tx.tradeMeta) ?? {}; - if (tradeMeta) { - yield { - type: SubmitStep.SetTradeMeta, - payload: { tradeMeta }, - }; + if (!tradeMeta) { + throw new Error( + 'Failed to update cross-chain swap transaction batch: tradeMeta not found', + ); + } + + yield { + type: SubmitStep.SetTradeMeta, + payload: { tradeMeta }, + }; - yield { - type: SubmitStep.AddHistoryItem, - payload: { - historyKey: tradeMeta.id, - isAtomicBatch, - approvalTxId: approvalMeta?.id, - bridgeTxMeta: { - id: tradeMeta.id, - hash: tradeMeta.hash, - batchId: tradeMeta.batchId, - }, + yield { + type: SubmitStep.AddHistoryItem, + payload: { + historyKey: tradeMeta.id, + approvalTxId: approvalMeta?.id, + bridgeTxMeta: { + id: tradeMeta.id, + hash: tradeMeta.hash, + batchId: tradeMeta.batchId, }, - }; - } + isAtomicBatch, + }, + }; } diff --git a/packages/bridge-status-controller/src/strategy/index.ts b/packages/bridge-status-controller/src/strategy/index.ts index 52ff1f19f3..2d7fb17598 100644 --- a/packages/bridge-status-controller/src/strategy/index.ts +++ b/packages/bridge-status-controller/src/strategy/index.ts @@ -48,7 +48,7 @@ const validateParams = < const validateBatchSellParams = ( params: SubmitStrategyParams, ): params is SubmitStrategyParams => - Boolean(params.batchSellTradesResponse); + Boolean(params.batchSellTrades); /** * Selects the appropriate submit strategy based on the quote parameters then executes it @@ -83,22 +83,33 @@ const executeSubmitStrategy = ( ); } - if (validateBatchSellParams(params)) { - return submitBatchSellHandler(params); - } - // Intent transactions if (quoteResponse.quote.intent) { + console.error('====submitIntentHandler====', params); return submitIntentHandler(params); } + // Batch sell transactions + // TODO check isDelegatedAccount to enable this ? only if we limit to 7702 + if (validateBatchSellParams(params)) { + console.error('====submitBatchSellHandler====', params); + return submitBatchSellHandler(params); + } + // Batched transactions const shouldBatchTxs = isStxEnabled || quoteResponse.quote.gasIncluded7702 || isDelegatedAccount; if (shouldBatchTxs) { + console.error('====submitBatchHandler====', params); return submitBatchHandler(params); } + console.error('====submitBatchHandler====', params, { + isStxEnabled, + isDelegatedAccount, + gasIncluded7702: quoteResponse.quote.gasIncluded7702, + }); + // Non-stx/gasless EVM transactions return defaultSubmitHandler(params); }; diff --git a/packages/bridge-status-controller/src/strategy/types.ts b/packages/bridge-status-controller/src/strategy/types.ts index fe297e168a..16678fcc39 100644 --- a/packages/bridge-status-controller/src/strategy/types.ts +++ b/packages/bridge-status-controller/src/strategy/types.ts @@ -9,6 +9,7 @@ import type { } from '@metamask/bridge-controller'; import type { TraceCallback } from '@metamask/controller-utils'; import type { + TransactionBatchResult, TransactionController, TransactionMeta, } from '@metamask/transaction-controller'; @@ -21,6 +22,8 @@ import type { export enum SubmitStep { AddHistoryItem = 'addHistoryItem', + AddBatchHistoryItem = 'addBatchHistoryItem', + AddBatchHistoryItemEntry = 'addNestedHistoryItemEntry', RekeyHistoryItem = 'rekeyHistoryItem', StartPolling = 'startPolling', PublishCompletedEvent = 'publishCompletedEvent', @@ -38,13 +41,30 @@ export type SubmitStepResult = 'approvalTxId' | 'bridgeTxMeta' | 'originalTransactionId' | 'actionId' > & { historyKey: string; - tradeTxData?: string; - approvalTxData?: string; - quoteRequestIndex?: number; batchId?: string; isAtomicBatch?: boolean; + quoteResponse?: QuoteResponse & QuoteMetadata; + approvalTxData?: TxData['data']; + tradeTxData?: TxData['data']; }; } + // | { + // type: SubmitStep.AddBatchHistoryItem; + // payload: { + // historyKey: string; + // batchId: string; + // }; + // } + // | { + // type: SubmitStep.AddBatchHistoryItemEntry; + // payload: { + // historyKey: string; + // quote: Quote; + // tradeTxData: TxData['data']; + // approvalTxData?: TxData['data']; + // hasApprovalTx: boolean; + // }; + // } | { type: SubmitStep.RekeyHistoryItem; payload: { @@ -74,7 +94,7 @@ export type SubmitStepResult = type: SubmitStep.SetTradeMeta; /** The {@link TransactionMeta} for the transaction that has been submitted successfully */ payload: { - tradeMeta: TransactionMeta; + tradeMeta: TransactionMeta | TransactionBatchResult; quoteRequestIndex?: number; }; }; @@ -84,11 +104,12 @@ export type SubmitStepResult = */ export type SubmitStrategyParams< TradeType extends Trade = TxData, - BatchSellTradesResponseType extends BatchSellTradesResponse | undefined = + BatchSellTradesResponseType extends | BatchSellTradesResponse - | undefined, + | undefined + | null = BatchSellTradesResponse | undefined | null, > = { - batchSellTradesResponse: BatchSellTradesResponseType; + batchSellTrades: BatchSellTradesResponseType; addTransactionBatchFn: TransactionController['addTransactionBatch']; isBridgeTx: boolean; isDelegatedAccount: boolean; diff --git a/packages/bridge-status-controller/src/types.ts b/packages/bridge-status-controller/src/types.ts index 28a5645a6f..43ae8ec923 100644 --- a/packages/bridge-status-controller/src/types.ts +++ b/packages/bridge-status-controller/src/types.ts @@ -4,14 +4,15 @@ import type { ControllerStateChangeEvent, } from '@metamask/base-controller'; import type { - BridgeBackgroundAction, - BridgeControllerAction, ChainId, FeatureId, Quote, QuoteMetadata, QuoteResponse, MetaMetricsSwapsEventSource, + BridgeControllerGetStateAction, + BridgeControllerStopPollingForQuotesAction, + BridgeControllerTrackUnifiedSwapBridgeEventAction, } from '@metamask/bridge-controller'; import type { GetGasFeeState } from '@metamask/gas-fee-controller'; import type { KeyringControllerSignTypedMessageAction } from '@metamask/keyring-controller'; @@ -319,8 +320,9 @@ type AllowedActions = | TransactionControllerAddTransactionAction | TransactionControllerEstimateGasFeeAction | TransactionControllerIsAtomicBatchSupportedAction - | BridgeControllerAction - | BridgeControllerAction + | BridgeControllerTrackUnifiedSwapBridgeEventAction + | BridgeControllerStopPollingForQuotesAction + | BridgeControllerGetStateAction | GetGasFeeState | AccountsControllerGetAccountByAddressAction | AuthenticationControllerGetBearerTokenAction diff --git a/packages/bridge-status-controller/src/utils/bridge.ts b/packages/bridge-status-controller/src/utils/bridge.ts index b5a94ff3a7..5a541bed20 100644 --- a/packages/bridge-status-controller/src/utils/bridge.ts +++ b/packages/bridge-status-controller/src/utils/bridge.ts @@ -2,8 +2,9 @@ import { AbortReason, FeatureId, UnifiedSwapBridgeEventName, + BatchSellTradesResponse, + RequiredEventContextFromClient, } from '@metamask/bridge-controller'; -import type { RequiredEventContextFromClient } from '@metamask/bridge-controller'; import { BridgeStatusControllerMessenger } from '../types'; @@ -21,6 +22,12 @@ export const stopPollingForQuotes = ( ); }; +export const getBatchSellTrades = ( + messenger: BridgeStatusControllerMessenger, +): BatchSellTradesResponse | null => { + return messenger.call('BridgeController:getState').batchSellTrades; +}; + export const trackMetricsEvent = ({ messenger, eventName, diff --git a/packages/bridge-status-controller/src/utils/transaction.test.ts b/packages/bridge-status-controller/src/utils/transaction.test.ts index 773105ad54..093df7b200 100644 --- a/packages/bridge-status-controller/src/utils/transaction.test.ts +++ b/packages/bridge-status-controller/src/utils/transaction.test.ts @@ -29,6 +29,321 @@ import { waitForTxConfirmation, } from './transaction'; +const mockTxDataByType = [ + { + swapApproval: + '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + swap: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + }, + { + swapApproval: + '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + swap: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + }, + {}, // TODO ignore this bc it's the transfer +]; + +const addTransactionBatchNested = [ + { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'batch', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, +]; + +const resultAllTxMetas = [ + { + tradeMeta: { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'swap', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, + }, + { + tradeMeta: { + batchId: '0x19e28f7e5fc', + chainId: '0x38', + id: '108f1b10-4ff2-11f1-9f48-c9082a6dd9ea', + isGasFeeTokenIgnoredIfBalance: false, + isGasFeeIncluded: true, + isGasFeeSponsored: false, + excludeNativeTokenForFee: true, + nestedTransactions: [ + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e', + gas: '0x793f5', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3', + value: '0x0', + data: '0x095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32', + gas: '0x1110c', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swapApproval', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x1a1ec25DC08e98e5E93F1104B5e5cdD298707d31', + value: '0x0', + data: '0x5f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c', + gas: '0x5d131', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'swap', + }, + { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + to: '0x55d398326f99059ff775485246999027b3197955', + value: '0x0', + data: '0xa9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d', + gas: '0xcc57', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: 'transfer', + }, + ], + networkClientId: '9a1eafde-5f04-434b-b011-e9de5c50baf0', + origin: 'metamask', + selectedGasFeeToken: '0x55d398326f99059ff775485246999027b3197955', + status: 'submitted', + time: 1778803650369, + txParams: { + from: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + data: '0xe9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000', + gas: '0x916a8', + gasLimit: '0x916a8', + to: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + value: '0x0', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + type: '0x2', + }, + type: 'swap', + userEditedGasLimit: false, + verifiedOnBlockchain: false, + gasLimitNoBuffer: '0x916a8', + originalGasEstimate: '0x916a8', + defaultGasEstimates: { + gas: '0x916a8', + maxFeePerGas: '0x3938700', + maxPriorityFeePerGas: '0x3938700', + estimateType: 'medium', + }, + userFeeLevel: 'medium', + delegationAddress: '0x63c0c19a282a1b52b07dd5a65b58948a07dae32b', + r: '0x36c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289', + s: '0x388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + v: '0x1', + rawTx: + '0x02f910b1385c84039387008403938700830916a894141d32a89a1e0a5ef360034a2f60a4b917c1883880b91044e9ae5c53010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000ec0000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000295b637bd12ec91000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000004455f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0000000000000000000000000000000000000000000000000295b637bd12ec9100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd00000000000000000000000055d398326f99059ff775485246999027b31979550000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a6091f10cd19fbb0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000003cd2b07f1fb9f4000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c420000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000022e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000120000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000295b637bd12ec910000000000000000000000000000000000000000000000001a9ee71032febe7d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000042f8a0bf9cf54bb92f17374d9e9a321e6a111a51bd0001f42170ed0880ac9a755fd29b2688956bd959f933f80001f455d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000003203235c920cba32000000000000000000000000000000000000000000000000000000000000000000000000000000001a1ec25dc08e98e5e93f1104b5e5cdd298707d310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006e55f57552900000000000000000000000000000000000000000000000000000000000000800000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000003203235c920cba3200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000031931c550a5f2d0c000000000000000000000000000000000000000000000000309435be821a88f300000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000070070787ad8d26000000000000000000000000b28da7bc87a9dd1e60849aa7fcb5da24ea913c42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004ce3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006a066ac1000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000031931c550a5f2d0c00000000000000000000000000000000000000000000000030992fb8beccff6d0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000c590175e458b83680867afd273527ff58f74c02b0000000000000000000000000000000000000000000000000000000000000000756e69780000b2c5de0b0000000000000000000000000000000000005c00000000000000000000000000000000000000000000000000000000000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000c673dfa365026d00000000000000000000000000000000000000000000000000000000c001a036c7f0a5e218d9724269d6d9d0ed4612887e4b3d48d032ef38697f19eea62289a0388c9351834ccf3f9439936564f0fcad7594717a049cc3bc6bc2cbb731a74bce', + hash: '0x1af8fb2bebcc7b224ced25e09d3952f2b3a98f4bb8924502510d53301a0df3d5', + submittedTime: 1778803654101, + }, + }, +]; + describe('Bridge Status Controller Transaction Utils', () => { describe('waitForTxConfirmation', () => { it('resolves when confirmed', async () => { @@ -2510,5 +2825,41 @@ describe('Bridge Status Controller Transaction Utils', () => { }), ); }); + + it.only('should handle multiple swaps in a batch', () => { + const txs = addTransactionBatchNested; + + const mockMessenger = createMockMessagingSystemWithTxs(txs); + const callSpy = jest.spyOn(mockMessenger, 'call'); + + const result = findAndUpdateTransactionsInBatch({ + messenger: mockMessenger as unknown as BridgeStatusControllerMessenger, + batchId: '0x19e28f7e5fc', + txDataByType: mockTxDataByType, + }); + + expect(result).toStrictEqual(resultAllTxMetas); + + // Should identify and update 7702 transaction with delegationAddress + expect( + callSpy.mock.calls.find( + ([action]) => action === 'TransactionController:updateTransaction', + ), + ).toMatchInlineSnapshot(` + [ + "TransactionController:updateTransaction", + { + "batchId": "test-batch-id", + "delegationAddress": "0xDelegationAddress", + "id": "tx1", + "txParams": { + "data": "0xbatchData", + }, + "type": "swap", + }, + "Update tx type to swap", + ] + `); + }); }); }); diff --git a/packages/bridge-status-controller/src/utils/transaction.ts b/packages/bridge-status-controller/src/utils/transaction.ts index d42e09c348..7afd068184 100644 --- a/packages/bridge-status-controller/src/utils/transaction.ts +++ b/packages/bridge-status-controller/src/utils/transaction.ts @@ -67,7 +67,9 @@ const appendGasFees = async ( value: trade.value, data: trade.data, }; - if (isGasIncluded7702) { + // TODO always add simulatedGasFeeLimits for gasIncluded and 7702 + // TODO add gasLimit? + if (isGasIncluded7702 && !simulatedGasFeeLimits) { return normalizedTrade; } const transactionParams = { @@ -205,7 +207,8 @@ export const addTransaction = async ( }; export const generateActionId = () => (Date.now() + Math.random()).toString(); -export const generateBatchId = () => toHex(Date.now() + Math.random()); +export const generateBatchId = () => + toHex(Date.now() + Math.floor(Math.random() * 1000000)); /** * Adds a synthetic transaction to the TransactionController to display pending intent orders in the UI @@ -320,20 +323,19 @@ export const getAddTransactionBatchParams = async ({ messenger, tradeData, requireApproval = false, - isAtomic, gasIncluded7702, gasSponsored, gasIncluded, isDelegatedAccount, - batchId, -}: GaslessProperties & { - messenger: BridgeStatusControllerMessenger; - tradeData: TradeWithMetadata[]; - requireApproval?: boolean; - isDelegatedAccount: boolean; - isAtomic?: boolean; - batchId?: Hex; -}): Promise[0]> => { + ...addTransactionBatchParams +}: GaslessProperties & + Partial[0]> & { + messenger: BridgeStatusControllerMessenger; + tradeData: TradeWithMetadata[]; + requireApproval?: boolean; + isDelegatedAccount: boolean; + isAtomic?: boolean; + }): Promise[0]> => { const trade = tradeData[0].tx; const selectedAccount = getAccountByAddress(messenger, trade.from); if (!selectedAccount) { @@ -389,11 +391,19 @@ export const getAddTransactionBatchParams = async ({ from: selectedAccount.address as Hex, isInternal: true, transactions, - atomic: isAtomic, - batchId, + ...addTransactionBatchParams, }; }; +// TODO txDataByType revert to old +// TODO should return only 1 txMeta +// tx matcher should check nestedTransactions +// When batch is submitted, txType is batch +// This updates it from batch -> swap or swapApproval etc IF it has a delegation Address +// BUT if it doesn't have a delegation Address, then there are multiple txMetas for the same batchId ITHINK (check this) +// AND each one gets updated to swap/swapApproval etc +// TODO if there is delegationAddress and there are nestedTransactions, then the batch should be updated to the swap and be done (not approval) +// TODO TxHistory -> batchId, txMetaId, key by batchId-quoteRequestIndex, then txMetaId-nestedTransactionIndex export const findAndUpdateTransactionsInBatch = ({ messenger, batchId, @@ -414,8 +424,10 @@ export const findAndUpdateTransactionsInBatch = ({ const txEntries = txDataByType.flatMap( (list) => Object.entries(list) as [TransactionType, string][], ); + console.error('====findAndUpdateTransactionsInBatch INPUTS FOR TESTING====', { + txDataByType, + }); txEntries.forEach(([txType, txData], index) => { - txBatch[index] ??= {}; // Skip types not present in the batch (e.g. swap entry is undefined for bridge txs) if (txData === undefined) { return; @@ -451,7 +463,17 @@ export const findAndUpdateTransactionsInBatch = ({ }); if (txMeta) { + // console.error( + // '====findAndUpdateTransactionsInBatch txMetas FOR TESTING====', + // txMeta, + // ); + txBatch[index] ??= {}; const updatedTx = { ...txMeta, type: txType }; + // This updates the entire batch to Swap + // Which is ok for non-BatchSell trades but not needed + // TODO logic should be generic. So if txMeta is batch AND its nestedTransactions includes a swap/bridge trade, update the batch to the trade type + // TODO BUT IF THERE ARE MULTIPLE SWAPS THEY ONLY SHOW UP AS ONE + // FOR TESTING SHOW MULTIPLE SWAPS IN DETAILS updateTransaction( messenger, txMeta, @@ -467,11 +489,10 @@ export const findAndUpdateTransactionsInBatch = ({ } }); - return txBatch; + return txBatch.filter(Boolean); }; export const addTransactionBatch = async ( - messenger: BridgeStatusControllerMessenger, addTransactionBatchFn: TransactionController['addTransactionBatch'], args: Parameters[0], ) => { @@ -487,23 +508,10 @@ export const addTransactionBatch = async ( } }); - const { batchId } = await addTransactionBatchFn(args); - - const allTransactionMetas = findAndUpdateTransactionsInBatch({ - messenger, - batchId, - txDataByType, - }); - - const tradeMeta = allTransactionMetas.find((tx) => tx.tradeMeta); - - if (!tradeMeta) { - throw new Error( - 'Failed to update cross-chain swap transaction batch: tradeMeta not found', - ); - } + console.error('====addTransactionBatch====', args); - return allTransactionMetas; + const results = await addTransactionBatchFn(args); + return { transactionBatchResponse: results, txDataByType }; }; /** diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index d75a550ae7..e8d738a200 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -3303,6 +3303,10 @@ export class TransactionController extends BaseController< if (transactionMeta.batchTransactions?.length) { log('Found batch transactions', transactionMeta.batchTransactions); + console.error( + '====Found batch transactions====', + transactionMeta.batchTransactions, + ); const extraTransactionsPublishHook = new ExtraTransactionsPublishHook({ addTransactionBatch: this.addTransactionBatch.bind(this), getTransaction: this.#getTransactionOrThrow.bind(this), @@ -3860,6 +3864,7 @@ export class TransactionController extends BaseController< const { networkClientId } = transactionMeta; + // TODO error happens here await checkGasFeeTokenBeforePublish({ messenger: this.messenger, networkClientId, @@ -4683,6 +4688,9 @@ export class TransactionController extends BaseController< await this.#trace( { name: 'Publish', parentContext: traceContext }, async () => { + console.error('====Publish====', { + hasOverride: Boolean(publishHookOverride), + }); const publishHook = publishHookOverride ?? this.#publish; ({ transactionHash } = await publishHook(transactionMeta, signedTx)); diff --git a/packages/transaction-controller/src/utils/batch.ts b/packages/transaction-controller/src/utils/batch.ts index 0645744377..f9b3256713 100644 --- a/packages/transaction-controller/src/utils/batch.ts +++ b/packages/transaction-controller/src/utils/batch.ts @@ -145,8 +145,10 @@ export async function addTransactionBatch( if (!transactionBatchRequest.disable7702 && accountCanUse7702) { try { + console.error('====addTransactionBatchWith7702 attempt====', request); return await addTransactionBatchWith7702(request); } catch (error: unknown) { + console.error('====addTransactionBatchWith7702 error====', error); const isEIP7702NotSupportedError = error instanceof JsonRpcError && error.message === 'Chain does not support EIP-7702'; @@ -156,6 +158,9 @@ export async function addTransactionBatch( } } } + console.error('====addTransactionBatchWithHook NO 7702====', { + accountCanUse7702, + }); return await addTransactionBatchWithHook(request); } @@ -433,8 +438,7 @@ async function addTransactionBatchWith7702( return { batchId }; } - - const { result } = await addTransaction(txParams, { + const opts = { batchId, gasFeeToken, excludeNativeTokenForFee, @@ -450,7 +454,12 @@ async function addTransactionBatchWith7702( securityAlertResponse, skipInitialGasEstimate, type: TransactionType.batch, + }; + console.error('====addTransactionBatchWith7702 addTransaction====', { + txParams, + opts, }); + const { result } = await addTransaction(txParams, opts); const transactionHash = await result; From a61a39bf23a71f994564ad721c46657134b17674 Mon Sep 17 00:00:00 2001 From: micaelae Date: Tue, 19 May 2026 10:02:12 -0700 Subject: [PATCH 8/8] chore: undo --- .../mock-quotes-erc20-native-gasIncluded.json | 1211 ---------------- packages/bridge-controller/tests/v2.json | 1242 ----------------- 2 files changed, 2453 deletions(-) delete mode 100644 packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json delete mode 100644 packages/bridge-controller/tests/v2.json diff --git a/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json b/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json deleted file mode 100644 index 26575cb876..0000000000 --- a/packages/bridge-controller/tests/mock-quotes-erc20-native-gasIncluded.json +++ /dev/null @@ -1,1211 +0,0 @@ -[ - { - "quote": { - "requestId": "0x6a47515696329fc021f05809a701dd64dee2e66489b05e8148daaf961a4ea045", - "bridgeId": "okx", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "okx", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4957536175634874", - "minDestTokenAmount": "4858385452122176", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1185357122341796", - "maxFeePerGas": "2734769381", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54224783210386", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ] - }, - "bridges": ["okx"], - "protocols": ["okx"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.539651319829108", - "priceImpact": "-0.0009637813454112697", - "totalFeeAmountUsd": "0.12621896623095138" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123276166587858, - "effectiveGas": 48549, - "gasCost": "21323266539309" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000046f6b7836000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001142ad030e4040000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000046764a7268336000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001049871efa400000000000000003bbd3996dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000159385696c503200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001f0000000000000003b6d03403af7a58d54cf014675af2b7ebc222c3166bf56927777777711118000000000000000000000000000000000000016043efddc3cf0777777771111000000000064fa00a9ed787f3793db668bff3e6e6e7db0f92a1b0000000000000000000000000000000000000000000000000000000049", - "gasLimit": 354487, - "feeEstimate": 645787438332892, - "effectiveGas": 254326, - "gasCost": "111702838078566" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "ee891e38-328e-407a-b2e3-067451a0cd9d" - }, - { - "quote": { - "requestId": "0x20144f1827580dae9717f0181dc329fc229f5bebea435ab76ec7391e9d309ec1", - "bridgeId": "1inch", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "1inch", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5027712466030201", - "minDestTokenAmount": "4927158216709596", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1108910779267246", - "maxFeePerGas": "2734769381", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "54169435961011", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["1inch"], - "protocols": ["1inch"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.703000591199263", - "priceImpact": "0.000057902628994835026", - "totalFeeAmountUsd": "0.1260901345015052" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123276166587858, - "effectiveGas": 48549, - "gasCost": "21323266539309" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563646656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000560000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001181396b4255dc0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000421d0b712ef61000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000042807ed23790000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e3000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e300000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158de21eabee880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002ce0000000000000000000000000000000000000002b000029a00025e00004e00a0744c8c09dac17f958d2ee523a2206206994597c13d831ec790cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000000000000000005a05120111111125421ca6dc452d289314280a0f8842a65dac17f958d2ee523a2206206994597c13d831ec70124cc713a04b603a75f1dc7f577a235263b790a6f8a2fc209152ce45685b24c2be638baeb98000000000000000000000000bee3211ab312a8d065c4fef0247448e17a8da0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000015fe44973c24510000000000000000000000000000000000000000000000000000000000dbd68200000000000000000000000000000cca830069e81001fd29e1d2454c98d1a6e30000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041ad019b49f5f19b25d6d68017e56cafa03d02fcc89010b2f75ea7da25bfff397f23dcb6ee334bf5bde0652673a6a649845f9d6ba3d986a60d21674a780b6f45741b000000000000000000000000000000000000000000000000000000000000004101c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c061111111125421ca6dc452d289314280a0f8842a650000000000000000000000000000000000007dcbea7c00000000000000000000000000000000000000000000000070", - "gasLimit": 330521, - "feeEstimate": 598441305514560, - "effectiveGas": 235680, - "gasCost": "103513305278880" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "01655c52-4408-41ff-b783-fdb64d031fdc" - }, - { - "quote": { - "requestId": "0x436804d4814a61731c3de729ee88745d3ad94544b0e45bcebc3ecfa29ea3b7af", - "bridgeId": "openocean", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "openocean", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4683190331479924", - "minDestTokenAmount": "4589526524850325", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1455710570940982", - "maxFeePerGas": "2734769381", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "54189541383286", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["openocean"], - "protocols": ["openocean"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "10.901056810291943", - "priceImpact": "-0.00031323393098036187", - "totalFeeAmountUsd": "0.12613693387007696" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123276166587858, - "effectiveGas": 48549, - "gasCost": "21323266539309" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f70656e4f6365616e46656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000104e266a337095000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000055d3f03d766ac000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000da40a9704d50000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d1d705e16de0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ef53a4bd0e16ccc9116770a41c4bd3ad1147bd4f00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000860000000000000000000000000000000000000000000000000000000000000098000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008487517c45000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004a424856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef000500000000000000000000000000000000000000000000001600953bf6fe2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025", - "gasLimit": 457333, - "feeEstimate": 842233516070222, - "effectiveGas": 331691, - "gasCost": "145682415738531" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "06c0b6ac-3d38-4d41-a480-769eaf5cce00" - }, - { - "quote": { - "requestId": "0x7c38ef7921435cbba74a9a6bfe38679d5281b516aa986ae947a81d57a76bdcda", - "bridgeId": "kyberswap", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "kyberswap", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4656608705028969", - "minDestTokenAmount": "4563476530928389", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1479602115167892", - "maxFeePerGas": "2734769381", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "54165795386353", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["kyberswap"], - "protocols": ["kyberswap"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "10.839182788622564", - "priceImpact": "0.00012510591060489168", - "totalFeeAmountUsd": "0.12608166034001272" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123276166587858, - "effectiveGas": 48549, - "gasCost": "21323266539309" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136b796265725377617046656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001036752d911b050000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000572f42b79fa85000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000ea4e21fd0e900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000b600000000000000000000000000000000000000000000000000000000000000da00000000000000000000000000000000000000000000000000000000000000aa000000000000000000000000000dbdc2200000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000004153edf746a147ad30af2d7e6a3833a821295de6e7e2fdc9a797e55372b7b21c54487ca90b38aebc729d8fc57762789e29aafeb8d67751beeb2e5e84f0b0d082241b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009a000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000d0dded00000000000000000000000000e6da5600000000000000000000000000dbdc2200000000000000000015fe1d5f329def0000000000000000000000000000000000000170f9a6a70000000f42400000000000000000000000000000004f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e814840000000000000000000000000000000000000000000000000000000000000980000000000000000000000000000000000000000000000000000000000000000261f598cd000000000000000031439a79a3535d69b65c3be384840282b4ea0aa700000000000000000000000031439a79a3535d69b65c3be384840282b4ea0aa70000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000740000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec78000000000000000000000000000000e00000000000000000000000000dbdc220000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000dbdc22890e63370000000000000101f77f93531ef2505d6e45b9dccf555d5a48400d0800000000000000000000000000000000000000000000000000000000000000800000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f9960000000000000000000000000000000000000000000000000000000000000460000000000044000000000024a540ec8c73322200d68e1b86c471a5c850854f22000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003e40947c2d900000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d1a34369686ae59ac97ae4e1df5635ffda9ee7c000000000000000000000000129b3d9a0a6e4beab88f5cb1e57995d72a6e24f10000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000015fe2564c5e24e00000000000000000000000000000000000000000000000000158d8b0bb7afb20000000000000000000000000000000000000000000000000000000069e8100f000000000000000000000000000000000000000000000000433934a4b6f654c10000000000000000000000000000000000000000000000000000000069e80fd80000000000000000000000000000000000000000000000000000000069e80fe2000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000005efb6ef4a4054fe5ad70804c39fa13c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000006044eef7179034319e2c8636ea885b37cbfa9aba0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000418b305ca7778b653635245632606d1ca7c2ab41fb17821a2214c2f3e70556bf4a31b728c31e374590cc511c1ab2265703d10cce0820e3019369873186e214fefd1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041f5849ce7b0c54807f6bd8266c903425ed7fb31528d02d3cf2cde53308167b4934a222bf5d56110f0242a1a879277a5ddf68793c7f86842741369dd0d6757430d1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc280000000000000000000000170fa2d3c00000000000000000015fe2564c5bf500000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000015fe2564c5bf500000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d832f36b97d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ae7b22536f75726365223a226d6574616d61736b222c22416d6f756e74496e555344223a2231342e343032313639222c22416d6f756e744f7574555344223a2231342e343034333139222c22416d6f756e744f7574223a2236313930333736363135353833323134222c22526f7574654944223a2232653331313134316545424d4872756c3a66373437376635334f66394d4a377842222c2254696d657374616d70223a313737363831363038347d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e7", - "gasLimit": 466174, - "feeEstimate": 941394793492806, - "effectiveGas": 370743, - "gasCost": "162834493122063" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "64569240-2c37-4728-8d96-4ae4db4766af" - }, - { - "quote": { - "requestId": "0x6311b3d2527f3e3e66dddfab06e9917f7fd2a344993fa0bb482370919b372d01", - "bridgeId": "uniswap", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "uniswap", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5079488552854566", - "minDestTokenAmount": "4977898781797474", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1056915742960501", - "maxFeePerGas": "2803531485", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54167503241747", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ] - }, - "bridges": ["uniswap"], - "protocols": ["uniswap"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.823519729636384", - "priceImpact": "0.00009357971000129942", - "totalFeeAmountUsd": "0.1260856357130717" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123653076263868, - "effectiveGas": 48549, - "gasCost": "21700176215319" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011af5f609dec6200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003f2863a34ad88000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000069e816dc0000000000000000000000000000000000000000000000000000000000000002000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bdac17f958d2ee523a2206206994597c13d831ec7000064c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000158fe4f518ee32756e69780000b2c5de0b00000000000000000000000000000000000040", - "gasLimit": 302290, - "feeEstimate": 550189840682444, - "effectiveGas": 216017, - "gasCost": "96554140466427" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "35e71ce8-5283-486a-b5cc-f3968e6ea413" - }, - { - "quote": { - "requestId": "0x125c6a062fc6fdef5e1907e8dca0581cf013eff9f14db1db1a88e4d395798a71", - "bridgeId": "0x", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "0x", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4953371012980742", - "minDestTokenAmount": "4854303592721127", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1182803799394610", - "maxFeePerGas": "2803531485", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "54165477536730", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["0x"], - "protocols": ["0x"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.529956075454436", - "priceImpact": "0.00013097326389069737", - "totalFeeAmountUsd": "0.12608092048180664" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123653076263868, - "effectiveGas": 48549, - "gasCost": "21700176215319" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000430785632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000113ef6a146aae70000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000465045a597d0c000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c5c7e7adbe5400000000000000000000000000000000000000000000000000000000000000a04b4639d9f60921dae89d626c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e810ff0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000d0a67cb08be17475f4315a04c5f0be3e200ef66c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ee", - "gasLimit": 347190, - "feeEstimate": 645395756164604, - "effectiveGas": 253397, - "gasCost": "113262055911207" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "d80788a8-6ad8-4ebc-8d60-4dbd35254f16" - }, - { - "quote": { - "requestId": "0xb7d2484ef7c0a505cc37586b6735b82093555a71084dcbcd7d8f4fa6974c1563", - "bridgeId": "mayan", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "mayan", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4742779248620463", - "minDestTokenAmount": "4647923663648053", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1393395563754887", - "maxFeePerGas": "2803531485", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "54165477536730", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["mayan"], - "protocols": ["mayan"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.039761864973658", - "priceImpact": "0.0001309732638909439", - "totalFeeAmountUsd": "0.12608092048180664" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123653076263868, - "effectiveGas": 48549, - "gasCost": "21700176215319" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000f6d6179616e46656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000980000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001083430eea353500000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000005248c91a82961000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000084430dedc57000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000158d7a15ab5400000000000000000000000000238856de6d9d32ea3dd4e9e7dbfe08b23cd5048c00000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f000000000000000000000000337685fdab40d39bd02028545a4ffa7d287cc3e2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000158d7ae556a7b800000000000000000000000000000000000000000000000000000000000000a08bcbd82b377a97a86d8001920000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e811000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad2000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000646eb183d000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000001f3c3f0243d06a0353abcb066be9140747aeb8c90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018", - "gasLimit": 422092, - "feeEstimate": 801525307236204, - "effectiveGas": 314697, - "gasCost": "140661606921507" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "6192a91e-308c-4c14-a83a-9ff9cc6699f0" - }, - { - "quote": { - "requestId": "0xc95f4840e2e85fbfe856aee3361ba4235add53d3086f4381a264fb4fb282cd70", - "bridgeId": "relay", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "relay", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4396463016695471", - "minDestTokenAmount": "4308533756361561", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": { - "amount": "1678350047554084", - "maxFeePerGas": "2803531485", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - }, - "metabridge": { - "amount": "53623822761345", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - }, - "bridges": ["relay"], - "protocols": ["relay"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "10.233641965646914", - "priceImpact": "0.010129663531584725", - "totalFeeAmountUsd": "0.12482011127694735" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123653076263868, - "effectiveGas": 48549, - "gasCost": "21700176215319" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000e72656c61794164617074657256330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000f4e96b00cfb59000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000062738974ce7a5000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000c64f9e4bab400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000900000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000000000000000001ff3684f28c67538d4d072c22734000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b30000000000000000000000000000000000001ff3684f28c67538d4d072c227340000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005c42213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000004e41fff991f000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c5c7e7adbe5400000000000000000000000000000000000000000000000000000000000000a0a4f5c22b144373f032b103350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000001843036d6a60000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e810ff0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040dac17f958d2ee523a2206206994597c13d831ec701000064fffd8963efd1fc6a506488495d951d5263988d25c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001603ade14cfad20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c4a6bd8c96000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000218eba873234c1e55640a096616a1063fa18a82abc4ff9093f60b177b440dc426300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000218eba873234c1e55640a096616a1063fa18a82abc4ff9093f60b177b440dc426300000000000000000000000000000000000000000000000000000000000000003624cd044b771b06f3909ff4cba28a81af3601a616690a04655e1c432378abe80000000000000000000000000000000000000000000000000000000029", - "gasLimit": 523928, - "feeEstimate": 936418182992388, - "effectiveGas": 367659, - "gasCost": "164334282624729" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "6c891386-dd97-4b17-885c-55dbdd0fa7b3" - }, - { - "quote": { - "requestId": "0x726b3098ae326c8fd6c28b4b6fba3f2ccb47f7da7351a604db75c8164050afe3", - "bridgeId": "pancakeswap", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "pancakeswap", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4956592447279492", - "minDestTokenAmount": "4857460598333902", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1179582365095860", - "maxFeePerGas": "2803531485", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54165477536730", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ] - }, - "bridges": ["pancakeswap"], - "protocols": ["pancakeswap"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.411135528520346", - "totalToAmountUsd": "11.537454604409206", - "priceImpact": "0.00013097326389069737", - "totalFeeAmountUsd": "0.12608092048180664" - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 123653076263868, - "effectiveGas": 48549, - "gasCost": "21700176215319" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001b70616e63616b6553776170526f7574657246656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000360000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001141d5ad7961ce0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000462164de70b8e000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000224ac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158fb01ca56548000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000158fb01ca5654800000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000052", - "gasLimit": 346023, - "feeEstimate": 635602638320064, - "effectiveGas": 249552, - "gasCost": "111543438070512" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "3a86038b-663b-4c70-8d65-df677d9feb42" - } -] diff --git a/packages/bridge-controller/tests/v2.json b/packages/bridge-controller/tests/v2.json deleted file mode 100644 index 10d7cc76f8..0000000000 --- a/packages/bridge-controller/tests/v2.json +++ /dev/null @@ -1,1242 +0,0 @@ -[ - { - "quote": { - "requestId": "0xc7973589851fbeb7ef14c1e849ad37e2acb6942196598fdaa75d3ae91767d12a", - "bridgeId": "okx", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "okx", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4868207331426220", - "minDestTokenAmount": "4770843184797695", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1267577961167593", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54162039152782", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "105468452094480", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.24540635728608054" - } - ] - }, - "bridges": ["okx"], - "protocols": ["okx"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "11.327453887807907", - "priceImpact": "0.0008232380102231435", - "totalFeeAmountUsd": "0.1260254461662471", - "swapRate": "0.000337864935251527", - "cost": { - "usd": "3.0873210361038392" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000046f6b7836000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000010f30e7d4f17ff00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000004b21d93345b77000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000003c4f2c42696000000000000000000000000000000000000000000000000000000003bac0522000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158d213ba63e6f0000000000000000000000000000000000000000000000000000000069e81fa000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000006747bcaf9bd5a5f0758cbe08903490e45ddfacb500000000000000000000000000000000000000000000000000000000000000010000000000000000000000006747bcaf9bd5a5f0758cbe08903490e45ddfacb50000000000000000000000000000000000000000000000000000000000000001800000000000000000012710acdb27b266142223e1e676841c1e809255fc6d070000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc27777777711118000000000000000000000000000000000000015fdb96be31b23777777771111000000000064fa00a9ed787f3793db668bff3e6e6e7db0f92a1b0000000000000000000000000000000000000000000000000000000050", - "gasLimit": 418678, - "feeEstimate": 747089363179593, - "effectiveGas": 312291, - "gasCost": "91278262867302" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "241a2c9d-89dd-4b4e-bfed-c5f84afa48fe" - }, - { - "quote": { - "requestId": "0x4547136cc5f714ea6d615a2d617367589dadf1e730ef69ef163f20c9156134ed", - "bridgeId": "1inch", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "1inch", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5155373057314276", - "minDestTokenAmount": "5052265596167990", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "978228710964240", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54142764663240", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "81745649807194", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.19020760942993886" - } - ] - }, - "bridges": ["1inch"], - "protocols": ["1inch"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "11.99563753256711", - "priceImpact": "0.0011788121789798405", - "totalFeeAmountUsd": "0.12598059785214827", - "swapRate": "0.000357794905932378", - "cost": { - "usd": "2.419137391344636" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f6e65496e6368563646656544796e616d69630000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011f302402ba73600000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003aaefb714bdd8000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028807ed23790000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e3000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000004c3ccc98c01103be72bcfd29e1d2454c98d1a6e300000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158b2a9c8cc7a800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000013900000000000000000000000000000000000000011b0001050000c900004e00a0744c8c09dac17f958d2ee523a2206206994597c13d831ec790cbe4bdd538d6e9b379bff5fe72c3d67a521de500000000000000000000000000000000000000000000000000000000000005a00c20dac17f958d2ee523a2206206994597c13d831ec706da0fd433c1a5d7a4faa01111c044910a1845536ae4071118002dc6c006da0fd433c1a5d7a4faa01111c044910a18455300000000000000000000000000000000000000000000000000158b2a9c8cc7a8dac17f958d2ee523a2206206994597c13d831ec74101c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200042e1a7d4d0000000000000000000000000000000000000000000000000000000000000000c061111111125421ca6dc452d289314280a0f8842a65000000000000007dcbea7c00000000000000000000000000000000000000000000000008", - "gasLimit": 306326, - "feeEstimate": 552924260811144, - "effectiveGas": 231128, - "gasCost": "67555460580016" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "d2c6b3f6-2b52-4564-811f-902e7f1808e9" - }, - { - "quote": { - "requestId": "0x72e861173646c2161676fad648f9faf047f441bd9f069b183af370a771a5126e", - "bridgeId": "kyberswap", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "kyberswap", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5082097733881599", - "minDestTokenAmount": "4980455779203967", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1054611769848065", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54170197384751", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "91097922453428", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.21196868695483279" - } - ] - }, - "bridges": ["kyberswap"], - "protocols": ["kyberswap"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "11.825138868317598", - "priceImpact": "0.000672735630156201", - "totalFeeAmountUsd": "0.1260444289231725", - "swapRate": "0.000352709427701552", - "cost": { - "usd": "2.5896360555941484" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136b796265725377617046656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ae0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011b1b2b989fb7f00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003f06e6b4a4f30000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000009a4e21fd0e900000000000000000000000000000000000000000000000000000000000000200000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f996000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000008a000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000dbdc2200000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000041b02d846bac0f13e72b1b173a398a2d5da62d4d8e3a40eaf72be7bc44e492f29d12090e7bf6353b31684cd0eced217a920c232304a46afba3c48c880c44eabd5e1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000d0dded00000000000000000000000000e6da5600000000000000000000000000dbdc2200000000000000000015fe92816e9e3000000000000000000000000000000000000001710153d50000000f42400000000000000000000000000000004f82e73edb06d29ff62c91ec8f5ff06571bdeb2900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e816410000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000000261f598cd000000000000000031439a79a3535d69b65c3be384840282b4ea0aa700000000000000000000000031439a79a3535d69b65c3be384840282b4ea0aa7000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000240000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec78000000000000000000000000000000e00000000000000000000000000dbdc220000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000dbdc2216717ef60000000000000001d1877a31a73c7cb31c02b9e7d7c336531562b21e00000000000000000000000000000000000000000000000000000000000000800000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000014aa86c5d3c41765bb24e11bd7010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000020c49ba5e353f88000137c00000000000000000000000000000000000000004002d47fbacb3064d1cbe8150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000158df5f9b9349e0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008f10b468b06c6fd214b65f87778827f7d113f99600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad7b22536f75726365223a226d6574616d61736b222c22416d6f756e74496e555344223a2231342e343038343236222c22416d6f756e744f7574555344223a2231342e3430363333222c22416d6f756e744f7574223a2236313930383739373031313134343135222c22526f7574654944223a2236633962363436346f52564c623748723a35363562356163354d7a424453725a37222c2254696d657374616d70223a313737363831363532397d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012", - "gasLimit": 335824, - "feeEstimate": 629470233489375, - "effectiveGas": 263125, - "gasCost": "76907733226250" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "55f644b4-3d48-4c3c-83fc-27adc6b62589" - }, - { - "quote": { - "requestId": "0xe85477ecddedf1d7791c682329a82e4feba1d44a6cb71b2e44fc0851dfb39da1", - "bridgeId": "openocean", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "openocean", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4810126981706790", - "minDestTokenAmount": "4713924442072654", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1329643509443150", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54197217450251", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "108725394123326", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.2529846829684849" - } - ] - }, - "bridges": ["openocean"], - "protocols": ["openocean"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "11.192311228827963", - "priceImpact": "0.00017427172484729865", - "totalFeeAmountUsd": "0.12610729981694505", - "swapRate": "0.000333834023611699", - "cost": { - "usd": "3.2224636950837837" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000136f70656e4f6365616e46656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000010bf4a0fde264e00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000004ea9886f3c359000000000000000000000000e3478b0bb1a5084567c319096437924948be196400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000dc490411a320000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000001590b6941ef51b000000000000000000000000000000000000000000000000001601617d05777f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ef53a4bd0e16ccc9116770a41c4bd3ad1147bd4f00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000860000000000000000000000000000000000000000000000000000000000000098000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008487517c45000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af0000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000066a9893cc07d91d95644aedd05d03f95e1dba8af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000004a424856bc300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003070b0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007baa298d36fe21df2f6b54510da76445661a91ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000648a6a1e85000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000922164bbbd36acf9e854acbbf32facc949fcaeef000000000000000000000000000000000000000000000000001601617d05777f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a49f865422000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c9", - "gasLimit": 448035, - "feeEstimate": 773746605219582, - "effectiveGas": 323434, - "gasCost": "94535204896148" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "eb0d9c2f-3d91-43cd-bda6-18f66ab5c56b" - }, - { - "quote": { - "requestId": "0xa6fc34fef522a04e60231368295989cf2d5f546e1122a6d769522042bb16a79f", - "bridgeId": "relay", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "relay", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4100150540798504", - "minDestTokenAmount": "4018147529982533", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1970928114339421", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "53590858242075", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "157447411319272", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.36635216416538274" - } - ] - }, - "bridges": ["relay"], - "protocols": ["relay"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "9.540322139558324", - "priceImpact": "0.011360335612132242", - "totalFeeAmountUsd": "0.12469640962627415", - "swapRate": "0.000284560003853114", - "cost": { - "usd": "4.874452784353423" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000e72656c617941646170746572563300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000e467be02e024500000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000007314a0e33a678000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000008a4f9e4bab400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000000000000008200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000540000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d35000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d350000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000fd0b31d2e955fa55e3fa641fe90e08b677188d350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000204e21dd0d30000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015c25abeb630a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000ac00699d32e9f569b22ae8d8c6f788037c1cd53632a059dac17f958d2ee523a2206206994597c13d831ec7a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000064fd0b31d2e955fa55e3fa641fe90e08b677188d3504c8577958ccc170eb3d2cca76f9d51bc6e42d8f0000003f7191a6a3006ea020c73acd7068295b9b3767a3bb836951eb21f3df98273517b7249dceff270d34bf01b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b92fe925dc43a0ecde6c8b1a2709c170ec4fff4f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c4a6bd8c96000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002159bae0e78e30d384fd6c87310ca333dfabb3fd03440da5093af9b6862e8b7ce2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002159bae0e78e30d384fd6c87310ca333dfabb3fd03440da5093af9b6862e8b7ce200000000000000000000000000000000000000000000000000000000000000002ec7b8e2686b9fa3905ad04430df3bbafd333ac01378c6df483d03e87e0eab95000000000000000000000000000000000000000000000000000000006a", - "gasLimit": 692558, - "feeEstimate": 1172523922582221, - "effectiveGas": 490127, - "gasCost": "143257222092094" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "68d81104-5ce3-43d5-b455-071b9c6c0394" - }, - { - "quote": { - "requestId": "0x9265083b401b014e55680831e35aebc009f5b4b15c39e212e9beb870263bebfa", - "bridgeId": "0x", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "0x", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5166875377680456", - "minDestTokenAmount": "5063537870126846", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "966228987009532", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54138373963215", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "76756621404576", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.17859902636676375" - } - ] - }, - "bridges": ["0x"], - "protocols": ["0x"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "12.022401389297206", - "priceImpact": "0.001259811445298311", - "totalFeeAmountUsd": "0.1259703814729593", - "swapRate": "0.000358593193774532", - "cost": { - "usd": "2.3923735346145403" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000430785632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000780000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011fd42c80e3efe00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003a004ca1757cb000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000006442213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000005641fff991f00000000000000000000000074de5d4fcbf63e00296fd95d33236b9794016631000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015c2fde985450c00000000000000000000000000000000000000000000000000000000000000a0a4e92d85e1145ae3d6cca73d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000000e4c1fb425e00000000000000000000000017c1ae82d99379240059940093762c5e4539aba5000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e812bd00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c4103b48be0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017c1ae82d99379240059940093762c5e4539aba50000000000000000000000000000000000000000000000000000000000001900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000d0a67cb08be17475f4315a04c5f0be3e200ef66c000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000015ff190d54ca3300000000000000000000000000000000000000000000000000000000000027100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f", - "gasLimit": 301571, - "feeEstimate": 512090332391457, - "effectiveGas": 214059, - "gasCost": "62566432177398" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "5f4f4200-750a-4c76-ae74-7ecdb09f1e4e" - }, - { - "quote": { - "requestId": "0xc7fc6aae02c7206c085bb43eee3119286db1f8807e9b5057783bf8dd1c7e31db", - "bridgeId": "uniswap", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "uniswap", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "5166358267808821", - "minDestTokenAmount": "5063031102452644", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "968069333292662", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54150054486393", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "77331255527228", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.1799360979176573" - } - ] - }, - "bridges": ["uniswap"], - "protocols": ["uniswap"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "12.021198166462375", - "priceImpact": "0.0010443301319967306", - "totalFeeAmountUsd": "0.12599755997598447", - "swapRate": "0.000358557305144199", - "cost": { - "usd": "2.393576757449372" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000018756e69737761705065726d69743246656544796e616d6963000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000000000000000000000000000000011fcccca5933a400000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000003a1b3ff7db7ef000000000000000000000000e3478b0bb1a5084567c319096437924948be19640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000028e3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000069e818990000000000000000000000000000000000000000000000000000000000000002000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bdac17f958d2ee523a2206206994597c13d831ec7000064c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000074de5d4fcbf63e00296fd95d33236b979401663100000000000000000000000000000000000000000000000000158e1dc37a0914756e69780000b2c5de0b000000000000000000000000000000000000e2", - "gasLimit": 302300, - "feeEstimate": 516793566516075, - "effectiveGas": 216025, - "gasCost": "63141066300050" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "f0f4e0a4-ccbe-4729-b0cd-055ad7895a35" - }, - { - "quote": { - "requestId": "0x4b9f2f606270d82b401d316f2ec2df1c4fa3a0a148f57a113f049159191e8840", - "bridgeId": "mayan", - "srcChainId": 1, - "destChainId": 1, - "aggregator": "mayan", - "aggregatorType": "AGG", - "srcAsset": { - "address": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "chainId": 1, - "assetId": "eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7", - "symbol": "USDT", - "decimals": 6, - "name": "Tether USD", - "coingeckoId": "tether", - "aggregators": [ - "metamask", - "oneInch", - "liFi", - "socket", - "rubic", - "squid", - "rango", - "sonarwatch", - "sushiSwap", - "pmm", - "bancor" - ], - "occurrences": 11, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/erc20/0xdac17f958d2ee523a2206206994597c13d831ec7.png", - "metadata": { - "storage": { - "balance": 2, - "approval": 5 - } - } - }, - "srcTokenAmount": "14408738", - "destAsset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "destTokenAmount": "4458951315579674", - "minDestTokenAmount": "4369772289268080", - "walletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "destWalletAddress": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "feeData": { - "txFee": [ - { - "amount": "1677025378095194", - "maxFeePerGas": "2567794865", - "maxPriorityFeePerGas": "2100000004", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - } - } - ], - "metabridge": [ - { - "amount": "54163728695742", - "asset": { - "address": "0x0000000000000000000000000000000000000000", - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "symbol": "ETH", - "decimals": 18, - "name": "Ether", - "coingeckoId": "ethereum", - "aggregators": [], - "occurrences": 100, - "iconUrl": "https://static.cx.metamask.io/api/v2/tokenIcons/assets/eip155/1/slip44/60.png", - "metadata": {} - }, - "quoteBpsFee": 87.5, - "baseBpsFee": 87.5 - } - ], - "network": [ - { - "amount": "140914258141342", - "asset": { - "chainId": 1, - "assetId": "eip155:1/slip44:60", - "address": "0x0000000000000000000000000000000000000000", - "symbol": "ETH", - "name": "Ether", - "decimals": 18 - }, - "usd": "0.3278824529363418" - } - ] - }, - "bridges": ["mayan"], - "protocols": ["mayan"], - "steps": [], - "slippage": 2, - "gasSponsored": false, - "gasIncluded": true, - "gasIncluded7702": false, - "priceData": { - "totalFromAmountUsd": "14.414774923911747", - "totalToAmountUsd": "10.375187821019091", - "priceImpact": "0.0007920694632009893", - "totalFeeAmountUsd": "0.12602937743265957", - "swapRate": "0.000309461613888716", - "cost": { - "usd": "4.039587102892655" - } - } - }, - "approval": { - "chainId": 1, - "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x095ea7b3000000000000000000000000881d40237659c251811cec9c364ef91dc08d300c0000000000000000000000000000000000000000000000000000000000dbdc22", - "gasLimit": 48936, - "feeEstimate": 116143089275727, - "effectiveGas": 48549, - "gasCost": "14190189227178" - }, - "trade": { - "chainId": 1, - "to": "0x881D40237659C251811CEC9c364ef91dC08D300C", - "from": "0x30E8ccaD5A980BDF30447f8c2C48e70989D9d294", - "value": "0x0", - "data": "0x5f5755290000000000000000000000000000000000000000000000000000000000000080000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000f6d6179616e46656544796e616d696300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b20000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000f8648e50d1970000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000062681dfbfd218000000000000000000000000e3478b0bb1a5084567c319096437924948be1964000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000009e430dedc57000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ff3684f28c67538d4d072c2273400000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000158d4b84bd8400000000000000000000000000238856de6d9d32ea3dd4e9e7dbfe08b23cd5048c000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000007642213bc0b0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc220000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000006841fff991f000000000000000000000000337685fdab40d39bd02028545a4ffa7d287cc3e2000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000158d4d4a90c12800000000000000000000000000000000000000000000000000000000000000a043741dcb1774bc1eebcfa8be00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000e4c1fb425e0000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000000dbdc2200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069e812bd00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e438c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000271000000000000000000000000072d63a5b080e1b89cc93f9b9f50cbfa5e291c8ac00000000000000000000000000000000000000000000000000000000000000a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001041679c792000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000001c798614ef4c6a8f8a1aab25785714933e59e9630000000000000000000000007f54f05635d15cde17a49502fedb9d1803a3be8a0000000000000000000000000000000000000000000000000000000069e812bd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010438c9c147000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000002710000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000242e1a7d4d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008434ee90ca000000000000000000000000f5c4f3dc02c3fb9279495a8fef7b0741da956157000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000001601bbb8bd6754000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000646eb183d000000000000000000000000074de5d4fcbf63e00296fd95d33236b97940166310000000000000000000000001f3c3f0243d06a0353abcb066be9140747aeb8c9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009b", - "gasLimit": 578366, - "feeEstimate": 1037204269347726, - "effectiveGas": 433562, - "gasCost": "126724068914164" - }, - "estimatedProcessingTimeInSeconds": 0, - "quoteId": "89a89cc7-13e1-486f-950e-c6ebd7e319c8" - } -]