diff --git a/src/constants/misc.ts b/src/constants/misc.ts index 082d6a8b..311381f7 100644 --- a/src/constants/misc.ts +++ b/src/constants/misc.ts @@ -7,8 +7,7 @@ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' // TODO(WEB-1984): Convert the deadline to minutes and remove unecessary conversions from // seconds to minutes in the codebase. // 60 minutes, denominated in seconds -export const DEFAULT_DEADLINE_FROM_NOW = 60 * 60 -export const L2_DEADLINE_FROM_NOW = 60 * 5 +export const DEFAULT_DEADLINE_FROM_NOW = 5 * 60 // transaction popup dismissal amounts export const DEFAULT_TXN_DISMISS_MS = 10000 diff --git a/src/hooks/useTransactionDeadline.ts b/src/hooks/useTransactionDeadline.ts index 23d544aa..53c733a7 100644 --- a/src/hooks/useTransactionDeadline.ts +++ b/src/hooks/useTransactionDeadline.ts @@ -1,12 +1,7 @@ import { BigNumber } from '@ethersproject/bignumber' import { useAccountDetails } from 'hooks/starknet-react' -import { L2_DEADLINE_FROM_NOW } from 'constants/misc' import { useMemo } from 'react' import { useAppSelector } from 'state/hooks' -import { useBlock, useContractRead } from '@starknet-react/core' -import MultiContractABI from 'contracts/multicall/abi.json' -import { MULTICALL_NETWORKS } from 'contracts/multicall' -import { DEFAULT_CHAIN_ID } from 'constants/tokens' // combines the block timestamp with the user setting to give the deadline that should be used for any submitted transaction export default function useTransactionDeadline(): BigNumber | undefined { diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index ad32c2d5..f580d472 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -2,7 +2,6 @@ import { Percent, Token } from '@vnaysn/jediswap-sdk-core' import { computePairAddress, Pair } from '@vnaysn/jediswap-sdk-v2' import { useAccountDetails } from 'hooks/starknet-react' import { SupportedLocale } from 'constants/locales' -import { L2_DEADLINE_FROM_NOW } from 'constants/misc' import JSBI from 'jsbi' import { useCallback, useMemo } from 'react' import { useAppDispatch, useAppSelector } from 'state/hooks' @@ -162,9 +161,7 @@ export function useUserHideClosedPositions(): [boolean, (newHideClosedPositions: export function useUserTransactionTTL(): [number, (slippage: number) => void] { const { chainId } = useAccountDetails() const dispatch = useAppDispatch() - const userDeadline = useAppSelector((state) => state.user.userDeadline) - const onL2 = false - const deadline = onL2 ? L2_DEADLINE_FROM_NOW : userDeadline + const deadline = useAppSelector((state) => state.user.userDeadline) const setUserDeadline = useCallback( (userDeadline: number) => {