Skip to content

Commit

Permalink
Merge branch 'dev2' into feature/falkor-mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
totop716 committed Jul 7, 2024
2 parents 98dbe7b + cacd20c commit 86d66f9
Show file tree
Hide file tree
Showing 33 changed files with 895 additions and 8,179 deletions.
4 changes: 0 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ IPFS_DEPLOY_PINATA__SECRET_API_KEY=d17f8f50c3e6a633b12843890a8fb537908f0632f642b
REACT_APP_PORTIS_ID="e086c1f2-2d26-4443-804f-3398bbab069e"
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"

REACT_APP_GRAPH_V3_137_API_URL="https://api.thegraph.com/subgraphs/name/sameepsi/quickswap-v3"
REACT_APP_GRAPH_V3_2000_API_URL="https://graph-node.dogechain.dog/subgraphs/name/quickswap/dogechain-info"
REACT_APP_GRAPH_V3_1101_API_URL="https://api.studio.thegraph.com/query/44554/quickswap-v3-02/0.0.7"

REACT_APP_PREDICTIONS_URL="https://quickswap.nexter.fi/"
REACT_APP_GAMEHUB_URL="https://versagames.io/quickswap-gaming-hub"
REACT_APP_TOKEN_LIST_DEFAULT_URL="https://unpkg.com/quickswap-default-token-list@latest/build/quickswap-default.tokenlist.json"
Expand Down
78 changes: 56 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@0xsquid/widget": "2.0.0-beta.19",
"@ape.swap/apeswap-lists": "1.18.39",
"@ape.swap/apeswap-lists": "1.20.5",
"@arcxmoney/analytics": "^2.0.2",
"@cryption/df-sdk-core": "0.0.26",
"@hypelab/sdk-react": "^1.0.1",
"@ichidao/ichi-vaults-sdk": "^0.0.51",
"@ichidao/ichi-vaults-sdk": "^0.0.59",
"@imtbl/sdk": "^1.36.3",
"@intract/attribution": "^2.0.0",
"@masa-finance/analytics-react": "^0.12.4",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions src/components/AssetModal/AssetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { CurrencyLogo, CustomModal } from 'components';
import { useMemo, useState } from 'react';
import { useActiveWeb3React } from 'hooks';
import 'components/styles/AssetModal.scss';
import NotifyModal from '../NotifyModal';
import { NotifyModal } from './NotifyModal';
import {
useAccount,
useChains,
useCollateral,
useDeposit,
usePositionStream,
useWithdraw,
} from '@orderly.network/hooks';
import { Box, Button } from '@material-ui/core';
Expand Down Expand Up @@ -70,6 +71,9 @@ const AssetModal: React.FC<AssetModalProps> = ({
withdrawalFee = data[0].chain_details[0].withdrawal_fee;
}

const [data] = usePositionStream();
const unsettledPnl = Number(data?.aggregated?.unsettledPnL ?? 0);

return (
<CustomModal
open={open}
Expand Down Expand Up @@ -295,15 +299,18 @@ const AssetModal: React.FC<AssetModalProps> = ({
if (!withdrawAmount) return;
try {
setLoading(true);
await account.settle();
if (unsettledPnl !== 0) {
await account.settle();
}
await withdraw({
chainId: Number(chainId),
amount: withdrawAmount,
token: 'USDC',
allowCrossChainWithdraw: false,
});
setLoading(false);
} catch {
} catch (e) {
console.log('Withdraw Error ', e);
setLoading(false);
}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ interface NotifyModalProps {
onClose: () => void;
tx: any;
}
const NotifyModal: React.FC<NotifyModalProps> = ({ open, onClose, tx }) => {

export const NotifyModal: React.FC<NotifyModalProps> = ({
open,
onClose,
tx,
}) => {
const [duration, setDuration] = useState(0);
const { chainId } = useActiveWeb3React();
const config = getConfig(chainId);
Expand Down Expand Up @@ -120,4 +125,3 @@ const NotifyModal: React.FC<NotifyModalProps> = ({ open, onClose, tx }) => {
</CustomModal>
);
};
export default NotifyModal;
6 changes: 3 additions & 3 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import QuickIcon from 'assets/images/quickIcon.svg';
import QuickLogo from 'assets/images/quickLogo.png';
import QuickLogoWebP from 'assets/images/quickLogo.webp';
import QuickPerpsLogo from 'assets/images/quickPerpsLogo.webp';
import QuickPerpsIcon from 'assets/images/quickPerpsIcon.svg';
import { ReactComponent as ThreeDotIcon } from 'assets/images/ThreeDot.svg';
// import { ReactComponent as LightIcon } from 'assets/images/LightIcon.svg';
import 'components/styles/Header.scss';
import { useTranslation } from 'react-i18next';
import { getConfig } from 'config/index';
import useDeviceWidth from 'hooks/useDeviceWidth';
import { USDC, USDT } from 'constants/v3/addresses';
import { USDC, USDO, USDT } from 'constants/v3/addresses';
import { ChainId } from '@uniswap/sdk';
import { MobileMenuDrawer } from './MobileMenuDrawer';
import useParsedQueryString from 'hooks/useParsedQueryString';
Expand Down Expand Up @@ -99,6 +97,8 @@ const Header: React.FC<{ onUpdateNewsletter: (val: boolean) => void }> = ({
if (!chainId) return '';
if (chainId === ChainId.ZKTESTNET)
return `&currency1=${USDT[chainId].address}`;
if (chainId === ChainId.DOGECHAIN)
return `&currency1=${USDO[chainId].address}`;
if (USDC[chainId]) return `&currency1=${USDC[chainId].address}`;
return '';
}, [chainId]);
Expand Down
1 change: 0 additions & 1 deletion src/components/NotifyModal/index.ts

This file was deleted.

6 changes: 4 additions & 2 deletions src/components/RemoveLiquidityModal/RemoveLiquidityModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const RemoveLiquidityModal: React.FC<RemoveLiquidityModalProps> = ({
setTxPending(false);
} catch (error) {
setTxPending(false);
setRemoveErrorMessage(t('errorInTx'));
setRemoveErrorMessage(t('removeLiquidityError1'));
}

ReactGA.event({
Expand All @@ -354,7 +354,9 @@ const RemoveLiquidityModal: React.FC<RemoveLiquidityModalProps> = ({
// we only care if the error is something _other_ than the user rejected the tx
console.error(error);
setRemoveErrorMessage(
error.code === 'ACTION_REJECTED' ? t('txRejected') : t('errorInTx'),
error.code === 'ACTION_REJECTED'
? t('txRejected')
: t('removeLiquidityError1'),
);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/config/layerx.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
},
"farm": {
"quickswap": false,
"merkl": false,
"available": false
"merkl": true,
"available": true
},
"lair": {
"available": false,
Expand Down
11 changes: 11 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const AVERAGE_L1_BLOCK_TIME = 12000;
export const merklAMMs: { [chainId in ChainId]?: string[] } = {
[ChainId.MATIC]: ['quickswapalgebra'],
[ChainId.ZKEVM]: ['quickswapalgebra', 'quickswapuni'],
[ChainId.LAYERX]: ['quickswapalgebra'],
};

export const blackListMerklFarms: { [chainId in ChainId]?: string[] } = {
Expand Down Expand Up @@ -1506,6 +1507,15 @@ export const GammaPairs: {
token1Address: '0xa3fa99a148fa48D14ed51d610c367c61876997f1',
},
],
'0x3c499c542cef5e3811e1192ce70d8cc03d5c3359-0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39': [
{
type: Presets.GAMMA_NARROW,
title: 'Narrow',
address: '0x9854aba3f857f19660f856bdb19718081ce6120a',
token0Address: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359',
token1Address: '0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39',
},
],
},
[ChainId.ZKEVM]: {
'0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9-0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035': [
Expand Down Expand Up @@ -2320,6 +2330,7 @@ export const IchiVaults: {
'0xb5a4B8d3c8F88a25801aF460f52fEc639403534f',
'0x2ED64d3De2A2c060FF4b31e9B2f9268ADcE7e671',
'0x6fD4058ED78608F3C613585EEa222F6F5480e0D5',
'0x3c306334b3728F5E50c1eDfA8338ffe96C875812',
],
[ChainId.ZKEVM]: [
'0x423382e084f1d1d180bec638bc64cc6408896c3c',
Expand Down
Loading

0 comments on commit 86d66f9

Please sign in to comment.