Skip to content

Commit 7c44b48

Browse files
authored
Merge pull request #2 from lidofinance/main
Main to develop
2 parents b43d4e4 + b326349 commit 7c44b48

File tree

10 files changed

+27
-49
lines changed

10 files changed

+27
-49
lines changed

config/external-config/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ export { ManifestConfigPageList, ManifestConfigPageEnum } from './types';
1010
export {
1111
isManifestValid,
1212
isManifestEntryValid,
13-
isEnabledDexesValid,
1413
isFeatureFlagsValid,
15-
isMultiChainBannerValid,
1614
isPagesValid,
1715
shouldRedirectToRoot,
1816
} from './utils';

modules/web3/hooks/use-aa.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
import { TransactionCallbackStage } from '@lidofinance/lido-ethereum-sdk';
99

1010
import { useDappStatus } from './use-dapp-status';
11-
import { useLidoSDK, useLidoSDKL2 } from '../web3-provider';
11+
import { useLidoSDK } from '../web3-provider';
1212
import { config } from 'config';
1313

1414
import type { Address, Hash } from 'viem';
@@ -75,9 +75,7 @@ export type AACall = { to: Address; data?: Hash; value?: bigint };
7575

7676
export const useSendAACalls = () => {
7777
const { sendCallsAsync } = useSendCalls();
78-
const { core: l1core } = useLidoSDK();
79-
const { core: l2core, isL2 } = useLidoSDKL2();
80-
const core = isL2 ? l2core : l1core;
78+
const { core } = useLidoSDK();
8179

8280
return useCallback(
8381
async (

modules/web3/hooks/use-balance.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
useAccount,
1010
} from 'wagmi';
1111

12-
import { useDappStatus, useLidoSDK, useLidoSDKL2 } from 'modules/web3';
12+
import { useDappStatus, useLidoSDK } from 'modules/web3';
1313
import { config } from 'config';
1414

1515
import type { Address, WatchContractEventOnLogsFn } from 'viem';
@@ -235,17 +235,16 @@ export const useStethBalance = ({
235235
}: UseBalanceProps = {}) => {
236236
const { chainId } = useDappStatus();
237237
const { stETH } = useLidoSDK();
238-
const { l2, isL2 } = useLidoSDKL2();
239238
const { isSupportedChain, address } = useDappStatus();
240239

241240
const mergedAccount = account ?? address;
242241

243242
const { data: contract, isLoading } = useQuery({
244-
queryKey: ['steth-contract', chainId, isL2],
243+
queryKey: ['steth-contract', chainId],
245244
enabled: !!mergedAccount && isSupportedChain,
246245

247246
staleTime: Infinity,
248-
queryFn: async () => (isL2 ? l2.steth.getContract() : stETH.getContract()),
247+
queryFn: async () => stETH.getContract(),
249248
});
250249

251250
const balanceData = useTokenBalance(
@@ -269,13 +268,12 @@ export const useWstethBalance = ({
269268
const mergedAccount = account ?? address;
270269
const { chainId } = useDappStatus();
271270
const { wstETH } = useLidoSDK();
272-
const { l2, isL2 } = useLidoSDKL2();
273271

274272
const { data: contract, isLoading } = useQuery({
275-
queryKey: ['wsteth-contract', chainId, isL2],
273+
queryKey: ['wsteth-contract', chainId],
276274
enabled: !!mergedAccount && isSupportedChain,
277275
staleTime: Infinity,
278-
queryFn: () => (isL2 ? l2.wsteth.getContract() : wstETH.getContract()),
276+
queryFn: () => wstETH.getContract(),
279277
});
280278

281279
const balanceData = useTokenBalance(
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
import invariant from 'tiny-invariant';
22
import { useQuery } from '@tanstack/react-query';
3-
import { useDappStatus, useLidoSDK, useLidoSDKL2 } from 'modules/web3';
3+
import { useDappStatus, useLidoSDK } from 'modules/web3';
44

55
export const useStETHByWstETH = (wsteth?: bigint | null) => {
66
const { chainId } = useDappStatus();
77
const { wrap } = useLidoSDK();
8-
const { l2, isL2 } = useLidoSDKL2();
98

109
return useQuery({
11-
queryKey: ['use-steth-by-wsteth', wsteth?.toString(), isL2, chainId],
12-
enabled: wsteth != null && !!(isL2 ? l2.steth : wrap),
10+
queryKey: ['use-steth-by-wsteth', wsteth?.toString(), chainId],
11+
enabled: wsteth != null && !!wrap,
1312
staleTime: Infinity,
1413
queryFn: () => {
1514
if (wsteth === 0n) return 0n;
1615
invariant(wsteth);
1716

18-
return isL2
19-
? l2.steth.convertToSteth(wsteth)
20-
: wrap.convertWstethToSteth(wsteth);
17+
return wrap.convertWstethToSteth(wsteth);
2118
},
2219
});
2320
};
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { useQuery } from '@tanstack/react-query';
2-
import { useLidoSDK, useLidoSDKL2 } from 'modules/web3';
2+
import { useLidoSDK } from 'modules/web3';
33

44
export const useStETHContractAddress = () => {
55
const { stETH } = useLidoSDK();
6-
const { l2, isL2 } = useLidoSDKL2();
76

87
return useQuery({
9-
queryKey: ['use-steth-contract-address', isL2, l2.steth, stETH],
10-
enabled: !!(isL2 ? l2.steth : stETH),
8+
queryKey: ['use-steth-contract-address', stETH],
9+
enabled: !!stETH,
1110
staleTime: Infinity,
12-
queryFn: () =>
13-
isL2 ? l2.steth.contractAddress() : stETH.contractAddress(),
11+
queryFn: () => stETH.contractAddress(),
1412
});
1513
};
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
import invariant from 'tiny-invariant';
22
import { useQuery } from '@tanstack/react-query';
3-
import { useLidoSDK, useLidoSDKL2 } from 'modules/web3';
3+
import { useLidoSDK } from 'modules/web3';
44

55
export const useWstethBySteth = (steth?: bigint | null) => {
66
const { wrap, chainId } = useLidoSDK();
7-
const { l2, isL2 } = useLidoSDKL2();
87

98
return useQuery({
10-
queryKey: ['use-wsteth-by-steth', steth?.toString(), isL2, chainId],
11-
enabled: steth != null && !!(isL2 ? l2.wsteth : wrap),
9+
queryKey: ['use-wsteth-by-steth', steth?.toString(), chainId],
10+
enabled: steth != null && !!wrap,
1211
staleTime: Infinity,
1312
queryFn: () => {
1413
if (steth === 0n) return 0n;
1514
invariant(steth);
1615

17-
return isL2
18-
? l2.steth.convertToShares(steth)
19-
: wrap.convertStethToWsteth(steth);
16+
return wrap.convertStethToWsteth(steth);
2017
},
2118
});
2219
};
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { useQuery } from '@tanstack/react-query';
2-
import { useLidoSDK, useLidoSDKL2 } from 'modules/web3';
2+
import { useLidoSDK } from 'modules/web3';
33

44
export const useWstETHContractAddress = () => {
55
const { wstETH } = useLidoSDK();
6-
const { l2, isL2 } = useLidoSDKL2();
76

87
return useQuery({
9-
queryKey: ['use-wsteth-contract-address', isL2, l2.wsteth, wstETH],
10-
enabled: !!(isL2 ? l2.wsteth : wstETH),
8+
queryKey: ['use-wsteth-contract-address', wstETH],
9+
enabled: !!wstETH,
1110
staleTime: Infinity,
12-
queryFn: () =>
13-
isL2 ? l2.wsteth.contractAddress() : wstETH.contractAddress(),
11+
queryFn: () => wstETH.contractAddress(),
1412
});
1513
};

shared/wallet/fallback/useErrorMessage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ import { useConnectorInfo } from 'reef-knot/core-react';
33
// TODO: to remove the 'reef-knot/web3-react' after it will be deprecated
44
import { helpers } from 'reef-knot/web3-react';
55
import { joinWithOr } from 'utils/join-with-or';
6-
import { useConnect } from 'wagmi';
6+
import { useAccount, useConnect } from 'wagmi';
77

88
export const useErrorMessage = (): string | undefined => {
99
const { isLedger } = useConnectorInfo();
1010
const {
1111
isSupportedChain,
1212
isChainTypeMatched,
1313
isAccountActive,
14-
chainType,
1514
supportedChainLabels,
1615
} = useDappStatus();
1716
const { error } = useConnect();
17+
const { chainId } = useAccount();
1818

1919
// Errors from chain state
2020

2121
if (isAccountActive && !isChainTypeMatched) {
22-
return `Wrong network. Please switch to ${supportedChainLabels[chainType]} in your wallet to wrap/unwrap.`;
22+
return `Wrong network. Please switch to ${supportedChainLabels[chainId || 1]} in your wallet to wrap/unwrap.`;
2323
}
2424

2525
if (!isSupportedChain) {

styles/global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const GlobalStyle = createGlobalStyle`
5858
text-size-adjust: none;
5959
}
6060
main {
61-
min-height: calc(100vh - 150px);
61+
min-height: calc(100vh - 200px);
6262
}
6363
a {
6464
cursor: pointer;

utils/apply-gas-limit-ratio.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)