Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master to dev #1077

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config/dogechain.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"v3": true,
"v2": true,
"rpc": "https://rpc-sg.dogechain.dog",
"rpc": "https://rpc.dogechain.dog",
"blockExplorer": "https://explorer.dogechain.dog",
"aprAPINetwork": "DogeChain",
"networkName": "DogeChain",
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const networkInfoMap: NetworkInfoChainMap = {
scanUrl: 'https://polygonscan.com/',
},
[ChainId.DOGECHAIN]: {
rpcUrl: 'https://rpc-sg.dogechain.dog/',
rpcUrl: 'https://rpc.dogechain.dog/',
scanUrl: 'https://explorer.dogechain.dog/',
},
[ChainId.MUMBAI]: {
Expand Down
2 changes: 1 addition & 1 deletion src/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ChainId } from '@uniswap/sdk';
export const rpcMap = {
[ChainId.MATIC]: 'https://polygon-rpc.com/',
[ChainId.MUMBAI]: 'https://rpc-mumbai.maticvigil.com/',
[ChainId.DOGECHAIN]: 'https://rpc-sg.dogechain.dog/',
[ChainId.DOGECHAIN]: 'https://rpc.dogechain.dog/',
[ChainId.DOEGCHAIN_TESTNET]: 'https://rpc-testnet.dogechain.dog',
[ChainId.ZKTESTNET]: 'https://rpc.public.zkevm-test.net',
[ChainId.ZKEVM]: 'https://zkevm-rpc.com',
Expand Down
22 changes: 3 additions & 19 deletions src/pages/SwapPage/V3/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import CurrencyLogo from 'components/CurrencyLogo';
import Loader from 'components/Loader';
import CurrencyInputPanel from 'components/v3/CurrencyInputPanel';
import { AdvancedSwapDetails } from 'components/v3/swap/AdvancedSwapDetails';
import confirmPriceImpactWithoutFee from 'components/v3/swap/confirmPriceImpactWithoutFee';
import ConfirmSwapModal from 'components/v3/swap/ConfirmSwapModal';
import SwapCallbackError from 'components/v3/swap/SwapCallbackError';
import SwapHeader from 'components/v3/swap/SwapHeader';
Expand Down Expand Up @@ -164,10 +163,6 @@ const SwapV3Page: React.FC = () => {

const fiatValueInput = useUSDCValue(parsedAmounts[Field.INPUT]);
const fiatValueOutput = useUSDCValue(parsedAmounts[Field.OUTPUT]);
const priceImpact = computeFiatValuePriceImpact(
fiatValueInput,
fiatValueOutput,
);

const {
onCurrencySelection,
Expand Down Expand Up @@ -333,9 +328,6 @@ const SwapV3Page: React.FC = () => {
if (!swapCallback) {
return;
}
if (priceImpact && !confirmPriceImpactWithoutFee(priceImpact, t)) {
return;
}

setSwapState({
attemptingTxn: true,
Expand Down Expand Up @@ -427,8 +419,6 @@ const SwapV3Page: React.FC = () => {
});
}, [
swapCallback,
priceImpact,
t,
account,
currencies,
selectedWallet,
Expand All @@ -453,14 +443,8 @@ const SwapV3Page: React.FC = () => {
// warnings on the greater of fiat value price impact and execution price impact
const priceImpactSeverity = useMemo(() => {
const executionPriceImpact = trade?.priceImpact;
return warningSeverity(
executionPriceImpact && priceImpact
? executionPriceImpact.greaterThan(priceImpact)
? executionPriceImpact
: priceImpact
: executionPriceImpact ?? priceImpact,
);
}, [priceImpact, trade]);
return warningSeverity(executionPriceImpact);
}, [trade]);

// show approve flow when: no error on inputs, not approved or pending, or approved in current session
// never show if price impact is above threshold in non expert mode
Expand Down Expand Up @@ -703,7 +687,7 @@ const SwapV3Page: React.FC = () => {
showHalfButton={false}
hideBalance={false}
fiatValue={fiatValueOutput ?? undefined}
priceImpact={priceImpact}
priceImpact={trade?.priceImpact}
currency={currencies[Field.OUTPUT] as WrappedCurrency}
onCurrencySelect={handleOutputSelect}
otherCurrency={currencies[Field.INPUT]}
Expand Down
3 changes: 1 addition & 2 deletions src/state/swap/v3/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ export function useDefaultsFromURLSearch():
inputCurrencyId: parsed[Field.INPUT].currencyId,
outputCurrencyId: parsed[Field.OUTPUT].currencyId,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, chainId]);
}, [dispatch, chainId, parsedQs]);

return result;
}
Loading