diff --git a/package.json b/package.json
index 97cef075ff..fa3b14d4e7 100644
--- a/package.json
+++ b/package.json
@@ -49,9 +49,8 @@
"@kybernetwork/oauth2": "1.0.1",
"@kyberswap/krystal-walletconnect-v2": "0.0.1",
"@kyberswap/ks-sdk-classic": "^1.0.3",
- "@kyberswap/ks-sdk-core": "1.0.13",
+ "@kyberswap/ks-sdk-core": "1.1.0-rc",
"@kyberswap/ks-sdk-elastic": "^1.1.2",
- "@kyberswap/ks-sdk-solana": "^1.0.2",
"@lingui/loader": "~3.14.0",
"@lingui/macro": "~3.14.0",
"@lingui/react": "~3.14.0",
@@ -63,11 +62,6 @@
"@reduxjs/toolkit": "1.9.3",
"@sentry/react": "^7.18.0",
"@sentry/tracing": "^7.18.0",
- "@solana/spl-token": "0.2.0",
- "@solana/wallet-adapter-base": "~0.9.18",
- "@solana/wallet-adapter-react": "0.15.18",
- "@solana/wallet-adapter-wallets": "^0.19.5",
- "@solana/web3.js": "^1.66.2",
"@use-gesture/react": "^10.2.27",
"@web3-react/coinbase-wallet": "8.2.0",
"@web3-react/core": "8.2.0",
@@ -198,7 +192,7 @@
"vite-tsconfig-paths": "^4.0.8"
},
"resolutions": {
- "@kyberswap/ks-sdk-core": "1.0.13",
+ "@kyberswap/ks-sdk-core": "1.1.0-rc",
"babel-plugin-lodash/@babel/types": "~7.20.0",
"react-error-overlay": "6.0.9",
"@lingui/babel-plugin-extract-messages": "3.14.0",
diff --git a/src/assets/wallets-connect/phantom.svg b/src/assets/wallets-connect/phantom.svg
deleted file mode 100644
index 211a33f507..0000000000
--- a/src/assets/wallets-connect/phantom.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/assets/wallets-connect/slope.svg b/src/assets/wallets-connect/slope.svg
deleted file mode 100644
index 8b27cd4a78..0000000000
--- a/src/assets/wallets-connect/slope.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-
diff --git a/src/assets/wallets-connect/solflare.svg b/src/assets/wallets-connect/solflare.svg
deleted file mode 100644
index 6187e01a79..0000000000
--- a/src/assets/wallets-connect/solflare.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/components/AddToMetamask/index.tsx b/src/components/AddToMetamask/index.tsx
index f730ea9b7e..9dc039d60a 100644
--- a/src/components/AddToMetamask/index.tsx
+++ b/src/components/AddToMetamask/index.tsx
@@ -1,14 +1,11 @@
import { Token } from '@kyberswap/ks-sdk-core'
-import { createUserAssociatedTokenAccount } from '@kyberswap/ks-sdk-solana'
-import { PublicKey } from '@solana/web3.js'
import styled from 'styled-components'
import { ButtonEmpty } from 'components/Button'
import { RowFixed } from 'components/Row'
import { SUPPORTED_WALLETS } from 'constants/wallets'
import { useActiveWeb3React } from 'hooks'
-import useProvider from 'hooks/solana/useProvider'
-import { getTokenLogoURL, isAddress } from 'utils'
+import { getTokenLogoURL } from 'utils'
const StyledLogo = styled.img`
height: 16px;
@@ -16,8 +13,7 @@ const StyledLogo = styled.img`
`
export default function AddTokenToMetaMask({ token }: { token: Token }) {
- const { chainId, walletKey, account, isEVM } = useActiveWeb3React()
- const provider = useProvider()
+ const { chainId, walletKey } = useActiveWeb3React()
async function addToMetaMask() {
const tokenAddress = token.address
@@ -25,35 +21,26 @@ export default function AddTokenToMetaMask({ token }: { token: Token }) {
const tokenDecimals = token.decimals
const tokenImage = getTokenLogoURL(token.address, chainId)
- if (isEVM) {
- try {
- await window.ethereum?.request({
- method: 'wallet_watchAsset',
- params: {
- type: 'ERC20',
- options: {
- address: tokenAddress,
- symbol: tokenSymbol,
- decimals: tokenDecimals,
- image: tokenImage,
- },
+ try {
+ await window.ethereum?.request({
+ method: 'wallet_watchAsset',
+ params: {
+ type: 'ERC20',
+ options: {
+ address: tokenAddress,
+ symbol: tokenSymbol,
+ decimals: tokenDecimals,
+ image: tokenImage,
},
- })
- } catch (error) {
- console.error(error)
- }
- } else {
- if (!account || !provider || !isAddress(chainId, tokenAddress)) return
- try {
- await createUserAssociatedTokenAccount(provider, new PublicKey(tokenAddress), new PublicKey(account))
- } catch (error) {
- console.error(error)
- }
+ },
+ })
+ } catch (error) {
+ console.error(error)
}
}
if (!walletKey) return null
if (walletKey === 'WALLET_CONNECT') return null
- if (isEVM && walletKey === 'COINBASE') return null // Coinbase wallet no need to add since it automatically track token
+ if (walletKey === 'COINBASE') return null // Coinbase wallet no need to add since it automatically track token
return (
diff --git a/src/components/AddressInputPanel/index.tsx b/src/components/AddressInputPanel/index.tsx
index fce0ca5253..2b322696c8 100644
--- a/src/components/AddressInputPanel/index.tsx
+++ b/src/components/AddressInputPanel/index.tsx
@@ -141,7 +141,7 @@ export default function AddressInputPanel({
// triggers whenever the typed value changes
onChange: (value: string | null) => void
}) {
- const { chainId, networkInfo, isEVM } = useActiveWeb3React()
+ const { chainId, networkInfo } = useActiveWeb3React()
const { address, loading, name } = useENS(value)
const handleInput = useCallback(
@@ -155,7 +155,6 @@ export default function AddressInputPanel({
const theme = useTheme()
const error = Boolean((value || '').length > 0 && !loading && !address)
- if (!isEVM) return null
return (
{
const { networkInfo } = useActiveWeb3React()
- const isZapAvailable = !!(networkInfo as EVMNetworkInfo).elastic.zap
+ const isZapAvailable = !!networkInfo.elastic.zap
const theme = useTheme()
const tmp = true
@@ -135,7 +134,7 @@ export default function QuickZap(props: Props) {
function QuickZapModal({ isOpen, onDismiss, poolAddress, tokenId, expectedChainId }: Props) {
const { chainId, networkInfo, account } = useActiveWeb3React()
- const zapInContractAddress = (networkInfo as EVMNetworkInfo).elastic.zap?.router
+ const zapInContractAddress = networkInfo.elastic.zap?.router
const { changeNetwork } = useChangeNetwork()
const theme = useTheme()
const [selectedRange, setSelectedRange] = useState(null)
diff --git a/src/components/FeeSelector/hook.ts b/src/components/FeeSelector/hook.ts
index 7f5baec1e5..5d6570f030 100644
--- a/src/components/FeeSelector/hook.ts
+++ b/src/components/FeeSelector/hook.ts
@@ -3,7 +3,6 @@ import { FeeAmount } from '@kyberswap/ks-sdk-elastic'
import { useEffect, useState } from 'react'
import { POOL_POSITION_COUNT } from 'apollo/queries/promm'
-import { useActiveWeb3React } from 'hooks'
import { useProAmmPoolInfos } from 'hooks/useProAmmPoolInfo'
import { useKyberSwapConfig } from 'state/application/hooks'
@@ -29,14 +28,12 @@ export const useFeeTierDistribution = (
currencyA: Currency | undefined,
currencyB: Currency | undefined,
): { [key in FeeAmount]: number } => {
- const { isEVM } = useActiveWeb3React()
const { elasticClient } = useKyberSwapConfig()
const poolIds = useProAmmPoolInfos(currencyA, currencyB, FEE_AMOUNTS).filter(Boolean)
const [feeTierDistribution, setFeeTierDistribution] = useState<{ [key in FeeAmount]: number }>(initState)
useEffect(() => {
- if (!isEVM) return
if (!poolIds.length) return
setFeeTierDistribution(initState)
elasticClient
@@ -69,7 +66,7 @@ export const useFeeTierDistribution = (
})
.catch(err => console.warn({ err }))
// eslint-disable-next-line
- }, [JSON.stringify(poolIds), isEVM, elasticClient])
+ }, [JSON.stringify(poolIds), elasticClient])
return feeTierDistribution
}
diff --git a/src/components/Header/groups/EarnNavGroup.tsx b/src/components/Header/groups/EarnNavGroup.tsx
index 3baad2ee91..d0268ee58b 100644
--- a/src/components/Header/groups/EarnNavGroup.tsx
+++ b/src/components/Header/groups/EarnNavGroup.tsx
@@ -15,16 +15,12 @@ import { DropdownTextAnchor, StyledNavLink } from '../styleds'
import NavGroup from './NavGroup'
const EarnNavGroup = () => {
- const { isEVM, networkInfo } = useActiveWeb3React()
+ const { networkInfo } = useActiveWeb3React()
const upTo420 = useMedia('(max-width: 420px)')
const { pathname } = useLocation()
const { mixpanelHandler } = useMixpanel()
const isActive = [APP_PATHS.POOLS, APP_PATHS.FARMS, APP_PATHS.MY_POOLS].some(path => pathname.includes(path))
- if (!isEVM) {
- return null
- }
-
return (
{
)}
{/*
- !(isSolana || chainId === ChainId.LINEA_TESTNET) && (
+ !(chainId === ChainId.LINEA_TESTNET) && (
void
}) => {
const theme = useTheme()
- const { isWrongNetwork, walletSolana, walletEVM } = useActiveWeb3React()
+ const { isWrongNetwork, wallet } = useActiveWeb3React()
const { changeNetwork } = useChangeNetwork()
const [dragging, setDragging] = useState(false)
const ref = useRef(null)
@@ -143,29 +143,18 @@ const DraggableNetworkButton = ({
const isMaintenance = state === ChainState.MAINTENANCE
const disabled = (activeChainIds ? !activeChainIds?.includes(chainId) : false) || isMaintenance
const selected = isSelected && !isWrongNetwork
- const walletKey =
- chainId === ChainId.SOLANA ? walletSolana.walletKey : walletEVM.chainId === chainId ? walletEVM.walletKey : null
+ const walletKey = wallet.chainId === chainId ? wallet.walletKey : null
const handleChainSelect = () => {
if (disabled) return
customToggleModal?.()
if (customOnSelectNetwork) {
customOnSelectNetwork(chainId)
- } else if (getChainType(chainId) === getChainType(chainId)) {
- changeNetwork(chainId, () => {
- navigate(
- {
- search: stringify(qs),
- },
- { replace: true },
- )
- onChangedNetwork?.()
- })
} else {
changeNetwork(chainId, () => {
navigate(
{
- search: '',
+ search: stringify(qs),
},
{ replace: true },
)
diff --git a/src/components/Header/web3/SelectWallet.tsx b/src/components/Header/web3/SelectWallet.tsx
index fe6fe28ef6..8693939b92 100644
--- a/src/components/Header/web3/SelectWallet.tsx
+++ b/src/components/Header/web3/SelectWallet.tsx
@@ -102,11 +102,11 @@ const AccountElement = styled.div`
`
function Web3StatusInner() {
- const { chainId, account, walletKey, isEVM, isWrongNetwork } = useActiveWeb3React()
+ const { chainId, account, walletKey, isWrongNetwork } = useActiveWeb3React()
const { mixpanelHandler } = useMixpanel()
const uptoMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`)
const { signIn } = useLogin()
- const { ENSName } = useENSName(isEVM ? account ?? undefined : undefined)
+ const { ENSName } = useENSName(account ?? undefined)
const theme = useTheme()
const allTransactions = useAllTransactions()
diff --git a/src/components/Header/web3/SignWallet/ProfileContent.tsx b/src/components/Header/web3/SignWallet/ProfileContent.tsx
index 48c1f1315c..239180826d 100644
--- a/src/components/Header/web3/SignWallet/ProfileContent.tsx
+++ b/src/components/Header/web3/SignWallet/ProfileContent.tsx
@@ -213,7 +213,7 @@ const ProfileItem = ({
const ProfileContent = ({ scroll, toggleModal }: { scroll?: boolean; toggleModal: () => void }) => {
const { signIn, signOutAll } = useLogin()
const { profiles, totalGuest } = useProfileInfo()
- const { account, isEVM } = useActiveWeb3React()
+ const { account } = useActiveWeb3React()
if (!profiles.length) return null
const listNotActive = profiles.slice(1)
@@ -230,7 +230,7 @@ const ProfileContent = ({ scroll, toggleModal }: { scroll?: boolean; toggleModal
1}>
- {!KyberOauth2.getConnectedAccounts().includes(account?.toLowerCase() ?? '') && isEVM && (
+ {!KyberOauth2.getConnectedAccounts().includes(account?.toLowerCase() ?? '') && (
{
toggleModal()
diff --git a/src/components/Header/web3/WalletModal/Option.tsx b/src/components/Header/web3/WalletModal/Option.tsx
index 03df6ab5e8..19347e344c 100644
--- a/src/components/Header/web3/WalletModal/Option.tsx
+++ b/src/components/Header/web3/WalletModal/Option.tsx
@@ -1,15 +1,13 @@
import { Trans } from '@lingui/macro'
-import { WalletReadyState } from '@solana/wallet-adapter-base'
import { darken } from 'polished'
import React from 'react'
import styled, { css } from 'styled-components'
import { MouseoverTooltip } from 'components/Tooltip'
-import { SUPPORTED_WALLET, SUPPORTED_WALLETS } from 'constants/wallets'
+import { SUPPORTED_WALLET, SUPPORTED_WALLETS, WalletReadyState } from 'constants/wallets'
import { useActiveWeb3React } from 'hooks'
import { useIsAcceptedTerm } from 'state/user/hooks'
import { ExternalLink } from 'theme'
-import { isEVMWallet, isSolanaWallet } from 'utils'
import checkForBraveBrowser from 'utils/checkForBraveBrowser'
import { C98OverrideGuide } from './WarningBox'
@@ -106,19 +104,17 @@ const StyledLink = styled(ExternalLink)`
const Option = ({
walletKey,
readyState,
- isSupportCurrentChain,
installLink,
isOverridden,
onSelected,
}: {
walletKey: SUPPORTED_WALLET
- isSupportCurrentChain: boolean
readyState?: WalletReadyState
installLink?: string
isOverridden?: boolean
onSelected?: (walletKey: SUPPORTED_WALLET) => any
}) => {
- const { walletKey: walletKeyConnected, isEVM, isSolana } = useActiveWeb3React()
+ const { walletKey: walletKeyConnected } = useActiveWeb3React()
const isBraveBrowser = checkForBraveBrowser()
const [isAcceptedTerm] = useIsAcceptedTerm()
@@ -134,10 +130,8 @@ const Option = ({
onClick={
onSelected &&
!isConnected &&
- (readyState === WalletReadyState.Installed ||
- (readyState === WalletReadyState.Loadable && isSolanaWallet(wallet))) &&
+ readyState === WalletReadyState.Installed &&
isAcceptedTerm &&
- isSupportCurrentChain &&
!isOverridden &&
!(walletKey === 'BRAVE' && !isBraveBrowser)
? () => onSelected(walletKey)
@@ -157,13 +151,9 @@ const Option = ({
)
- if (!isSupportCurrentChain) {
- return null
- }
-
if (!isAcceptedTerm) return content
- if (readyState === WalletReadyState.Loadable && isEVMWallet(wallet) && wallet.href) {
+ if (readyState === WalletReadyState.Loadable && wallet.href) {
return {content}
}
@@ -193,7 +183,7 @@ const Option = ({
)
}
// Brave wallet overrided by Metamask extension
- if (isBraveBrowser && !window.ethereum?.isBraveWallet && isEVM) {
+ if (isBraveBrowser && !window.ethereum?.isBraveWallet) {
return (
transparentize(0.8, theme.primary)};
- color: ${({ theme }) => theme.primary};
- width: 24px;
- height: 24px;
- border-radius: 50%;
- margin: 0 8px !important;
- font-size: 12px;
-`
-
enum WALLET_VIEWS {
CHANGE_WALLET = 'CHANGE_WALLET',
ACCOUNT = 'account',
@@ -130,16 +115,14 @@ enum WALLET_VIEWS {
type WalletInfoExtended = WalletInfo & {
key: SUPPORTED_WALLET
- readyState: WalletReadyState | undefined
- isSupportCurrentChain: boolean
+ readyStateResult: WalletReadyState | undefined
isOverridden: boolean
}
export default function WalletModal() {
- const { isWrongNetwork, account, isSolana, isEVM, walletKey } = useActiveWeb3React()
+ const { isWrongNetwork, account, walletKey } = useActiveWeb3React()
// important that these are destructed from the account-specific web3-react context
const { active, connector } = useWeb3React()
- const { connected, connecting, wallet: solanaWallet } = useWallet()
const { tryActivation } = useActivationWallet()
const theme = useTheme()
@@ -202,14 +185,6 @@ export default function WalletModal() {
}
}, [setWalletView, active, error, connector, walletModalOpen, activePrevious, connectorPrevious])
- useEffect(() => {
- // If is there any issue when connecting wallet, solanaWallet will be cleared and set to null
- // Use it to check is there any error after connecting
- if (!connecting && !connected && !solanaWallet) {
- setPendingError(true)
- }
- }, [connecting, connected, solanaWallet])
-
const [, setIsConnectingWallet] = useIsConnectingWallet()
const handleWalletChange = useCallback(
async (walletKey: SUPPORTED_WALLET) => {
@@ -236,19 +211,13 @@ export default function WalletModal() {
// Generate list of wallets and states of it depend on current network
const parsedWalletList: WalletInfoExtended[] = (Object.keys(SUPPORTED_WALLETS) as SUPPORTED_WALLET[]).map(k => {
const wallet = SUPPORTED_WALLETS[k]
- const readyState = (() => {
- const readyStateEVM = isEVMWallet(wallet) ? wallet.readyState() : undefined
- const readyStateSolana = isSolanaWallet(wallet) ? wallet.readyStateSolana() : undefined
- return (isEVM && readyStateEVM) || (isSolana && readyStateSolana) || readyStateEVM || readyStateSolana
- })()
- const isSupportCurrentChain = (isEVMWallet(wallet) && isEVM) || (isSolanaWallet(wallet) && isSolana) || false
+ const readyState = wallet.readyState()
const overridden = isOverriddenWallet(k) || (walletKey === 'COIN98' && !window.ethereum?.isCoin98)
return {
...wallet,
key: k,
- readyState,
- isSupportCurrentChain,
+ readyStateResult: readyState,
isOverridden: overridden,
installLink: readyState === WalletReadyState.NotDetected ? wallet.installLink : undefined,
}
@@ -262,23 +231,22 @@ export default function WalletModal() {
}
const sortWallets = (walletA: WalletInfoExtended, walletB: WalletInfoExtended): number => {
return (
- sortPoint[walletB.readyState || WalletReadyState.Unsupported] -
- sortPoint[walletA.readyState || WalletReadyState.Unsupported]
+ sortPoint[walletB.readyStateResult || WalletReadyState.Unsupported] -
+ sortPoint[walletA.readyStateResult || WalletReadyState.Unsupported]
)
}
return (
parsedWalletList
.sort(sortWallets)
// Filter Unsupported state wallets
- .filter(wallet => wallet.readyState !== WalletReadyState.Unsupported)
+ .filter(wallet => wallet.readyStateResult !== WalletReadyState.Unsupported)
.map(wallet => (
))
@@ -354,63 +322,6 @@ export default function WalletModal() {
onClickTryAgain={() => {
pendingWalletKey && tryActivation(pendingWalletKey)
}}
- context={
- pendingWalletKey === 'SOLFLARE' ? (
-
-
-
-
-
-
-
- If you haven‘t created a Solflare wallet yet, please follow the steps below
-
-
-
- }
- expandContent={
-
-
-
- 1
-
-
- Create a Solflare wallet
-
-
-
-
- 2
-
-
- Close the Solflare popup
-
-
-
-
- 3
-
-
- Try to connect again
-
-
-
- }
- />
-
- ) : undefined
- }
/>
) : (
{getOptions()}
diff --git a/src/components/Icons/Solana.tsx b/src/components/Icons/Solana.tsx
deleted file mode 100644
index dfff86253a..0000000000
--- a/src/components/Icons/Solana.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import useTheme from 'hooks/useTheme'
-
-function Solana() {
- const theme = useTheme()
- return (
-
- )
-}
-
-export default Solana
diff --git a/src/components/Icons/SolanaLogoFull.tsx b/src/components/Icons/SolanaLogoFull.tsx
deleted file mode 100644
index ea681c04a6..0000000000
--- a/src/components/Icons/SolanaLogoFull.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-function SolanaLogoFull() {
- return (
-
- )
-}
-
-export default SolanaLogoFull
diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts
index 11d68a723a..04132fee60 100644
--- a/src/components/Icons/index.ts
+++ b/src/components/Icons/index.ts
@@ -28,8 +28,6 @@ export { default as PolygonLogoFull } from './PolygonLogoFull'
export { default as PoolClassicIcon } from './PoolClassicIcon'
export { default as Shield } from './Shield'
export { default as PoolElasticIcon } from './PoolElasticIcon'
-export { default as Solana } from './Solana'
-export { default as SolanaLogoFull } from './SolanaLogoFull'
export { default as LineaFull } from './LineaFull'
export { default as Swap } from './Swap'
export { default as Swap2 } from './Swap_2'
diff --git a/src/components/LiveChart/index.tsx b/src/components/LiveChart/index.tsx
index 32ca912051..6403d4d448 100644
--- a/src/components/LiveChart/index.tsx
+++ b/src/components/LiveChart/index.tsx
@@ -111,7 +111,7 @@ function LiveChart({
currencies: { [field in Field]?: Currency }
enableProChart?: boolean
}) {
- const { isSolana, networkInfo } = useActiveWeb3React()
+ const { networkInfo } = useActiveWeb3React()
const theme = useTheme()
const [currenciesState, setCurrenciesState] = useState(currencies)
@@ -185,7 +185,6 @@ function LiveChart({
}, [nativeInputCurrency, nativeOutputCurrency])
const isWrappedToken = !!tokens[0]?.address && tokens[0]?.address === tokens[1]?.address
- const isUnwrapingWSOL = isSolana && isWrappedToken && currencies[Field.INPUT]?.isToken
const [hoverValue, setHoverValue] = useState(null)
const [timeFrame, setTimeFrame] = useState(LiveDataTimeframeEnum.DAY)
@@ -273,13 +272,9 @@ function LiveChart({
>
- {isUnwrapingWSOL ? (
- You can only swap all WSOL to SOL
- ) : (
-
- You can swap {nativeInputCurrency?.symbol} for {nativeOutputCurrency?.symbol} (and vice versa)
-
- )}
+
+ You can swap {nativeInputCurrency?.symbol} for {nativeOutputCurrency?.symbol} (and vice versa)
+
Exchange rate is always 1 to 1.
diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index 44796e4579..4339cb7e8d 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -28,7 +28,6 @@ import { ENV_LEVEL, TAG } from 'constants/env'
import { AGGREGATOR_ANALYTICS_URL, APP_PATHS, DMM_ANALYTICS_URL, TERM_FILES_PATH } from 'constants/index'
import { getLocaleLabel } from 'constants/locales'
import { FAUCET_NETWORKS } from 'constants/networks'
-import { EVMNetworkInfo } from 'constants/networks/type'
import { THRESHOLD_HEADER } from 'constants/styles'
import { ENV_TYPE } from 'constants/type'
import { useActiveWeb3React } from 'hooks'
@@ -206,7 +205,7 @@ const ScrollEnd = styled.div<{ show: boolean }>`
const noop = () => {}
export default function Menu() {
- const { chainId, account, isEVM, networkInfo } = useActiveWeb3React()
+ const { chainId, account, networkInfo } = useActiveWeb3React()
const theme = useTheme()
const open = useModalOpen(ApplicationModal.MENU)
@@ -599,7 +598,7 @@ export default function Menu() {
{
mixpanelHandler(MIXPANEL_TYPE.CLAIM_REWARDS_INITIATED)
toggleClaimPopup()
diff --git a/src/components/PoolList/ItemCard/index.tsx b/src/components/PoolList/ItemCard/index.tsx
index 33528f141e..d1ada448a9 100644
--- a/src/components/PoolList/ItemCard/index.tsx
+++ b/src/components/PoolList/ItemCard/index.tsx
@@ -28,7 +28,6 @@ import { FeeTag, FlipCard, FlipCardBack, FlipCardFront } from 'components/YieldP
import { APRTooltipContent } from 'components/YieldPools/FarmingPoolAPRCell'
import DMM_POOL_INTERFACE from 'constants/abis/dmmPool'
import { APP_PATHS, DMM_ANALYTICS_URL, ONE_BIPS, SUBGRAPH_AMP_MULTIPLIER } from 'constants/index'
-import { EVMNetworkInfo } from 'constants/networks/type'
import { NativeCurrencies } from 'constants/tokens'
import { useActiveWeb3React } from 'hooks'
import { ClassicPoolData } from 'hooks/pool/classic/type'
@@ -81,7 +80,7 @@ const ItemCard = ({ poolData, myLiquidity }: ListItemProps) => {
const isFarmingPool = !!farm
const factories = useMultipleContractSingleData([poolData.id], DMM_POOL_INTERFACE, 'factory')
- const isNewStaticFeePool = factories?.[0]?.result?.[0] === (networkInfo as EVMNetworkInfo).classic.static.factory
+ const isNewStaticFeePool = factories?.[0]?.result?.[0] === networkInfo.classic.static.factory
// Shorten address with 0x + 3 characters at start and end
const shortenPoolAddress = shortenAddress(chainId, poolData.id, 3)
diff --git a/src/components/PoolList/index.tsx b/src/components/PoolList/index.tsx
index 83f36fbcd3..fb380b70b5 100644
--- a/src/components/PoolList/index.tsx
+++ b/src/components/PoolList/index.tsx
@@ -109,7 +109,7 @@ const PoolList = ({ currencies, searchValue, isShowOnlyActiveFarmPools, onlyShow
const { loading: loadingPoolsData, data: classicPoolsData } = useGetClassicPools()
- const { account, chainId, networkInfo, isEVM } = useActiveWeb3React()
+ const { account, chainId, networkInfo } = useActiveWeb3React()
const [viewMode] = useViewMode()
useResetPools(chainId)
@@ -363,7 +363,7 @@ const PoolList = ({ currencies, searchValue, isShowOnlyActiveFarmPools, onlyShow
})
if (onlyShowStable) {
- const stableList = isEVM ? stableCoins?.map(item => item.address.toLowerCase()) || [] : []
+ const stableList = stableCoins?.map(item => item.address.toLowerCase()) || []
res = res.filter(poolData => {
return (
stableList.includes(poolData.token0.address.toLowerCase()) &&
@@ -381,7 +381,6 @@ const PoolList = ({ currencies, searchValue, isShowOnlyActiveFarmPools, onlyShow
onlyShowStable,
farms,
searchValue,
- isEVM,
stableCoins,
])
diff --git a/src/components/ProAmm/ProAmmFee.tsx b/src/components/ProAmm/ProAmmFee.tsx
index 6ef4f463b8..eb778f9023 100644
--- a/src/components/ProAmm/ProAmmFee.tsx
+++ b/src/components/ProAmm/ProAmmFee.tsx
@@ -17,7 +17,6 @@ import { RowBetween, RowFixed } from 'components/Row'
import TransactionConfirmationModal, { TransactionErrorContent } from 'components/TransactionConfirmationModal'
import FarmV21ABI from 'constants/abis/v2/farmv2.1.json'
import FarmV2ABI from 'constants/abis/v2/farmv2.json'
-import { EVMNetworkInfo } from 'constants/networks/type'
import { useActiveWeb3React, useWeb3React } from 'hooks'
import {
useProAmmNFTPositionManagerReadingContract,
@@ -115,9 +114,7 @@ export default function ProAmmFee({
const info = userInfo?.find(item => item.nftId.toString() === tokenId.toString())
const address = info?.farmAddress
- const isFarmV21 = (networkInfo as EVMNetworkInfo).elastic['farmV2.1S']
- ?.map(item => item.toLowerCase())
- .includes(address?.toLowerCase())
+ const isFarmV21 = networkInfo.elastic['farmV2.1S']?.map(item => item.toLowerCase()).includes(address?.toLowerCase())
const farmV2Contract = useSigningContract(address, FarmV2ABI)
const farmV21Contract = useSigningContract(address, FarmV21ABI)
diff --git a/src/components/SearchModal/CurrencyList.tsx b/src/components/SearchModal/CurrencyList.tsx
index d28dfe9ced..ab01f45f91 100644
--- a/src/components/SearchModal/CurrencyList.tsx
+++ b/src/components/SearchModal/CurrencyList.tsx
@@ -12,7 +12,6 @@ import Column from 'components/Column'
import CurrencyLogo from 'components/CurrencyLogo'
import Loader from 'components/Loader'
import { RowBetween, RowFixed } from 'components/Row'
-import { isEVM } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
import useTheme from 'hooks/useTheme'
import { WrappedTokenInfo } from 'state/lists/wrappedTokenInfo'
@@ -225,9 +224,8 @@ function CurrencyList({
customChainId?: ChainId
}) {
const currencyBalances = useCurrencyBalances(currencies, customChainId)
- const { chainId, account } = useActiveWeb3React()
+ const { account } = useActiveWeb3React()
const tokenImports = useUserAddedTokens(customChainId)
- const canShowBalance = customChainId && customChainId !== chainId ? isEVM(customChainId) === isEVM(chainId) : true
const { favoriteTokens } = useUserFavoriteTokens(customChainId)
const Row = useCallback(
@@ -268,7 +266,7 @@ function CurrencyList({
style={{ ...style, ...itemStyle }}
currency={currency}
currencyBalance={currencyBalance}
- customBalance={canShowBalance ? undefined : }
+ customBalance={}
isSelected={isSelected}
showFavoriteIcon={showFavoriteIcon}
onSelect={onCurrencySelect}
@@ -290,7 +288,6 @@ function CurrencyList({
itemStyle,
showFavoriteIcon,
tokenImports,
- canShowBalance,
account,
favoriteTokens,
],
diff --git a/src/components/SearchModal/CurrencySearch.tsx b/src/components/SearchModal/CurrencySearch.tsx
index 77f04ce421..b0f90d852a 100644
--- a/src/components/SearchModal/CurrencySearch.tsx
+++ b/src/components/SearchModal/CurrencySearch.tsx
@@ -13,7 +13,6 @@ import Column from 'components/Column'
import InfoHelper from 'components/InfoHelper'
import { RowBetween } from 'components/Row'
import { KS_SETTING_API } from 'constants/env'
-import { isEVM } from 'constants/networks'
import { Z_INDEXS } from 'constants/styles'
import { NativeCurrencies } from 'constants/tokens'
import { useActiveWeb3React } from 'hooks'
@@ -154,7 +153,7 @@ export function CurrencySearch({
const [searchQuery, setSearchQuery] = useState('')
const debouncedQuery = useDebounce(searchQuery, 200)
- const isQueryValidEVMAddress = isEVM(chainId) && !!isAddress(chainId, debouncedQuery)
+ const isQueryValidEVMAddress = !!isAddress(chainId, debouncedQuery)
const { favoriteTokens, toggleFavoriteToken } = useUserFavoriteTokens(chainId)
diff --git a/src/components/SolanaWalletContext/index.tsx b/src/components/SolanaWalletContext/index.tsx
deleted file mode 100644
index f875b56c18..0000000000
--- a/src/components/SolanaWalletContext/index.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { WalletProvider } from '@solana/wallet-adapter-react'
-import { FC, ReactNode, useMemo } from 'react'
-
-import { SUPPORTED_WALLETS } from 'constants/wallets'
-import { isSolanaWallet } from 'utils'
-
-const SolanaWalletContext: FC<{ children: ReactNode }> = ({ children }) => {
- const wallets = useMemo(
- () =>
- Object.values(SUPPORTED_WALLETS)
- .filter(isSolanaWallet)
- .map(wallet => wallet.adapter),
- [],
- )
-
- return (
-
- {children}
-
- )
-}
-
-export default SolanaWalletContext
diff --git a/src/components/SwapForm/InputCurrencyPanel.tsx b/src/components/SwapForm/InputCurrencyPanel.tsx
index 7498cf7ee2..01082048ce 100644
--- a/src/components/SwapForm/InputCurrencyPanel.tsx
+++ b/src/components/SwapForm/InputCurrencyPanel.tsx
@@ -1,9 +1,7 @@
import { ChainId, Currency, CurrencyAmount } from '@kyberswap/ks-sdk-core'
-import { useEffect } from 'react'
import CurrencyInputPanel from 'components/CurrencyInputPanel'
import { useSwapFormContext } from 'components/SwapForm/SwapFormContext'
-import { useActiveWeb3React } from 'hooks'
import { WrapType } from 'hooks/useWrapCallback'
import { formattedNum } from 'utils'
import { halfAmountSpend, maxAmountSpend } from 'utils/maxAmountSpend'
@@ -28,10 +26,7 @@ const InputCurrencyPanel: React.FC = ({
onChangeCurrencyIn,
customChainId,
}) => {
- const { isSolana } = useActiveWeb3React()
-
const { routeSummary } = useSwapFormContext()
- const isSolanaUnwrap = isSolana && wrapType === WrapType.UNWRAP
const showWrap: boolean = wrapType !== WrapType.NOT_APPLICABLE
const trade = showWrap ? undefined : routeSummary
@@ -45,21 +40,14 @@ const InputCurrencyPanel: React.FC = ({
setTypedValue(half || '')
}
- useEffect(() => {
- // reset value for unwrapping WSOL
- // because on Solana, unwrap WSOL is closing WSOL account,
- // which mean it will unwrap all WSOL at once and we can't unwrap partial amount of WSOL
- if (isSolanaUnwrap) setTypedValue(balanceIn?.toExact() ?? '')
- }, [balanceIn, isSolanaUnwrap, setTypedValue])
-
return (
diff --git a/src/components/SwapForm/SwapModal/ConfirmSwapModalContent.tsx b/src/components/SwapForm/SwapModal/ConfirmSwapModalContent.tsx
index 36337161c8..c826a0f989 100644
--- a/src/components/SwapForm/SwapModal/ConfirmSwapModalContent.tsx
+++ b/src/components/SwapForm/SwapModal/ConfirmSwapModalContent.tsx
@@ -8,7 +8,6 @@ import { calculatePriceImpact } from 'services/route/utils'
import styled from 'styled-components'
import { ButtonPrimary } from 'components/Button'
-import { GreyCard } from 'components/Card'
import { AutoColumn } from 'components/Column'
import Loader from 'components/Loader'
import { RowBetween } from 'components/Row'
@@ -21,10 +20,8 @@ import { BuildRouteResult } from 'components/SwapForm/hooks/useBuildRoute'
import { MouseoverTooltip } from 'components/Tooltip'
import WarningNote from 'components/WarningNote'
import { Dots } from 'components/swapv2/styleds'
-import { useActiveWeb3React } from 'hooks'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
import useTheme from 'hooks/useTheme'
-import { useEncodeSolana } from 'state/swap/hooks'
import { useDegenModeManager } from 'state/user/hooks'
import { CloseIcon } from 'theme/components'
import { minimumAmountAfterSlippage, toCurrencyAmount } from 'utils/currencyAmount'
@@ -80,8 +77,6 @@ export default function ConfirmSwapModalContent({
onSwap,
}: Props) {
const theme = useTheme()
- const { isSolana } = useActiveWeb3React()
- const [encodeSolana] = useEncodeSolana()
const { routeSummary, slippage, isStablePairSwap, isAdvancedMode } = useSwapFormContext()
const [hasAcceptedNewAmount, setHasAcceptedNewAmount] = useState(false)
const [showAreYouSureModal, setShowAreYouSureModal] = useState(false)
@@ -307,13 +302,7 @@ export default function ConfirmSwapModalContent({
{errorWhileBuildRoute && }
- {isSolana && !encodeSolana ? (
-
-
- Checking accounts
-
-
- ) : errorWhileBuildRoute ? (
+ {errorWhileBuildRoute ? (
Dismiss
diff --git a/src/components/SwapForm/SwapModal/SwapDetails/index.tsx b/src/components/SwapForm/SwapModal/SwapDetails/index.tsx
index 392a7ce743..3156626efc 100644
--- a/src/components/SwapForm/SwapModal/SwapDetails/index.tsx
+++ b/src/components/SwapForm/SwapModal/SwapDetails/index.tsx
@@ -72,7 +72,7 @@ export default function SwapDetails({
priceImpact,
buildData,
}: Props) {
- const { isEVM, chainId, networkInfo, account } = useActiveWeb3React()
+ const { chainId, networkInfo, account } = useActiveWeb3React()
const [showInverted, setShowInverted] = useState(false)
const theme = useTheme()
const { slippage, routeSummary } = useSwapFormContext()
@@ -224,30 +224,28 @@ export default function SwapDetails({
/>
- {isEVM && (
-
-
-
- Estimated network fee for your transaction.} placement="right">
- Est. Gas Fee
-
-
-
+
+
+
+ Estimated network fee for your transaction.} placement="right">
+ Est. Gas Fee
+
+
+
-
- {gasUsd ? formattedNum(String(gasUsd), true) : '--'}
-
- }
- />
-
- )}
+
+ {gasUsd ? formattedNum(String(gasUsd), true) : '--'}
+
+ }
+ />
+
{!!feeAmount && feeAmount !== '0' && (
diff --git a/src/components/SwapForm/SwapModal/index.tsx b/src/components/SwapForm/SwapModal/index.tsx
index f162f4a2bf..6befbe6acc 100644
--- a/src/components/SwapForm/SwapModal/index.tsx
+++ b/src/components/SwapForm/SwapModal/index.tsx
@@ -115,7 +115,7 @@ const SwapModal: React.FC = props => {
const renderModalContent = () => {
if (isAttemptingTx) {
- return
+ return
}
if (txHash) {
diff --git a/src/components/SwapForm/TradeTypeSelection.tsx b/src/components/SwapForm/TradeTypeSelection.tsx
index 9e10473748..30c00187f8 100644
--- a/src/components/SwapForm/TradeTypeSelection.tsx
+++ b/src/components/SwapForm/TradeTypeSelection.tsx
@@ -1,10 +1,8 @@
import { Trans } from '@lingui/macro'
-import { useEffect } from 'react'
import { Text } from 'rebass/styled-components'
import styled from 'styled-components'
import { GasStation, MoneyFill } from 'components/Icons'
-import { useActiveWeb3React } from 'hooks'
const GroupButtonReturnTypes = styled.div`
display: flex;
@@ -33,14 +31,6 @@ type Props = {
setSaveGas: React.Dispatch>
}
const TradeTypeSelection: React.FC = ({ isSaveGas, setSaveGas }) => {
- const { isSolana } = useActiveWeb3React()
-
- useEffect(() => {
- if (isSolana) setSaveGas(false)
- }, [isSolana, setSaveGas])
-
- if (isSolana) return null
-
return (
setSaveGas(false)} active={!isSaveGas} role="button">
diff --git a/src/components/SwapForm/hooks/useGetRoute.ts b/src/components/SwapForm/hooks/useGetRoute.ts
index 6afe1262d5..bd4f9bcea9 100644
--- a/src/components/SwapForm/hooks/useGetRoute.ts
+++ b/src/components/SwapForm/hooks/useGetRoute.ts
@@ -1,6 +1,6 @@
-import { ChainId, Currency, CurrencyAmount, Price, WETH } from '@kyberswap/ks-sdk-core'
+import { ChainId, Currency, CurrencyAmount } from '@kyberswap/ks-sdk-core'
import debounce from 'lodash/debounce'
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useCallback, useEffect, useMemo, useRef } from 'react'
import { useSearchParams } from 'react-router-dom'
import routeApi from 'services/route'
import { GetRouteParams } from 'services/route/types/getRoute'
@@ -8,21 +8,13 @@ import { GetRouteParams } from 'services/route/types/getRoute'
import useGetSwapFeeConfig, { SwapFeeConfig } from 'components/SwapForm/hooks/useGetSwapFeeConfig'
import useSelectedDexes from 'components/SwapForm/hooks/useSelectedDexes'
import { AGGREGATOR_API } from 'constants/env'
-import {
- AGGREGATOR_API_PATHS,
- ETHER_ADDRESS,
- INPUT_DEBOUNCE_TIME,
- SWAP_FEE_RECEIVER_ADDRESS,
- ZERO_ADDRESS_SOLANA,
-} from 'constants/index'
-import { NETWORKS_INFO, isEVM } from 'constants/networks'
+import { AGGREGATOR_API_PATHS, ETHER_ADDRESS, INPUT_DEBOUNCE_TIME, SWAP_FEE_RECEIVER_ADDRESS } from 'constants/index'
+import { NETWORKS_INFO } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
-import useDebounce from 'hooks/useDebounce'
import { useKyberswapGlobalConfig } from 'hooks/useKyberSwapConfig'
import { useSessionInfo } from 'state/authen/hooks'
import { useAppDispatch } from 'state/hooks'
import { ChargeFeeBy } from 'types/route'
-import { Aggregator } from 'utils/aggregator'
export type ArgsGetRoute = {
isSaveGas: boolean
@@ -35,11 +27,7 @@ export type ArgsGetRoute = {
}
export const getRouteTokenAddressParam = (currency: Currency) =>
- currency.isNative
- ? isEVM(currency.chainId)
- ? ETHER_ADDRESS
- : WETH[currency.chainId].address
- : currency.wrapped.address
+ currency.isNative ? ETHER_ADDRESS : currency.wrapped.address
const getFeeConfigParams = (
swapFeeConfig: SwapFeeConfig | undefined,
@@ -161,13 +149,7 @@ const useGetRoute = (args: ArgsGetRoute) => {
const fetcher = useCallback(async () => {
const amountIn = parsedAmount?.quotient?.toString() || ''
- if (
- !currencyIn ||
- !currencyOut ||
- !amountIn ||
- !parsedAmount?.currency?.equals(currencyIn) ||
- chainId === ChainId.SOLANA
- ) {
+ if (!currencyIn || !currencyOut || !amountIn || !parsedAmount?.currency?.equals(currencyIn)) {
return undefined
}
@@ -220,46 +202,4 @@ const useGetRoute = (args: ArgsGetRoute) => {
return { fetcher, result }
}
-export const useGetRouteSolana = (args: ArgsGetRoute) => {
- const { parsedAmount, currencyIn, currencyOut, customChain } = args
- const { account } = useActiveWeb3React()
- const controller = useRef(new AbortController())
-
- const { aggregatorAPI } = useKyberswapGlobalConfig()
- const [price, setPrice] = useState | null>(null)
-
- const debounceAmount = useDebounce(parsedAmount, INPUT_DEBOUNCE_TIME)
-
- const fetcherWithoutDebounce = useCallback(async () => {
- const amountIn = debounceAmount?.quotient?.toString() || ''
-
- if (
- !currencyIn ||
- !currencyOut ||
- !amountIn ||
- !debounceAmount?.currency?.equals(currencyIn) ||
- customChain !== ChainId.SOLANA
- ) {
- setPrice(null)
- return
- }
- controller.current.abort()
- controller.current = new AbortController()
- const to = account ?? ZERO_ADDRESS_SOLANA
- const signal = controller.current.signal
- const result = await Aggregator.baseTradeSolana({
- aggregatorAPI,
- currencyAmountIn: debounceAmount,
- currencyOut,
- to,
- signal,
- })
- setPrice(result)
- }, [currencyIn, currencyOut, debounceAmount, account, aggregatorAPI, customChain])
-
- const fetcher = useMemo(() => debounce(fetcherWithoutDebounce, INPUT_DEBOUNCE_TIME), [fetcherWithoutDebounce])
-
- return { fetcher, result: price }
-}
-
export default useGetRoute
diff --git a/src/components/SwapForm/index.tsx b/src/components/SwapForm/index.tsx
index a5a6d7ee28..d3be063070 100644
--- a/src/components/SwapForm/index.tsx
+++ b/src/components/SwapForm/index.tsx
@@ -105,7 +105,7 @@ const SwapForm: React.FC = props => {
omniView,
} = props
- const { isEVM, isSolana, chainId: walletChainId } = useActiveWeb3React()
+ const { chainId: walletChainId } = useActiveWeb3React()
const chainId = customChainId || walletChainId
const navigate = useNavigate()
const [isProcessingSwap, setProcessingSwap] = useState(false)
@@ -173,14 +173,6 @@ const SwapForm: React.FC = props => {
parsedAmountFromTypedValue: parsedAmount,
})
- const isSolanaUnwrap = isSolana && wrapType === WrapType.UNWRAP
- useEffect(() => {
- // reset value for unwrapping WSOL
- // because on Solana, unwrap WSOL is closing WSOL account,
- // which mean it will unwrap all WSOL at once, and we can't unwrap partial amount of WSOL
- if (isSolanaUnwrap) onUserInput(balanceIn?.toExact() ?? '')
- }, [balanceIn, isSolanaUnwrap, onUserInput])
-
useEffect(() => {
setRouteSummary(routeSummary)
}, [routeSummary, setRouteSummary])
@@ -265,7 +257,7 @@ const SwapForm: React.FC = props => {
customChainId={customChainId}
/>
- {isDegenMode && isEVM && !isWrapOrUnwrap && (
+ {isDegenMode && !isWrapOrUnwrap && (
)}
diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx
index 446ac03ae1..9b4caf8374 100644
--- a/src/components/TransactionConfirmationModal/index.tsx
+++ b/src/components/TransactionConfirmationModal/index.tsx
@@ -13,7 +13,6 @@ import Loader from 'components/Loader'
import Modal from 'components/Modal'
import { RowBetween, RowFixed } from 'components/Row'
import ListGridViewGroup from 'components/YieldPools/ListGridViewGroup'
-import HurryUpBanner from 'components/swapv2/HurryUpBanner'
import { SUPPORTED_WALLETS } from 'constants/wallets'
import { useActiveWeb3React } from 'hooks'
import useTheme from 'hooks/useTheme'
@@ -51,11 +50,9 @@ const StyledLogo = styled.img`
export function ConfirmationPendingContent({
onDismiss,
pendingText,
- startedTime,
}: {
onDismiss: () => void
pendingText: string | React.ReactNode
- startedTime?: number | undefined
}) {
const theme = useTheme()
@@ -82,14 +79,13 @@ export function ConfirmationPendingContent({
Confirm this transaction in your wallet
-
)
}
function AddTokenToInjectedWallet({ token, chainId }: { token: Token; chainId: ChainId }) {
- const { walletKey, isEVM } = useActiveWeb3React()
+ const { walletKey } = useActiveWeb3React()
const handleClick = async () => {
const tokenAddress = token.address
const tokenSymbol = token.symbol
@@ -118,7 +114,6 @@ function AddTokenToInjectedWallet({ token, chainId }: { token: Token; chainId: C
}
if (!walletKey) return null
- if (!isEVM) return null
if (walletKey === 'WALLET_CONNECT') return null
if (walletKey === 'KRYSTAL_WC') return null
const walletConfig = SUPPORTED_WALLETS[walletKey]
@@ -326,7 +321,6 @@ interface ConfirmationModalProps {
pendingText: string | React.ReactNode
tokenAddToMetaMask?: Currency
showTxBanner?: boolean
- startedTime?: number
maxWidth?: string | number
width?: string
}
@@ -341,7 +335,6 @@ export default function TransactionConfirmationModal({
content,
tokenAddToMetaMask,
showTxBanner,
- startedTime,
maxWidth = 420,
width,
}: ConfirmationModalProps) {
@@ -359,7 +352,7 @@ export default function TransactionConfirmationModal({
attemptingTxnContent ? (
attemptingTxnContent()
) : (
-
+
)
) : hash ? (
theme.text};
font-weight: 500;
`
-const getListSteps = (isLogin: boolean, isSolana: boolean) => {
+const getListSteps = (isLogin: boolean) => {
let stepNumber = 0
const isHighlightBtnConnectWallet = !isLogin || isMobile
return filterTruthy([
@@ -309,7 +309,7 @@ const getListSteps = (isLogin: boolean, isSolana: boolean) => {
orientationPreferences: [CardinalOrientation.SOUTH],
popupStyle: { width: 430 },
},
- !isSolana && {
+ {
selector: TutorialIds.EARNING_LINKS,
title: LIST_TITLE.EARN,
stepNumber: stepNumber++,
@@ -407,7 +407,7 @@ export const TutorialKeys = {
export default memo(function TutorialSwap() {
const [{ show = false, step = 0 }, setShowTutorial] = useTutorialSwapGuide()
const stopTutorial = () => setShowTutorial({ show: false })
- const { account, isSolana } = useActiveWeb3React()
+ const { account } = useActiveWeb3React()
const { mixpanelHandler } = useMixpanel()
useEffect(() => {
@@ -419,7 +419,7 @@ export default memo(function TutorialSwap() {
}, [setShowTutorial])
const steps = useMemo(() => {
- const list = getListSteps(!!account, isSolana)
+ const list = getListSteps(!!account)
if (isMobile) {
return list
.filter(e => !e.pcOnly)
@@ -437,7 +437,7 @@ export default memo(function TutorialSwap() {
selector: '#' + e.selector,
}
})
- }, [account, isSolana])
+ }, [account])
const stepInfo = (steps[step] || {}) as StepTutorial
diff --git a/src/components/Vesting/RewardLockerSchedules.tsx b/src/components/Vesting/RewardLockerSchedules.tsx
index fa65d6c21d..b5e1303a73 100644
--- a/src/components/Vesting/RewardLockerSchedules.tsx
+++ b/src/components/Vesting/RewardLockerSchedules.tsx
@@ -2,7 +2,6 @@ import { BigNumber } from '@ethersproject/bignumber'
import { Token } from '@kyberswap/ks-sdk-core'
import { ZERO_ADDRESS } from 'constants/index'
-import { EVMNetworkInfo } from 'constants/networks/type'
import { NativeCurrencies } from 'constants/tokens'
import { useActiveWeb3React } from 'hooks'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
@@ -186,7 +185,7 @@ const RewardLockerSchedules = ({
}
return acc
- }, endTimestampFromBlock || currentTimestamp + blockDiff * ((networkInfo as EVMNetworkInfo).averageBlockTimeInSeconds || 0))
+ }, endTimestampFromBlock || currentTimestamp + blockDiff * (networkInfo.averageBlockTimeInSeconds || 0))
return
}
diff --git a/src/components/WalletPopup/ReceiveToken.tsx b/src/components/WalletPopup/ReceiveToken.tsx
index f185be1fd1..c01dbecae6 100644
--- a/src/components/WalletPopup/ReceiveToken.tsx
+++ b/src/components/WalletPopup/ReceiveToken.tsx
@@ -45,7 +45,7 @@ const Wrapper = styled.div`
`
export default function ReceiveToken() {
- const { account = '', chainId, isEVM } = useActiveWeb3React()
+ const { account = '', chainId } = useActiveWeb3React()
const copyButtonRef = useRef(null)
const qrCodeProps: QRCodeProps | undefined = useMemo(() => {
@@ -60,12 +60,12 @@ export default function ReceiveToken() {
size: QR_SIZE,
// `ethereum` is intentional. This QR is used to open the Send feature on the wallet (e.g. Metamask)
// Chain is not switched by this prefix
- value: isEVM ? `ethereum:${account}` : account,
+ value: `ethereum:${account}`,
eyeColor: { outer: '#000000', inner: '#000000' },
quietZone: 14,
removeQrCodeBehindLogo: true,
}
- }, [account, isEVM])
+ }, [account])
const onCopy = async () => {
copyButtonRef.current?.click()
diff --git a/src/components/WalletPopup/SendToken/index.tsx b/src/components/WalletPopup/SendToken/index.tsx
index 83089063cf..3efb45d8dd 100644
--- a/src/components/WalletPopup/SendToken/index.tsx
+++ b/src/components/WalletPopup/SendToken/index.tsx
@@ -23,7 +23,6 @@ import useTheme from 'hooks/useTheme'
import { tryParseAmount } from 'state/swap/hooks'
import { useTokenPrices } from 'state/tokenPrices/hooks'
import { useCurrencyBalance } from 'state/wallet/hooks'
-import { useCheckAddressSolana } from 'state/wallet/solanaHooks'
import { TransactionFlowState } from 'types/TransactionFlowState'
import { formattedNum, shortenAddress } from 'utils'
import { friendlyError } from 'utils/errorMessage'
@@ -73,7 +72,7 @@ export default function SendToken({
const [currencyIn, setCurrency] = useState()
const [inputAmount, setInputAmount] = useState('')
const [showListToken, setShowListToken] = useState(false)
- const { account, isEVM, isSolana, chainId } = useActiveWeb3React()
+ const { account, chainId } = useActiveWeb3React()
const [flowState, setFlowState] = useState(TRANSACTION_STATE_DEFAULT)
const theme = useTheme()
@@ -92,16 +91,10 @@ export default function SendToken({
const parseInputAmount = tryParseAmount(inputAmount, currencyIn)
- const respEvm = useENS(isEVM ? recipient : '')
- const respSolana = useCheckAddressSolana(isEVM ? '' : recipient)
-
- const { address, loading } = isEVM ? respEvm : respSolana
+ const { address, loading } = useENS(recipient)
const recipientError =
- recipient &&
- ((!loading && !address) ||
- (!recipient.startsWith('0x') && isEVM) ||
- (isSolana && recipient.toLowerCase().startsWith('0x')))
+ recipient && ((!loading && !address) || !recipient.startsWith('0x'))
? t`Invalid wallet address`
: recipient.toLowerCase() === account?.toLowerCase()
? t`You can’t use your own address as a receiver`
@@ -194,7 +187,7 @@ export default function SendToken({
const formatRecipient = (val: string) => {
try {
- setDisplayRecipient(shortenAddress(chainId, val, isSolana || isMobile ? 14 : 16))
+ setDisplayRecipient(shortenAddress(chainId, val, isMobile ? 14 : 16))
} catch {
setDisplayRecipient(val)
}
@@ -228,7 +221,7 @@ export default function SendToken({
onFocus={onFocus}
onBlur={onBlur}
value={displayRecipient}
- placeholder={isEVM ? '0x...' : 'Wallet address'}
+ placeholder="0x..."
icon={
diff --git a/src/components/WalletPopup/SendToken/useSendToken.tsx b/src/components/WalletPopup/SendToken/useSendToken.tsx
index 3f39e57ea3..458a737db0 100644
--- a/src/components/WalletPopup/SendToken/useSendToken.tsx
+++ b/src/components/WalletPopup/SendToken/useSendToken.tsx
@@ -1,66 +1,19 @@
import { Currency } from '@kyberswap/ks-sdk-core'
-import { createTransferCheckedInstruction, getOrCreateAssociatedTokenAccount } from '@solana/spl-token'
-import { SignerWalletAdapter } from '@solana/wallet-adapter-base'
-import { useWallet } from '@solana/wallet-adapter-react'
-import { LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from '@solana/web3.js'
import { ethers } from 'ethers'
import { useCallback, useEffect, useState } from 'react'
-import { useActiveWeb3React, useWeb3React, useWeb3Solana } from 'hooks'
+import { useActiveWeb3React, useWeb3React } from 'hooks'
import { useTokenSigningContract } from 'hooks/useContract'
-import { tryParseAmount } from 'state/swap/hooks'
import { useTransactionAdder } from 'state/transactions/hooks'
import { TRANSACTION_TYPE } from 'state/transactions/type'
export default function useSendToken(currency: Currency | undefined, recipient: string, amount: string) {
- const { account, isEVM, walletSolana, isSolana } = useActiveWeb3React()
+ const { account } = useActiveWeb3React()
const { library } = useWeb3React()
const [estimateGas, setGasFee] = useState(null)
- const tokenContract = useTokenSigningContract(isSolana ? undefined : currency?.wrapped.address)
+ const tokenContract = useTokenSigningContract(currency?.wrapped.address)
const addTransactionWithType = useTransactionAdder()
const [isSending, setIsSending] = useState(false)
- const { publicKey } = useWallet()
- const { connection } = useWeb3Solana()
-
- const prepareTransactionSolana = useCallback(async () => {
- const amountIn = tryParseAmount(amount, currency)
- if (!publicKey || !currency || !recipient || !amountIn || !walletSolana || !connection) {
- return Promise.reject('wrong input')
- }
- const recipientAddress = new PublicKey(recipient)
- let transaction: Transaction
- if (!currency.isNative) {
- const tokenKey = new PublicKey(currency.wrapped.address)
- const [fromTokenAccount, toTokenAccount] = await Promise.all([
- getOrCreateAssociatedTokenAccount(connection, publicKey as any, tokenKey, publicKey),
- getOrCreateAssociatedTokenAccount(connection, publicKey as any, tokenKey, recipientAddress),
- ])
- transaction = new Transaction().add(
- createTransferCheckedInstruction(
- fromTokenAccount.address,
- tokenKey,
- toTokenAccount.address,
- publicKey,
- BigInt(amountIn.quotient.toString()),
- currency.decimals,
- ),
- )
- } else {
- transaction = new Transaction().add(
- SystemProgram.transfer({
- fromPubkey: publicKey,
- toPubkey: recipientAddress,
- lamports: BigInt(amountIn.quotient.toString()),
- }),
- )
- }
-
- const { blockhash } = await connection.getLatestBlockhash('finalized')
- transaction.recentBlockhash = blockhash
- transaction.feePayer = publicKey
-
- return transaction
- }, [publicKey, recipient, amount, walletSolana, currency, connection])
useEffect(() => {
if (!currency || !amount || !recipient) {
@@ -88,30 +41,8 @@ export default function useSendToken(currency: Currency | undefined, recipient:
setGasFee(null)
}
}
-
- async function getGasFeeSolana() {
- if (!connection) return
- try {
- const transaction = await prepareTransactionSolana()
- const fee = (await transaction.getEstimatedFee(connection)) || 0
- setGasFee(fee / LAMPORTS_PER_SOL)
- } catch (error) {
- setGasFee(null)
- }
- }
- isEVM ? getGasFee() : getGasFeeSolana()
- }, [
- library,
- account,
- amount,
- currency,
- prepareTransactionSolana,
- isEVM,
- recipient,
- tokenContract,
- isSolana,
- connection,
- ])
+ getGasFee()
+ }, [library, account, amount, currency, recipient, tokenContract])
const addTransaction = useCallback(
(hash: string) => {
@@ -155,24 +86,5 @@ export default function useSendToken(currency: Currency | undefined, recipient:
return
}, [amount, account, currency, library, recipient, tokenContract, addTransaction])
- const sendTokenSolana = useCallback(async () => {
- try {
- const amountIn = tryParseAmount(amount, currency)
- if (!publicKey || !currency || !recipient || !amountIn || !walletSolana || !connection) {
- return Promise.reject('wrong input')
- }
- setIsSending(true)
- const transaction = await prepareTransactionSolana()
- const signedTx = await (walletSolana.wallet?.adapter as SignerWalletAdapter)?.signTransaction(transaction)
- const hash = await connection.sendRawTransaction(Buffer.from(signedTx.serialize()))
- addTransaction(hash)
- setIsSending(false)
- } catch (error) {
- setIsSending(false)
- throw error
- }
- return
- }, [publicKey, recipient, amount, addTransaction, prepareTransactionSolana, walletSolana, currency, connection])
-
- return { sendToken: isEVM ? sendTokenEvm : sendTokenSolana, isSending, estimateGas }
+ return { sendToken: sendTokenEvm, isSending, estimateGas }
}
diff --git a/src/components/WalletPopup/Transactions/TransactionItem.tsx b/src/components/WalletPopup/Transactions/TransactionItem.tsx
index c7ea998c3d..7b3d1bf4d1 100644
--- a/src/components/WalletPopup/Transactions/TransactionItem.tsx
+++ b/src/components/WalletPopup/Transactions/TransactionItem.tsx
@@ -376,9 +376,6 @@ const DESCRIPTION_MAP: {
[TRANSACTION_TYPE.ELASTIC_COLLECT_FEE]: DescriptionLiquidity,
[TRANSACTION_TYPE.HARVEST]: DescriptionHarvestFarmReward,
-
- // to make sure you don't forgot setup
- [TRANSACTION_TYPE.SETUP_SOLANA_SWAP]: () => null,
}
type Prop = {
diff --git a/src/components/WalletPopup/Transactions/index.tsx b/src/components/WalletPopup/Transactions/index.tsx
index 519cd6066d..7d99b1cefe 100644
--- a/src/components/WalletPopup/Transactions/index.tsx
+++ b/src/components/WalletPopup/Transactions/index.tsx
@@ -1,4 +1,3 @@
-import { ChainId } from '@kyberswap/ks-sdk-core'
import { Trans, t } from '@lingui/macro'
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Info } from 'react-feather'
@@ -179,9 +178,6 @@ function ListTransaction({ isMinimal }: { isMinimal: boolean }) {
if (tab.value === TRANSACTION_GROUP.KYBERDAO) {
return isSupportKyberDao(chainId)
}
- if (tab.value === TRANSACTION_GROUP.LIQUIDITY) {
- return chainId !== ChainId.SOLANA
- }
return true
})
}, [chainId])
diff --git a/src/components/Web3ReactManager/index.tsx b/src/components/Web3ReactManager/index.tsx
index b43c750ff4..1ee1654a2a 100644
--- a/src/components/Web3ReactManager/index.tsx
+++ b/src/components/Web3ReactManager/index.tsx
@@ -3,14 +3,13 @@ import { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import LocalLoader from 'components/LocalLoader'
-import { useActiveWeb3React, useWeb3React } from 'hooks'
+import { useWeb3React } from 'hooks'
import { useEagerConnect } from 'hooks/web3/useEagerConnect'
import { AppState } from 'state'
import { updateChainId } from 'state/user/actions'
export default function Web3ReactManager({ children }: { children: JSX.Element }) {
const chainIdState = useSelector(state => state.user.chainId) || ChainId.MAINNET
- const { isEVM } = useActiveWeb3React()
const { active, chainId: chainIdEVM } = useWeb3React()
// try to eagerly connect to an injected provider, if it exists and has granted access already
@@ -19,7 +18,7 @@ export default function Web3ReactManager({ children }: { children: JSX.Element }
const dispatch = useDispatch()
/** On user change network from wallet, update chainId in store, only work on EVM wallet */
useEffect(() => {
- if (triedEager.current && chainIdEVM && chainIdState !== chainIdEVM && active && isEVM) {
+ if (triedEager.current && chainIdEVM && chainIdState !== chainIdEVM && active) {
dispatch(updateChainId(chainIdEVM))
}
// Only run on change network from wallet
@@ -27,7 +26,7 @@ export default function Web3ReactManager({ children }: { children: JSX.Element }
}, [chainIdEVM, triedEager.current, active])
// on page load, do nothing until we've tried to connect to the injected connector
- if (isEVM && !triedEager.current) {
+ if (!triedEager.current) {
return
}
diff --git a/src/components/YieldPools/ElasticFarmGroup/index.tsx b/src/components/YieldPools/ElasticFarmGroup/index.tsx
index 28955578fe..c73b9ed96a 100644
--- a/src/components/YieldPools/ElasticFarmGroup/index.tsx
+++ b/src/components/YieldPools/ElasticFarmGroup/index.tsx
@@ -1,4 +1,4 @@
-import { ChainId, Currency, CurrencyAmount, Token } from '@kyberswap/ks-sdk-core'
+import { Currency, CurrencyAmount, Token } from '@kyberswap/ks-sdk-core'
import { computePoolAddress } from '@kyberswap/ks-sdk-elastic'
import { Trans, t } from '@lingui/macro'
import { useState } from 'react'
@@ -16,7 +16,7 @@ import HoverDropdown from 'components/HoverDropdown'
import InfoHelper from 'components/InfoHelper'
import { MouseoverTooltip, MouseoverTooltipDesktopOnly, TextDashed } from 'components/Tooltip'
import { FARM_TAB, SORT_DIRECTION, ZERO_ADDRESS } from 'constants/index'
-import { NETWORKS_INFO, isEVM } from 'constants/networks'
+import { NETWORKS_INFO } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
import { useProAmmNFTPositionManagerReadingContract } from 'hooks/useContract'
import useTheme from 'hooks/useTheme'
@@ -158,12 +158,11 @@ const ElasticFarmGroup: React.FC = ({ address, onOpenModal, pools, onShow
return (
pool.poolAddress.toLowerCase() ===
computePoolAddress({
- factoryAddress: NETWORKS_INFO[isEVM(chainId) ? chainId : ChainId.MAINNET].elastic.coreFactory,
+ factoryAddress: NETWORKS_INFO[chainId].elastic.coreFactory,
tokenA: pos.pool.token0,
tokenB: pos.pool.token1,
fee: pos.pool.fee,
- initCodeHashManualOverride:
- NETWORKS_INFO[isEVM(chainId) ? chainId : ChainId.MAINNET].elastic.initCodeHash,
+ initCodeHashManualOverride: NETWORKS_INFO[chainId].elastic.initCodeHash,
}).toLowerCase()
)
}) || []
diff --git a/src/components/YieldPools/ElasticFarmModals/StakeModal.tsx b/src/components/YieldPools/ElasticFarmModals/StakeModal.tsx
index 2032effd5d..52a2f64570 100644
--- a/src/components/YieldPools/ElasticFarmModals/StakeModal.tsx
+++ b/src/components/YieldPools/ElasticFarmModals/StakeModal.tsx
@@ -18,7 +18,7 @@ import LocalLoader from 'components/LocalLoader'
import Modal from 'components/Modal'
import { MouseoverTooltip } from 'components/Tooltip'
import { APP_PATHS } from 'constants/index'
-import { NETWORKS_INFO, isEVM } from 'constants/networks'
+import { NETWORKS_INFO } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
import { useProAmmPositions } from 'hooks/useProAmmPositions'
@@ -255,7 +255,6 @@ function StakeModal({
const allDepositedPositions = useDepositedNftsByFarm(selectedFarmAddress)
const depositedNfts: ExplicitNFT[] = useMemo(() => {
- if (!isEVM(chainId)) return []
const joinedPositions = userFarmInfo?.[selectedFarmAddress]?.joinedPositions?.[poolId] || []
const depositedPositions =
allDepositedPositions.filter(pos => {
diff --git a/src/components/YieldPools/ElasticFarmModals/WithdrawModal.tsx b/src/components/YieldPools/ElasticFarmModals/WithdrawModal.tsx
index 37455fb147..d2cbd5d072 100644
--- a/src/components/YieldPools/ElasticFarmModals/WithdrawModal.tsx
+++ b/src/components/YieldPools/ElasticFarmModals/WithdrawModal.tsx
@@ -15,7 +15,7 @@ import HoverDropdown from 'components/HoverDropdown'
import Modal from 'components/Modal'
import { MouseoverTooltip } from 'components/Tooltip'
import { FARM_TAB } from 'constants/index'
-import { NETWORKS_INFO, isEVM } from 'constants/networks'
+import { NETWORKS_INFO } from 'constants/networks'
import { useActiveWeb3React } from 'hooks'
import { useToken } from 'hooks/Tokens'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
@@ -242,37 +242,35 @@ function WithdrawModal({
const userDepositedNFTs: PositionDetails[] = useMemo(
() =>
- isEVM(chainId)
- ? depositedPositions.map(pos => {
- const stakedLiquidity = Object.values(joinedPositions)
- .flat()
- .filter(
- p => pos.nftId.toString() === p.nftId.toString() && BigNumber.from(p.liquidity.toString()).gt('0'),
- )?.[0]?.liquidity
-
- return {
- nonce: BigNumber.from(0),
- poolId: computePoolAddress({
- factoryAddress: NETWORKS_INFO[chainId].elastic.coreFactory,
- tokenA: pos.pool.token0,
- tokenB: pos.pool.token1,
- fee: pos.pool.fee,
- initCodeHashManualOverride: NETWORKS_INFO[chainId].elastic.initCodeHash,
- }),
- feeGrowthInsideLast: BigNumber.from(0),
- operator: '',
- rTokenOwed: BigNumber.from(0),
- fee: pos.pool.fee,
- tokenId: pos.nftId,
- tickLower: pos.tickLower,
- tickUpper: pos.tickUpper,
- liquidity: BigNumber.from(pos.liquidity.toString()),
- token0: pos.amount0.currency.address,
- token1: pos.amount1.currency.address,
- stakedLiquidity: stakedLiquidity ? BigNumber.from(stakedLiquidity.toString()) : BigNumber.from(0),
- }
- })
- : [],
+ depositedPositions.map(pos => {
+ const stakedLiquidity = Object.values(joinedPositions)
+ .flat()
+ .filter(
+ p => pos.nftId.toString() === p.nftId.toString() && BigNumber.from(p.liquidity.toString()).gt('0'),
+ )?.[0]?.liquidity
+
+ return {
+ nonce: BigNumber.from(0),
+ poolId: computePoolAddress({
+ factoryAddress: NETWORKS_INFO[chainId].elastic.coreFactory,
+ tokenA: pos.pool.token0,
+ tokenB: pos.pool.token1,
+ fee: pos.pool.fee,
+ initCodeHashManualOverride: NETWORKS_INFO[chainId].elastic.initCodeHash,
+ }),
+ feeGrowthInsideLast: BigNumber.from(0),
+ operator: '',
+ rTokenOwed: BigNumber.from(0),
+ fee: pos.pool.fee,
+ tokenId: pos.nftId,
+ tickLower: pos.tickLower,
+ tickUpper: pos.tickUpper,
+ liquidity: BigNumber.from(pos.liquidity.toString()),
+ token0: pos.amount0.currency.address,
+ token1: pos.amount1.currency.address,
+ stakedLiquidity: stakedLiquidity ? BigNumber.from(stakedLiquidity.toString()) : BigNumber.from(0),
+ }
+ }),
[chainId, depositedPositions, joinedPositions],
)
diff --git a/src/components/YieldPools/FairLaunchPools.tsx b/src/components/YieldPools/FairLaunchPools.tsx
index 77da2a76c0..533c03ac79 100644
--- a/src/components/YieldPools/FairLaunchPools.tsx
+++ b/src/components/YieldPools/FairLaunchPools.tsx
@@ -1,7 +1,6 @@
import { BigNumber } from '@ethersproject/bignumber'
import { Trans, t } from '@lingui/macro'
import { useCallback, useState } from 'react'
-import { Navigate } from 'react-router-dom'
import { useMedia } from 'react-use'
import { Text } from 'rebass'
@@ -9,7 +8,6 @@ import { ReactComponent as DropdownSVG } from 'assets/svg/down.svg'
import InfoHelper from 'components/InfoHelper'
import Row, { RowBetween, RowFit } from 'components/Row'
import { AMP_HINT } from 'constants/index'
-import { EVMNetworkInfo } from 'constants/networks/type'
import { useActiveWeb3React } from 'hooks'
import useFairLaunch from 'hooks/useFairLaunch'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
@@ -55,7 +53,7 @@ const FairLaunchPools = ({ fairLaunchAddress, farms, active }: FarmsListProps) =
const [viewMode] = useViewMode()
const above1200 = useMedia(`(min-width:${MEDIA_WIDTHS.upToLarge}px)`)
const above768 = useMedia(`(min-width:${MEDIA_WIDTHS.upToSmall}px)`)
- const { account, isEVM, networkInfo } = useActiveWeb3React()
+ const { account, networkInfo } = useActiveWeb3React()
const theme = useTheme()
const blockNumber = useBlockNumber()
const totalRewards = useFarmRewards(farms)
@@ -125,8 +123,7 @@ const FairLaunchPools = ({ fairLaunchAddress, farms, active }: FarmsListProps) =
} else {
remainingBlocks = farm && blockNumber && farm.endBlock - blockNumber
}
- const estimatedRemainingSeconds =
- remainingBlocks && remainingBlocks * (networkInfo as EVMNetworkInfo).averageBlockTimeInSeconds
+ const estimatedRemainingSeconds = remainingBlocks && remainingBlocks * networkInfo.averageBlockTimeInSeconds
const formattedEstimatedRemainingTime =
estimatedRemainingSeconds && getFormattedTimeFromSecond(estimatedRemainingSeconds)
@@ -158,7 +155,6 @@ const FairLaunchPools = ({ fairLaunchAddress, farms, active }: FarmsListProps) =
)
const ConditionListWrapper = viewMode === VIEW_MODE.LIST && above1200 ? ListItemWrapper : ClassicFarmGridWrapper
- if (!isEVM) return
return (
diff --git a/src/components/YieldPools/ListItem.tsx b/src/components/YieldPools/ListItem.tsx
index 056304d8eb..0f4f9b2abb 100644
--- a/src/components/YieldPools/ListItem.tsx
+++ b/src/components/YieldPools/ListItem.tsx
@@ -67,7 +67,7 @@ interface ListItemProps {
}
const ListItem = ({ farm }: ListItemProps) => {
- const { account, chainId, isEVM, networkInfo } = useActiveWeb3React()
+ const { account, chainId, networkInfo } = useActiveWeb3React()
const toggleWalletModal = useWalletModalToggle()
const currentTimestamp = Math.floor(Date.now() / 1000)
const [viewMode] = useViewMode()
@@ -177,7 +177,7 @@ const ListItem = ({ farm }: ListItemProps) => {
[balance.decimals, chainId, depositValue, pairAddressChecksum, pairSymbol, isStakeInvalidAmount],
)
- const [approvalState, approve] = useApproveCallback(amountToApprove, isEVM ? farm.fairLaunchAddress : undefined)
+ const [approvalState, approve] = useApproveCallback(amountToApprove, farm.fairLaunchAddress)
let isUnstakeInvalidAmount
diff --git a/src/components/swapv2/AdvancedSwapDetails.tsx b/src/components/swapv2/AdvancedSwapDetails.tsx
index 93107ab187..82f798c88f 100644
--- a/src/components/swapv2/AdvancedSwapDetails.tsx
+++ b/src/components/swapv2/AdvancedSwapDetails.tsx
@@ -118,7 +118,6 @@ interface TradeSummaryProps {
}
function TradeSummary({ trade, allowedSlippage }: TradeSummaryProps) {
- const { isEVM } = useActiveWeb3React()
const theme = useTheme()
const [show, setShow] = useState(true)
@@ -153,20 +152,18 @@ function TradeSummary({ trade, allowedSlippage }: TradeSummaryProps) {
- {isEVM && (
-
-
-
- Gas Fee
-
-
-
-
-
- {trade.gasUsd ? formattedNum(trade.gasUsd?.toString(), true) : '--'}
+
+
+
+ Gas Fee
-
- )}
+
+
+
+
+ {trade.gasUsd ? formattedNum(trade.gasUsd?.toString(), true) : '--'}
+
+
diff --git a/src/components/swapv2/ConfirmSwapModal.tsx b/src/components/swapv2/ConfirmSwapModal.tsx
index a97abd6077..453e974f73 100644
--- a/src/components/swapv2/ConfirmSwapModal.tsx
+++ b/src/components/swapv2/ConfirmSwapModal.tsx
@@ -1,13 +1,11 @@
import { Currency } from '@kyberswap/ks-sdk-core'
import { t } from '@lingui/macro'
-import { useCallback, useEffect, useMemo, useState } from 'react'
+import { useCallback, useMemo } from 'react'
import TransactionConfirmationModal, {
ConfirmationModalContent,
TransactionErrorContent,
} from 'components/TransactionConfirmationModal'
-import { useActiveWeb3React } from 'hooks'
-import { useEncodeSolana } from 'state/swap/hooks'
import { Aggregator } from 'utils/aggregator'
import { useCurrencyConvertedToNative } from 'utils/dmm'
@@ -54,15 +52,6 @@ export default function ConfirmSwapModal({
onDismiss: () => void
showTxBanner?: boolean
}) {
- const { isSolana } = useActiveWeb3React()
- const [startedTime, setStartedTime] = useState(undefined)
- const [encodeSolana] = useEncodeSolana()
-
- useEffect(() => {
- if (isSolana && encodeSolana) setStartedTime(Date.now())
- else setStartedTime(undefined)
- }, [encodeSolana, isOpen, isSolana])
-
const showAcceptChanges = useMemo(
() => Boolean(trade && originalTrade && tradeMeaningfullyDiffers(trade, originalTrade)),
[originalTrade, trade],
@@ -77,13 +66,12 @@ export default function ConfirmSwapModal({
) : null
- }, [allowedSlippage, onConfirm, showAcceptChanges, swapErrorMessage, trade, isSolana, startedTime, encodeSolana])
+ }, [allowedSlippage, onConfirm, showAcceptChanges, swapErrorMessage, trade])
const nativeInput = useCurrencyConvertedToNative(originalTrade?.inputAmount?.currency)
const nativeOutput = useCurrencyConvertedToNative(originalTrade?.outputAmount?.currency)
@@ -117,7 +105,6 @@ export default function ConfirmSwapModal({
pendingText={pendingText}
tokenAddToMetaMask={tokenAddToMetaMask}
showTxBanner={showTxBanner}
- startedTime={startedTime}
/>
)
}
diff --git a/src/components/swapv2/HurryUpBanner.tsx b/src/components/swapv2/HurryUpBanner.tsx
deleted file mode 100644
index 2d14711bde..0000000000
--- a/src/components/swapv2/HurryUpBanner.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Trans } from '@lingui/macro'
-import { useState } from 'react'
-import styled from 'styled-components'
-
-import { GreyCard } from 'components/Card'
-import { ColumnCenter } from 'components/Column'
-import Loader from 'components/Loader'
-import { RowFixed } from 'components/Row'
-import { useActiveWeb3React } from 'hooks'
-import useInterval from 'hooks/useInterval'
-import useTheme from 'hooks/useTheme'
-
-const ConfirmedIcon = styled(ColumnCenter)`
- width: 40px;
-`
-const CountdountNumber = styled.div`
- position: absolute;
- margin-top: 7px;
-`
-
-function HurryUpBanner({ startedTime }: { startedTime: number | undefined }) {
- const theme = useTheme()
- const { isSolana } = useActiveWeb3React()
- const [, rerender] = useState({})
-
- useInterval(() => rerender({}), 1000)
-
- if (!startedTime) return null
- if (!isSolana) return null
-
- const currentTime = Math.round((Date.now() - startedTime) / 1000) + 1
- const color = currentTime <= 5 ? theme.green : currentTime <= 10 ? theme.yellow1 : theme.red2
-
- return (
-
-
-
- {currentTime}
-
-
-
- We've got you the superior price! Confirm soon to lock-in this rate
-
-
- )
-}
-
-export default HurryUpBanner
diff --git a/src/components/swapv2/LiquiditySourcesPanel/index.tsx b/src/components/swapv2/LiquiditySourcesPanel/index.tsx
index 686e5cc7d7..1384558fc4 100644
--- a/src/components/swapv2/LiquiditySourcesPanel/index.tsx
+++ b/src/components/swapv2/LiquiditySourcesPanel/index.tsx
@@ -6,7 +6,6 @@ import { Box, Flex, Text } from 'rebass'
import styled from 'styled-components'
import Checkbox from 'components/CheckBox'
-import { useActiveWeb3React } from 'hooks'
import useDebounce from 'hooks/useDebounce'
import { useAllDexes, useExcludeDexes } from 'state/customizeDexes/hooks'
@@ -113,7 +112,6 @@ export const isKyberSwapDex = (id: string) => id.toLowerCase().includes('kyber')
const LiquiditySourcesPanel: React.FC = ({ onBack, chainId }) => {
const [searchText, setSearchText] = useState('')
const debouncedSearchText = useDebounce(searchText.toLowerCase(), 200).trim()
- const { isEVM } = useActiveWeb3React()
const dexes = useAllDexes(chainId)
const [excludeDexes, setExcludeDexes] = useExcludeDexes(chainId)
@@ -206,7 +204,7 @@ const LiquiditySourcesPanel: React.FC = ({ onBack, chainId }) => {
- {isEVM && !!ksDexes.filter(item => item.name.toLowerCase().includes(debouncedSearchText)).length && (
+ {!!ksDexes.filter(item => item.name.toLowerCase().includes(debouncedSearchText)).length && (
<>