Skip to content

Commit 0652535

Browse files
authored
Merge branch 'main' into feat/add-alert-plasma-txhistory
2 parents a14dad3 + 2fe889e commit 0652535

File tree

239 files changed

+19244
-9763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+19244
-9763
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ src/locales/
2020
*.md
2121
*.log
2222
*.lock
23+
24+
src/components/transactions/Swap/backup/**/*.*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ yarn-error.log*
4242
package-lock.json
4343

4444
.eslintcache
45+
.yarn-cache
4546

4647
# IDE specific
4748
.idea

.npmrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Uncomment for CoW Preview Releases
2+
3+
# @cowprotocol:registry=https://npm.pkg.github.com
4+
# always-auth=true
5+
# # registry=https://registry.npmjs.org/
6+
# //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
"@aave/math-utils": "1.36.1",
3636
"@aave/react": "0.6.1",
3737
"@amplitude/analytics-browser": "^2.13.0",
38-
"@bgd-labs/aave-address-book": "^4.34.1",
39-
"@cowprotocol/app-data": "^3.1.0",
40-
"@cowprotocol/cow-sdk": "6.3.3",
38+
"@bgd-labs/aave-address-book": "^4.36.3",
39+
"@cowprotocol/cow-sdk": "7.1.1",
40+
"@cowprotocol/sdk-flash-loans": "1.5.3",
41+
"@cowprotocol/sdk-ethers-v5-adapter": "0.2.0",
4142
"@emotion/cache": "11.10.3",
4243
"@emotion/react": "11.10.4",
4344
"@emotion/server": "latest",
@@ -157,4 +158,4 @@
157158
"budgetPercentIncreaseRed": 20,
158159
"showDetails": true
159160
}
160-
}
161+
}

pages/_app.page.tsx

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import { AddressBlocked } from 'src/components/AddressBlocked';
1616
import { Meta } from 'src/components/Meta';
1717
import { TransactionEventHandler } from 'src/components/TransactionEventHandler';
1818
import { GasStationProvider } from 'src/components/transactions/GasStation/GasStationProvider';
19-
import { CowOrderToast } from 'src/components/transactions/Switch/cowprotocol/CowOrderToast';
19+
import { CowOrderToast } from 'src/components/transactions/Swap/modals/result/CowOrderToast';
2020
import { AppDataProvider } from 'src/hooks/app-data-provider/useAppDataProvider';
21-
import { CowOrderToastProvider } from 'src/hooks/useCowOrderToast';
2221
import { ModalContextProvider } from 'src/hooks/useModal';
22+
import { SwapOrdersTrackingProvider } from 'src/hooks/useSwapOrdersTracking';
2323
import { Web3ContextProvider } from 'src/libs/web3-data-provider/Web3Provider';
2424
import { useRootStore } from 'src/store/root';
2525
import { SharedDependenciesProvider } from 'src/ui-config/SharedDependenciesProvider';
@@ -31,16 +31,22 @@ import createEmotionCache from '../src/createEmotionCache';
3131
import { AppGlobalStyles } from '../src/layouts/AppGlobalStyles';
3232
import { LanguageProvider } from '../src/libs/LanguageProvider';
3333

34-
const SwitchModal = dynamic(() =>
35-
import('src/components/transactions/Switch/SwitchModal').then((module) => module.SwitchModal)
34+
const SwapModal = dynamic(() =>
35+
import('src/components/transactions/Swap/modals/SwapModal').then((module) => module.SwapModal)
3636
);
3737

3838
const CollateralSwapModal = dynamic(() =>
39-
import('src/components/transactions/Switch/CollateralSwap/CollateralSwapModal').then(
39+
import('src/components/transactions/Swap/modals/CollateralSwapModal').then(
4040
(module) => module.CollateralSwapModal
4141
)
4242
);
4343

44+
const DebtSwapModal = dynamic(() =>
45+
import('src/components/transactions/Swap/modals/DebtSwapModal').then(
46+
(module) => module.DebtSwapModal
47+
)
48+
);
49+
4450
const BridgeModal = dynamic(() =>
4551
import('src/components/transactions/Bridge/BridgeModal').then((module) => module.BridgeModal)
4652
);
@@ -53,16 +59,6 @@ const ClaimRewardsModal = dynamic(() =>
5359
(module) => module.ClaimRewardsModal
5460
)
5561
);
56-
const CollateralChangeModal = dynamic(() =>
57-
import('src/components/transactions/CollateralChange/CollateralChangeModal').then(
58-
(module) => module.CollateralChangeModal
59-
)
60-
);
61-
const DebtSwitchModal = dynamic(() =>
62-
import('src/components/transactions/DebtSwitch/DebtSwitchModal').then(
63-
(module) => module.DebtSwitchModal
64-
)
65-
);
6662
const EmodeModal = dynamic(() =>
6763
import('src/components/transactions/Emode/EmodeModal').then((module) => module.EmodeModal)
6864
);
@@ -93,6 +89,11 @@ const CancelCowOrderModal = dynamic(() =>
9389
const ReadOnlyModal = dynamic(() =>
9490
import('src/components/WalletConnection/ReadOnlyModal').then((module) => module.ReadOnlyModal)
9591
);
92+
const CollateralChangeModal = dynamic(() =>
93+
import('src/components/transactions/CollateralChange/CollateralChangeModal').then(
94+
(module) => module.CollateralChangeModal
95+
)
96+
);
9697

9798
// Client-side cache, shared for the whole session of the user in the browser.
9899
const clientSideEmotionCache = createEmotionCache();
@@ -160,7 +161,7 @@ export default function MyApp(props: MyAppProps) {
160161
<Web3ContextProvider>
161162
<AppGlobalStyles>
162163
<AddressBlocked>
163-
<CowOrderToastProvider>
164+
<SwapOrdersTrackingProvider>
164165
<ModalContextProvider>
165166
<SharedDependenciesProvider>
166167
<AppDataProvider>
@@ -171,23 +172,25 @@ export default function MyApp(props: MyAppProps) {
171172
<BorrowModal />
172173
<RepayModal />
173174
<CollateralChangeModal />
174-
<DebtSwitchModal />
175175
<ClaimRewardsModal />
176176
<EmodeModal />
177177
<FaucetModal />
178178
<TransactionEventHandler />
179-
<SwitchModal />
180-
<CollateralSwapModal />
181179
<StakingMigrateModal />
182180
<BridgeModal />
183181
<ReadOnlyModal />
184-
<CowOrderToast />
182+
183+
{/* Swap Modals */}
184+
<SwapModal />
185+
<CollateralSwapModal />
186+
<DebtSwapModal />
185187
<CancelCowOrderModal />
188+
<CowOrderToast />
186189
</GasStationProvider>
187190
</AppDataProvider>
188191
</SharedDependenciesProvider>
189192
</ModalContextProvider>
190-
</CowOrderToastProvider>
193+
</SwapOrdersTrackingProvider>
191194
</AddressBlocked>
192195
</AppGlobalStyles>
193196
</Web3ContextProvider>
Lines changed: 1 addition & 0 deletions
Loading

public/icons/tokens/vbill.svg

Lines changed: 1 addition & 0 deletions
Loading

public/icons/tokens/wbtc.svg

Lines changed: 1 addition & 1 deletion
Loading

public/icons/tokens/xpl.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/MarketSwitcher.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ type MarketLogoProps = {
7878
export const MarketLogo = ({ size, logo, testChainName, sx }: MarketLogoProps) => {
7979
return (
8080
<Box sx={{ mr: 2, width: size, height: size, position: 'relative', ...sx }}>
81-
<img src={logo} alt="" width="100%" height="100%" />
81+
<img
82+
src={logo}
83+
alt=""
84+
width="100%"
85+
height="100%"
86+
style={{ display: 'block', objectFit: 'contain', objectPosition: 'center center' }}
87+
/>
8288

8389
{testChainName && (
8490
<Tooltip title={testChainName} arrow>
@@ -351,6 +357,10 @@ export const MarketSwitcher = () => {
351357
value={selectedMarketVersion}
352358
exclusive
353359
onChange={(_, value) => {
360+
if (value === SelectedMarketVersion.V2) {
361+
window.open('https://v2-market.aave.com/', '_blank', 'noopener');
362+
return;
363+
}
354364
if (value !== null) {
355365
setSelectedMarketVersion(value);
356366
}
@@ -372,6 +382,8 @@ export const MarketSwitcher = () => {
372382
value={SelectedMarketVersion.V3}
373383
data-cy={`markets_switch_button_v3`}
374384
sx={{
385+
flex: '0 0 96px',
386+
px: 1.5,
375387
backgroundColor: theme.palette.mode === 'dark' ? '#EAEBEF' : '#383D51',
376388
'&.Mui-selected, &.Mui-selected:hover': {
377389
backgroundColor: theme.palette.mode === 'dark' ? '#292E41' : '#FFFFFF',
@@ -401,12 +413,16 @@ export const MarketSwitcher = () => {
401413
value={SelectedMarketVersion.V2}
402414
data-cy={`markets_switch_button_v2`}
403415
sx={{
416+
flexGrow: 1.2,
417+
flexBasis: 0,
418+
px: 2,
404419
backgroundColor: theme.palette.mode === 'dark' ? '#EAEBEF' : '#383D51',
405420
'&.Mui-selected, &.Mui-selected:hover': {
406421
backgroundColor: theme.palette.mode === 'dark' ? '#292E41' : '#FFFFFF',
407422
boxShadow: '0px 1px 0px rgba(0, 0, 0, 0.05)',
408423
},
409424
borderRadius: '4px',
425+
padding: 0,
410426
}}
411427
>
412428
<Typography
@@ -419,11 +435,17 @@ export const MarketSwitcher = () => {
419435
color: 'transparent',
420436
}
421437
: {
438+
display: 'flex',
439+
flexDirection: 'row',
440+
alignItems: 'center',
422441
color: theme.palette.mode === 'dark' ? '#0F121D' : '#FFFFFF',
423442
}
424443
}
425444
>
426445
<Trans>Version 2</Trans>
446+
<SvgIcon sx={{ ml: 1, fontSize: 14 }}>
447+
<ExternalLinkIcon />
448+
</SvgIcon>
427449
</Typography>
428450
</StyledToggleButton>
429451
</StyledToggleButtonGroup>

0 commit comments

Comments
 (0)