Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
retroboydev committed Mar 20, 2024
1 parent 444dc33 commit dda69b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/constants/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/hooks/useTransactionDeadline.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions src/state/user/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit dda69b6

Please sign in to comment.