diff --git a/assets/icons/lido-multichain/unichain.svg b/assets/icons/lido-multichain/unichain.svg
new file mode 100644
index 000000000..1dc11ef67
--- /dev/null
+++ b/assets/icons/lido-multichain/unichain.svg
@@ -0,0 +1,4 @@
+
diff --git a/consts/chains.ts b/consts/chains.ts
index 8c6d1f86b..cd959b127 100644
--- a/consts/chains.ts
+++ b/consts/chains.ts
@@ -20,6 +20,7 @@ export enum LIDO_MULTICHAIN_CHAINS {
'BNB Chain' = 56,
'Mode Chain' = 34443,
'Zircuit Chain' = 48900,
+ Unichain = 130,
}
// TODO: move to @lidofinance/lido-ethereum-sdk package
diff --git a/consts/matomo-wallets-events.ts b/consts/matomo-wallets-events.ts
index e543f5dbf..21af892b9 100644
--- a/consts/matomo-wallets-events.ts
+++ b/consts/matomo-wallets-events.ts
@@ -1,263 +1,70 @@
-import { MatomoEventType, trackEvent } from '@lidofinance/analytics-matomo';
-import { MetricsProp } from '@reef-knot/types';
-import { WalletIdsEthereum } from 'reef-knot/wallets';
+import { trackEvent } from '@lidofinance/analytics-matomo';
+import type { ReefKnotWalletsModalConfig } from '@reef-knot/types';
+import type { WalletIdsEthereum } from '@reef-knot/wallets-list';
import { MATOMO_CLICK_EVENTS } from './matomo-click-events';
-export const enum MATOMO_WALLETS_EVENTS_TYPES {
- onClickAmbire = 'onClickAmbire',
- onConnectAmbire = 'onConnectAmbire',
- onClickBrave = 'onClickBrave',
- onConnectBrave = 'onConnectBrave',
- onClickCoin98 = 'onClickCoin98',
- onConnectCoin98 = 'onConnectCoin98',
- onClickCoinbase = 'onClickCoinbase',
- onClickCoinbaseSmartWallet = 'onClickCoinbaseSmartWallet',
- onConnectCoinbase = 'onConnectCoinbase',
- onConnectCoinbaseSmartWallet = 'onConnectCoinbaseSmartWallet',
- onClickExodus = 'onClickExodus',
- onConnectExodus = 'onConnectExodus',
- onClickImToken = 'onClickImToken',
- onConnectImToken = 'onConnectImToken',
- onClickLedger = 'onClickLedger',
- onConnectLedger = 'onConnectLedger',
- onClickMetamask = 'onClickMetamask',
- onConnectMetamask = 'onConnectMetamask',
- onClickTrust = 'onClickTrust',
- onConnectTrust = 'onConnectTrust',
- onClickWC = 'onClickWC',
- onConnectWC = 'onConnectWC',
- onClickXdefi = 'onClickXdefi',
- onConnectXdefi = 'onConnectXdefi',
- onClickOkx = 'onClickOkx',
- onConnectOkx = 'onConnectOkx',
- onClickBitget = 'onClickBitget',
- onConnectBitget = 'onConnectBitget',
- onClickBrowser = 'onClickBrowser',
- onConnectBrowser = 'onConnectBrowser',
- onClickBinance = 'onClickBinance',
- onConnectBinance = 'onConnectBinance',
-}
+type MetricProps = Pick<
+ ReefKnotWalletsModalConfig,
+ | 'onClickTermsAccept'
+ | 'onClickWalletsMore'
+ | 'onClickWalletsLess'
+ | 'onConnectStart'
+ | 'onConnectSuccess'
+>;
-export const MATOMO_WALLETS_EVENTS: Record<
- MATOMO_WALLETS_EVENTS_TYPES,
- MatomoEventType
-> = {
- [MATOMO_WALLETS_EVENTS_TYPES.onClickAmbire]: [
- 'Ethereum_Staking_Widget',
- 'Click on Ambire wallet',
- 'eth_widget_click_ambire',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectAmbire]: [
- 'Ethereum_Staking_Widget',
- 'Connect Ambire wallet',
- 'eth_widget_connect_ambire',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickBrave]: [
- 'Ethereum_Staking_Widget',
- 'Click Brave wallet',
- 'eth_widget_click_brave',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectBrave]: [
- 'Ethereum_Staking_Widget',
- 'Connect Brave wallet',
- 'eth_widget_connect_brave',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickCoin98]: [
- 'Ethereum_Staking_Widget',
- 'Click Coin98 wallet',
- 'eth_widget_click_coin98',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectCoin98]: [
- 'Ethereum_Staking_Widget',
- 'Connect Coin98 wallet',
- 'eth_widget_connect_coin98',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickCoinbase]: [
- 'Ethereum_Staking_Widget',
- 'Click Coinbase Wallet wallet',
- 'eth_widget_click_coinbase_wallet',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectCoinbase]: [
- 'Ethereum_Staking_Widget',
- 'Connect Coinbase Wallet wallet',
- 'eth_widget_connect_coinbase_wallet',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickCoinbaseSmartWallet]: [
- 'Ethereum_Staking_Widget',
- 'Click Coinbase Smart Wallet wallet',
- 'eth_widget_click_coinbase_smart_wallet',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectCoinbaseSmartWallet]: [
- 'Ethereum_Staking_Widget',
- 'Connect Coinbase Smart Wallet wallet',
- 'eth_widget_connect_coinbase_smart_wallet',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickExodus]: [
- 'Ethereum_Staking_Widget',
- 'Click Exodus wallet',
- 'eth_widget_click_exodus',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectExodus]: [
- 'Ethereum_Staking_Widget',
- 'Connect Exodus wallet',
- 'eth_widget_connect_exodus',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickImToken]: [
- 'Ethereum_Staking_Widget',
- 'Click imToken wallet',
- 'eth_widget_click_imtoken',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectImToken]: [
- 'Ethereum_Staking_Widget',
- 'Connect imToken wallet',
- 'eth_widget_connect_imtoken',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickLedger]: [
- 'Ethereum_Staking_Widget',
- 'Click Ledger wallet',
- 'eth_widget_click_ledger',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectLedger]: [
- 'Ethereum_Staking_Widget',
- 'Connect Ledger wallet',
- 'eth_widget_connect_ledger',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickMetamask]: [
- 'Ethereum_Staking_Widget',
- 'Click Metamask wallet',
- 'eth_widget_click_metamask',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectMetamask]: [
- 'Ethereum_Staking_Widget',
- 'Connect Metamask wallet',
- 'eth_widget_connect_metamask',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickTrust]: [
- 'Ethereum_Staking_Widget',
- 'Click Trust wallet',
- 'eth_widget_click_trust',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectTrust]: [
- 'Ethereum_Staking_Widget',
- 'Connect Trust wallet',
- 'eth_widget_connect_trust',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickWC]: [
- 'Ethereum_Staking_Widget',
- 'Click WalletConnect wallet',
- 'eth_widget_click_walletconnect',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectWC]: [
- 'Ethereum_Staking_Widget',
- 'Connect WalletConnect wallet',
- 'eth_widget_connect_walletconnect',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickXdefi]: [
- 'Ethereum_Staking_Widget',
- 'Click XDEFI wallet',
- 'eth_widget_click_xdefi',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectXdefi]: [
- 'Ethereum_Staking_Widget',
- 'Connect XDEFI wallet',
- 'eth_widget_connect_xdefi',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickOkx]: [
- 'Ethereum_Staking_Widget',
- 'Click OKX wallet',
- 'eth_widget_click_okx',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectOkx]: [
- 'Ethereum_Staking_Widget',
- 'Connect OKX wallet',
- 'eth_widget_connect_okx',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickBitget]: [
- 'Ethereum_Staking_Widget',
- 'Click BitGet wallet',
- 'eth_widget_click_bitget',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectBitget]: [
- 'Ethereum_Staking_Widget',
- 'Connect BitGet wallet',
- 'eth_widget_connect_bitget',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickBrowser]: [
- 'Ethereum_Staking_Widget',
- 'Click Browser wallet',
- 'eth_widget_click_browser',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectBrowser]: [
- 'Ethereum_Staking_Widget',
- 'Connect Browser wallet',
- 'eth_widget_connect_browser',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onClickBinance]: [
- 'Ethereum_Staking_Widget',
- 'Click Binance Web3 wallet',
- 'eth_widget_click_binance_web3',
- ],
- [MATOMO_WALLETS_EVENTS_TYPES.onConnectBinance]: [
- 'Ethereum_Staking_Widget',
- 'Connect Binance Web3 wallet',
- 'eth_widget_connect_binance_web3_wallet',
- ],
+type EventsData = Partial>;
+
+const EVENTS_DATA_CONNECT_START: EventsData = {
+ ambire: ['on Ambire', 'ambire'],
+ binanceWallet: ['Binance Web3', 'binance_web3'],
+ bitget: ['BitGet', 'bitget'],
+ brave: ['Brave', 'brave'],
+ browserExtension: ['Browser', 'browser'],
+ coin98: ['Coin98', 'coin98'],
+ coinbase: ['Coinbase Wallet', 'coinbase_wallet'],
+ coinbaseSmartWallet: ['Coinbase Smart Wallet', 'coinbase_smart_wallet'],
+ exodus: ['Exodus', 'exodus'],
+ imToken: ['imToken', 'imtoken'],
+ ledgerHID: ['Ledger', 'ledger'],
+ metaMask: ['Metamask', 'metamask'],
+ okx: ['OKX', 'okx'],
+ trust: ['Trust', 'trust'],
+ walletConnect: ['WalletConnect', 'walletconnect'],
+ xdefi: ['XDEFI', 'xdefi'],
+} as const;
+
+const EVENTS_DATA_CONNECT_SUCCESS: EventsData = {
+ ...EVENTS_DATA_CONNECT_START,
+ ambire: ['Ambire', 'ambire'],
+ binanceWallet: ['Binance Web3', 'binance_web3_wallet'],
};
-const getMetricHandler = (event: Parameters) => () =>
- trackEvent(...event);
+export const walletMetricProps: MetricProps = {
+ onClickWalletsLess: () =>
+ trackEvent(...MATOMO_CLICK_EVENTS.clickShowLessWallets),
+
+ onClickWalletsMore: () =>
+ trackEvent(...MATOMO_CLICK_EVENTS.clickShowMoreWallets),
+
+ onConnectStart: ({ walletId }) => {
+ const eventData = EVENTS_DATA_CONNECT_START[walletId];
+ if (eventData) {
+ trackEvent(
+ 'Ethereum_Staking_Widget',
+ `Click ${eventData[0]} wallet`,
+ `eth_widget_click_${eventData[1]}`,
+ );
+ }
+ },
-export const walletsMetrics: MetricsProp = {
- events: {
- click: {
- handlers: {
- ambire: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickAmbire),
- brave: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickBrave),
- coin98: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickCoin98),
- coinbase: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickCoinbase),
- coinbaseSmartWallet: getMetricHandler(
- MATOMO_WALLETS_EVENTS.onClickCoinbaseSmartWallet,
- ),
- exodus: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickExodus),
- imToken: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickImToken),
- ledgerHID: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickLedger),
- metaMask: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickMetamask),
- trust: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickTrust),
- walletConnect: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickWC),
- xdefi: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickXdefi),
- okx: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickOkx),
- bitget: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickBitget),
- browserExtension: getMetricHandler(
- MATOMO_WALLETS_EVENTS.onClickBrowser,
- ),
- binanceWallet: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickBinance),
- walletsLess: getMetricHandler(MATOMO_CLICK_EVENTS.clickShowLessWallets),
- walletsMore: getMetricHandler(MATOMO_CLICK_EVENTS.clickShowMoreWallets),
- },
- },
- connect: {
- handlers: {
- ambire: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectAmbire),
- brave: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectBrave),
- coin98: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectCoin98),
- coinbase: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectCoinbase),
- coinbaseSmartWallet: getMetricHandler(
- MATOMO_WALLETS_EVENTS.onConnectCoinbaseSmartWallet,
- ),
- exodus: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectExodus),
- imToken: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectImToken),
- ledgerHID: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectLedger),
- metaMask: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectMetamask),
- trust: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectTrust),
- walletConnect: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectWC),
- xdefi: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectXdefi),
- okx: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectOkx),
- bitget: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectBitget),
- browserExtension: getMetricHandler(
- MATOMO_WALLETS_EVENTS.onConnectBrowser,
- ),
- binanceWallet: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectBinance),
- },
- },
+ onConnectSuccess: ({ walletId }) => {
+ const eventData = EVENTS_DATA_CONNECT_SUCCESS[walletId];
+ if (eventData) {
+ trackEvent(
+ 'Ethereum_Staking_Widget',
+ `Connect ${eventData[0]}`,
+ `eth_widget_connect_${eventData[1]}`,
+ );
+ }
},
};
diff --git a/features/rewards/components/IndexerLink.tsx b/features/rewards/components/IndexerLink.tsx
index b2a064ab7..2c7fac089 100644
--- a/features/rewards/components/IndexerLink.tsx
+++ b/features/rewards/components/IndexerLink.tsx
@@ -1,5 +1,5 @@
import { Box, External as ExternalLinkIcon } from '@lidofinance/lido-ui';
-import { getEtherscanTxLink } from 'utils/get-etherscan-tx-link';
+import { getEtherscanTxLink } from 'utils/etherscan';
import { config } from 'config';
diff --git a/features/stake/lido-stats/lido-stats.tsx b/features/stake/lido-stats/lido-stats.tsx
index f0deebd64..9f8e8f6aa 100644
--- a/features/stake/lido-stats/lido-stats.tsx
+++ b/features/stake/lido-stats/lido-stats.tsx
@@ -1,17 +1,16 @@
import { FC, memo, useMemo } from 'react';
-import { getEtherscanTokenLink } from '@lido-sdk/helpers';
import { useSDK } from '@lido-sdk/react';
import { getTokenAddress, TOKENS } from '@lido-sdk/constants';
import { Block, DataTable, Question, Tooltip } from '@lidofinance/lido-ui';
-import { Section, MatomoLink } from 'shared/components';
-import { useLidoApr, useLidoStats } from 'shared/hooks';
-
import { config } from 'config';
-
import { LIDO_APR_TOOLTIP_TEXT, DATA_UNAVAILABLE } from 'consts/text';
import { MATOMO_CLICK_EVENTS_TYPES } from 'consts/matomo-click-events';
+import { getEtherscanTokenLink } from 'utils/etherscan';
+
+import { Section, MatomoLink } from 'shared/components';
+import { useLidoApr, useLidoStats } from 'shared/hooks';
import { FlexCenterVertical } from './styles';
import { LidoStatsItem } from './lido-stats-item';
diff --git a/features/stake/stake.tsx b/features/stake/stake.tsx
index a2444e0c7..cb0b67f9b 100644
--- a/features/stake/stake.tsx
+++ b/features/stake/stake.tsx
@@ -1,5 +1,4 @@
import { FaqPlaceholder } from 'features/ipfs';
-import { useWagmiKey } from 'modules/web3';
import NoSSRWrapper from 'shared/components/no-ssr-wrapper';
import { OnlyInfraRender } from 'shared/components/only-infra-render';
@@ -8,12 +7,10 @@ import { LidoStats } from './lido-stats/lido-stats';
import { StakeForm } from './stake-form';
export const Stake = () => {
- const key = useWagmiKey();
-
return (
<>
-
+
}>
diff --git a/features/wsteth/shared/wrap-faq/ethereum-faq/faq.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/faq.tsx
new file mode 100644
index 000000000..f0ad570a8
--- /dev/null
+++ b/features/wsteth/shared/wrap-faq/ethereum-faq/faq.tsx
@@ -0,0 +1,21 @@
+import {
+ WhatIsWsteth,
+ HowCanIGetWsteth,
+ HowCanIUseWsteth,
+ DoIGetMyStakingRewards,
+ DoINeedToClaimMyStakingRewards,
+ HowCouldIUnwrapWstethToSteth,
+ DoINeedToUnwrapMyWsteth,
+} from './list';
+
+export const EthereumFAQ = () => (
+ <>
+
+
+
+
+
+
+
+ >
+);
diff --git a/features/wsteth/shared/wrap-faq/list/do-i-get-my-staking-rewards.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/do-i-get-my-staking-rewards.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/do-i-get-my-staking-rewards.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/do-i-get-my-staking-rewards.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/do-i-need-to-claim-my-staking-rewards.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/do-i-need-to-claim-my-staking-rewards.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/do-i-need-to-claim-my-staking-rewards.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/do-i-need-to-claim-my-staking-rewards.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/do_i_need_to_unwrap_my_wsteth.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/do_i_need_to_unwrap_my_wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/do_i_need_to_unwrap_my_wsteth.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/do_i_need_to_unwrap_my_wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/how-can-i-get-wsteth.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/how-can-i-get-wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/how-can-i-get-wsteth.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/how-can-i-get-wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/how-can-i-use-wsteth.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/how-can-i-use-wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/how-can-i-use-wsteth.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/how-can-i-use-wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/how-could-i-unwrap-wsteth-to-steth.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/how-could-i-unwrap-wsteth-to-steth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/how-could-i-unwrap-wsteth-to-steth.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/how-could-i-unwrap-wsteth-to-steth.tsx
diff --git a/features/wsteth/shared/wrap-faq/list/index.ts b/features/wsteth/shared/wrap-faq/ethereum-faq/list/index.ts
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/index.ts
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/index.ts
diff --git a/features/wsteth/shared/wrap-faq/list/what-is-wsteth.tsx b/features/wsteth/shared/wrap-faq/ethereum-faq/list/what-is-wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/list/what-is-wsteth.tsx
rename to features/wsteth/shared/wrap-faq/ethereum-faq/list/what-is-wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-faq/faq.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/faq.tsx
new file mode 100644
index 000000000..12efac87a
--- /dev/null
+++ b/features/wsteth/shared/wrap-faq/optimism-faq/faq.tsx
@@ -0,0 +1,23 @@
+import {
+ WhatIsWstethOnOptimism,
+ HowCanIGetWstethOnOptimism,
+ HowCanIUseWstethOnOptimism,
+ CanIStakeMyETHDirectlyOnOptimism,
+ DoIStillGetStakingRewardsWithStETHOrWstETHOnOptimism,
+ DoINeedToClaimMyStakingRewardsIfIWrapStETHToWstETHOnOptimism,
+ HowCouldIUnwrapWstETHBackToStETHOnOptimism,
+ WhatHappensIfIWantToUnstakeETHOnEthereumCanIDoThatFromOptimism,
+} from './list';
+
+export const OptimismFAQ = () => (
+ <>
+
+
+
+
+
+
+
+
+ >
+);
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/can-i-stake-my-eth-directly-on-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/can-i-stake-my-eth-directly-on-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/can-i-stake-my-eth-directly-on-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/can-i-stake-my-eth-directly-on-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/do-i-need-to-claim-my-staking-rewards-if-i-wrap-steth-to-wsteth-on-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/do-i-need-to-claim-my-staking-rewards-if-i-wrap-steth-to-wsteth-on-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/do-i-need-to-claim-my-staking-rewards-if-i-wrap-steth-to-wsteth-on-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/do-i-need-to-claim-my-staking-rewards-if-i-wrap-steth-to-wsteth-on-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/do-i-still-get-staking-rewards-with-steth-or-wsteth-on-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/do-i-still-get-staking-rewards-with-steth-or-wsteth-on-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/do-i-still-get-staking-rewards-with-steth-or-wsteth-on-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/do-i-still-get-staking-rewards-with-steth-or-wsteth-on-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/how-can-i-get-wsteth.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/how-can-i-get-wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/how-can-i-get-wsteth.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/how-can-i-get-wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/how-can-i-use-wsteth-on-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/how-can-i-use-wsteth-on-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/how-can-i-use-wsteth-on-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/how-can-i-use-wsteth-on-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/how-could-i-unwrap-wsteth-back-to-steth-on-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/how-could-i-unwrap-wsteth-back-to-steth-on-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/how-could-i-unwrap-wsteth-back-to-steth-on-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/how-could-i-unwrap-wsteth-back-to-steth-on-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/index.ts b/features/wsteth/shared/wrap-faq/optimism-faq/list/index.ts
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/index.ts
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/index.ts
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/what-happens-if-i-want-to-unstake-eth-on-ethereum-can-i-do-that-from-optimism.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/what-happens-if-i-want-to-unstake-eth-on-ethereum-can-i-do-that-from-optimism.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/what-happens-if-i-want-to-unstake-eth-on-ethereum-can-i-do-that-from-optimism.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/what-happens-if-i-want-to-unstake-eth-on-ethereum-can-i-do-that-from-optimism.tsx
diff --git a/features/wsteth/shared/wrap-faq/optimism-list/what-is-wsteth.tsx b/features/wsteth/shared/wrap-faq/optimism-faq/list/what-is-wsteth.tsx
similarity index 100%
rename from features/wsteth/shared/wrap-faq/optimism-list/what-is-wsteth.tsx
rename to features/wsteth/shared/wrap-faq/optimism-faq/list/what-is-wsteth.tsx
diff --git a/features/wsteth/shared/wrap-faq/wrap-faq.tsx b/features/wsteth/shared/wrap-faq/wrap-faq.tsx
index 347a390b3..c2409724f 100644
--- a/features/wsteth/shared/wrap-faq/wrap-faq.tsx
+++ b/features/wsteth/shared/wrap-faq/wrap-faq.tsx
@@ -1,56 +1,28 @@
+import React from 'react';
import { Section } from 'shared/components';
import { useMatomoEventHandle } from 'shared/hooks';
import { useDappStatus, DAPP_CHAIN_TYPE } from 'modules/web3';
-import {
- WhatIsWsteth,
- HowCanIGetWsteth,
- HowCanIUseWsteth,
- DoIGetMyStakingRewards,
- DoINeedToClaimMyStakingRewards,
- HowCouldIUnwrapWstethToSteth,
- DoINeedToUnwrapMyWsteth,
-} from './list';
+import { EthereumFAQ } from './ethereum-faq/faq';
+import { OptimismFAQ } from './optimism-faq/faq';
-import {
- WhatIsWstethOnOptimism,
- HowCanIGetWstethOnOptimism,
- HowCanIUseWstethOnOptimism,
- CanIStakeMyETHDirectlyOnOptimism,
- DoIStillGetStakingRewardsWithStETHOrWstETHOnOptimism,
- DoINeedToClaimMyStakingRewardsIfIWrapStETHToWstETHOnOptimism,
- HowCouldIUnwrapWstETHBackToStETHOnOptimism,
- WhatHappensIfIWantToUnstakeETHOnEthereumCanIDoThatFromOptimism,
-} from './optimism-list';
+export const faqComponentsMap = new Map([
+ [DAPP_CHAIN_TYPE.Ethereum, EthereumFAQ],
+ [DAPP_CHAIN_TYPE.Optimism, OptimismFAQ],
+ // FAQ for other networks
+]);
export const WrapFaq = () => {
const { isWalletConnected, chainType } = useDappStatus();
const onClickHandler = useMatomoEventHandle();
- if (isWalletConnected && chainType === DAPP_CHAIN_TYPE.Optimism) {
- return (
-
- );
- }
+ const FAQ = !isWalletConnected
+ ? EthereumFAQ
+ : faqComponentsMap.get(chainType) || EthereumFAQ;
return (
);
};
diff --git a/modules/web3/hooks/index.ts b/modules/web3/hooks/index.ts
index 07bfc2c0e..e3560f1f1 100644
--- a/modules/web3/hooks/index.ts
+++ b/modules/web3/hooks/index.ts
@@ -3,7 +3,6 @@ export * from './use-balance';
export * from './use-dapp-status';
export * from './use-is-contract';
export * from './use-tx-conformation';
-export * from './use-wagmi-key';
export * from './use-max-gas-price';
export * from './use-is-multisig';
export * from './use-stETH-by-wstETH-on-l2';
diff --git a/modules/web3/hooks/use-wagmi-key.ts b/modules/web3/hooks/use-wagmi-key.ts
deleted file mode 100644
index a05688778..000000000
--- a/modules/web3/hooks/use-wagmi-key.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { useDappStatus } from './use-dapp-status';
-
-// In order to simplify side effects of switching wallets/chains
-// we can remount by this key, resetting all internal states
-export const useWagmiKey = () => {
- const { chainId, address } = useDappStatus();
- return `${address ?? 'NO_ADDRESS'}_${chainId}`;
-};
diff --git a/modules/web3/web3-provider/web3-provider.tsx b/modules/web3/web3-provider/web3-provider.tsx
index a9eb2311d..dd4493be2 100644
--- a/modules/web3/web3-provider/web3-provider.tsx
+++ b/modules/web3/web3-provider/web3-provider.tsx
@@ -14,7 +14,7 @@ import { config } from 'config';
import { useUserConfig } from 'config/user-config';
import { useGetRpcUrlByChainId } from 'config/rpc';
import { CHAINS } from 'consts/chains';
-import { walletsMetrics } from 'consts/matomo-wallets-events';
+import { walletMetricProps } from 'consts/matomo-wallets-events';
import { useWeb3Transport } from './use-web3-transport';
import { LidoSDKProvider } from './lido-sdk';
@@ -104,7 +104,7 @@ export const Web3Provider: FC = ({ children }) => {
// Wallets config args
...getDefaultWalletsModalConfig(),
- metrics: walletsMetrics,
+ ...walletMetricProps,
walletsPinned: WALLETS_PINNED,
});
}, [
diff --git a/package.json b/package.json
index 7ce1913a4..cd15db22a 100644
--- a/package.json
+++ b/package.json
@@ -45,7 +45,7 @@
"@lidofinance/next-pages": "^0.45.1",
"@lidofinance/rpc": "^0.45.1",
"@lidofinance/satanizer": "^0.45.1",
- "@reef-knot/types": "^3.0.0",
+ "@reef-knot/types": "^4.0.0",
"@tanstack/react-query": "^5.51.21",
"bignumber.js": "9.1.0",
"copy-to-clipboard": "^3.3.1",
@@ -70,7 +70,7 @@
"react-hook-form": "^7.45.2",
"react-is": "^18.2.0",
"react-transition-group": "^4.4.2",
- "reef-knot": "6.0.3",
+ "reef-knot": "7.0.1",
"styled-components": "^5.3.5",
"swr": "^1.3.0",
"tiny-async-pool": "^1.2.0",
diff --git a/pages/api/rpc.ts b/pages/api/rpc.ts
index 7723c629a..57bffcd24 100644
--- a/pages/api/rpc.ts
+++ b/pages/api/rpc.ts
@@ -41,23 +41,23 @@ const allowedLogsAddresses: Record = Object.entries(
);
const allowedRPCMethods = [
- 'test',
- 'eth_call',
- 'eth_gasPrice',
- 'eth_getCode',
- 'eth_estimateGas',
- 'eth_getBlockByNumber',
- 'eth_feeHistory',
- 'eth_maxPriorityFeePerGas',
- 'eth_getBalance',
- 'eth_blockNumber',
- 'eth_getTransactionByHash',
- 'eth_getTransactionReceipt',
- 'eth_getTransactionCount',
- 'eth_sendRawTransaction',
- 'eth_getLogs',
- 'eth_chainId',
- 'net_version',
+ 'test',
+ 'eth_call',
+ 'eth_gasPrice',
+ 'eth_getCode',
+ 'eth_estimateGas',
+ 'eth_getBlockByNumber',
+ 'eth_feeHistory',
+ 'eth_maxPriorityFeePerGas',
+ 'eth_getBalance',
+ 'eth_blockNumber',
+ 'eth_getTransactionByHash',
+ 'eth_getTransactionReceipt',
+ 'eth_getTransactionCount',
+ 'eth_sendRawTransaction',
+ 'eth_getLogs',
+ 'eth_chainId',
+ 'net_version',
];
const rpc = rpcFactory({
@@ -86,7 +86,6 @@ const rpc = rpcFactory({
maxGetLogsRange: 20_000, // only 20k blocks size historical queries
maxResponseSize: 1_000_000, // 1mb max response
},
-
});
export default wrapNextRequest([
diff --git a/pages/withdrawals/[mode].tsx b/pages/withdrawals/[mode].tsx
index 2065ecf15..3d28df4ec 100644
--- a/pages/withdrawals/[mode].tsx
+++ b/pages/withdrawals/[mode].tsx
@@ -5,12 +5,9 @@ import Head from 'next/head';
import { WithdrawalsTabs } from 'features/withdrawals';
import { WithdrawalsProvider } from 'features/withdrawals/contexts/withdrawals-context';
import { Layout } from 'shared/components';
-import { useWagmiKey } from 'modules/web3';
import { getDefaultStaticProps } from 'utilsApi/get-default-static-props';
const Withdrawals: FC = ({ mode }) => {
- const key = useWagmiKey();
-
return (
= ({ mode }) => {
Withdrawals | Lido
-
+
);
diff --git a/pages/wrap/[[...mode]].tsx b/pages/wrap/[[...mode]].tsx
index d33aff243..13c82fe9f 100644
--- a/pages/wrap/[[...mode]].tsx
+++ b/pages/wrap/[[...mode]].tsx
@@ -4,12 +4,10 @@ import Head from 'next/head';
import { WrapUnwrapTabs } from 'features/wsteth/wrap-unwrap-tabs';
import { Layout } from 'shared/components';
-import { SupportL2Chains, useWagmiKey } from 'modules/web3';
+import { SupportL2Chains } from 'modules/web3';
import { getDefaultStaticProps } from 'utilsApi/get-default-static-props';
const WrapPage: FC = ({ mode }) => {
- const key = useWagmiKey();
-
return (
= ({ mode }) => {
Wrap | Lido
-
+
);
diff --git a/shared/components/tx-link-etherscan/tx-link-etherscan.tsx b/shared/components/tx-link-etherscan/tx-link-etherscan.tsx
index 919f6388d..d9d9b18da 100644
--- a/shared/components/tx-link-etherscan/tx-link-etherscan.tsx
+++ b/shared/components/tx-link-etherscan/tx-link-etherscan.tsx
@@ -1,7 +1,7 @@
import { Link } from '@lidofinance/lido-ui';
-import { CHAINS } from 'consts/chains';
-import { getEtherscanTxLink } from 'utils/get-etherscan-tx-link';
+import { config } from 'config';
+import { getEtherscanTxLink } from 'utils/etherscan';
import { useDappStatus } from 'modules/web3';
type TxLinkEtherscanProps = {
@@ -22,7 +22,7 @@ export const TxLinkEtherscan = (props: TxLinkEtherscanProps) => {
return (
{text}
diff --git a/shared/hook-form/form-controller/form-controller.tsx b/shared/hook-form/form-controller/form-controller.tsx
index 816b71cce..8a247f872 100644
--- a/shared/hook-form/form-controller/form-controller.tsx
+++ b/shared/hook-form/form-controller/form-controller.tsx
@@ -4,6 +4,7 @@ import { useFormContext } from 'react-hook-form';
import { useDappStatus } from 'modules/web3';
import { useFormControllerContext } from './form-controller-context';
+import { useWagmiConnectionChangedCallback } from 'shared/hooks/use-wagmi-connection-changed-callback';
type FormControllerProps = React.ComponentProps<'form'>;
@@ -42,6 +43,9 @@ export const FormController: FC> = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isDappActive]);
+ // Reset the form when chain id or wallet address changed
+ useWagmiConnectionChangedCallback(resetDefault);
+
return (