Skip to content

Commit

Permalink
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
Browse files Browse the repository at this point in the history
…to farm-v2-kn-protocol
  • Loading branch information
viet-nv committed Sep 11, 2023
2 parents 48c541d + 47b6d12 commit 2d1b019
Show file tree
Hide file tree
Showing 40 changed files with 283 additions and 494 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@kybernetwork/oauth2": "1.0.0",
"@kyberswap/ks-sdk-classic": "^1.0.3",
"@kyberswap/ks-sdk-core": "1.0.10",
"@kyberswap/ks-sdk-core": "1.0.11",
"@kyberswap/ks-sdk-elastic": "^1.1.2",
"@kyberswap/ks-sdk-solana": "^1.0.2",
"@lingui/loader": "~3.14.0",
Expand Down Expand Up @@ -198,7 +198,7 @@
"vite-tsconfig-paths": "^4.0.8"
},
"resolutions": {
"@kyberswap/ks-sdk-core": "1.0.10",
"@kyberswap/ks-sdk-core": "1.0.11",
"react-error-overlay": "6.0.9",
"@lingui/babel-plugin-extract-messages": "3.14.0",
"@lingui/cli": "3.14.0",
Expand Down
316 changes: 214 additions & 102 deletions src/assets/svg/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/Announcement/Popups/TopBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ const TextContent = styled.div<{ isOverflow: boolean; animationDuration: number
};
white-space: nowrap;
position: absolute;
display: flex;
gap: 4px;
`}
> * {
margin: 0;
Expand Down
2 changes: 0 additions & 2 deletions src/components/ApproveMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default function ApproveMessage({
![
ChainId.BSCMAINNET,
ChainId.BTTC,
ChainId.VELAS,
ChainId.CRONOS,
ChainId.ARBITRUM,
ChainId.MATIC,
Expand All @@ -39,7 +38,6 @@ export default function ApproveMessage({
ChainId.AURORA,
ChainId.MAINNET,
ChainId.AVAXMAINNET,
ChainId.OASIS,
].includes(chainId)
) {
return null
Expand Down
15 changes: 0 additions & 15 deletions src/components/Icons/Oasis.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions src/components/Icons/OasisLogoFull.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions src/components/Icons/Velas.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/Icons/VelasLogoFull.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/Icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export { default as LowestSlippage } from './LowestSlippage'
export { default as MoneyBagOutline } from './MoneyBagOutline'
export { default as MoneyBag } from './MoneyBag'
export { default as MoneyFill } from './MoneyFill'
export { default as Oasis } from './Oasis'
export { default as OasisLogoFull } from './OasisLogoFull'
export { default as OptimismLogo } from './OptimismLogo'
export { default as OptimismLogoFull } from './OptimismLogoFull'
export { default as Polygon } from './Polygon'
Expand All @@ -36,8 +34,6 @@ export { default as LineaFull } from './LineaFull'
export { default as Swap } from './Swap'
export { default as Swap2 } from './Swap_2'
export { default as Telegram } from './Telegram'
export { default as Velas } from './Velas'
export { default as VelasLogoFull } from './VelasLogoFull'
export { default as FarmingIcon } from './FarmingIcon'
export { default as CheckCircle } from './CheckCircle'
export { default as XCircle } from './XCircle'
Expand Down
15 changes: 11 additions & 4 deletions src/components/LiveChart/AnimatingNumber.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion'
import { useRef } from 'react'
import { useCallback, useState } from 'react'
import { Flex, Text } from 'rebass'
import styled from 'styled-components'

Expand Down Expand Up @@ -50,11 +50,18 @@ const TickerColumn = styled(motion.div)`
`

function NumberColumn({ digit, fontSize }: { digit: number; fontSize: number }) {
const columnContainer = useRef<HTMLDivElement>()
const y = (columnContainer.current?.clientHeight || 0) * digit ?? 0
const [clientHeight, setClientHeight] = useState(0)

const columnContainerRef = useCallback((node: HTMLDivElement) => {
if (node !== null) {
setClientHeight(node.clientHeight)
}
}, [])

const y = (clientHeight || 0) * digit ?? 0

return (
<Container ref={columnContainer as any} fontSize={fontSize}>
<Container ref={columnContainerRef} fontSize={fontSize}>
<TickerColumn animate={{ y }} transition={{ type: 'spring', stiffness: 400, damping: 25 }}>
{[9, 8, 7, 6, 5, 4, 3, 2, 1, 0].map(num => (
<TickerDigit key={num}>{num}</TickerDigit>
Expand Down
16 changes: 3 additions & 13 deletions src/components/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import { Trans, t } from '@lingui/macro'
import { useEffect, useState } from 'react'
import { isMobile } from 'react-device-detect'
import {
Award,
BookOpen,
ChevronDown,
Edit,
FileText,
HelpCircle,
Info,
MessageCircle,
PieChart,
Share2,
} from 'react-feather'
import { Award, BookOpen, ChevronDown, Edit, FileText, HelpCircle, Info, MessageCircle, PieChart } from 'react-feather'
import { NavLink, useLocation, useNavigate } from 'react-router-dom'
import { useMedia } from 'react-use'
import { Text } from 'rebass'
import styled, { css } from 'styled-components'

import { ReactComponent as MenuIcon } from 'assets/svg/all_icon.svg'
import { ReactComponent as BlogIcon } from 'assets/svg/blog.svg'
import { ReactComponent as BridgeIcon } from 'assets/svg/bridge_icon.svg'
import { ReactComponent as LightIcon } from 'assets/svg/light.svg'
import { ReactComponent as RoadMapIcon } from 'assets/svg/roadmap.svg'
import { ButtonEmpty, ButtonPrimary } from 'components/Button'
Expand Down Expand Up @@ -332,7 +322,7 @@ export default function Menu() {
{bridgeLink && (
<MenuItem>
<ExternalLink href={bridgeLink}>
<Share2 />
<BridgeIcon />
<Trans>Bridge Assets</Trans>
</ExternalLink>
</MenuItem>
Expand Down
6 changes: 5 additions & 1 deletion src/components/swapv2/LimitOrder/LimitOrderForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ const LimitOrderForm = function LimitOrderForm({
}
}, [currencyIn?.isNative, currentAllowance, parseInputAmount, parsedActiveOrderMakingAmount])

const [approval, approveCallback] = useApproveCallback(parseInputAmount, limitOrderContract || '', !enoughAllowance)
const [approval, approveCallback] = useApproveCallback(
parseInputAmount,
limitOrderContract || undefined,
!enoughAllowance,
)

const { inputError, outPutError } = useValidateInputError({
inputAmount,
Expand Down
6 changes: 0 additions & 6 deletions src/constants/bases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const WETH_ONLY: ChainTokenList = {
[ChainId.AURORA]: [WETH[ChainId.AURORA]],
[ChainId.BTTC]: [WETH[ChainId.BTTC]],
[ChainId.ARBITRUM]: [WETH[ChainId.ARBITRUM]],
[ChainId.VELAS]: [WETH[ChainId.VELAS]],
[ChainId.OASIS]: [WETH[ChainId.OASIS]],
[ChainId.OPTIMISM]: [WETH[ChainId.OPTIMISM]],
[ChainId.ZKSYNC]: [WETH[ChainId.ZKSYNC]],
[ChainId.SOLANA]: [WETH[ChainId.SOLANA]],
Expand Down Expand Up @@ -81,8 +79,6 @@ export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = {
[ChainId.FANTOM]: [...WETH_ONLY[ChainId.FANTOM], DAI[ChainId.FANTOM], USDC[ChainId.FANTOM], USDT[ChainId.FANTOM]],
[ChainId.CRONOS]: [...WETH_ONLY[ChainId.CRONOS], DAI[ChainId.CRONOS], USDC[ChainId.CRONOS], USDT[ChainId.CRONOS]],
[ChainId.AURORA]: [...WETH_ONLY[ChainId.AURORA], DAI[ChainId.AURORA], USDC[ChainId.AURORA], USDT[ChainId.AURORA]],
[ChainId.VELAS]: [...WETH_ONLY[ChainId.VELAS], USDC[ChainId.VELAS], USDT[ChainId.VELAS]],
[ChainId.OASIS]: [...WETH_ONLY[ChainId.OASIS], USDC[ChainId.OASIS], USDT[ChainId.OASIS]],
[ChainId.BTTC]: [
...WETH_ONLY[ChainId.BTTC],
DAI[ChainId.BTTC],
Expand Down Expand Up @@ -159,8 +155,6 @@ export const SUGGESTED_BASES: ChainTokenList = {
new Token(ChainId.ARBITRUM, '0x5979D7b546E38E414F7E9822514be443A4800529', 18, 'wstETH', 'Lido Wrapped Staked ETH'),
],
[ChainId.BTTC]: [...WETH_ONLY[ChainId.BTTC], DAI[ChainId.BTTC], USDC[ChainId.BTTC], USDT[ChainId.BTTC]],
[ChainId.VELAS]: [...WETH_ONLY[ChainId.VELAS], USDC[ChainId.VELAS], USDT[ChainId.VELAS]],
[ChainId.OASIS]: [...WETH_ONLY[ChainId.OASIS], USDC[ChainId.OASIS], USDT[ChainId.OASIS]],
[ChainId.OPTIMISM]: [
...WETH_ONLY[ChainId.OPTIMISM],
USDC[ChainId.OPTIMISM],
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export const TRANSACTION_STATE_DEFAULT: TransactionFlowState = {
pendingText: '',
}

export const CHAINS_SUPPORT_FEE_CONFIGS = [ChainId.OASIS, ChainId.VELAS, ChainId.AURORA, ChainId.CRONOS]
export const CHAINS_SUPPORT_FEE_CONFIGS = [ChainId.AURORA, ChainId.CRONOS]
export const CHAINS_SUPPORT_CROSS_CHAIN =
ENV.ENV_KEY === ENV.EnvKeys.PROD || ENV.ENV_KEY === ENV.EnvKeys.STG
? [
Expand Down
20 changes: 1 addition & 19 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ import {
linea,
matic,
mumbai,
oasis,
optimism,
solana,
solanaDevnet,
velas,
zkEvm,
zksync,
} from './networks/index'
Expand All @@ -47,9 +45,7 @@ const NETWORKS_INFO_CONFIG: NETWORKS_INFO_CONFIG_TYPE = {
[ChainId.CRONOS]: cronos,
[ChainId.ARBITRUM]: arbitrum,
[ChainId.BTTC]: bttc,
[ChainId.VELAS]: velas,
[ChainId.AURORA]: aurora,
[ChainId.OASIS]: oasis,
[ChainId.OPTIMISM]: optimism,
[ChainId.ZKSYNC]: zksync,
[ChainId.LINEA]: linea,
Expand Down Expand Up @@ -87,8 +83,6 @@ export const MAINNET_NETWORKS = [
ChainId.FANTOM,
ChainId.BTTC,
ChainId.CRONOS,
ChainId.VELAS,
ChainId.OASIS,
ChainId.AURORA,
] as const

Expand Down Expand Up @@ -160,8 +154,6 @@ export const FAUCET_NETWORKS = [ChainId.BTTC]
export const STATIC_FEE_OPTIONS: { [chainId: number]: number[] | undefined } = {
[ChainId.ARBITRUM]: [8, 10, 50, 300, 500, 1000],
[ChainId.AURORA]: [8, 10, 50, 300, 500, 1000],
[ChainId.VELAS]: [8, 10, 50, 300, 500, 1000],
[ChainId.OASIS]: [8, 10, 50, 300, 500, 1000],
[ChainId.MAINNET]: [8, 10, 50, 300, 500, 1000],
[ChainId.MATIC]: [8, 10, 50, 300, 500, 1000],
[ChainId.AVAXMAINNET]: [8, 10, 50, 300, 500, 1000],
Expand All @@ -180,8 +172,6 @@ export const STATIC_FEE_OPTIONS: { [chainId: number]: number[] | undefined } = {
export const ONLY_STATIC_FEE_CHAINS = [
ChainId.ARBITRUM,
ChainId.AURORA,
ChainId.VELAS,
ChainId.OASIS,
ChainId.OPTIMISM,
ChainId.GÖRLI,
ChainId.ZKSYNC,
Expand Down Expand Up @@ -216,18 +206,11 @@ export const SUPPORTED_NETWORKS_FOR_MY_EARNINGS = [
ChainId.FANTOM,
ChainId.CRONOS,
ChainId.BTTC,
ChainId.VELAS,
ChainId.AURORA,
ChainId.OASIS,
]
export const COMING_SOON_NETWORKS_FOR_MY_EARNINGS: ChainId[] = []
export const COMING_SOON_NETWORKS_FOR_MY_EARNINGS_LEGACY: ChainId[] = []
export const COMING_SOON_NETWORKS_FOR_MY_EARNINGS_CLASSIC: ChainId[] = [
ChainId.CRONOS,
ChainId.VELAS,
ChainId.AURORA,
ChainId.OASIS,
]
export const COMING_SOON_NETWORKS_FOR_MY_EARNINGS_CLASSIC: ChainId[] = [ChainId.CRONOS, ChainId.AURORA]
export const BLOCTO_SUPPORTED_NETWORKS: ChainId[] = [
ChainId.MAINNET,
ChainId.ARBITRUM,
Expand All @@ -240,7 +223,6 @@ export const BLOCTO_SUPPORTED_NETWORKS: ChainId[] = [
export const ELASTIC_NOT_SUPPORTED: { [key: string]: string } = {
[ChainId.AURORA]: t`Elastic is not supported on Aurora. Please switch to other chains`,
[ChainId.ZKSYNC]: t`Elastic will be available soon`,
// [ChainId.VELAS]: t`Elastic will be available soon`,
}

export const CLASSIC_NOT_SUPPORTED: { [key: string]: string } = {
Expand Down
Loading

0 comments on commit 2d1b019

Please sign in to comment.