diff --git a/cypress/fixtures/uniswapx/quote1.json b/cypress/fixtures/uniswapx/quote1.json index dd4f88d71e..ee09e615c4 100644 --- a/cypress/fixtures/uniswapx/quote1.json +++ b/cypress/fixtures/uniswapx/quote1.json @@ -32,6 +32,7 @@ "quoteId": "f9f47cd7-a62c-4622-9ac7-51d0e662245a", "requestId": "2d16f993-6429-4755-ba50-1383789459dc", "auctionPeriodSecs": 60, + "startTimeBufferSecs": 30, "deadlineBufferSecs": 12, "slippageTolerance": "0.5", "permitData": { @@ -252,6 +253,7 @@ "quoteId": "f9f47cd7-a62c-4622-9ac7-51d0e662245a", "requestId": "2d16f993-6429-4755-ba50-1383789459dc", "auctionPeriodSecs": 60, + "startTimeBufferSecs": 30, "deadlineBufferSecs": 12, "slippageTolerance": "0.5", "permitData": { diff --git a/cypress/fixtures/uniswapx/quote2.json b/cypress/fixtures/uniswapx/quote2.json index a46549870b..43c4f64de8 100644 --- a/cypress/fixtures/uniswapx/quote2.json +++ b/cypress/fixtures/uniswapx/quote2.json @@ -32,6 +32,7 @@ "quoteId": "09ce28b7-1ddf-4317-a28d-d21092be9f84", "requestId": "f00535d4-461a-4363-afbe-7a5ab7061cd1", "auctionPeriodSecs": 60, + "startTimeBufferSecs": 30, "deadlineBufferSecs": 12, "slippageTolerance": "0.5", "permitData": { @@ -252,6 +253,7 @@ "quoteId": "09ce28b7-1ddf-4317-a28d-d21092be9f84", "requestId": "f00535d4-461a-4363-afbe-7a5ab7061cd1", "auctionPeriodSecs": 60, + "startTimeBufferSecs": 30, "deadlineBufferSecs": 12, "slippageTolerance": "0.5", "permitData": { diff --git a/src/hooks/useUniswapXSwapCallback.ts b/src/hooks/useUniswapXSwapCallback.ts index c898b7b9ab..c8dbba6b00 100644 --- a/src/hooks/useUniswapXSwapCallback.ts +++ b/src/hooks/useUniswapXSwapCallback.ts @@ -13,8 +13,6 @@ import { UserRejectedRequestError } from 'utils/errors' import { signTypedData } from 'utils/signing' import { didUserReject, swapErrorToUserReadableMessage } from 'utils/swapErrorToUserReadableMessage' -const DEFAULT_START_TIME_PADDING_SECONDS = 30 - type DutchAuctionOrderError = { errorCode?: number; detail?: string } type DutchAuctionOrderSuccess = { hash: string } type DutchAuctionOrderResponse = DutchAuctionOrderError | DutchAuctionOrderSuccess @@ -69,7 +67,7 @@ export function useUniswapXSwapCallback({ try { const updatedNonce = await getUpdatedNonce(account, trade.order.chainId) - const startTime = Math.floor(Date.now() / 1000) + DEFAULT_START_TIME_PADDING_SECONDS + const startTime = Math.floor(Date.now() / 1000) + trade.startTimeBufferSecs setTraceData('startTime', startTime) const endTime = startTime + trade.auctionPeriodSecs diff --git a/src/state/routing/types.ts b/src/state/routing/types.ts index 9c04b4990e..14cfcb6683 100644 --- a/src/state/routing/types.ts +++ b/src/state/routing/types.ts @@ -114,6 +114,7 @@ type URADutchOrderQuoteResponse = { quote: { auctionPeriodSecs: number deadlineBufferSecs: number + startTimeBufferSecs: number orderInfo: DutchOrderInfoJSON quoteId?: string requestId?: string @@ -236,6 +237,7 @@ export class DutchOrderTrade extends IDutchOrderTrade