diff --git a/config/external-config/index.ts b/config/external-config/index.ts index 25f1edf6..6f3b358f 100644 --- a/config/external-config/index.ts +++ b/config/external-config/index.ts @@ -10,9 +10,7 @@ export { ManifestConfigPageList, ManifestConfigPageEnum } from './types'; export { isManifestValid, isManifestEntryValid, - isEnabledDexesValid, isFeatureFlagsValid, - isMultiChainBannerValid, isPagesValid, shouldRedirectToRoot, } from './utils'; diff --git a/modules/web3/hooks/use-aa.ts b/modules/web3/hooks/use-aa.ts index 0f45960c..0dc67e6f 100644 --- a/modules/web3/hooks/use-aa.ts +++ b/modules/web3/hooks/use-aa.ts @@ -8,7 +8,7 @@ import { import { TransactionCallbackStage } from '@lidofinance/lido-ethereum-sdk'; import { useDappStatus } from './use-dapp-status'; -import { useLidoSDK, useLidoSDKL2 } from '../web3-provider'; +import { useLidoSDK } from '../web3-provider'; import { config } from 'config'; import type { Address, Hash } from 'viem'; @@ -75,9 +75,7 @@ export type AACall = { to: Address; data?: Hash; value?: bigint }; export const useSendAACalls = () => { const { sendCallsAsync } = useSendCalls(); - const { core: l1core } = useLidoSDK(); - const { core: l2core, isL2 } = useLidoSDKL2(); - const core = isL2 ? l2core : l1core; + const { core } = useLidoSDK(); return useCallback( async ( diff --git a/modules/web3/hooks/use-balance.ts b/modules/web3/hooks/use-balance.ts index b7b0961b..264abc55 100644 --- a/modules/web3/hooks/use-balance.ts +++ b/modules/web3/hooks/use-balance.ts @@ -9,7 +9,7 @@ import { useAccount, } from 'wagmi'; -import { useDappStatus, useLidoSDK, useLidoSDKL2 } from 'modules/web3'; +import { useDappStatus, useLidoSDK } from 'modules/web3'; import { config } from 'config'; import type { Address, WatchContractEventOnLogsFn } from 'viem'; @@ -235,17 +235,16 @@ export const useStethBalance = ({ }: UseBalanceProps = {}) => { const { chainId } = useDappStatus(); const { stETH } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); const { isSupportedChain, address } = useDappStatus(); const mergedAccount = account ?? address; const { data: contract, isLoading } = useQuery({ - queryKey: ['steth-contract', chainId, isL2], + queryKey: ['steth-contract', chainId], enabled: !!mergedAccount && isSupportedChain, staleTime: Infinity, - queryFn: async () => (isL2 ? l2.steth.getContract() : stETH.getContract()), + queryFn: async () => stETH.getContract(), }); const balanceData = useTokenBalance( @@ -269,13 +268,12 @@ export const useWstethBalance = ({ const mergedAccount = account ?? address; const { chainId } = useDappStatus(); const { wstETH } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); const { data: contract, isLoading } = useQuery({ - queryKey: ['wsteth-contract', chainId, isL2], + queryKey: ['wsteth-contract', chainId], enabled: !!mergedAccount && isSupportedChain, staleTime: Infinity, - queryFn: () => (isL2 ? l2.wsteth.getContract() : wstETH.getContract()), + queryFn: () => wstETH.getContract(), }); const balanceData = useTokenBalance( diff --git a/modules/web3/hooks/use-stETH-by-wstETH.ts b/modules/web3/hooks/use-stETH-by-wstETH.ts index d77e2acd..ff793002 100644 --- a/modules/web3/hooks/use-stETH-by-wstETH.ts +++ b/modules/web3/hooks/use-stETH-by-wstETH.ts @@ -1,23 +1,20 @@ import invariant from 'tiny-invariant'; import { useQuery } from '@tanstack/react-query'; -import { useDappStatus, useLidoSDK, useLidoSDKL2 } from 'modules/web3'; +import { useDappStatus, useLidoSDK } from 'modules/web3'; export const useStETHByWstETH = (wsteth?: bigint | null) => { const { chainId } = useDappStatus(); const { wrap } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); return useQuery({ - queryKey: ['use-steth-by-wsteth', wsteth?.toString(), isL2, chainId], - enabled: wsteth != null && !!(isL2 ? l2.steth : wrap), + queryKey: ['use-steth-by-wsteth', wsteth?.toString(), chainId], + enabled: wsteth != null && !!wrap, staleTime: Infinity, queryFn: () => { if (wsteth === 0n) return 0n; invariant(wsteth); - return isL2 - ? l2.steth.convertToSteth(wsteth) - : wrap.convertWstethToSteth(wsteth); + return wrap.convertWstethToSteth(wsteth); }, }); }; diff --git a/modules/web3/hooks/use-steth-contract-address.ts b/modules/web3/hooks/use-steth-contract-address.ts index 2b2d2d0b..63df371a 100644 --- a/modules/web3/hooks/use-steth-contract-address.ts +++ b/modules/web3/hooks/use-steth-contract-address.ts @@ -1,15 +1,13 @@ import { useQuery } from '@tanstack/react-query'; -import { useLidoSDK, useLidoSDKL2 } from 'modules/web3'; +import { useLidoSDK } from 'modules/web3'; export const useStETHContractAddress = () => { const { stETH } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); return useQuery({ - queryKey: ['use-steth-contract-address', isL2, l2.steth, stETH], - enabled: !!(isL2 ? l2.steth : stETH), + queryKey: ['use-steth-contract-address', stETH], + enabled: !!stETH, staleTime: Infinity, - queryFn: () => - isL2 ? l2.steth.contractAddress() : stETH.contractAddress(), + queryFn: () => stETH.contractAddress(), }); }; diff --git a/modules/web3/hooks/use-wstETH-by-stETH.ts b/modules/web3/hooks/use-wstETH-by-stETH.ts index 6a97ba62..57a400dd 100644 --- a/modules/web3/hooks/use-wstETH-by-stETH.ts +++ b/modules/web3/hooks/use-wstETH-by-stETH.ts @@ -1,22 +1,19 @@ import invariant from 'tiny-invariant'; import { useQuery } from '@tanstack/react-query'; -import { useLidoSDK, useLidoSDKL2 } from 'modules/web3'; +import { useLidoSDK } from 'modules/web3'; export const useWstethBySteth = (steth?: bigint | null) => { const { wrap, chainId } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); return useQuery({ - queryKey: ['use-wsteth-by-steth', steth?.toString(), isL2, chainId], - enabled: steth != null && !!(isL2 ? l2.wsteth : wrap), + queryKey: ['use-wsteth-by-steth', steth?.toString(), chainId], + enabled: steth != null && !!wrap, staleTime: Infinity, queryFn: () => { if (steth === 0n) return 0n; invariant(steth); - return isL2 - ? l2.steth.convertToShares(steth) - : wrap.convertStethToWsteth(steth); + return wrap.convertStethToWsteth(steth); }, }); }; diff --git a/modules/web3/hooks/use-wsteth-contract-address.ts b/modules/web3/hooks/use-wsteth-contract-address.ts index 31b47e0e..20929231 100644 --- a/modules/web3/hooks/use-wsteth-contract-address.ts +++ b/modules/web3/hooks/use-wsteth-contract-address.ts @@ -1,15 +1,13 @@ import { useQuery } from '@tanstack/react-query'; -import { useLidoSDK, useLidoSDKL2 } from 'modules/web3'; +import { useLidoSDK } from 'modules/web3'; export const useWstETHContractAddress = () => { const { wstETH } = useLidoSDK(); - const { l2, isL2 } = useLidoSDKL2(); return useQuery({ - queryKey: ['use-wsteth-contract-address', isL2, l2.wsteth, wstETH], - enabled: !!(isL2 ? l2.wsteth : wstETH), + queryKey: ['use-wsteth-contract-address', wstETH], + enabled: !!wstETH, staleTime: Infinity, - queryFn: () => - isL2 ? l2.wsteth.contractAddress() : wstETH.contractAddress(), + queryFn: () => wstETH.contractAddress(), }); }; diff --git a/shared/wallet/fallback/useErrorMessage.ts b/shared/wallet/fallback/useErrorMessage.ts index dbe734a1..69fa03bd 100644 --- a/shared/wallet/fallback/useErrorMessage.ts +++ b/shared/wallet/fallback/useErrorMessage.ts @@ -3,7 +3,7 @@ import { useConnectorInfo } from 'reef-knot/core-react'; // TODO: to remove the 'reef-knot/web3-react' after it will be deprecated import { helpers } from 'reef-knot/web3-react'; import { joinWithOr } from 'utils/join-with-or'; -import { useConnect } from 'wagmi'; +import { useAccount, useConnect } from 'wagmi'; export const useErrorMessage = (): string | undefined => { const { isLedger } = useConnectorInfo(); @@ -11,15 +11,15 @@ export const useErrorMessage = (): string | undefined => { isSupportedChain, isChainTypeMatched, isAccountActive, - chainType, supportedChainLabels, } = useDappStatus(); const { error } = useConnect(); + const { chainId } = useAccount(); // Errors from chain state if (isAccountActive && !isChainTypeMatched) { - return `Wrong network. Please switch to ${supportedChainLabels[chainType]} in your wallet to wrap/unwrap.`; + return `Wrong network. Please switch to ${supportedChainLabels[chainId || 1]} in your wallet to wrap/unwrap.`; } if (!isSupportedChain) { diff --git a/styles/global.ts b/styles/global.ts index c0bb7289..cd439963 100644 --- a/styles/global.ts +++ b/styles/global.ts @@ -58,7 +58,7 @@ const GlobalStyle = createGlobalStyle` text-size-adjust: none; } main { - min-height: calc(100vh - 150px); + min-height: calc(100vh - 200px); } a { cursor: pointer; diff --git a/utils/apply-gas-limit-ratio.ts b/utils/apply-gas-limit-ratio.ts deleted file mode 100644 index ecca6e48..00000000 --- a/utils/apply-gas-limit-ratio.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { config } from 'config'; - -export const applyGasLimitRatio = (gasLimit: bigint): bigint => - (gasLimit * - BigInt(config.SUBMIT_EXTRA_GAS_TRANSACTION_RATIO * config.PRECISION)) / - BigInt(config.PRECISION);