├── .babelrc ├── .env.development ├── .env.example ├── .eslintignore ├── .eslintrc.js ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report---.md │ └── feature-request---.md ├── actions │ ├── analyze-comment │ │ └── action.yml │ ├── build │ │ └── action.yml │ ├── cypress │ │ └── action.yml │ ├── fork-result-comment │ │ └── action.yml │ └── upload-artifacts │ │ └── action.yml ├── dependabot.yml ├── release-template.md └── workflows │ ├── build-fork.yml │ ├── build-test-deploy.yml │ ├── crowdin-download.yml │ ├── crowdin-upload.yml │ ├── i18n-check.yml │ ├── test-deploy-fork.yml │ ├── update-cache.yml │ └── update-prod-staging.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .linguirc ├── .nvmrc ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── codegen.yml ├── commitlint.config.js ├── crowdin.yml ├── custom.d.ts ├── cypress.json ├── cypress ├── README.md ├── configs │ ├── base.cypress.json │ ├── settings.config.json │ ├── v2-markets │ │ ├── amm-v2-full.config.json │ │ ├── amm-v2-smoke.config.json │ │ ├── arc-v2-full.config.json │ │ ├── avalanche-v2-additional.config.json │ │ ├── avalanche-v2-full.config.json │ │ ├── avalanche-v2-smoke.config.json │ │ ├── ethereum-v2-additional.config.json │ │ ├── ethereum-v2-full.config.json │ │ ├── ethereum-v2-smoke.config.json │ │ ├── polygon-v2-additional.config.json │ │ ├── polygon-v2-full.config.json │ │ └── polygon-v2-smoke.config.json │ └── v3-markets │ │ ├── arbitrum-v3-additional.config.json │ │ ├── arbitrum-v3-full.config.json │ │ ├── arbitrum-v3-smoke.config.json │ │ ├── avalanche-v3-additional.config.json │ │ ├── avalanche-v3-full.config.json │ │ ├── avalanche-v3-smoke.config.json │ │ ├── fantom-v3-additional.config.json │ │ ├── fantom-v3-full.config.json │ │ ├── fantom-v3-smoke.config.json │ │ ├── optimism-v3-additional.config.json │ │ ├── optimism-v3-full.config.json │ │ ├── optimism-v3-smoke.config.json │ │ ├── polygon-v3-additional.config.json │ │ ├── polygon-v3-full.config.json │ │ └── polygon-v3-smoke.config.json ├── fixtures │ ├── assets.json │ ├── constans.json │ ├── erc20_abi.json │ ├── markets.json │ └── poolConfig.json ├── integration │ ├── 0-v2-markets │ │ ├── 0-main-v2-market │ │ │ ├── 0-assets │ │ │ │ ├── bat.aave-v2.spec.ts │ │ │ │ ├── dai.aave-v2.spec.ts │ │ │ │ ├── eth.aave-v2.spec.ts │ │ │ │ ├── mana.aave-v2.spec.ts │ │ │ │ ├── mkr.aave-v2.spec.ts │ │ │ │ ├── ren.aave-v2.spec.ts │ │ │ │ ├── tusd.aave-v2.spec.ts │ │ │ │ ├── usdc.aave-v2.spec.ts │ │ │ │ └── usdt.aave-v2.spec.ts │ │ │ ├── critical-conditions.aave-v2.spec.ts │ │ │ ├── reward.aave-v2.spec.ts │ │ │ ├── stake.aave-v2.spec.ts │ │ │ └── swap.aave-v2.spec.ts │ │ ├── 1-amm-v2-market │ │ │ ├── 0-assets │ │ │ │ ├── dai.amm-v2.spec.ts │ │ │ │ ├── eth.amm-v2.spec.ts │ │ │ │ ├── usdc.amm-v2.spec.ts │ │ │ │ ├── usdt.amm-v2.spec.ts │ │ │ │ └── wbtc.amm-v2.spec.ts │ │ │ └── critical-conditions.amm-v2.spec.ts │ │ ├── 2-polygon-v2-market │ │ │ ├── 0-assets │ │ │ │ ├── bal.polygon-v2.spec.ts │ │ │ │ ├── crv.polygon-v2.spec.ts │ │ │ │ ├── dai.polygon-v2.spec.ts │ │ │ │ ├── dpi.polygon-v2.spec.ts │ │ │ │ ├── ghst.polygon-v2.spec.ts │ │ │ │ ├── link.polygon-v2.spec.ts │ │ │ │ ├── matic.polygon-v2.spec.ts │ │ │ │ ├── sushi.polygon-v2.spec.ts │ │ │ │ ├── usdc.polygon-v2.spec.ts │ │ │ │ ├── usdt.polygon-v2.spec.ts │ │ │ │ ├── wbtc.polygon-v2.spec.ts │ │ │ │ └── weth.polygon-v2.spec.ts │ │ │ ├── critical-conditions.polygon-v2.spec.ts │ │ │ └── swap.polygon-v2.spec.ts │ │ ├── 3-avalanche-v2-market │ │ │ ├── 0-assets │ │ │ │ ├── avax.avalanche-v2.spec.ts │ │ │ │ ├── dai.avalanche-v2.spec.ts │ │ │ │ ├── usdc.avalanche-v2.spec.ts │ │ │ │ ├── usdt.avalanche-v2.spec.ts │ │ │ │ ├── wbtc.avalanche-v2.spec.ts │ │ │ │ └── weth.avalanche-v2.spec.ts │ │ │ ├── critical-conditions.avalanche-v2.spec.ts │ │ │ ├── reward.avalanche-v2.spec.ts │ │ │ └── swap.avalanche-v2.spec.ts │ │ └── 4-arc-v2-market │ │ │ └── accessibility.arc-v2.spec.ts │ ├── 1-v3-markets │ │ ├── 1-arbitrum-v3-market │ │ │ ├── 0-assets │ │ │ │ ├── dai.arbitrum-v3.spec.ts │ │ │ │ ├── eth.arbitrum-v3.spec.ts │ │ │ │ ├── link.arbitrum-v3.spec.ts │ │ │ │ ├── usdc.arbitrum-v3.spec.ts │ │ │ │ ├── usdt.arbitrum-v3.spec.ts │ │ │ │ └── wbtc.arbitrum-v3.spec.ts │ │ │ ├── critical-conditions.arbitrum-v3.spec.ts │ │ │ └── e-mode.arbitrum-v3.spec.ts │ │ ├── 2-avalanche-v3-market │ │ │ ├── 0-assets │ │ │ │ ├── avax.avalanche-v3.spec.ts │ │ │ │ ├── dai.avalanche-v3.spec.ts │ │ │ │ ├── link.avalanche-v3.spec.ts │ │ │ │ ├── usdc.avalanche-v3.spec.ts │ │ │ │ ├── usdt.avalacnhe-v3.spec.ts │ │ │ │ ├── wbtc.avalanche-v3.spec.ts │ │ │ │ └── weth.avalanche-v3.spec.ts │ │ │ ├── critical-conditions.avalanche-v3.spec.ts │ │ │ ├── e-mode.avalanche-v3.spec.ts │ │ │ ├── isolated-mode.avalanche-v3.spec.ts │ │ │ ├── reward.avalanche-v3.spec.ts │ │ │ └── swap.avalanche-v3.spec.ts │ │ ├── 3-polygon-v3-market │ │ │ ├── 0-assets │ │ │ │ ├── dai.polygon-v3.spec.ts │ │ │ │ ├── eurs.polygon-v3.spec.ts │ │ │ │ ├── link.polygon-v3.spec.ts │ │ │ │ ├── matic.polygon-v3.spec.ts │ │ │ │ ├── usdc.polygon-v3.spec.ts │ │ │ │ ├── usdt.polygon-v3.spec.ts │ │ │ │ ├── wbtc.polygon-v3.spec.ts │ │ │ │ └── weth.polygon-v3.spec.ts │ │ │ ├── critical-conditions.polygon-v3.spec.ts │ │ │ ├── e-mode.polygon-v3.spec.ts │ │ │ ├── isolated-mode.polygon-v3.spec.ts │ │ │ └── swap.polygon-v3.spec.ts │ │ ├── 4-optimism-v3-market │ │ │ ├── 0-assets │ │ │ │ ├── dai.optimism-v3.spec.ts │ │ │ │ ├── eth.optimism-v3.spec.ts │ │ │ │ ├── link.optimism-v3.spec.ts │ │ │ │ ├── susd.optimism-v3.spec.ts │ │ │ │ ├── usdc.optimism-v3.spec.ts │ │ │ │ ├── usdt.optimism-v3.spec.ts │ │ │ │ └── wbtc.optimism-v3.spec.ts │ │ │ ├── critical-conditions.optimism-v3.spec.ts │ │ │ └── e-mode.optimism-v3.spec.ts │ │ └── 5-fantom-v3-market │ │ │ ├── 0-assets │ │ │ ├── dai.fantom-v3.spec.ts │ │ │ ├── ftm.fantom-v3.spec.ts │ │ │ ├── link.fantom-v3.spec.ts │ │ │ ├── usdc.fantom-v3.spec.ts │ │ │ ├── usdt.fantom-v3.spec.ts │ │ │ ├── wbtc.fantom-v3.spec.ts │ │ │ └── weth.fantom-v3.spec.ts │ │ │ ├── critical-conditions.fantom-v3.spec.ts │ │ │ ├── e-mode.fantom-v3.spec.ts │ │ │ ├── isolated-mode.fantom-v3.spec.ts │ │ │ └── swap.fantom-v3.spec.ts │ └── 2-settings │ │ ├── change-languages.spec.ts │ │ ├── stake-abpt.ts │ │ ├── switch-market.spec.ts │ │ ├── switch-tabs.spec.ts │ │ └── wallet-connect.ts ├── plugins │ └── index.js └── support │ ├── commands.ts │ ├── cypress.d.ts │ ├── index.ts │ ├── steps │ ├── actions.steps.ts │ ├── common.ts │ ├── configuration.steps.ts │ ├── main.steps.ts │ └── verification.steps.ts │ └── tools │ ├── bridge.ts │ ├── math.util.ts │ └── tenderly.ts ├── index.d.ts ├── next-env.d.ts ├── next.config.js ├── package.json ├── pages ├── _app.page.tsx ├── _document.page.tsx ├── faucet.page.tsx ├── governance │ ├── index.governance.tsx │ └── proposal │ │ ├── [proposalId].governance.tsx │ │ └── index.governance.tsx ├── index.page.tsx ├── markets.page.tsx ├── reserve-overview.page.tsx └── staking.staking.tsx ├── public ├── aave.svg ├── aaveLogo.svg ├── aaveMetaLogo.png ├── favicon.ico ├── fonts │ └── inter │ │ ├── Inter-Black.woff │ │ ├── Inter-Black.woff2 │ │ ├── Inter-BlackItalic.woff │ │ ├── Inter-BlackItalic.woff2 │ │ ├── Inter-Bold.woff │ │ ├── Inter-Bold.woff2 │ │ ├── Inter-BoldItalic.woff │ │ ├── Inter-BoldItalic.woff2 │ │ ├── Inter-ExtraBold.woff │ │ ├── Inter-ExtraBold.woff2 │ │ ├── Inter-ExtraBoldItalic.woff │ │ ├── Inter-ExtraBoldItalic.woff2 │ │ ├── Inter-ExtraLight.woff │ │ ├── Inter-ExtraLight.woff2 │ │ ├── Inter-ExtraLightItalic.woff │ │ ├── Inter-ExtraLightItalic.woff2 │ │ ├── Inter-Italic.woff │ │ ├── Inter-Italic.woff2 │ │ ├── Inter-Light.woff │ │ ├── Inter-Light.woff2 │ │ ├── Inter-LightItalic.woff │ │ ├── Inter-LightItalic.woff2 │ │ ├── Inter-Medium.woff │ │ ├── Inter-Medium.woff2 │ │ ├── Inter-MediumItalic.woff │ │ ├── Inter-MediumItalic.woff2 │ │ ├── Inter-Regular.woff │ │ ├── Inter-Regular.woff2 │ │ ├── Inter-SemiBold.woff │ │ ├── Inter-SemiBold.woff2 │ │ ├── Inter-SemiBoldItalic.woff │ │ ├── Inter-SemiBoldItalic.woff2 │ │ ├── Inter-Thin.woff │ │ ├── Inter-Thin.woff2 │ │ ├── Inter-ThinItalic.woff │ │ ├── Inter-ThinItalic.woff2 │ │ ├── Inter-italic.var.woff2 │ │ ├── Inter-roman.var.woff2 │ │ ├── Inter.var.woff2 │ │ └── inter.css ├── icons │ ├── aave_classic.svg │ ├── bridge │ │ ├── arbitrum.svg │ │ ├── avalanche.svg │ │ ├── fantom.svg │ │ ├── harmony.svg │ │ ├── optimism.svg │ │ └── polygon.svg │ ├── discord.svg │ ├── flags │ │ ├── cn.svg │ │ ├── el.svg │ │ ├── en.svg │ │ ├── es.svg │ │ ├── fr.svg │ │ ├── it.svg │ │ ├── jp.svg │ │ ├── kr.svg │ │ ├── pr.svg │ │ ├── tr.svg │ │ └── vt.svg │ ├── github.svg │ ├── healthFactor │ │ ├── HAL.svg │ │ ├── HALHover.svg │ │ ├── hfEmpty.svg │ │ ├── hfFull.svg │ │ ├── hfLow.svg │ │ └── hfMiddle.svg │ ├── markets │ │ ├── claim-gift-icon.svg │ │ ├── cube-icon.svg │ │ ├── dollar-icon.svg │ │ ├── empty-heart-icon.svg │ │ ├── net-apy-icon.svg │ │ ├── pie-icon.svg │ │ ├── total-borrow-indicator.svg │ │ ├── total-supply-indicator.svg │ │ ├── uptrend-icon.svg │ │ └── wallet-icon.svg │ ├── networks │ │ ├── arbitrum.svg │ │ ├── avalanche.svg │ │ ├── ethereum.svg │ │ ├── fantom.svg │ │ ├── harmony.svg │ │ ├── optimism.svg │ │ └── polygon.svg │ ├── staking │ │ ├── emission-staking-icon.svg │ │ └── trust-staking-icon.svg │ ├── tokens │ │ ├── 1inch.svg │ │ ├── aave.svg │ │ ├── ageur.svg │ │ ├── ampl.svg │ │ ├── avax.svg │ │ ├── bal.svg │ │ ├── bat.svg │ │ ├── bpt.svg │ │ ├── btc.svg │ │ ├── busd.svg │ │ ├── crv.svg │ │ ├── cvx.svg │ │ ├── dai.svg │ │ ├── default.svg │ │ ├── dpi.svg │ │ ├── enj.svg │ │ ├── ens.svg │ │ ├── eth.svg │ │ ├── eurs.svg │ │ ├── fei.svg │ │ ├── frax.svg │ │ ├── ftm.svg │ │ ├── ghst.svg │ │ ├── gusd.svg │ │ ├── jeur.svg │ │ ├── knc.svg │ │ ├── lend.svg │ │ ├── link.svg │ │ ├── mana.svg │ │ ├── matic.svg │ │ ├── mkr.svg │ │ ├── one.svg │ │ ├── op.svg │ │ ├── pax.svg │ │ ├── pools │ │ │ ├── bpt.svg │ │ │ ├── guni.svg │ │ │ └── uni.svg │ │ ├── rai.svg │ │ ├── ren.svg │ │ ├── renfil.svg │ │ ├── rep.svg │ │ ├── savax.svg │ │ ├── seth.svg │ │ ├── snx.svg │ │ ├── steth.svg │ │ ├── stkaave.svg │ │ ├── stkbpt.svg │ │ ├── susd.svg │ │ ├── sushi.svg │ │ ├── tribe.svg │ │ ├── tusd.svg │ │ ├── uni.svg │ │ ├── usdc.svg │ │ ├── usdp.svg │ │ ├── usdt.svg │ │ ├── ust.svg │ │ ├── wavax.svg │ │ ├── wbtc.svg │ │ ├── weth.svg │ │ ├── wftm.svg │ │ ├── wmatic.svg │ │ ├── wone.svg │ │ ├── xsushi.svg │ │ ├── yfi.svg │ │ └── zrx.svg │ └── wallets │ │ ├── browserWallet.svg │ │ ├── coinbase.svg │ │ ├── frame.svg │ │ ├── torus.svg │ │ ├── walletConnect.svg │ │ ├── walletIcon.svg │ │ └── walletIconHover.svg ├── lightningBoltGradient.svg ├── loveGhost.svg └── manifest.json ├── scripts └── populate-cache.js ├── src ├── components │ ├── BridgeButton.tsx │ ├── CircleIcon.tsx │ ├── ConnectWalletPaper.tsx │ ├── ContentContainer.tsx │ ├── ContentWithTooltip.tsx │ ├── FaucetButton.tsx │ ├── HALLink.tsx │ ├── HealthFactorNumber.tsx │ ├── MarketSwitcher.tsx │ ├── Meta.tsx │ ├── ReserveOverviewBox.tsx │ ├── ReserveSubheader.tsx │ ├── TextWithModal.tsx │ ├── TextWithTooltip.tsx │ ├── TopInfoPanel │ │ ├── PageTitle.tsx │ │ ├── TopInfoPanel.tsx │ │ └── TopInfoPanelItem.tsx │ ├── WalletConnection │ │ ├── ConnectWalletButton.tsx │ │ ├── WalletModal.tsx │ │ └── WalletSelector.tsx │ ├── Warnings │ │ └── CooldownWarning.tsx │ ├── caps │ │ ├── CapsHint.tsx │ │ ├── CapsTooltip.tsx │ │ └── helper.ts │ ├── incentives │ │ ├── IncentivesButton.tsx │ │ ├── IncentivesCard.tsx │ │ └── IncentivesTooltipContent.tsx │ ├── infoModalContents │ │ ├── ApprovalInfoContent.tsx │ │ ├── InfoContentWrapper.tsx │ │ └── RetryWithApprovalInfoContent.tsx │ ├── infoTooltips │ │ ├── AMPLWarning.tsx │ │ ├── APYTypeTooltip.tsx │ │ ├── AvailableTooltip.tsx │ │ ├── BorrowPowerTooltip.tsx │ │ ├── CollateralSwitchTooltip.tsx │ │ ├── CollateralTooltip.tsx │ │ ├── DarkTooltip.tsx │ │ ├── EModeTooltip.tsx │ │ ├── FrozenWarning.tsx │ │ ├── GasTooltip.tsx │ │ ├── LiquidationPenaltyTooltip.tsx │ │ ├── LiquidationThresholdTooltip.tsx │ │ ├── MaxLTVTooltip.tsx │ │ ├── NetAPYTooltip.tsx │ │ ├── ReserveFactorTooltip.tsx │ │ ├── StableAPYTooltip.tsx │ │ ├── TotalBorrowAPYTooltip.tsx │ │ ├── TotalSupplyAPYTooltip.tsx │ │ └── VariableAPYTooltip.tsx │ ├── isolationMode │ │ ├── IsolatedBadge.tsx │ │ └── IsolatedTooltip.tsx │ ├── lists │ │ ├── ListColumn.tsx │ │ ├── ListHeaderTitle.tsx │ │ ├── ListHeaderWrapper.tsx │ │ ├── ListItem.tsx │ │ ├── ListMobileItem.tsx │ │ └── ListWrapper.tsx │ ├── primitives │ │ ├── BasicModal.tsx │ │ ├── CheckBadge.tsx │ │ ├── FormattedNumber.tsx │ │ ├── Link.tsx │ │ ├── NoData.tsx │ │ ├── Row.tsx │ │ ├── TokenIcon.tsx │ │ ├── TypographyGradient.tsx │ │ └── Warning.tsx │ └── transactions │ │ ├── AssetInput.tsx │ │ ├── Borrow │ │ ├── BorrowActions.tsx │ │ ├── BorrowModal.tsx │ │ └── BorrowModalContent.tsx │ │ ├── ClaimRewards │ │ ├── ClaimRewardsActions.tsx │ │ ├── ClaimRewardsModal.tsx │ │ ├── ClaimRewardsModalContent.tsx │ │ └── RewardsSelect.tsx │ │ ├── CollateralChange │ │ ├── CollateralChangeActions.tsx │ │ ├── CollateralChangeModal.tsx │ │ └── CollateralChangeModalContent.tsx │ │ ├── Emode │ │ ├── EmodeActions.tsx │ │ ├── EmodeModal.tsx │ │ ├── EmodeModalContent.tsx │ │ ├── EmodeNaming.ts │ │ └── EmodeSelect.tsx │ │ ├── Faucet │ │ ├── FaucetActions.tsx │ │ ├── FaucetModal.tsx │ │ └── FaucetModalContent.tsx │ │ ├── FlowCommons │ │ ├── Error.tsx │ │ ├── GasEstimationError.tsx │ │ ├── LeftHelperText.tsx │ │ ├── ModalWrapper.tsx │ │ ├── PermissionView.tsx │ │ ├── RightHelperText.tsx │ │ ├── Success.tsx │ │ ├── TxModalDetails.tsx │ │ └── TxModalTitle.tsx │ │ ├── GasStation │ │ ├── GasButton.tsx │ │ ├── GasStation.tsx │ │ └── GasStationProvider.tsx │ │ ├── GovDelegation │ │ ├── DelegationTokenSelector.tsx │ │ ├── DelegationTypeSelector.tsx │ │ ├── GovDelegationActions.tsx │ │ ├── GovDelegationModal.tsx │ │ └── GovDelegationModalContent.tsx │ │ ├── GovVote │ │ ├── GovVoteActions.tsx │ │ ├── GovVoteModal.tsx │ │ └── GovVoteModalContent.tsx │ │ ├── RateSwitch │ │ ├── RateSwitchActions.tsx │ │ ├── RateSwitchModal.tsx │ │ └── RateSwitchModalContent.tsx │ │ ├── Repay │ │ ├── CollateralRepayActions.tsx │ │ ├── CollateralRepayModalContent.tsx │ │ ├── RepayActions.tsx │ │ ├── RepayModal.tsx │ │ ├── RepayModalContent.tsx │ │ └── RepayTypeSelector.tsx │ │ ├── Stake │ │ ├── StakeActions.tsx │ │ ├── StakeModal.tsx │ │ └── StakeModalContent.tsx │ │ ├── StakeCooldown │ │ ├── StakeCooldownActions.tsx │ │ ├── StakeCooldownModal.tsx │ │ └── StakeCooldownModalContent.tsx │ │ ├── StakeRewardClaim │ │ ├── StakeRewardClaimActions.tsx │ │ ├── StakeRewardClaimModal.tsx │ │ └── StakeRewardClaimModalContent.tsx │ │ ├── Supply │ │ ├── SupplyActions.tsx │ │ ├── SupplyModal.tsx │ │ └── SupplyModalContent.tsx │ │ ├── Swap │ │ ├── SwapActions.tsx │ │ ├── SwapModal.tsx │ │ └── SwapModalContent.tsx │ │ ├── TxActionsWrapper.tsx │ │ ├── UnStake │ │ ├── UnStakeActions.tsx │ │ ├── UnStakeModal.tsx │ │ └── UnStakeModalContent.tsx │ │ ├── Warnings │ │ ├── AAVEWarning.tsx │ │ ├── AMPLWarning.tsx │ │ ├── ChangeNetworkWarning.tsx │ │ ├── HarmonyWarning.tsx │ │ ├── IsolationModeWarning.tsx │ │ ├── SNXWarning.tsx │ │ └── SupplyCapWarning.tsx │ │ ├── Withdraw │ │ ├── WithdrawActions.tsx │ │ ├── WithdrawModal.tsx │ │ └── WithdrawModalContent.tsx │ │ └── utils.ts ├── createEmotionCache.ts ├── helpers │ ├── text-center-ellipsis.ts │ ├── timeHelper.tsx │ ├── toggle-local-storage-click.ts │ ├── types.ts │ └── useTransactionHandler.tsx ├── hooks │ ├── app-data-provider │ │ ├── BackgroundDataProvider.tsx │ │ ├── graphql │ │ │ ├── hooks.tsx │ │ │ ├── incentives-data.graphql │ │ │ ├── protocol-data.graphql │ │ │ ├── user-data.graphql │ │ │ └── user-incentives-data.graphql │ │ ├── useAppDataProvider.tsx │ │ ├── useIncentiveData.tsx │ │ ├── useIncentiveDataCached.tsx │ │ ├── useIncentiveDataRPC.tsx │ │ ├── usePoolData.tsx │ │ ├── usePoolDataCached.tsx │ │ ├── usePoolDataRPC.tsx │ │ └── useWalletBalances.tsx │ ├── governance-data-provider │ │ ├── AaveTokensDataProvider.tsx │ │ ├── GovernanceDataProvider.tsx │ │ ├── _useGovernanceDataRPC.tsx │ │ └── useVotingPower.tsx │ ├── stake-data-provider │ │ ├── StakeDataProvider.tsx │ │ ├── _useStakeDataRPC.tsx │ │ └── graphql │ │ │ ├── hooks.tsx │ │ │ ├── stake-general-ui-data.graphql │ │ │ └── stake-user-ui-data.graphql │ ├── useConnectionStatusContext.tsx │ ├── useCurrentTimestamp.tsx │ ├── useGasStation.tsx │ ├── useGetGasPrices.tsx │ ├── useModal.tsx │ ├── usePermissions.tsx │ ├── usePolling.tsx │ ├── useProtocolDataContext.tsx │ ├── useReservesHistory.tsx │ ├── useStakeTxBuilder.tsx │ ├── useSwap.ts │ ├── useTxBuilder.tsx │ └── useWalletModal.tsx ├── layouts │ ├── AppGlobalStyles.tsx │ ├── AppHeader.tsx │ ├── MainLayout.tsx │ ├── MobileMenu.tsx │ ├── MoreMenu.tsx │ ├── SettingsMenu.tsx │ ├── WalletWidget.tsx │ └── components │ │ ├── DarkModeSwitcher.tsx │ │ ├── DrawerWrapper.tsx │ │ ├── LanguageSwitcher.tsx │ │ ├── MobileCloseButton.tsx │ │ ├── NavItems.tsx │ │ └── TestNetModeSwitcher.tsx ├── libs │ ├── LanguageProvider.tsx │ ├── hooks │ │ ├── use-get-ens.tsx │ │ └── useWeb3Context.tsx │ └── web3-data-provider │ │ ├── WalletOptions.ts │ │ └── Web3Provider.tsx ├── locales │ ├── de │ │ └── messages.po │ ├── el │ │ ├── messages.js │ │ └── messages.po │ ├── en │ │ ├── messages.js │ │ └── messages.po │ ├── es │ │ ├── messages.js │ │ └── messages.po │ └── fr │ │ ├── messages.js │ │ └── messages.po ├── modules │ ├── dashboard │ │ ├── DashboardContentNoData.tsx │ │ ├── DashboardContentWrapper.tsx │ │ ├── DashboardEModeButton.tsx │ │ ├── DashboardListTopPanel.tsx │ │ ├── DashboardTopPanel.tsx │ │ ├── LiquidationRiskParametresModal │ │ │ ├── LiquidationRiskParametresModal.tsx │ │ │ └── components │ │ │ │ ├── HFContent.tsx │ │ │ │ ├── InfoWrapper.tsx │ │ │ │ └── LTVContent.tsx │ │ └── lists │ │ │ ├── BorrowAssetsList │ │ │ ├── BorrowAssetsList.tsx │ │ │ ├── BorrowAssetsListItem.tsx │ │ │ ├── BorrowAssetsListMobileItem.tsx │ │ │ └── types.ts │ │ │ ├── BorrowedPositionsList │ │ │ ├── BorrowedPositionsList.tsx │ │ │ ├── BorrowedPositionsListItem.tsx │ │ │ ├── BorrowedPositionsListMobileItem.tsx │ │ │ └── types.ts │ │ │ ├── ListAPRColumn.tsx │ │ │ ├── ListBottomText.tsx │ │ │ ├── ListButtonsColumn.tsx │ │ │ ├── ListHeader.tsx │ │ │ ├── ListItemAPYButton.tsx │ │ │ ├── ListItemCanBeCollateral.tsx │ │ │ ├── ListItemIsolationBadge.tsx │ │ │ ├── ListItemLoader.tsx │ │ │ ├── ListItemUsedAsCollateral.tsx │ │ │ ├── ListItemWrapper.tsx │ │ │ ├── ListLoader.tsx │ │ │ ├── ListMobileItemWrapper.tsx │ │ │ ├── ListTopInfoItem.tsx │ │ │ ├── ListValueColumn.tsx │ │ │ ├── ListValueRow.tsx │ │ │ ├── MobileListItemLoader.tsx │ │ │ ├── SuppliedPositionsList │ │ │ ├── SuppliedPositionsList.tsx │ │ │ ├── SuppliedPositionsListItem.tsx │ │ │ └── SuppliedPositionsListMobileItem.tsx │ │ │ └── SupplyAssetsList │ │ │ ├── SupplyAssetsList.tsx │ │ │ ├── SupplyAssetsListItem.tsx │ │ │ ├── SupplyAssetsListMobileItem.tsx │ │ │ └── types.ts │ ├── faucet │ │ ├── FaucetAssetsList.tsx │ │ ├── FaucetItemLoader.tsx │ │ ├── FaucetMobileItemLoader.tsx │ │ └── FaucetTopPanel.tsx │ ├── governance │ │ ├── FormattedProposalTime.tsx │ │ ├── GovernanceTopPanel.tsx │ │ ├── ProposalListItem.tsx │ │ ├── ProposalsList.tsx │ │ ├── StateBadge.tsx │ │ ├── VoteBar.tsx │ │ ├── VotingPowerInfoPanel.tsx │ │ ├── proposal │ │ │ ├── ProposalTopPanel.tsx │ │ │ └── VoteInfo.tsx │ │ └── utils │ │ │ ├── formatProposal.ts │ │ │ ├── getProposalMetadata.ts │ │ │ ├── getVotes.ts │ │ │ ├── governanceProvider.tsx │ │ │ └── immutableStates.ts │ ├── markets │ │ ├── AssetsList.tsx │ │ ├── AssetsListItem.tsx │ │ ├── AssetsListItemLoader.tsx │ │ ├── AssetsListMobileItem.tsx │ │ ├── AssetsListMobileItemLoader.tsx │ │ └── MarketsTopPanel.tsx │ ├── reserve-overview │ │ ├── AddTokenDropdown.tsx │ │ ├── ApyChart.tsx │ │ ├── ChartLegend.tsx │ │ ├── InterestRateModelChart.tsx │ │ ├── ReserveActions.tsx │ │ ├── ReserveConfiguration.tsx │ │ ├── ReserveFactorOverview.tsx │ │ ├── ReserveTopDetails.tsx │ │ └── TokenLinkDropdown.tsx │ └── staking │ │ ├── GetABPToken.tsx │ │ ├── GetABPTokenModal.tsx │ │ ├── StakeActionBox.tsx │ │ ├── StakingHeader.tsx │ │ └── StakingPanel.tsx ├── providers │ ├── StakeTxBuilderProvider.tsx │ └── TxBuilderProvider.tsx ├── static-build │ ├── ipfs.ts │ ├── ipfsFiles.json │ ├── populateCache.ts │ ├── proposal.ts │ ├── proposals.json │ ├── vote.ts │ └── votes.json ├── ui-config │ ├── errorMapping.tsx │ ├── governanceConfig.ts │ ├── marketsConfig.tsx │ ├── menu-items │ │ └── index.tsx │ ├── networksConfig.ts │ ├── permitConfig.ts │ ├── reservePatches.ts │ └── stakeConfig.ts ├── uiConfig.ts └── utils │ ├── apolloClient.ts │ ├── eMode.ts │ ├── getMaxAmountAvailableToBorrow.ts │ ├── getMaxAmountAvailableToSupply.ts │ ├── hfUtils.ts │ ├── marketsAndNetworksConfig.ts │ ├── theme.tsx │ └── utils.ts ├── svgo.config.js ├── tsconfig.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["next/babel"], 3 | "plugins": ["macros", "@babel/plugin-proposal-class-properties"] 4 | } 5 | -------------------------------------------------------------------------------- /.env.development: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_ENV=prod -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | URL=http://localhost:3000 2 | TENDERLY_KEY= 3 | TENDERLY_ACCOUNT= 4 | TENDERLY_PROJECT= 5 | NEXT_PUBLIC_ENV=prod 6 | NEXT_PUBLIC_ENABLE_GOVERNANCE=true 7 | NEXT_PUBLIC_ENABLE_STAKING=true -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | scripts/ -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'next/core-web-vitals', 4 | 'prettier', 5 | 'plugin:import/recommended', 6 | 'plugin:import/typescript', 7 | 'plugin:@typescript-eslint/recommended', 8 | ], 9 | plugins: ['prettier', 'import', /* 'simple-import-sort', */ '@typescript-eslint'], 10 | rules: { 11 | '@typescript-eslint/no-empty-interface': 'off', 12 | '@typescript-eslint/no-explicit-any': 'error', 13 | 'prettier/prettier': 'warn', 14 | 'react-hooks/rules-of-hooks': 'error', 15 | 'react-hooks/exhaustive-deps': 'warn', 16 | // 'simple-import-sort/imports': 'error', 17 | // 'simple-import-sort/exports': 'warn', 18 | 'import/first': 'error', 19 | 'import/newline-after-import': 'error', 20 | 'import/no-duplicates': 'error', 21 | 'import/no-named-as-default': 'error', 22 | 'import/no-unresolved': 'warn', 23 | // disabled as with the static export Image does not make to much sense 24 | '@next/next/no-img-element': 'off', 25 | 'react/self-closing-comp': 'warn', 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # generated files 2 | scripts/populate-cache.js linguist-vendored 3 | src/locales/*.js linguist-vendored 4 | src/static-build/*.json linguist-vendored -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report---.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Bug report \U0001F41B" 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is, including the exact market(e.g. polygon v3) on which it was observed. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request---.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Feature request \U0001F47B" 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/actions/fork-result-comment/action.yml: -------------------------------------------------------------------------------- 1 | name: Comment on CI results 2 | description: Comment on CI results 3 | inputs: 4 | PULL_REQUEST_NUMBER: 5 | description: Pull request id 6 | required: false 7 | default: "0" 8 | COMMENT_BODY: 9 | description: Text of the comment 10 | required: true 11 | runs: 12 | using: "composite" 13 | steps: 14 | - name: Find Comment 15 | uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d # v2.0.0 16 | id: fc 17 | with: 18 | issue-number: '${{ inputs.PULL_REQUEST_NUMBER }}' 19 | body-includes: 'runs/${{ github.run_id }}' 20 | 21 | - name: Update Comment 22 | uses: peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32 # v2.0.0 23 | with: 24 | issue-number: '${{ inputs.PULL_REQUEST_NUMBER }}' 25 | body: '${{ inputs.COMMENT_BODY }}' 26 | comment-id: ${{ steps.fc.outputs.comment-id }} 27 | edit-mode: replace 28 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'npm' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'weekly' 12 | open-pull-requests-limit: 10 13 | - package-ecosystem: 'github-actions' 14 | directory: '/' 15 | schedule: 16 | # Check for updates to GitHub Actions every weekday 17 | interval: 'weekly' 18 | -------------------------------------------------------------------------------- /.github/release-template.md: -------------------------------------------------------------------------------- 1 | ### Links to the latest release 2 | 3 | https://app.aave.com/ 4 | https://.ipfs.cf-ipfs.com/ 5 | https://.ipfs.dweb.link/ 6 | https://.ipfs.infura-ipfs.io/ 7 | -------------------------------------------------------------------------------- /.github/workflows/build-fork.yml: -------------------------------------------------------------------------------- 1 | name: Build PR From Fork 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.head_ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | pull_request: 9 | branches: ["main"] 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | if: | # check if PR opened from fork 15 | github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name || contains(github.head_ref, 'dependabot') 16 | steps: 17 | - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 18 | with: 19 | persist-credentials: false 20 | 21 | - name: Build App 22 | uses: ./.github/actions/build 23 | with: 24 | NEXT_PUBLIC_ENV: "prod" 25 | 26 | - name: Upload artifacts 27 | uses: ./.github/actions/upload-artifacts 28 | -------------------------------------------------------------------------------- /.github/workflows/crowdin-upload.yml: -------------------------------------------------------------------------------- 1 | name: Upload Crowdin files 2 | 3 | # on any push to main, we upload the translations to be translated 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | upload-to-crowdin: 11 | name: Upload sources to Crowdin 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 17 | 18 | - uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 19 | with: 20 | node-version-file: '.nvmrc' 21 | cache: 'yarn' 22 | 23 | - name: Synchronize 24 | uses: crowdin/github-action@9237b4cb361788dfce63feb2e2f15c09e2fe7415 # v1.4.7 25 | with: 26 | upload_sources: true 27 | download_translations: false 28 | config: 'crowdin.yml' 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} 31 | CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }} 32 | -------------------------------------------------------------------------------- /.github/workflows/i18n-check.yml: -------------------------------------------------------------------------------- 1 | name: i18n Check 2 | 3 | concurrency: 4 | group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} 5 | cancel-in-progress: true 6 | 7 | on: 8 | pull_request: 9 | branches: ["main"] 10 | push: 11 | branches: ["main"] 12 | 13 | jobs: 14 | i18n-check: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 18 | 19 | - name: i18n compile 20 | uses: ./.github/actions/build 21 | with: 22 | YARN_COMMAND: i18n 23 | USE_NEXT_CACHE: 'false' 24 | 25 | - name: check diff 26 | run: | 27 | if [[ -z $(git status -s) ]] 28 | then 29 | echo "i18n up to date" 30 | else 31 | echo "please run yarn i18n" 32 | exit 1 33 | exit 34 | fi 35 | -------------------------------------------------------------------------------- /.github/workflows/update-cache.yml: -------------------------------------------------------------------------------- 1 | name: Update build cache 2 | # This action checks if there's new proposal data every 12h 3 | # If new proposal data is found the cache will be warmed up & a new build will be generated 4 | concurrency: 5 | group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} 6 | cancel-in-progress: true 7 | 8 | on: 9 | workflow_dispatch: 10 | schedule: 11 | - cron: 0 */3 * * * 12 | 13 | jobs: 14 | cache-refresh: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0 18 | with: 19 | token: ${{ secrets.BOT_TOKEN }} 20 | 21 | - name: Update cache 22 | uses: ./.github/actions/build 23 | with: 24 | YARN_COMMAND: 'cache:update' 25 | 26 | - name: check diff 27 | run: | 28 | if [[ -z $(git status -s) ]] 29 | then 30 | echo "tree is clean" 31 | else 32 | git config --global user.name 'Cache bot' 33 | git config --global user.email 'cache-bot@aave.com' 34 | git commit -am "chore: automated cache update [skip cypress]" 35 | git push 36 | exit 37 | fi 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | cypress/screenshots 11 | cypress/videos 12 | 13 | # next.js 14 | /.next/ 15 | /out/ 16 | 17 | # production 18 | /build 19 | 20 | # misc 21 | .DS_Store 22 | *.pem 23 | 24 | # debug 25 | npm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # local env files 30 | .env.local 31 | .env.development.local 32 | .env.test.local 33 | .env.production.local 34 | 35 | # vercel 36 | .vercel 37 | 38 | .out 39 | 40 | # ignore package lock due the mandatory usage of yarn 41 | package-lock.json 42 | 43 | .eslintcache 44 | 45 | # IDE specific 46 | .idea 47 | .vscode 48 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "${1}" 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | yarn i18n -------------------------------------------------------------------------------- /.linguirc: -------------------------------------------------------------------------------- 1 | { 2 | "locales": [ 3 | "en", 4 | "es", 5 | "fr", 6 | "el" 7 | ], 8 | "catalogs": [ 9 | { 10 | "path": "src/locales/{locale}/messages", 11 | "include": [ 12 | "src", 13 | "pages" 14 | ] 15 | } 16 | ], 17 | "format": "po", 18 | "formatOptions": { 19 | "origins": true, 20 | "lineNumbers": false 21 | }, 22 | "orderBy": "messageId", 23 | "sourceLocale": "en", 24 | "fallbackLocales": { 25 | "default": "en" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "semi": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // See https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional 3 | extends: ['@commitlint/config-conventional'], 4 | }; 5 | -------------------------------------------------------------------------------- /custom.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*/locales/en/messages.js'; 2 | 3 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 4 | namespace NodeJS { 5 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 6 | interface ProcessEnv { 7 | CACHE_PATH: string; 8 | NEXT_PUBLIC_ENABLE_GOVERNANCE: string; 9 | NEXT_PUBLIC_ENABLE_STAKING: string; 10 | NEXT_PUBLIC_ENV: string; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "supportFile": "cypress/support/index.ts", 3 | "viewportWidth": 1200, 4 | "viewportHeight": 800, 5 | "defaultCommandTimeout": 40000, 6 | "pageLoadTimeout": 120000, 7 | "video": true, 8 | "watchForFileChanges": false, 9 | "scrollBehavior": "center", 10 | "retries": { 11 | "runMode": 1, 12 | "openMode": 0 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cypress/README.md: -------------------------------------------------------------------------------- 1 | # AAVE e2e testing 2 | based on cypress(8.5.0) with `cypress-repeat` and tenderly 3 | 4 | ###Development mode 5 | there is command for development/debuging/local executing tests: 6 | - `yarn run test:open` - it's open visual window with all test and manual executing 7 | 8 | *steps:* 9 | 1. install dependencies `yarn` 10 | 2. add .env.local file to the root folder with: 11 | ``` 12 | TENDERLY_KEY= 13 | TENDERLY_ACCOUNT=Aave 14 | TENDERLY_PROJECT=QA 15 | ``` 16 | `cp .env.example .env` - execute before spining up environment if you want to check Stake / Governance pages. 17 | 18 | 19 | 3. run `yarn run test:open` 20 | 21 | ###CI mode 22 | there are 2 types of suites: 23 | - `yarn run test:${marketName}-${marketVersion}-smoke` - executing only main specs, using for brunch pr 24 | - `yarn run test:${marketName}-${marketVersion}-full` - executing all specs, using for before live deployment 25 | 26 | P.C. for execute those commands locally need to: 27 | 1. install dependencies `yarn` 28 | 2. add .env.local file to the root folder with: 29 | ``` 30 | TENDERLY_KEY= 31 | TENDERLY_ACCOUNT=Aave 32 | TENDERLY_PROJECT=QA 33 | ``` 34 | 3. add to beginning of command `DOTENV_CONFIG_PATH='.env.local'` 35 | 4. run command -------------------------------------------------------------------------------- /cypress/configs/base.cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "viewportWidth": 1200, 3 | "viewportHeight": 800, 4 | "defaultCommandTimeout": 40000, 5 | "pageLoadTimeout": 120000, 6 | "video": false, 7 | "watchForFileChanges": false, 8 | "scrollBehavior": "center", 9 | "retries": { 10 | "runMode": 2, 11 | "openMode": 0 12 | } 13 | } -------------------------------------------------------------------------------- /cypress/configs/settings.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/2-settings", 3 | "testFiles": [ 4 | "*.*" 5 | ], 6 | "viewportWidth": 1200, 7 | "viewportHeight": 800, 8 | "defaultCommandTimeout": 40000, 9 | "pageLoadTimeout": 120000, 10 | "video": false, 11 | "scrollBehavior": "center", 12 | "retries": { 13 | "runMode": 1, 14 | "openMode": 0 15 | } 16 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/amm-v2-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/1-amm-v2-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "eth.amm-v2.spec.ts", 8 | "usdt.amm-v2.spec.ts" 9 | ], 10 | "viewportWidth": 1200, 11 | "viewportHeight": 800, 12 | "defaultCommandTimeout": 40000, 13 | "pageLoadTimeout": 120000, 14 | "video": false, 15 | "scrollBehavior": "center", 16 | "retries": { 17 | "runMode": 1, 18 | "openMode": 0 19 | } 20 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/amm-v2-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/1-amm-v2-market", 3 | "testFiles": [ 4 | "0-assets/eth.amm-v2.spec.ts", 5 | "0-assets/usdt.amm-v2.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/arc-v2-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/4-arc-v2-market", 3 | "testFiles": [ 4 | "accessibility.arc-v2.spec.ts" 5 | ], 6 | "viewportWidth": 1200, 7 | "viewportHeight": 800, 8 | "defaultCommandTimeout": 40000, 9 | "pageLoadTimeout": 120000, 10 | "video": false, 11 | "scrollBehavior": "center", 12 | "retries": { 13 | "runMode": 1, 14 | "openMode": 0 15 | } 16 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/avalanche-v2-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/3-avalanche-v2-market", 3 | "testFiles": [ 4 | "swap.avalanche-v2.spec.ts" 5 | ], 6 | "viewportWidth": 1200, 7 | "viewportHeight": 800, 8 | "defaultCommandTimeout": 40000, 9 | "pageLoadTimeout": 120000, 10 | "video": false, 11 | "scrollBehavior": "center", 12 | "retries": { 13 | "runMode": 1, 14 | "openMode": 0 15 | } 16 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/avalanche-v2-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/3-avalanche-v2-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "avax.avalanche-v2.spec.ts", 8 | "usdt.avalanche-v2.spec.ts", 9 | "reward.avalanche-v2.spec.ts", 10 | "swap.avalanche-v2.spec.ts" 11 | ], 12 | "viewportWidth": 1200, 13 | "viewportHeight": 800, 14 | "defaultCommandTimeout": 40000, 15 | "pageLoadTimeout": 120000, 16 | "video": false, 17 | "scrollBehavior": "center", 18 | "retries": { 19 | "runMode": 1, 20 | "openMode": 0 21 | } 22 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/avalanche-v2-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/3-avalanche-v2-market", 3 | "testFiles": [ 4 | "0-assets/avax.avalanche-v2.spec.ts", 5 | "0-assets/usdt.avalanche-v2.spec.ts", 6 | "reward.avalanche-v2.spec.ts" 7 | ], 8 | "viewportWidth": 1200, 9 | "viewportHeight": 800, 10 | "defaultCommandTimeout": 40000, 11 | "pageLoadTimeout": 120000, 12 | "video": false, 13 | "scrollBehavior": "center", 14 | "retries": { 15 | "runMode": 1, 16 | "openMode": 0 17 | } 18 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/0-main-v2-market", 3 | "testFiles": [ 4 | "swap.aave-v2.spec.ts", 5 | "stake.aave-v2.spec.ts", 6 | "reward.aave-v2.spec.ts", 7 | "critical-conditions.aave-v2.spec.ts" 8 | ], 9 | "viewportWidth": 1200, 10 | "viewportHeight": 800, 11 | "defaultCommandTimeout": 40000, 12 | "pageLoadTimeout": 120000, 13 | "video": false, 14 | "scrollBehavior": "center", 15 | "retries": { 16 | "runMode": 1, 17 | "openMode": 0 18 | } 19 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/0-main-v2-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "eth.aave-v2.spec.ts", 8 | "dai.aave-v2.spec.ts", 9 | "swap.aave-v2.spec.ts", 10 | "stake.aave-v2.spec.ts", 11 | "reward.aave-v2.spec.ts", 12 | "critical-conditions.aave-v2.spec.ts" 13 | ], 14 | "viewportWidth": 1200, 15 | "viewportHeight": 800, 16 | "defaultCommandTimeout": 40000, 17 | "pageLoadTimeout": 120000, 18 | "video": false, 19 | "scrollBehavior": "center", 20 | "retries": { 21 | "runMode": 1, 22 | "openMode": 0 23 | } 24 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/ethereum-v2-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/0-main-v2-market", 3 | "testFiles": [ 4 | "0-assets/eth.aave-v2.spec.ts", 5 | "0-assets/dai.aave-v2.spec.ts", 6 | "reward.aave-v2.spec.ts" 7 | ], 8 | "viewportWidth": 1200, 9 | "viewportHeight": 800, 10 | "defaultCommandTimeout": 40000, 11 | "pageLoadTimeout": 120000, 12 | "video": false, 13 | "scrollBehavior": "center", 14 | "retries": { 15 | "runMode": 1, 16 | "openMode": 0 17 | } 18 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/polygon-v2-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/2-polygon-v2-market", 3 | "testFiles": [ 4 | "swap.polygon-v2.spec.ts" 5 | ], 6 | "viewportWidth": 1200, 7 | "viewportHeight": 800, 8 | "defaultCommandTimeout": 40000, 9 | "pageLoadTimeout": 120000, 10 | "video": false, 11 | "scrollBehavior": "center", 12 | "retries": { 13 | "runMode": 1, 14 | "openMode": 0 15 | } 16 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/polygon-v2-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/2-polygon-v2-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "matic.polygon-v2.spec.ts", 8 | "usdt.polygon-v2.spec.ts", 9 | "swap.polygon-v2.spec.ts" 10 | ], 11 | "viewportWidth": 1200, 12 | "viewportHeight": 800, 13 | "defaultCommandTimeout": 40000, 14 | "pageLoadTimeout": 120000, 15 | "video": false, 16 | "scrollBehavior": "center", 17 | "retries": { 18 | "runMode": 1, 19 | "openMode": 0 20 | } 21 | } -------------------------------------------------------------------------------- /cypress/configs/v2-markets/polygon-v2-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/0-v2-markets/2-polygon-v2-market", 3 | "testFiles": [ 4 | "0-assets/matic.polygon-v2.spec.ts", 5 | "0-assets/usdt.polygon-v2.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/1-arbitrum-v3-market", 3 | "testFiles": [ 4 | "e-mode.arbitrum-v3.spec.ts", 5 | "critical-conditions.arbitrum-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/1-arbitrum-v3-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "eth.arbitrum-v3.spec.ts", 8 | "usdt.arbitrum-v3.spec.ts", 9 | "e-mode.arbitrum-v3.spec.ts", 10 | "critical-conditions.arbitrum-v3.spec.ts" 11 | ], 12 | "viewportWidth": 1200, 13 | "viewportHeight": 800, 14 | "defaultCommandTimeout": 40000, 15 | "pageLoadTimeout": 120000, 16 | "video": false, 17 | "scrollBehavior": "center", 18 | "retries": { 19 | "runMode": 1, 20 | "openMode": 0 21 | } 22 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/arbitrum-v3-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/1-arbitrum-v3-market", 3 | "testFiles": [ 4 | "0-assets/eth.arbitrum-v3.spec.ts", 5 | "0-assets/usdt.arbitrum-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 60000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/2-avalanche-v3-market", 3 | "testFiles": [ 4 | "swap.avalanche-v3.spec.ts", 5 | "e-mode.avalanche-v3.spec.ts", 6 | "isolated-mode.avalanche-v3.spec.ts" 7 | ], 8 | "viewportWidth": 1200, 9 | "viewportHeight": 800, 10 | "defaultCommandTimeout": 40000, 11 | "pageLoadTimeout": 120000, 12 | "video": false, 13 | "scrollBehavior": "center", 14 | "retries": { 15 | "runMode": 1, 16 | "openMode": 0 17 | } 18 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/2-avalanche-v3-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "avax.avalanche-v3.spec.ts", 8 | "dai.avalanche-v3.spec.ts", 9 | "swap.avalanche-v2.spec.ts", 10 | "e-mode.avalanche-v3.spec.ts", 11 | "isolated-mode.avalanche-v3.spec.ts" 12 | ], 13 | "viewportWidth": 1200, 14 | "viewportHeight": 800, 15 | "defaultCommandTimeout": 40000, 16 | "pageLoadTimeout": 120000, 17 | "video": false, 18 | "scrollBehavior": "center", 19 | "retries": { 20 | "runMode": 1, 21 | "openMode": 0 22 | } 23 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/avalanche-v3-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/2-avalanche-v3-market", 3 | "testFiles": [ 4 | "0-assets/avax.avalanche-v3.spec.ts", 5 | "0-assets/dai.avalanche-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/fantom-v3-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/5-fantom-v3-market", 3 | "testFiles": [ 4 | "swap.fantom-v3.spec.ts", 5 | "e-mode.fantom-v3.spec.ts", 6 | "isolated-mode.fantom-v3.spec.ts" 7 | ], 8 | "viewportWidth": 1200, 9 | "viewportHeight": 800, 10 | "defaultCommandTimeout": 40000, 11 | "pageLoadTimeout": 120000, 12 | "video": false, 13 | "scrollBehavior": "center", 14 | "retries": { 15 | "runMode": 1, 16 | "openMode": 0 17 | } 18 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/fantom-v3-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/5-fantom-v3-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "ftm.fantom-v3.spec.ts", 8 | "usdt.fantom-v3.spec.ts", 9 | "swap.fantom-v3.spec.ts", 10 | "e-mode.fantom-v3.spec.ts", 11 | "isolated-mode.fantom-v3.spec.ts" 12 | ], 13 | "viewportWidth": 1200, 14 | "viewportHeight": 800, 15 | "defaultCommandTimeout": 40000, 16 | "pageLoadTimeout": 120000, 17 | "video": false, 18 | "scrollBehavior": "center", 19 | "retries": { 20 | "runMode": 1, 21 | "openMode": 0 22 | } 23 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/fantom-v3-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/5-fantom-v3-market", 3 | "testFiles": [ 4 | "0-assets/ftm.fantom-v3.spec.ts", 5 | "0-assets/usdt.fantom-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/4-optimism-v3-market", 3 | "testFiles": [ 4 | "critical-conditions.optimism-v3.spec.ts", 5 | "e-mode.optimism-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/4-optimism-v3-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "0-assets/eth.optimism-v3.spec.ts", 8 | "0-assets/usdt.optimism-v3.spec.ts", 9 | "critical-conditions.optimism-v3.spec.ts", 10 | "e-mode.optimism-v3.spec.ts" 11 | ], 12 | "viewportWidth": 1200, 13 | "viewportHeight": 800, 14 | "defaultCommandTimeout": 40000, 15 | "pageLoadTimeout": 120000, 16 | "video": false, 17 | "scrollBehavior": "center", 18 | "retries": { 19 | "runMode": 1, 20 | "openMode": 0 21 | } 22 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/optimism-v3-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/4-optimism-v3-market", 3 | "testFiles": [ 4 | "0-assets/eth.optimism-v3.spec.ts", 5 | "0-assets/usdt.optimism-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-additional.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/3-polygon-v3-market", 3 | "testFiles": [ 4 | "swap.polygon-v3.spec.ts", 5 | "e-mode.polygon-v3.spec.ts", 6 | "isolated-mode.polygon-v3.spec.ts" 7 | ], 8 | "viewportWidth": 1200, 9 | "viewportHeight": 800, 10 | "defaultCommandTimeout": 40000, 11 | "pageLoadTimeout": 120000, 12 | "video": false, 13 | "scrollBehavior": "center", 14 | "retries": { 15 | "runMode": 1, 16 | "openMode": 0 17 | } 18 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-full.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/3-polygon-v3-market", 3 | "testFiles": [ 4 | "**/*.*" 5 | ], 6 | "ignoreTestFiles": [ 7 | "matic.polygon-v3.spec.ts", 8 | "eurs.polygon-v3.spec.ts", 9 | "swap.polygon-v3.spec.ts", 10 | "e-mode.polygon-v3.spec.ts", 11 | "isolated-mode.polygon-v3.spec.ts" 12 | ], 13 | "viewportWidth": 1200, 14 | "viewportHeight": 800, 15 | "defaultCommandTimeout": 40000, 16 | "pageLoadTimeout": 120000, 17 | "video": false, 18 | "scrollBehavior": "center", 19 | "retries": { 20 | "runMode": 1, 21 | "openMode": 0 22 | } 23 | } -------------------------------------------------------------------------------- /cypress/configs/v3-markets/polygon-v3-smoke.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "cypress/integration/1-v3-markets/3-polygon-v3-market", 3 | "testFiles": [ 4 | "0-assets/matic.polygon-v3.spec.ts", 5 | "0-assets/eurs.polygon-v3.spec.ts" 6 | ], 7 | "viewportWidth": 1200, 8 | "viewportHeight": 800, 9 | "defaultCommandTimeout": 40000, 10 | "pageLoadTimeout": 120000, 11 | "video": false, 12 | "scrollBehavior": "center", 13 | "retries": { 14 | "runMode": 1, 15 | "openMode": 0 16 | } 17 | } -------------------------------------------------------------------------------- /cypress/fixtures/constans.json: -------------------------------------------------------------------------------- 1 | { 2 | "repayType":{ 3 | "collateral": "collateral", 4 | "wallet": "wallet", 5 | "default": "default" 6 | }, 7 | "dashboardTypes": { 8 | "deposit": "deposit", 9 | "borrow": "borrow" 10 | }, 11 | "collateralType": { 12 | "isCollateral": "Yes", 13 | "isNotCollateral": "No" 14 | }, 15 | "borrowAPYType": { 16 | "variable": "Variable", 17 | "stable": "Stable", 18 | "default": "Default" 19 | }, 20 | "actionTypes": { 21 | "supply": "Supply", 22 | "borrow": "Borrow", 23 | "repay": "Repay", 24 | "withdraw": "Withdraw", 25 | "switchApy": "Switch rate" 26 | }, 27 | "apyType": { 28 | "stable": "Stable", 29 | "variable": "Variable" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /cypress/fixtures/poolConfig.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "bool", 6 | "name": "paused", 7 | "type": "bool" 8 | } 9 | ], 10 | "name": "setPoolPause", 11 | "outputs": [], 12 | "stateMutability": "nonpayable", 13 | "type": "function" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /cypress/integration/0-v2-markets/0-main-v2-market/reward.aave-v2.spec.ts: -------------------------------------------------------------------------------- 1 | import { skipState } from '../../../support/steps/common'; 2 | import { configEnvWithTenderlyMainnetFork } from '../../../support/steps/configuration.steps'; 3 | import { claimReward, supply, withdraw } from '../../../support/steps/main.steps'; 4 | import { rewardIsNotAvailable } from '../../../support/steps/verification.steps'; 5 | import assets from '../../../fixtures/assets.json'; 6 | 7 | const testData = { 8 | deposit: { 9 | asset: assets.aaveMarket.ETH, 10 | amount: 1000, 11 | hasApproval: true, 12 | }, 13 | withdraw: { 14 | asset: assets.aaveMarket.ETH, 15 | isCollateral: true, 16 | amount: 2000, 17 | hasApproval: false, 18 | }, 19 | claimReward: { 20 | asset: assets.aaveMarket.stkAAVE, 21 | }, 22 | }; 23 | 24 | // TODO: Add back after incentives merged fix 25 | describe.skip('REWARD, AAVE V2 MARKET, INTEGRATION SPEC', () => { 26 | const skipTestState = skipState(false); 27 | configEnvWithTenderlyMainnetFork({}); 28 | 29 | supply(testData.deposit, skipTestState, true); 30 | claimReward(testData.claimReward, skipTestState, true); 31 | withdraw(testData.withdraw, skipTestState, true); 32 | claimReward(testData.claimReward, skipTestState, true); 33 | rewardIsNotAvailable(skipTestState); 34 | }); 35 | -------------------------------------------------------------------------------- /cypress/integration/0-v2-markets/3-avalanche-v2-market/reward.avalanche-v2.spec.ts: -------------------------------------------------------------------------------- 1 | import { skipState } from '../../../support/steps/common'; 2 | import { configEnvWithTenderlyAvalancheFork } from '../../../support/steps/configuration.steps'; 3 | import { claimReward, supply, withdraw } from '../../../support/steps/main.steps'; 4 | import { rewardIsNotAvailable } from '../../../support/steps/verification.steps'; 5 | import assets from '../../../fixtures/assets.json'; 6 | 7 | const testData = { 8 | deposit: { 9 | asset: assets.avalancheMarket.AVAX, 10 | amount: 1000, 11 | hasApproval: true, 12 | }, 13 | withdraw: { 14 | asset: assets.avalancheMarket.AVAX, 15 | isCollateral: true, 16 | amount: 2000, 17 | hasApproval: false, 18 | }, 19 | claimReward: { 20 | asset: assets.avalancheMarket.WAVAX, 21 | }, 22 | }; 23 | 24 | describe.skip('REWARD, AVALANCHE V2 MARKET, INTEGRATION SPEC', () => { 25 | const skipTestState = skipState(false); 26 | configEnvWithTenderlyAvalancheFork({}); 27 | 28 | supply(testData.deposit, skipTestState, true); 29 | claimReward(testData.claimReward, skipTestState, true); 30 | withdraw(testData.withdraw, skipTestState, true); 31 | claimReward(testData.claimReward, skipTestState, true); 32 | rewardIsNotAvailable(skipTestState); 33 | }); 34 | -------------------------------------------------------------------------------- /cypress/integration/1-v3-markets/2-avalanche-v3-market/reward.avalanche-v3.spec.ts: -------------------------------------------------------------------------------- 1 | import { skipState } from '../../../support/steps/common'; 2 | import { configEnvWithTenderlyAvalancheFork } from '../../../support/steps/configuration.steps'; 3 | import { claimReward, supply, withdraw } from '../../../support/steps/main.steps'; 4 | import { rewardIsNotAvailable } from '../../../support/steps/verification.steps'; 5 | import assets from '../../../fixtures/assets.json'; 6 | 7 | const testData = { 8 | deposit: { 9 | asset: assets.avalancheMarket.AVAX, 10 | amount: 1000, 11 | hasApproval: true, 12 | }, 13 | withdraw: { 14 | asset: assets.avalancheMarket.AVAX, 15 | isCollateral: true, 16 | amount: 2000, 17 | hasApproval: false, 18 | }, 19 | claimReward: { 20 | asset: assets.avalancheMarket.WAVAX, 21 | }, 22 | }; 23 | 24 | describe('REWARD, AVALANCHE V3 MARKET, INTEGRATION SPEC', () => { 25 | const skipTestState = skipState(false); 26 | configEnvWithTenderlyAvalancheFork({ market: 'fork_proto_avalanche_v3', v3: true }); 27 | 28 | supply(testData.deposit, skipTestState, true); 29 | claimReward(testData.claimReward, skipTestState, true); 30 | withdraw(testData.withdraw, skipTestState, true); 31 | claimReward(testData.claimReward, skipTestState, true); 32 | rewardIsNotAvailable(skipTestState); 33 | }); 34 | -------------------------------------------------------------------------------- /cypress/integration/2-settings/stake-abpt.ts: -------------------------------------------------------------------------------- 1 | import { configEnvWithTenderlyMainnetFork } from '../../support/steps/configuration.steps'; 2 | 3 | describe('Checking ABPT token modal on Staking page', () => { 4 | describe('CASE1:Open Stake page', () => { 5 | configEnvWithTenderlyMainnetFork({}); 6 | 7 | it('step1:Open Stake page', () => { 8 | cy.get('[data-cy="menuStake"]').click(); 9 | }); 10 | }); 11 | 12 | describe('CASE2:GET ABP Token', () => { 13 | it('step2:Get ABP Token', () => { 14 | cy.contains('Stake ABPT').click(); 15 | cy.get('[data-cy="getAbp-token"]').first().click(); 16 | }); 17 | 18 | it('step3:Verify does Get ABP Token modal is opened', () => { 19 | cy.contains('Go to Balancer Pool').should( 20 | 'have.attr', 21 | 'href', 22 | 'https://pools.balancer.exchange/#/pool/0xc697051d1c6296c24ae3bcef39aca743861d9a81/' 23 | ); 24 | }); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | //const webpackPreprocessor = require('@cypress/webpack-preprocessor'); 2 | // *********************************************************** 3 | // This example plugins/index.js can be used to load plugins 4 | // 5 | // You can change the location of this file or turn off loading 6 | // the plugins file with the 'pluginsFile' configuration option. 7 | // 8 | // You can read more here: 9 | // https://on.cypress.io/plugins-guide 10 | // *********************************************************** 11 | 12 | // This function is called when a project is opened or re-opened (e.g. due to 13 | // the project's config changing) 14 | 15 | /** 16 | * @type {Cypress.PluginConfig} 17 | */ 18 | // eslint-disable-next-line no-unused-vars 19 | module.exports = (on, config) => { 20 | // `on` is used to hook into various events Cypress emits 21 | // `config` is the resolved Cypress config 22 | try { 23 | // eslint-disable-next-line @typescript-eslint/no-var-requires 24 | const configWithDotenv = require('dotenv').config({ path: process.env.DOTENV_CONFIG_PATH }); 25 | const env = { ...config.env, ...configWithDotenv.parsed }; 26 | const result = { ...config, env }; 27 | return result; 28 | } catch (e) { 29 | return config; 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /cypress/support/commands.ts: -------------------------------------------------------------------------------- 1 | import 'cypress-wait-until'; 2 | 3 | // import { ChainId } from '@aave/contract-helpers'; 4 | // import { MARKETS } from './steps/common'; 5 | // import { configEnvWithTenderly } from './steps/configuration.steps'; 6 | 7 | // https://github.com/quasarframework/quasar/issues/2233 8 | const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; 9 | Cypress.on('uncaught:exception', (err) => { 10 | /* returning false here prevents Cypress from failing the test */ 11 | if (resizeObserverLoopErrRe.test(err.message)) { 12 | return false; 13 | } 14 | }); 15 | 16 | // Cypress.Commands.add('initFork', (market, tokens = []) => { 17 | // if (!Object.keys(MARKETS).includes(market)) throw new Error(`not sure how to setup ${market}`); 18 | // if (market === MARKETS.fork_proto_mainnet) 19 | // configEnvWithTenderly({ chainId: ChainId.mainnet, market, tokens }); 20 | // if (market === MARKETS.fork_amm_mainnet) 21 | // configEnvWithTenderly({ chainId: ChainId.mainnet, market, tokens }); 22 | // if (market === MARKETS.fork_proto_avalanche) 23 | // configEnvWithTenderly({ chainId: ChainId.avalanche, market, tokens }); 24 | // if (market === MARKETS.fork_proto_matic) 25 | // configEnvWithTenderly({ chainId: ChainId.polygon, market, tokens }); 26 | // }); 27 | 28 | export {}; 29 | -------------------------------------------------------------------------------- /cypress/support/cypress.d.ts: -------------------------------------------------------------------------------- 1 | declare namespace Cypress { 2 | interface Chainable { 3 | /** 4 | * Custom command to select DOM element by data-cy attribute. 5 | * @example cy.dataCy('greeting') 6 | */ 7 | getBySel(value: string): Chainable; 8 | // initFork(market: string, tokens?: { address: string }[]): Promise; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /cypress/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | 19 | afterEach(function onAfterEach() { 20 | if ((this.currentTest as Mocha.Test).state === 'failed') { 21 | cy.setCookie('shouldSkip', 'true'); 22 | Cypress.Cookies.defaults({ 23 | preserve: 'shouldSkip', 24 | }); 25 | //set cookie to skip tests for further specs 26 | // this.skip() 27 | // Cypress.runner.stop(); 28 | //this will skip tests only for current spec 29 | } 30 | }); 31 | 32 | // Alternatively you can use CommonJS syntax: 33 | // require('./commands') 34 | -------------------------------------------------------------------------------- /cypress/support/steps/common.ts: -------------------------------------------------------------------------------- 1 | export const skipState = (initialValue = false) => { 2 | let _value = initialValue; 3 | return { 4 | set: (value: boolean) => { 5 | _value = value; 6 | }, 7 | get: () => { 8 | return _value; 9 | }, 10 | }; 11 | }; 12 | 13 | type SkipType = { 14 | set: (val: boolean) => void; 15 | get: () => boolean; 16 | }; 17 | 18 | export const skipSetup = ({ 19 | skip, 20 | updateSkipStatus, 21 | }: { 22 | skip: SkipType; 23 | updateSkipStatus: boolean; 24 | }) => { 25 | before(function () { 26 | if (skip.get()) { 27 | this.skip(); 28 | } 29 | }); 30 | 31 | afterEach(function onAfterEach() { 32 | if ((this.currentTest as Mocha.Test).state === 'failed' && updateSkipStatus) { 33 | skip.set(true); 34 | } 35 | }); 36 | }; 37 | 38 | export const MARKETS = { 39 | fork_proto_mainnet: 'fork_proto_mainnet', 40 | fork_amm_mainnet: 'fork_amm_mainnet', 41 | fork_proto_matic: 'fork_proto_matic', 42 | fork_proto_avalanche: 'fork_proto_avalanche', 43 | }; 44 | -------------------------------------------------------------------------------- /cypress/support/tools/math.util.ts: -------------------------------------------------------------------------------- 1 | export function getRoundDegree(number: number) { 2 | let _number = number; 3 | let _degree = 1; 4 | while (_number <= 1) { 5 | _degree = _degree * 10; 6 | _number = number * _degree; 7 | } 8 | return _degree; 9 | } 10 | 11 | export function randomNumber(maxValue: number) { 12 | return Math.floor(Math.random() * maxValue); 13 | } 14 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'eth-provider'; 2 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | const withBundleAnalyzer = require('@next/bundle-analyzer')({ 3 | enabled: process.env.ANALYZE === 'true', 4 | }); 5 | 6 | const pageExtensions = ['page.tsx']; 7 | if (process.env.NEXT_PUBLIC_ENABLE_GOVERNANCE === 'true') pageExtensions.push('governance.tsx'); 8 | if (process.env.NEXT_PUBLIC_ENABLE_STAKING === 'true') pageExtensions.push('staking.tsx'); 9 | 10 | /** @type {import('next').NextConfig} */ 11 | module.exports = withBundleAnalyzer({ 12 | webpack(config) { 13 | config.module.rules.push({ 14 | test: /\.svg$/i, 15 | issuer: /\.[jt]sx?$/, 16 | use: ['@svgr/webpack'], 17 | }); 18 | config.experiments = { topLevelAwait: true }; 19 | return config; 20 | }, 21 | reactStrictMode: true, 22 | // assetPrefix: "./", 23 | trailingSlash: true, 24 | pageExtensions, 25 | }); 26 | -------------------------------------------------------------------------------- /pages/faucet.page.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { FaucetModal } from 'src/components/transactions/Faucet/FaucetModal'; 3 | import { MainLayout } from 'src/layouts/MainLayout'; 4 | import FaucetAssetsList from 'src/modules/faucet/FaucetAssetsList'; 5 | import { FaucetTopPanel } from 'src/modules/faucet/FaucetTopPanel'; 6 | import { ContentContainer } from '../src/components/ContentContainer'; 7 | 8 | export default function Faucet() { 9 | return ( 10 | <> 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | } 18 | 19 | Faucet.getLayout = function getLayout(page: React.ReactElement) { 20 | return ( 21 | 22 | {page} 23 | 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /pages/markets.page.tsx: -------------------------------------------------------------------------------- 1 | import { MainLayout } from 'src/layouts/MainLayout'; 2 | import AssetsList from 'src/modules/markets/AssetsList'; 3 | import { MarketsTopPanel } from 'src/modules/markets/MarketsTopPanel'; 4 | 5 | import { ContentContainer } from '../src/components/ContentContainer'; 6 | 7 | export default function Markets() { 8 | return ( 9 | <> 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | } 17 | 18 | Markets.getLayout = function getLayout(page: React.ReactElement) { 19 | return {page}; 20 | }; 21 | -------------------------------------------------------------------------------- /public/aaveMetaLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/aaveMetaLogo.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Black.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Black.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-BlackItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-BlackItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Bold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Bold.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-BoldItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-BoldItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraBold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraBold.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraBoldItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraBoldItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraLight.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLight.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraLight.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraLightItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ExtraLightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ExtraLightItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Italic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Italic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Light.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Light.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-LightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-LightItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-LightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-LightItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Medium.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Medium.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-MediumItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-MediumItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-MediumItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Regular.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Regular.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-SemiBold.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-SemiBold.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-SemiBoldItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-SemiBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-SemiBoldItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Thin.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-Thin.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ThinItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ThinItalic.woff -------------------------------------------------------------------------------- /public/fonts/inter/Inter-ThinItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-ThinItalic.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-italic.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-italic.var.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter-roman.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter-roman.var.woff2 -------------------------------------------------------------------------------- /public/fonts/inter/Inter.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kryptoDev0777/interface/42bcba44cb32ba8707dfb28790884d6d252336b8/public/fonts/inter/Inter.var.woff2 -------------------------------------------------------------------------------- /public/icons/bridge/avalanche.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/bridge/harmony.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/bridge/polygon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/discord.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/cn.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/el.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/en.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/fr.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/it.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/jp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/tr.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/flags/vt.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/HAL.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/HALHover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/hfEmpty.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/hfFull.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/hfLow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/healthFactor/hfMiddle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/claim-gift-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/cube-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/dollar-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/empty-heart-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/net-apy-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/pie-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/total-borrow-indicator.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/total-supply-indicator.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/uptrend-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/markets/wallet-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/networks/avalanche.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/networks/harmony.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/staking/emission-staking-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/staking/trust-staking-icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/aave.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/avax.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/bal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/bat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/btc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/busd.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/cvx.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/dai.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/eth.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/eurs.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/fei.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/knc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/lend.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/matic.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/mkr.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/pools/bpt.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/seth.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/snx.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/steth.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/stkaave.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/tribe.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/usdc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/tokens/usdt.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/wallets/frame.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/wallets/torus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/wallets/walletConnect.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/wallets/walletIcon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/icons/wallets/walletIconHover.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/lightningBoltGradient.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Aave v3", 3 | "name": "Aave v3", 4 | "description": "Non-custodial liquidity protocol", 5 | "iconPath": "aave.svg", 6 | "icons": [ 7 | { 8 | "src": "favicon32.png", 9 | "sizes": "32x32", 10 | "type": "image/png" 11 | } 12 | ], 13 | "start_url": "./index.html", 14 | "display": "standalone", 15 | "theme_color": "#000000", 16 | "background_color": "#ffffff" 17 | } 18 | -------------------------------------------------------------------------------- /src/components/BridgeButton.tsx: -------------------------------------------------------------------------------- 1 | import { ExternalLinkIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, Button, ButtonProps, SvgIcon, Typography } from '@mui/material'; 4 | 5 | import { NetworkConfig } from '../ui-config/networksConfig'; 6 | import { Link } from './primitives/Link'; 7 | 8 | interface BridgeButtonProps extends Pick, ButtonProps { 9 | withoutIcon?: boolean; 10 | } 11 | 12 | export const BridgeButton = ({ bridge, withoutIcon, ...rest }: BridgeButtonProps) => { 13 | if (!bridge) return null; 14 | 15 | return ( 16 | 34 | ); 35 | }; 36 | -------------------------------------------------------------------------------- /src/components/CircleIcon.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Typography } from '@mui/material'; 3 | import { ReactNode } from 'react'; 4 | 5 | import { DarkTooltip } from './infoTooltips/DarkTooltip'; 6 | 7 | interface CircleIconProps { 8 | downToSM: boolean; 9 | tooltipText: string; 10 | children: ReactNode; 11 | } 12 | 13 | export const CircleIcon = ({ downToSM, tooltipText, children }: CircleIconProps) => { 14 | return ( 15 | 18 | {tooltipText} 19 | 20 | } 21 | > 22 | 30 | 42 | {children} 43 | 44 | 45 | 46 | ); 47 | }; 48 | -------------------------------------------------------------------------------- /src/components/ContentContainer.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Container } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ContentContainerProps { 5 | children: ReactNode; 6 | } 7 | 8 | export const ContentContainer = ({ children }: ContentContainerProps) => { 9 | return ( 10 | 18 | {children} 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/FaucetButton.tsx: -------------------------------------------------------------------------------- 1 | import { ExternalLinkIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Button, SvgIcon, Typography } from '@mui/material'; 4 | import { useRouter } from 'next/router'; 5 | import { useProtocolDataContext } from 'src/hooks/useProtocolDataContext'; 6 | import { DarkTooltip } from './infoTooltips/DarkTooltip'; 7 | import { ROUTES } from './primitives/Link'; 8 | 9 | export const FaucetButton = () => { 10 | const { currentNetworkConfig } = useProtocolDataContext(); 11 | const router = useRouter(); 12 | 13 | return ( 14 | 15 | 23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /src/components/ReserveOverviewBox.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | import { Box, Typography } from '@mui/material'; 3 | 4 | type ReserveOverviewBoxProps = { 5 | children: ReactNode; 6 | title: ReactNode; 7 | }; 8 | 9 | export function ReserveOverviewBox({ title, children }: ReserveOverviewBoxProps) { 10 | return ( 11 | ({ 13 | borderRadius: '6px', 14 | border: `1px solid ${theme.palette.divider}`, 15 | flex: '0 32%', 16 | marginBottom: '2%', 17 | height: { md: '70px', lg: '60px' }, 18 | maxWidth: '32%', 19 | })} 20 | > 21 | 30 | 31 | {title} 32 | 33 | {children} 34 | 35 | 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /src/components/ReserveSubheader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Box from '@mui/material/Box'; 3 | import { FormattedNumber } from './primitives/FormattedNumber'; 4 | 5 | type ReserveSubheaderProps = { 6 | value: string; 7 | rightAlign?: boolean; 8 | }; 9 | 10 | export function ReserveSubheader({ value, rightAlign }: ReserveSubheaderProps) { 11 | return ( 12 | 20 | 29 | 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /src/components/WalletConnection/ConnectWalletButton.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Button } from '@mui/material'; 3 | import { useWalletModalContext } from 'src/hooks/useWalletModal'; 4 | import { WalletModal } from './WalletModal'; 5 | 6 | export const ConnectWalletButton = () => { 7 | const { setWalletModalOpen } = useWalletModalContext(); 8 | 9 | return ( 10 | <> 11 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/WalletConnection/WalletModal.tsx: -------------------------------------------------------------------------------- 1 | import { useWalletModalContext } from 'src/hooks/useWalletModal'; 2 | import { BasicModal } from '../primitives/BasicModal'; 3 | import { WalletSelector } from './WalletSelector'; 4 | 5 | export const WalletModal = () => { 6 | const { isWalletModalOpen, setWalletModalOpen } = useWalletModalContext(); 7 | 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /src/components/Warnings/CooldownWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Warning } from '../primitives/Warning'; 5 | import { Link } from '../primitives/Link'; 6 | 7 | export const CooldownWarning = () => { 8 | return ( 9 | 10 | 11 | Cooldown period warning 12 | 13 | 14 | 15 | The cooldown period is the time required prior to unstaking your tokens(10 days). You can 16 | only withdraw your assets from the Security Module after the cooldown period and within 17 | the active the unstake window. 18 | 19 | Learn more 20 | 21 | 22 | 23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /src/components/caps/helper.ts: -------------------------------------------------------------------------------- 1 | export enum CapType { 2 | 'supplyCap' = 'supplyCap', 3 | 'borrowCap' = 'borrowCap', 4 | } 5 | -------------------------------------------------------------------------------- /src/components/infoModalContents/ApprovalInfoContent.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import Typography from '@mui/material/Typography'; 3 | 4 | import { Link } from '../primitives/Link'; 5 | import { InfoContentWrapper } from './InfoContentWrapper'; 6 | 7 | export const ApprovalInfoContent = () => { 8 | return ( 9 | Approval}> 10 | 11 | 12 | Before supplying, you need to approve its usage by the Aave protocol. You can learn more 13 | in our 14 | 15 | FAQ 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/infoModalContents/InfoContentWrapper.tsx: -------------------------------------------------------------------------------- 1 | import Box from '@mui/material/Box'; 2 | import Typography from '@mui/material/Typography'; 3 | import { ReactNode } from 'react'; 4 | 5 | interface InfoContentWrapperProps { 6 | children: ReactNode; 7 | caption: ReactNode; 8 | } 9 | 10 | export const InfoContentWrapper = ({ children, caption }: InfoContentWrapperProps) => { 11 | return ( 12 | 15 | 16 | {caption} 17 | 18 | {children} 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/infoModalContents/RetryWithApprovalInfoContent.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import Typography from '@mui/material/Typography'; 3 | 4 | import { InfoContentWrapper } from './InfoContentWrapper'; 5 | 6 | export const RetryWithApprovalInfoContent = () => { 7 | return ( 8 | Retry with Approval}> 9 | 10 | Define Retry with Approval text 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/AMPLWarning.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, SvgIcon } from '@mui/material'; 4 | 5 | import { ContentWithTooltip } from '../ContentWithTooltip'; 6 | import { Link } from '../primitives/Link'; 7 | 8 | export const AMPLWarning = () => { 9 | return ( 10 | 13 | 14 | Ampleforth is an asset affected by rebasing. Visit the{' '} 15 | 16 | documentation 17 | {' '} 18 | or{' '} 19 | 20 | {"Ampleforth's FAQ"} 21 | {' '} 22 | to learn more. 23 | 24 | 25 | } 26 | > 27 | 28 | 29 | 30 | 31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /src/components/infoTooltips/APYTypeTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const APYTypeTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Allows you to switch between variable and stable interest rates, where 10 | variable rate can increase and decrease depending on the amount of liquidity in the reserve, 11 | and stable rate will stay the same for the duration of your loan. 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/infoTooltips/AvailableTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { CapType } from '../caps/helper'; 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | interface AvailableTooltipProps extends TextWithTooltipProps { 7 | capType: CapType; 8 | } 9 | 10 | export const AvailableTooltip = ({ capType, ...rest }: AvailableTooltipProps) => { 11 | const description = 12 | capType === CapType.supplyCap ? ( 13 | 14 | This is the total amount that you are able to supply to in this reserve. You are able to 15 | supply your wallet balance up until the supply cap is reached. 16 | 17 | ) : ( 18 | 19 | This is the total amount available for you to borrow. You can borrow based on your 20 | collateral and until the borrow cap is reached. 21 | 22 | ); 23 | 24 | return {description}; 25 | }; 26 | -------------------------------------------------------------------------------- /src/components/infoTooltips/BorrowPowerTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const BorrowPowerTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The % of your total borrowing power used. This is based on the amount of your collateral 10 | supplied and the total amount that you can borrow. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/CollateralSwitchTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const CollateralSwitchTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Allows you to decide whether to use a supplied asset as collateral. An asset used as 10 | collateral will affect your borrowing power and health factor. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/CollateralTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const CollateralTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The total amount of your assets denominated in USD that can be used as collateral for 10 | borrowing assets. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/DarkTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Tooltip, TooltipProps } from '@mui/material'; 2 | 3 | export const DarkTooltip = ({ title, children }: TooltipProps) => { 4 | return ( 5 |
6 | 37 | {title} 38 | 39 | } 40 | > 41 | {children} 42 | 43 |
44 | ); 45 | }; 46 | -------------------------------------------------------------------------------- /src/components/infoTooltips/EModeTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { FormattedNumber } from '../primitives/FormattedNumber'; 3 | import { Link } from '../primitives/Link'; 4 | 5 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 6 | 7 | export const EModeTooltip = ({ 8 | eModeLtv, 9 | ...rest 10 | }: TextWithTooltipProps & { eModeLtv: number }) => { 11 | return ( 12 | 13 | 14 | E-Mode increases your LTV for a selected category of assets up to 15 | 21 | .{' '} 22 | 28 | Learn more 29 | 30 | 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/infoTooltips/FrozenWarning.tsx: -------------------------------------------------------------------------------- 1 | import { ExclamationIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, SvgIcon } from '@mui/material'; 4 | 5 | import { ContentWithTooltip } from '../ContentWithTooltip'; 6 | import { Link } from '../primitives/Link'; 7 | import { frozenProposalMap } from '../../utils/marketsAndNetworksConfig'; 8 | 9 | interface FrozenWarningProps { 10 | symbol?: string; 11 | } 12 | 13 | export const FrozenWarning = ({ symbol }: FrozenWarningProps) => { 14 | return ( 15 | 18 | 19 | {symbol} is frozen due to an Aave Protocol Governance decision.{' '} 20 | 28 | More details 29 | 30 | 31 | 32 | } 33 | > 34 | 35 | 36 | 37 | 38 | ); 39 | }; 40 | -------------------------------------------------------------------------------- /src/components/infoTooltips/GasTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const GasTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | This gas calculation is only an estimation. Your wallet will set the price of the 10 | transaction. You can modify the gas settings directly from your wallet provider. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/LiquidationPenaltyTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const LiquidationPenaltyTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | When a liquidation occurs, liquidators repay up to 50% of the outstanding borrowed amount on 10 | behalf of the borrower. In return, they can buy the collateral at a discount and keep the 11 | difference (liquidation penalty) as a bonus. 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/infoTooltips/LiquidationThresholdTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const LiquidationThresholdTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | This represents the threshold at which a borrow position will be considered 10 | undercollateralized and subject to liquidation for each collateral. For example, if a 11 | collateral has a liquidation threshold of 80%, it means that the position will be liquidated 12 | when the debt value is worth 80% of the collateral value. 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/infoTooltips/MaxLTVTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const MaxLTVTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | The Maximum LTV ratio represents the maximum borrowing power of a specific collateral. For 10 | example, if a collateral has an LTV of 75%, the user can borrow up to 0.75 worth of ETH in 11 | the principal currency for every 1 ETH worth of collateral. 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/infoTooltips/NetAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const NetAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Net APY is the combined effect of all supply and borrow positions on net worth, including 10 | incentives. It is possible to have a negative net APY if debt APY is higher than supply APY. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/ReserveFactorTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link } from '../primitives/Link'; 3 | 4 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 5 | 6 | interface ReserveFactorTooltipProps extends TextWithTooltipProps { 7 | collectorLink?: string; 8 | } 9 | 10 | export const ReserveFactorTooltip = ({ collectorLink, ...rest }: ReserveFactorTooltipProps) => { 11 | return ( 12 | 13 | 14 | Reserve factor is a percentage of interest which goes to a{' '} 15 | {collectorLink ? ( 16 | collector contract 17 | ) : ( 18 | 'collector contract' 19 | )}{' '} 20 | that is controlled by Aave governance to promote ecosystem growth.{' '} 21 | 22 | 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/components/infoTooltips/StableAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const StableAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Stable interest rate will stay the same for the duration of your loan. Recommended 10 | for long-term loan periods and for users who prefer predictability. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/infoTooltips/TotalBorrowAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const TotalBorrowAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | The weighted average of APY for all borrowed assets, including incentives. 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/infoTooltips/TotalSupplyAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const TotalSupplyAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | The weighted average of APY for all supplied assets, including incentives. 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /src/components/infoTooltips/VariableAPYTooltip.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | 3 | import { TextWithTooltip, TextWithTooltipProps } from '../TextWithTooltip'; 4 | 5 | export const VariableAPYTooltip = ({ ...rest }: TextWithTooltipProps) => { 6 | return ( 7 | 8 | 9 | Variable interest rate will fluctuate based on the market conditions. Recommended for 10 | short-term positions. 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/isolationMode/IsolatedBadge.tsx: -------------------------------------------------------------------------------- 1 | import { InformationCircleIcon } from '@heroicons/react/outline'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, SvgIcon, Typography } from '@mui/material'; 4 | 5 | import { ContentWithTooltip } from '../ContentWithTooltip'; 6 | import { IsolatedTooltip } from './IsolatedTooltip'; 7 | 8 | export const IsolatedBadge = () => { 9 | const iconSize = 14; 10 | 11 | return ( 12 | } withoutHover> 13 | 24 | 25 | Isolated 26 | 27 | 34 | 35 | 36 | 37 | 38 | ); 39 | }; 40 | -------------------------------------------------------------------------------- /src/components/lists/ListColumn.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListColumnProps { 5 | children?: ReactNode; 6 | maxWidth?: number; 7 | minWidth?: number; 8 | isRow?: boolean; 9 | align?: 'left' | 'center' | 'right'; 10 | } 11 | 12 | export const ListColumn = ({ 13 | isRow, 14 | children, 15 | minWidth, 16 | maxWidth, 17 | align = 'center', 18 | }: ListColumnProps) => { 19 | return ( 20 | 39 | {children} 40 | 41 | ); 42 | }; 43 | -------------------------------------------------------------------------------- /src/components/lists/ListHeaderWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListHeaderWrapperProps extends BoxProps { 5 | px?: 4 | 6; 6 | children: ReactNode; 7 | } 8 | 9 | export const ListHeaderWrapper = ({ px = 4, children, ...rest }: ListHeaderWrapperProps) => { 10 | return ( 11 | 28 | {children} 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /src/components/lists/ListItem.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListItemProps extends BoxProps { 5 | children: ReactNode; 6 | minHeight?: 71 | 76; 7 | px?: 4 | 6; 8 | button?: boolean; 9 | } 10 | 11 | export const ListItem = ({ children, minHeight = 71, px = 4, button, ...rest }: ListItemProps) => { 12 | return ( 13 | 28 | {children} 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /src/components/primitives/CheckBadge.tsx: -------------------------------------------------------------------------------- 1 | import { CheckCircleIcon, XCircleIcon, QuestionMarkCircleIcon } from '@heroicons/react/solid'; 2 | import { Box, BoxProps, Typography, TypographyProps, useTheme } from '@mui/material'; 3 | import { ReactNode } from 'react'; 4 | 5 | interface CheckBadgeProps extends BoxProps { 6 | checked?: boolean; 7 | text: ReactNode; 8 | variant?: TypographyProps['variant']; 9 | loading?: boolean; 10 | } 11 | 12 | export function CheckBadge({ 13 | checked, 14 | text, 15 | variant = 'subheader2', 16 | loading, 17 | ...rest 18 | }: CheckBadgeProps) { 19 | const { palette } = useTheme(); 20 | return ( 21 | 22 | 23 | {text} 24 | 25 | {loading ? ( 26 | 27 | ) : checked ? ( 28 | 29 | ) : ( 30 | 31 | )} 32 | 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /src/components/primitives/NoData.tsx: -------------------------------------------------------------------------------- 1 | import Typography, { TypographyProps } from '@mui/material/Typography'; 2 | 3 | export const NoData = ({ ...rest }: TypographyProps) => { 4 | return ; 5 | }; 6 | -------------------------------------------------------------------------------- /src/components/primitives/Row.tsx: -------------------------------------------------------------------------------- 1 | import { Box, BoxProps, Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface RowProps extends BoxProps { 5 | caption?: ReactNode; 6 | captionVariant?: 'secondary16' | 'description' | 'subheader1' | 'caption'; 7 | captionColor?: string; 8 | align?: 'center' | 'flex-start'; 9 | } 10 | 11 | export const Row = ({ 12 | caption, 13 | children, 14 | captionVariant = 'secondary16', 15 | captionColor, 16 | align = 'center', 17 | ...rest 18 | }: RowProps) => { 19 | return ( 20 | 24 | {caption && ( 25 | 26 | {caption} 27 | 28 | )} 29 | 30 | {children} 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/primitives/TypographyGradient.tsx: -------------------------------------------------------------------------------- 1 | import { Typography, TypographyProps } from '@mui/material'; 2 | 3 | export const TypographyGradient = ({ ...rest }: TypographyProps) => { 4 | return ( 5 | ({ 7 | color: 'transparent', 8 | backgroundClip: 'text !important', 9 | webkitTextFillColor: 'transparent', 10 | background: theme.palette.gradients.aaveGradient, 11 | })} 12 | {...rest} 13 | > 14 | {rest.children} 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/components/primitives/Warning.tsx: -------------------------------------------------------------------------------- 1 | import { Alert, AlertProps } from '@mui/material'; 2 | 3 | export const Warning = ({ children, ...rest }: AlertProps) => { 4 | return ( 5 | 6 | {children} 7 | 8 | ); 9 | }; 10 | -------------------------------------------------------------------------------- /src/components/transactions/Borrow/BorrowModal.tsx: -------------------------------------------------------------------------------- 1 | import { PERMISSION } from '@aave/contract-helpers'; 2 | import { Trans } from '@lingui/macro'; 3 | import React, { useState } from 'react'; 4 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 5 | 6 | import { BasicModal } from '../../primitives/BasicModal'; 7 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 8 | import { BorrowModalContent } from './BorrowModalContent'; 9 | 10 | export const BorrowModal = () => { 11 | const { type, close, args } = useModalContext() as ModalContextType<{ 12 | underlyingAsset: string; 13 | }>; 14 | const [borrowUnWrapped, setBorrowUnWrapped] = useState(true); 15 | 16 | return ( 17 | 18 | Borrow} 20 | underlyingAsset={args.underlyingAsset} 21 | keepWrappedSymbol={!borrowUnWrapped} 22 | requiredPermission={PERMISSION.BORROWER} 23 | > 24 | {(params) => ( 25 | 26 | )} 27 | 28 | 29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /src/components/transactions/ClaimRewards/ClaimRewardsModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { ClaimRewardsModalContent } from './ClaimRewardsModalContent'; 6 | 7 | export const ClaimRewardsModal = () => { 8 | const { type, close } = useModalContext(); 9 | return ( 10 | 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/transactions/CollateralChange/CollateralChangeModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import React from 'react'; 3 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { BasicModal } from '../../primitives/BasicModal'; 6 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 7 | import { CollateralChangeModalContent } from './CollateralChangeModalContent'; 8 | 9 | export const CollateralChangeModal = () => { 10 | const { type, close, args } = useModalContext() as ModalContextType<{ 11 | underlyingAsset: string; 12 | }>; 13 | return ( 14 | 15 | Review tx} underlyingAsset={args.underlyingAsset}> 16 | {(params) => } 17 | 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/transactions/Emode/EmodeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { EmodeModalContent } from './EmodeModalContent'; 6 | 7 | export const EmodeModal = () => { 8 | const { type, close } = useModalContext(); 9 | return ( 10 | 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/transactions/Emode/EmodeNaming.ts: -------------------------------------------------------------------------------- 1 | export const getEmodeMessage = (categoryId: number, baseAssetSymbol: string): string => { 2 | if (categoryId === 0) { 3 | return 'Disabled'; 4 | } else if (categoryId === 1) { 5 | return 'Stablecoins'; 6 | } else if (categoryId === 2) { 7 | return baseAssetSymbol; 8 | } else if (categoryId === 3) { 9 | return 'BTC'; 10 | } else { 11 | return 'unknown'; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /src/components/transactions/Faucet/FaucetModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import React from 'react'; 3 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 4 | 5 | import { BasicModal } from '../../primitives/BasicModal'; 6 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 7 | import { FaucetModalContent } from './FaucetModalContent'; 8 | 9 | export const FaucetModal = () => { 10 | const { type, close, args } = useModalContext() as ModalContextType<{ 11 | underlyingAsset: string; 12 | }>; 13 | 14 | return ( 15 | 16 | Faucet} underlyingAsset={args.underlyingAsset}> 17 | {(params) => } 18 | 19 | 20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /src/components/transactions/FlowCommons/PermissionView.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Button, Link, Typography } from '@mui/material'; 3 | import { useModalContext } from 'src/hooks/useModal'; 4 | 5 | export const PermissionView = () => { 6 | const { close } = useModalContext(); 7 | 8 | return ( 9 | <> 10 | 19 | 20 | Allowance required action 21 | 22 | 23 | 24 | To request access for this permissioned market, please visit:{' '} 25 | Acces Provider Name 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | ); 36 | }; 37 | -------------------------------------------------------------------------------- /src/components/transactions/FlowCommons/TxModalTitle.tsx: -------------------------------------------------------------------------------- 1 | import { Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | export type TxModalTitleProps = { 5 | title: ReactNode; 6 | symbol?: string; 7 | }; 8 | 9 | export const TxModalTitle = ({ title, symbol }: TxModalTitleProps) => { 10 | return ( 11 | 12 | {title} {symbol ?? ''} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/GasStation/GasButton.tsx: -------------------------------------------------------------------------------- 1 | import { Skeleton, ToggleButton, ToggleButtonProps, Typography } from '@mui/material'; 2 | import { formatUnits } from 'ethers/lib/utils'; 3 | import React from 'react'; 4 | 5 | import { GasOption } from './GasStationProvider'; 6 | 7 | export interface GasButtonProps extends ToggleButtonProps { 8 | value: GasOption; 9 | gwei?: string | undefined; 10 | } 11 | 12 | export const GasButton: React.FC = ({ value, gwei, ...props }) => { 13 | return ( 14 | 15 | {gwei ? ( 16 | 17 | {parseFloat(formatUnits(gwei, 'gwei')).toLocaleString(undefined, { 18 | maximumFractionDigits: 2, 19 | })} 20 | 21 | ) : ( 22 | 23 | )} 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /src/components/transactions/GovDelegation/GovDelegationModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { GovDelegationModalContent } from './GovDelegationModalContent'; 6 | 7 | export const GovDelegationModal = () => { 8 | const { type, close } = useModalContext(); 9 | return ( 10 | 11 | 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/transactions/GovVote/GovVoteModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { GovVoteModalContent } from './GovVoteModalContent'; 6 | 7 | export const GovVoteModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.power && args?.proposalId && args?.support !== undefined && ( 12 | 17 | )} 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/transactions/RateSwitch/RateSwitchModal.tsx: -------------------------------------------------------------------------------- 1 | import { InterestRate } from '@aave/contract-helpers'; 2 | import { Trans } from '@lingui/macro'; 3 | import React from 'react'; 4 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 5 | 6 | import { BasicModal } from '../../primitives/BasicModal'; 7 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 8 | import { RateSwitchModalContent } from './RateSwitchModalContent'; 9 | 10 | export const RateSwitchModal = () => { 11 | const { type, close, args } = useModalContext() as ModalContextType<{ 12 | underlyingAsset: string; 13 | currentRateMode: InterestRate; 14 | }>; 15 | 16 | return ( 17 | 18 | Switch APY type} 21 | underlyingAsset={args.underlyingAsset} 22 | > 23 | {(params) => } 24 | 25 | 26 | ); 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/transactions/Stake/StakeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeModalContent } from './StakeModalContent'; 6 | 7 | export const StakeModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.icon && args?.stakeAssetName && ( 12 | 13 | )} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/transactions/StakeCooldown/StakeCooldownModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | 4 | import { BasicModal } from '../../primitives/BasicModal'; 5 | import { StakeCooldownModalContent } from './StakeCooldownModalContent'; 6 | 7 | export const StakeCooldownModal = () => { 8 | const { type, close, args } = useModalContext(); 9 | return ( 10 | 11 | {args?.stakeAssetName && } 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/components/transactions/StakeRewardClaim/StakeRewardClaimModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | import { BasicModal } from '../../primitives/BasicModal'; 4 | import { StakeRewardClaimModalContent } from './StakeRewardClaimModalContent'; 5 | 6 | export const StakeRewardClaimModal = () => { 7 | const { type, close, args } = useModalContext(); 8 | return ( 9 | 10 | {args?.stakeAssetName && ( 11 | 12 | )} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/Supply/SupplyModal.tsx: -------------------------------------------------------------------------------- 1 | import { PERMISSION } from '@aave/contract-helpers'; 2 | import { Trans } from '@lingui/macro'; 3 | import React from 'react'; 4 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 5 | 6 | import { BasicModal } from '../../primitives/BasicModal'; 7 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 8 | import { SupplyModalContent } from './SupplyModalContent'; 9 | 10 | export const SupplyModal = () => { 11 | const { type, close, args } = useModalContext() as ModalContextType<{ 12 | underlyingAsset: string; 13 | }>; 14 | 15 | return ( 16 | 17 | Supply} 19 | underlyingAsset={args.underlyingAsset} 20 | requiredPermission={PERMISSION.DEPOSITOR} 21 | > 22 | {(params) => } 23 | 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /src/components/transactions/Swap/SwapModal.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import React from 'react'; 3 | import { BasicModal } from 'src/components/primitives/BasicModal'; 4 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 5 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 6 | 7 | import { SwapModalContent } from './SwapModalContent'; 8 | 9 | export const SwapModal = () => { 10 | const { type, close, args } = useModalContext() as ModalContextType<{ 11 | underlyingAsset: string; 12 | }>; 13 | return ( 14 | 15 | Swap} underlyingAsset={args.underlyingAsset}> 16 | {(params) => } 17 | 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/transactions/UnStake/UnStakeModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModalType, useModalContext } from 'src/hooks/useModal'; 3 | import { BasicModal } from '../../primitives/BasicModal'; 4 | import { UnStakeModalContent } from './UnStakeModalContent'; 5 | 6 | export const UnStakeModal = () => { 7 | const { type, close, args } = useModalContext(); 8 | return ( 9 | 10 | {args?.icon && args?.stakeAssetName && ( 11 | 12 | )} 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/AAVEWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link, Typography } from '@mui/material'; 3 | 4 | import { ROUTES } from '../../primitives/Link'; 5 | import { Warning } from '../../primitives/Warning'; 6 | 7 | export const AAVEWarning = () => { 8 | return ( 9 | 10 | 11 | Supplying your AAVE{' '} 12 | tokens is not the same as staking them. If you wish to stake your AAVE{' '} 13 | tokens, please go to the {' '} 14 | 15 | staking view 16 | 17 | 18 | 19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/AMPLWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link, Typography } from '@mui/material'; 3 | 4 | import { Warning } from '../../primitives/Warning'; 5 | 6 | export const AMPLWarning = () => { 7 | return ( 8 | 9 | 10 | Ampleforth is an asset affected by rebasing. Visit the {' '} 11 | 12 | documentation 13 | {' '} 14 | or{' '} 15 | 16 | Ampleforth FAQ 17 | {' '} 18 | to learn more. 19 | 20 | 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/HarmonyWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Link, Typography } from '@mui/material'; 3 | 4 | import { Warning } from '../../primitives/Warning'; 5 | 6 | interface HarmonyWarningProps { 7 | learnMore?: boolean; // Modify wording on link text 8 | } 9 | 10 | export const HarmonyWarning = ({ learnMore }: HarmonyWarningProps) => { 11 | return ( 12 | 13 | 14 | 15 | Due to the Horizon bridge exploit, certain assets on the Harmony network are not at parity 16 | with Ethereum, which affects the Aave V3 Harmony market.{' '} 17 | 21 | {learnMore ? 'Learn More' : 'Join the community discussion'} 22 | 23 | 24 | 25 | 26 | ); 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/IsolationModeWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Link } from '../../primitives/Link'; 5 | import { Warning } from '../../primitives/Warning'; 6 | 7 | // TODO: need text 8 | export const IsolationModeWarning = () => { 9 | return ( 10 | 11 | 12 | You are entering Isolation mode 13 | 14 | 15 | 16 | In Isolation mode, you cannot supply other assets as collateral. A global debt ceiling 17 | limits the borrowing power of the isolated asset. Read more in our{' '} 18 | FAQ 19 | 20 | 21 | 22 | ); 23 | }; 24 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/SNXWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Warning } from '../../primitives/Warning'; 5 | 6 | export const SNXWarning = () => { 7 | return ( 8 | 9 | 10 | Before supplying SNX{' '} 11 | 12 | {' '} 13 | please check that the amount you want to supply is not currently being used for staking. 14 | If it is being used for staking, your transaction might fail. 15 | 16 | 17 | 18 | ); 19 | }; 20 | -------------------------------------------------------------------------------- /src/components/transactions/Warnings/SupplyCapWarning.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Link } from '../../primitives/Link'; 5 | import { Warning } from '../../primitives/Warning'; 6 | 7 | // TODO: need text 8 | export const SupplyCapWarning = () => { 9 | return ( 10 | 11 | 12 | Supply amount is limited due to Supply Cap 13 | 14 | 15 | 16 | Supply caps limit the amount of a certain asset that can be supplied to the Aave protocol. 17 | This helps reducing exposure to the asset and mitigate attacks like infinite minting or 18 | price oracle manipulation. 19 | 20 | FAQ guide 21 | 22 | . 23 | 24 | 25 | 26 | ); 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/transactions/Withdraw/WithdrawModal.tsx: -------------------------------------------------------------------------------- 1 | import { PERMISSION } from '@aave/contract-helpers'; 2 | import { Trans } from '@lingui/macro'; 3 | import React, { useState } from 'react'; 4 | import { ModalContextType, ModalType, useModalContext } from 'src/hooks/useModal'; 5 | 6 | import { BasicModal } from '../../primitives/BasicModal'; 7 | import { ModalWrapper } from '../FlowCommons/ModalWrapper'; 8 | import { WithdrawModalContent } from './WithdrawModalContent'; 9 | 10 | export const WithdrawModal = () => { 11 | const { type, close, args } = useModalContext() as ModalContextType<{ 12 | underlyingAsset: string; 13 | }>; 14 | const [withdrawUnWrapped, setWithdrawUnWrapped] = useState(true); 15 | 16 | return ( 17 | 18 | Withdraw} 20 | underlyingAsset={args.underlyingAsset} 21 | keepWrappedSymbol={!withdrawUnWrapped} 22 | requiredPermission={PERMISSION.DEPOSITOR} 23 | > 24 | {(params) => ( 25 | 30 | )} 31 | 32 | 33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /src/components/transactions/utils.ts: -------------------------------------------------------------------------------- 1 | import { ChainId } from '@aave/contract-helpers'; 2 | import { BigNumber } from 'bignumber.js'; 3 | 4 | export enum ErrorType { 5 | SUPPLY_CAP_REACHED, 6 | HF_BELOW_ONE, 7 | FLASH_LOAN_NOT_AVAILABLE, 8 | NOT_ENOUGH_COLLATERAL_TO_REPAY_WITH, 9 | } 10 | 11 | export const useFlashloan = (healthFactor: string, hfEffectOfFromAmount: string) => { 12 | return ( 13 | healthFactor !== '-1' && 14 | new BigNumber(healthFactor).minus(new BigNumber(hfEffectOfFromAmount)).lt('1.05') 15 | ); 16 | }; 17 | 18 | // The stETH contract has a bug where there is a 2gwei precision error when 19 | // calling balanceOf() making it impossible to flashlon this asset. 20 | const stETHAddress = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'; 21 | const stETHChainId = ChainId.mainnet; 22 | 23 | export const flashLoanNotAvailable = (underlyingAsset: string, currentChainId: number) => { 24 | return underlyingAsset === stETHAddress && currentChainId === stETHChainId; 25 | }; 26 | -------------------------------------------------------------------------------- /src/createEmotionCache.ts: -------------------------------------------------------------------------------- 1 | import createCache from '@emotion/cache'; 2 | 3 | // prepend: true moves MUI styles to the top of the so they're loaded first. 4 | // It allows developers to easily override MUI styles with other styling solutions, like CSS modules. 5 | export default function createEmotionCache() { 6 | return createCache({ key: 'css', prepend: true }); 7 | } 8 | -------------------------------------------------------------------------------- /src/helpers/text-center-ellipsis.ts: -------------------------------------------------------------------------------- 1 | export const textCenterEllipsis = (str: string, from: number, to: number) => { 2 | return `${str.substr(0, from)}...${str.substr(str.length - to, str.length)}`; 3 | }; 4 | -------------------------------------------------------------------------------- /src/helpers/timeHelper.tsx: -------------------------------------------------------------------------------- 1 | export const daysFromSeconds = (time: number) => time / 60 / 60 / 24; 2 | export const hoursFromSeconds = (time: number) => time / 60 / 60; 3 | export const minutesFromSeconds = (time: number) => time / 60; 4 | 5 | export const formattedTime = (time: number) => 6 | daysFromSeconds(time) < 1 7 | ? hoursFromSeconds(time) < 1 8 | ? minutesFromSeconds(time) 9 | : hoursFromSeconds(time) 10 | : daysFromSeconds(time); 11 | 12 | export const timeText = (time: number) => 13 | daysFromSeconds(time) < 1 ? (hoursFromSeconds(time) < 1 ? 'minutes' : 'hours') : 'days'; 14 | -------------------------------------------------------------------------------- /src/helpers/toggle-local-storage-click.ts: -------------------------------------------------------------------------------- 1 | export const toggleLocalStorageClick = ( 2 | value: boolean, 3 | func: (val: boolean) => void, 4 | localStorageName: string 5 | ) => { 6 | if (value) { 7 | localStorage.setItem(localStorageName, 'false'); 8 | func(false); 9 | } else { 10 | localStorage.setItem(localStorageName, 'true'); 11 | func(true); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /src/helpers/types.ts: -------------------------------------------------------------------------------- 1 | export type TxState = { 2 | txError?: string; 3 | success: boolean; 4 | gasEstimationError?: string; 5 | }; 6 | 7 | export type Reward = { 8 | assets: string[]; 9 | incentiveControllerAddress: string; 10 | symbol: string; 11 | balance: string; 12 | balanceUsd: string; 13 | rewardTokenAddress: string; 14 | }; 15 | 16 | export type EmodeCategory = { 17 | id: number; 18 | ltv: number; 19 | liquidationThreshold: number; 20 | liquidationBonus: number; 21 | priceSource: string; 22 | label: string; 23 | assets: string[]; 24 | }; 25 | 26 | export enum DelegationType { 27 | VOTING = '0', 28 | PROPOSITION_POWER = '1', 29 | } 30 | 31 | export enum CollateralType { 32 | ENABLED, 33 | ISOLATED_ENABLED, 34 | DISABLED, 35 | ISOLATED_DISABLED, 36 | } 37 | -------------------------------------------------------------------------------- /src/hooks/app-data-provider/graphql/user-data.graphql: -------------------------------------------------------------------------------- 1 | fragment UserReserveDataFragment on UserReserveData { 2 | id 3 | underlyingAsset 4 | scaledATokenBalance 5 | usageAsCollateralEnabledOnUser 6 | scaledVariableDebt 7 | stableBorrowRate 8 | principalStableDebt 9 | stableBorrowLastUpdateTimestamp 10 | } 11 | 12 | query C_UserData($userAddress: String!, $lendingPoolAddressProvider: String!, $chainId: Int!) { 13 | userData( 14 | userAddress: $userAddress 15 | lendingPoolAddressProvider: $lendingPoolAddressProvider 16 | chainId: $chainId 17 | ) { 18 | userReserves { 19 | ...UserReserveDataFragment 20 | } 21 | userEmodeCategoryId 22 | } 23 | } 24 | subscription C_UserDataUpdate( 25 | $userAddress: String! 26 | $lendingPoolAddressProvider: String! 27 | $chainId: Int! 28 | ) { 29 | userDataUpdate( 30 | userAddress: $userAddress 31 | lendingPoolAddressProvider: $lendingPoolAddressProvider 32 | chainId: $chainId 33 | ) { 34 | userReserves { 35 | ...UserReserveDataFragment 36 | } 37 | userEmodeCategoryId 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/hooks/governance-data-provider/GovernanceDataProvider.tsx: -------------------------------------------------------------------------------- 1 | import { AaveGovernanceService, GovernancePowerDelegationToken } from '@aave/contract-helpers'; 2 | import React, { useContext } from 'react'; 3 | import { governanceConfig } from 'src/ui-config/governanceConfig'; 4 | 5 | import { _useGovernanceDataRPC } from './_useGovernanceDataRPC'; 6 | 7 | interface GovernanceDataProviderContextType { 8 | governanceService: AaveGovernanceService; 9 | governanceDelegationService: GovernancePowerDelegationToken; 10 | } 11 | 12 | const GovernanceDataProviderContext = React.createContext( 13 | {} as GovernanceDataProviderContextType 14 | ); 15 | 16 | /** 17 | * Naive provider that subscribes to different data sources to update the apollo cache. 18 | * @param param0 19 | * @returns 20 | */ 21 | export const GovernanceDataProvider: React.FC = ({ children }) => { 22 | const { governanceService, governanceDelegationService } = _useGovernanceDataRPC({ 23 | governanceConfig, 24 | }); 25 | return ( 26 | 29 | {children} 30 | 31 | ); 32 | }; 33 | 34 | export const useGovernanceDataProvider = () => useContext(GovernanceDataProviderContext); 35 | -------------------------------------------------------------------------------- /src/hooks/stake-data-provider/graphql/stake-general-ui-data.graphql: -------------------------------------------------------------------------------- 1 | fragment StakeGeneralUIDataFragment on StakeGeneralUIData { 2 | aave { 3 | stakeTokenTotalSupply 4 | stakeCooldownSeconds 5 | stakeUnstakeWindow 6 | stakeTokenPriceEth 7 | rewardTokenPriceEth 8 | stakeApy 9 | distributionPerSecond 10 | distributionEnd 11 | } 12 | bpt { 13 | stakeTokenTotalSupply 14 | stakeCooldownSeconds 15 | stakeUnstakeWindow 16 | stakeTokenPriceEth 17 | rewardTokenPriceEth 18 | stakeApy 19 | distributionPerSecond 20 | distributionEnd 21 | } 22 | usdPriceEth 23 | } 24 | 25 | query C_StakeGeneralUIData { 26 | stakeGeneralUIData { 27 | ...StakeGeneralUIDataFragment 28 | } 29 | } 30 | 31 | subscription C_StakeGeneralUIDataUpdate { 32 | stakeGeneralUIDataUpdate { 33 | ...StakeGeneralUIDataFragment 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/hooks/stake-data-provider/graphql/stake-user-ui-data.graphql: -------------------------------------------------------------------------------- 1 | fragment StakeUserUIDataFragment on StakeUserUIData { 2 | aave { 3 | stakeTokenUserBalance 4 | underlyingTokenUserBalance 5 | userCooldown 6 | userIncentivesToClaim 7 | userPermitNonce 8 | } 9 | bpt { 10 | stakeTokenUserBalance 11 | underlyingTokenUserBalance 12 | userCooldown 13 | userIncentivesToClaim 14 | userPermitNonce 15 | } 16 | usdPriceEth 17 | } 18 | 19 | query C_StakeUserUIData($userAddress: String!, $chainId: Int!) { 20 | stakeUserUIData(userAddress: $userAddress, chainId: $chainId) { 21 | ...StakeUserUIDataFragment 22 | } 23 | } 24 | 25 | subscription C_StakeUserUIDataUpdate($userAddress: String!, $chainId: Int!) { 26 | stakeUserUIDataUpdate(userAddress: $userAddress, chainId: $chainId) { 27 | ...StakeUserUIDataFragment 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/hooks/useCurrentTimestamp.tsx: -------------------------------------------------------------------------------- 1 | import dayjs from 'dayjs'; 2 | import { useEffect, useState } from 'react'; 3 | 4 | /** 5 | * Triggers an update based on provided updateInterval. 6 | * @param updateInterval 7 | * @returns current timestamp - when forkTimeAhead is set the time will be forwarded by the specified amount. 8 | */ 9 | export function useCurrentTimestamp(updateInterval = 15): number { 10 | const [timeTravel, setTimeTravel] = useState(0); 11 | const [timestamp, setTimestamp] = useState(0); 12 | 13 | useEffect(() => { 14 | const intervalHandlerID = setInterval( 15 | () => setTimestamp(dayjs().unix() + timeTravel), 16 | 1000 * updateInterval 17 | ); 18 | return () => clearInterval(intervalHandlerID); 19 | }, [updateInterval, timeTravel]); 20 | 21 | useEffect(() => { 22 | const forwardTime = Number(localStorage.getItem('forkTimeAhead') || 0); 23 | setTimeTravel(forwardTime); 24 | setTimestamp(dayjs().unix() + forwardTime); 25 | }, []); 26 | 27 | return timestamp; 28 | } 29 | -------------------------------------------------------------------------------- /src/hooks/useGasStation.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { GasStationContext } from 'src/components/transactions/GasStation/GasStationProvider'; 3 | 4 | export function useGasStation() { 5 | const context = React.useContext(GasStationContext); 6 | 7 | if (context === undefined) { 8 | throw new Error('useGasStation must be used within a GasStationProvider'); 9 | } 10 | return context; 11 | } 12 | -------------------------------------------------------------------------------- /src/hooks/usePolling.tsx: -------------------------------------------------------------------------------- 1 | import { DependencyList, useEffect, useRef, useState } from 'react'; 2 | 3 | export const usePolling = ( 4 | callback: () => Promise | (() => void), 5 | time: number, 6 | skip: boolean, 7 | deps: DependencyList 8 | ) => { 9 | const [timeoutUpdate, setTimeoutUpdate] = useState(0); 10 | 11 | const savedCallback = useRef(callback); 12 | 13 | useEffect(() => { 14 | savedCallback.current = callback; 15 | }, [callback]); 16 | 17 | useEffect(() => { 18 | // initial execution 19 | if (!skip) callback(); 20 | }, [...deps]); 21 | 22 | useEffect(() => { 23 | let timeout: number; 24 | 25 | function tick() { 26 | const currentCallback = savedCallback.current(); 27 | if (currentCallback instanceof Promise) { 28 | currentCallback.then(() => { 29 | setTimeoutUpdate(timeoutUpdate + 1); 30 | }); 31 | } else { 32 | currentCallback(); 33 | setTimeoutUpdate(timeoutUpdate + 1); 34 | } 35 | } 36 | 37 | if (!skip) { 38 | timeout = window.setTimeout(tick, time); 39 | } 40 | return () => clearTimeout(timeout); 41 | 42 | // eslint-disable-next-line react-hooks/exhaustive-deps 43 | }, [timeoutUpdate, ...deps]); 44 | 45 | return; 46 | }; 47 | -------------------------------------------------------------------------------- /src/hooks/useStakeTxBuilder.tsx: -------------------------------------------------------------------------------- 1 | import { StakingService } from '@aave/contract-helpers'; 2 | import { useContext } from 'react'; 3 | import { StakeTxBuilderContext } from 'src/providers/StakeTxBuilderProvider'; 4 | 5 | export const useStakeTxBuilderContext = (selectedToken: string): StakingService => { 6 | const context = useContext(StakeTxBuilderContext); 7 | 8 | return context.stakingServices[selectedToken]; 9 | }; 10 | -------------------------------------------------------------------------------- /src/hooks/useTxBuilder.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | FaucetService, 3 | IncentivesControllerInterface, 4 | IncentivesControllerV2Interface, 5 | LendingPool, 6 | PoolInterface, 7 | } from '@aave/contract-helpers'; 8 | import React, { useContext } from 'react'; 9 | 10 | export interface TxBuilderContextInterface { 11 | lendingPool: LendingPool | PoolInterface; 12 | faucetService: FaucetService; 13 | incentivesTxBuilder: IncentivesControllerInterface; 14 | incentivesTxBuilderV2: IncentivesControllerV2Interface; 15 | } 16 | 17 | export const TxBuilderContext = React.createContext({} as TxBuilderContextInterface); 18 | export const useTxBuilderContext = () => useContext(TxBuilderContext); 19 | -------------------------------------------------------------------------------- /src/hooks/useWalletModal.tsx: -------------------------------------------------------------------------------- 1 | import React, { createContext, useContext, useEffect, useState } from 'react'; 2 | import { useWeb3Context } from 'src/libs/hooks/useWeb3Context'; 3 | 4 | export type WalletModalContextType = { 5 | isWalletModalOpen: boolean; 6 | setWalletModalOpen: React.Dispatch>; 7 | }; 8 | 9 | export const WalletModalContext = createContext( 10 | {} as WalletModalContextType 11 | ); 12 | 13 | export const WalletModalContextProvider: React.FC = ({ children }) => { 14 | const { connected } = useWeb3Context(); 15 | 16 | const [isWalletModalOpen, setWalletModalOpen] = useState(false); 17 | 18 | useEffect(() => { 19 | if (connected) { 20 | setWalletModalOpen(false); 21 | } 22 | }, [connected]); 23 | 24 | return ( 25 | 31 | {children} 32 | 33 | ); 34 | }; 35 | 36 | export const useWalletModalContext = () => { 37 | const context = useContext(WalletModalContext); 38 | 39 | if (context === undefined) { 40 | throw new Error('useWalletModalContext must be used within a WalletModalProvider'); 41 | } 42 | 43 | return context; 44 | }; 45 | -------------------------------------------------------------------------------- /src/layouts/MainLayout.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import React, { ReactNode } from 'react'; 3 | 4 | import { AppHeader } from './AppHeader'; 5 | 6 | export function MainLayout({ children }: { children: ReactNode }) { 7 | return ( 8 | <> 9 | 10 | 11 | {children} 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /src/layouts/components/DrawerWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { Drawer } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface DrawerWrapperProps { 5 | open: boolean; 6 | setOpen: (value: boolean) => void; 7 | headerHeight: number; 8 | children: ReactNode; 9 | } 10 | 11 | export const DrawerWrapper = ({ open, setOpen, children, headerHeight }: DrawerWrapperProps) => { 12 | return ( 13 | setOpen(false)} 17 | hideBackdrop 18 | sx={{ top: `${headerHeight}px` }} 19 | PaperProps={{ 20 | sx: { 21 | background: 'rgba(56, 61, 81, 0.88)', 22 | backdropFilter: 'blur(20px)', 23 | boxShadow: 'none', 24 | borderRadius: 'unset', 25 | width: '100%', 26 | top: `${headerHeight}px`, 27 | pt: 6, 28 | pb: 15, 29 | minHeight: '100vh', 30 | }, 31 | }} 32 | > 33 | {children} 34 | 35 | ); 36 | }; 37 | -------------------------------------------------------------------------------- /src/layouts/components/MobileCloseButton.tsx: -------------------------------------------------------------------------------- 1 | import { XIcon } from '@heroicons/react/outline'; 2 | import { IconButton, SvgIcon } from '@mui/material'; 3 | import React from 'react'; 4 | 5 | interface MobileCloseButtonProps { 6 | setOpen: (value: boolean) => void; 7 | } 8 | 9 | export const MobileCloseButton = ({ setOpen }: MobileCloseButtonProps) => { 10 | return ( 11 | setOpen(false)} sx={{ p: 0, mr: { xs: -2, xsm: 1 } }}> 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/libs/hooks/useWeb3Context.tsx: -------------------------------------------------------------------------------- 1 | import React, { useContext } from 'react'; 2 | import { Web3Data } from '../web3-data-provider/Web3Provider'; 3 | // import { Web3Data } from '../web3-data-provider/Web3ContextProvider'; 4 | 5 | export type Web3ContextData = { 6 | web3ProviderData: Web3Data; 7 | }; 8 | 9 | export const Web3Context = React.createContext({} as Web3ContextData); 10 | 11 | export const useWeb3Context = () => { 12 | const { web3ProviderData } = useContext(Web3Context); 13 | if (Object.keys(web3ProviderData).length === 0) { 14 | throw new Error( 15 | 'useWeb3Context() can only be used inside of , ' + 16 | 'please declare it at a higher level.' 17 | ); 18 | } 19 | 20 | return web3ProviderData; 21 | }; 22 | -------------------------------------------------------------------------------- /src/modules/dashboard/DashboardContentNoData.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface DashboardContentNoDataProps { 5 | text: ReactNode; 6 | } 7 | 8 | export const DashboardContentNoData = ({ text }: DashboardContentNoDataProps) => { 9 | return ( 10 | 11 | {text} 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/BorrowAssetsList/types.ts: -------------------------------------------------------------------------------- 1 | import { ReserveIncentiveResponse } from '../../../../hooks/app-data-provider/useIncentiveData'; 2 | 3 | export type BorrowAssetsItem = { 4 | id: string; 5 | symbol: string; 6 | name: string; 7 | iconSymbol: string; 8 | underlyingAsset: string; 9 | stableBorrowRate: number | string; 10 | variableBorrowRate: number | string; 11 | availableBorrows: number | string; 12 | availableBorrowsInUSD: number | string; 13 | stableBorrowRateEnabled?: boolean; 14 | isFreezed?: boolean; 15 | aIncentivesData?: ReserveIncentiveResponse[]; 16 | vIncentivesData?: ReserveIncentiveResponse[]; 17 | sIncentivesData?: ReserveIncentiveResponse[]; 18 | borrowCap: string; 19 | borrowableInIsolation: boolean; 20 | totalBorrows: string; 21 | totalLiquidityUSD: string; 22 | borrowingEnabled: boolean; 23 | isActive: boolean; 24 | eModeCategoryId: number; 25 | }; 26 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/BorrowedPositionsList/types.ts: -------------------------------------------------------------------------------- 1 | import { ComputedReserveData } from '../../../../hooks/app-data-provider/useAppDataProvider'; 2 | import { ReserveIncentiveResponse } from '../../../../hooks/app-data-provider/useIncentiveData'; 3 | 4 | export type BorrowedPositionsItem = { 5 | isActive: boolean; 6 | isFrozen: boolean; 7 | borrowingEnabled: boolean; 8 | stableBorrowRateEnabled: boolean; 9 | borrowRate: string; 10 | vIncentives: ReserveIncentiveResponse[]; 11 | sIncentives: ReserveIncentiveResponse[]; 12 | borrowRateMode: string; 13 | reserve: Pick; 14 | }; 15 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListAPRColumn.tsx: -------------------------------------------------------------------------------- 1 | import { IncentivesCard } from '../../../components/incentives/IncentivesCard'; 2 | import { ListColumn } from '../../../components/lists/ListColumn'; 3 | import { ReserveIncentiveResponse } from '../../../hooks/app-data-provider/useIncentiveData'; 4 | 5 | interface ListAPRColumnProps { 6 | value: number; 7 | incentives?: ReserveIncentiveResponse[]; 8 | symbol: string; 9 | } 10 | 11 | export const ListAPRColumn = ({ value, incentives, symbol }: ListAPRColumnProps) => { 12 | return ( 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListBottomText.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Typography } from '@mui/material'; 3 | 4 | import { Link } from '../../../components/primitives/Link'; 5 | 6 | export const ListBottomText = () => { 7 | return ( 8 | 9 | 10 | Since this is a test network, you can get any of the assets if you have ETH on your wallet 11 | 12 | 13 | Faucet 14 | 15 | . 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListButtonsColumn.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | interface ListButtonsColumnProps { 5 | children?: ReactNode; 6 | } 7 | 8 | export const ListButtonsColumn = ({ children }: ListButtonsColumnProps) => { 9 | return ( 10 | 23 | {children} 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListHeader.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { ReactNode } from 'react'; 3 | 4 | import { ListColumn } from '../../../components/lists/ListColumn'; 5 | import { ListHeaderTitle } from '../../../components/lists/ListHeaderTitle'; 6 | import { ListHeaderWrapper } from '../../../components/lists/ListHeaderWrapper'; 7 | import { ListButtonsColumn } from './ListButtonsColumn'; 8 | 9 | interface ListHeaderProps { 10 | head: ReactNode[]; 11 | } 12 | 13 | export const ListHeader = ({ head }: ListHeaderProps) => { 14 | return ( 15 | 16 | 17 | 18 | Assets 19 | 20 | 21 | 22 | {head.map((title, i) => ( 23 | 24 | {title} 25 | 26 | ))} 27 | 28 | 29 | 30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListItemIsolationBadge.tsx: -------------------------------------------------------------------------------- 1 | import { Box } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | import { IsolatedBadge } from '../../../components/isolationMode/IsolatedBadge'; 5 | 6 | interface ListItemIsolationBadgeProps { 7 | children: ReactNode; 8 | } 9 | 10 | export const ListItemIsolationBadge = ({ children }: ListItemIsolationBadgeProps) => { 11 | return ( 12 | 20 | {children} 21 | 22 | 23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Skeleton } from '@mui/material'; 2 | 3 | import { ListColumn } from '../../../components/lists/ListColumn'; 4 | import { ListItem } from '../../../components/lists/ListItem'; 5 | import { ListButtonsColumn } from './ListButtonsColumn'; 6 | 7 | export const ListItemLoader = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | ); 35 | }; 36 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListItemUsedAsCollateral.tsx: -------------------------------------------------------------------------------- 1 | import { Switch } from '@mui/material'; 2 | import React from 'react'; 3 | 4 | import { ListItemIsolationBadge } from './ListItemIsolationBadge'; 5 | 6 | interface ListItemUsedAsCollateralProps { 7 | isIsolated: boolean; 8 | usageAsCollateralEnabledOnUser: boolean; 9 | canBeEnabledAsCollateral: boolean; 10 | onToggleSwitch: () => void; 11 | } 12 | 13 | export const ListItemUsedAsCollateral = ({ 14 | isIsolated, 15 | usageAsCollateralEnabledOnUser, 16 | canBeEnabledAsCollateral, 17 | onToggleSwitch, 18 | }: ListItemUsedAsCollateralProps) => { 19 | const isEnabled = usageAsCollateralEnabledOnUser && canBeEnabledAsCollateral; 20 | return ( 21 | <> 22 | {!isIsolated ? ( 23 | 29 | ) : ( 30 | 31 | 37 | 38 | )} 39 | 40 | ); 41 | }; 42 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListLoader.tsx: -------------------------------------------------------------------------------- 1 | import { useMediaQuery, useTheme } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | import { ListWrapper } from '../../../components/lists/ListWrapper'; 5 | import { ListHeader } from './ListHeader'; 6 | import { ListItemLoader } from './ListItemLoader'; 7 | import { MobileListItemLoader } from './MobileListItemLoader'; 8 | 9 | interface ListLoaderProps { 10 | title: ReactNode; 11 | withTopMargin?: boolean; 12 | head: ReactNode[]; 13 | } 14 | 15 | export const ListLoader = ({ title, withTopMargin, head }: ListLoaderProps) => { 16 | const theme = useTheme(); 17 | const downToXSM = useMediaQuery(theme.breakpoints.down('xsm')); 18 | 19 | return ( 20 | 21 | <> 22 | {!downToXSM && } 23 | {!downToXSM ? ( 24 | <> 25 | 26 | 27 | 28 | ) : ( 29 | 30 | )} 31 | 32 | 33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListMobileItemWrapper.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from 'react'; 2 | import { CustomMarket } from 'src/ui-config/marketsConfig'; 3 | 4 | import { AMPLWarning } from '../../../components/infoTooltips/AMPLWarning'; 5 | import { FrozenWarning } from '../../../components/infoTooltips/FrozenWarning'; 6 | import { ListMobileItem } from '../../../components/lists/ListMobileItem'; 7 | 8 | interface ListMobileItemWrapperProps { 9 | symbol?: string; 10 | iconSymbol?: string; 11 | name?: string; 12 | underlyingAsset?: string; 13 | children: ReactNode; 14 | loading?: boolean; 15 | currentMarket?: CustomMarket; 16 | frozen?: boolean; 17 | } 18 | 19 | export const ListMobileItemWrapper = ({ 20 | symbol, 21 | iconSymbol, 22 | name, 23 | children, 24 | underlyingAsset, 25 | loading, 26 | currentMarket, 27 | frozen, 28 | }: ListMobileItemWrapperProps) => { 29 | return ( 30 | : symbol === 'AMPL' ? : undefined 37 | } 38 | loading={loading} 39 | currentMarket={currentMarket} 40 | > 41 | {children} 42 | 43 | ); 44 | }; 45 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/ListTopInfoItem.tsx: -------------------------------------------------------------------------------- 1 | import { Paper, Typography } from '@mui/material'; 2 | import { ReactNode } from 'react'; 3 | 4 | import { FormattedNumber } from '../../../components/primitives/FormattedNumber'; 5 | 6 | interface ListTopInfoItemProps { 7 | title: ReactNode; 8 | value: number | string; 9 | percent?: boolean; 10 | tooltip?: ReactNode; 11 | } 12 | 13 | export const ListTopInfoItem = ({ title, value, percent, tooltip }: ListTopInfoItemProps) => { 14 | return ( 15 | 26 | 27 | {title} 28 | 29 | 30 | 31 | {tooltip} 32 | 33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/MobileListItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Skeleton } from '@mui/material'; 2 | 3 | import { Row } from '../../../components/primitives/Row'; 4 | import { ListMobileItemWrapper } from './ListMobileItemWrapper'; 5 | 6 | export const MobileListItemLoader = () => { 7 | return ( 8 | 9 | } 11 | align="flex-start" 12 | captionVariant="description" 13 | mb={2} 14 | > 15 | 16 | 17 | 18 | } 20 | align="flex-start" 21 | captionVariant="description" 22 | mb={2} 23 | > 24 | 25 | 26 | 27 | } 29 | align="flex-start" 30 | captionVariant="description" 31 | mb={2} 32 | > 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ); 42 | }; 43 | -------------------------------------------------------------------------------- /src/modules/dashboard/lists/SupplyAssetsList/types.ts: -------------------------------------------------------------------------------- 1 | import { ReserveIncentiveResponse } from '../../../../hooks/app-data-provider/useIncentiveData'; 2 | 3 | export type SupplyAssetsItem = { 4 | underlyingAsset: string; 5 | symbol: string; 6 | iconSymbol: string; 7 | name: string; 8 | walletBalance: string; 9 | walletBalanceUSD: string; 10 | availableToDeposit: string; 11 | availableToDepositUSD: string; 12 | supplyAPY: number | string; 13 | aIncentivesData?: ReserveIncentiveResponse[]; 14 | isFreezed?: boolean; 15 | isIsolated: boolean; 16 | totalLiquidity: string; 17 | supplyCap: string; 18 | isActive?: boolean; 19 | usageAsCollateralEnabledOnUser: boolean; 20 | detailsAddress: string; 21 | }; 22 | -------------------------------------------------------------------------------- /src/modules/faucet/FaucetItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Button, Skeleton } from '@mui/material'; 3 | 4 | import { ListColumn } from '../../components/lists/ListColumn'; 5 | import { ListItem } from '../../components/lists/ListItem'; 6 | 7 | export const FaucetItemLoader = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /src/modules/faucet/FaucetMobileItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Trans } from '@lingui/macro'; 2 | import { Box, Skeleton, Button } from '@mui/material'; 3 | 4 | import { ListColumn } from '../../components/lists/ListColumn'; 5 | import { ListItem } from '../../components/lists/ListItem'; 6 | 7 | export const FaucetMobileItemLoader = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | ); 23 | }; 24 | -------------------------------------------------------------------------------- /src/modules/governance/proposal/ProposalTopPanel.tsx: -------------------------------------------------------------------------------- 1 | import { ArrowLeftIcon } from '@heroicons/react/solid'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, Button, SvgIcon } from '@mui/material'; 4 | import * as React from 'react'; 5 | import { Link, ROUTES } from 'src/components/primitives/Link'; 6 | 7 | import { TopInfoPanel } from '../../../components/TopInfoPanel/TopInfoPanel'; 8 | 9 | export const ProposalTopPanel = () => { 10 | return ( 11 | 12 | 13 | 27 | 28 | 29 | ); 30 | }; 31 | -------------------------------------------------------------------------------- /src/modules/governance/utils/governanceProvider.tsx: -------------------------------------------------------------------------------- 1 | import { AaveGovernanceService } from '@aave/contract-helpers'; 2 | import { governanceConfig } from '../../../ui-config/governanceConfig'; 3 | import { getProvider } from '../../../utils/marketsAndNetworksConfig'; 4 | 5 | export const governanceContract = new AaveGovernanceService(getProvider(governanceConfig.chainId), { 6 | GOVERNANCE_ADDRESS: governanceConfig.addresses.AAVE_GOVERNANCE_V2, 7 | GOVERNANCE_HELPER_ADDRESS: governanceConfig.addresses.AAVE_GOVERNANCE_V2_HELPER, 8 | }); 9 | -------------------------------------------------------------------------------- /src/modules/governance/utils/immutableStates.ts: -------------------------------------------------------------------------------- 1 | import { ProposalState } from '@aave/contract-helpers'; 2 | 3 | export const isProposalStateImmutable = (proposal: { state: ProposalState }) => 4 | ![ 5 | ProposalState.Active, 6 | ProposalState.Pending, 7 | ProposalState.Queued, 8 | ProposalState.Succeeded, 9 | ].includes(proposal.state); 10 | -------------------------------------------------------------------------------- /src/modules/markets/AssetsListItemLoader.tsx: -------------------------------------------------------------------------------- 1 | import { Box, Skeleton } from '@mui/material'; 2 | 3 | import { ListColumn } from '../../components/lists/ListColumn'; 4 | import { ListItem } from '../../components/lists/ListItem'; 5 | 6 | export const AssetsListItemLoader = () => { 7 | return ( 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | ); 41 | }; 42 | -------------------------------------------------------------------------------- /src/modules/reserve-overview/ChartLegend.tsx: -------------------------------------------------------------------------------- 1 | import { Typography, Box } from '@mui/material'; 2 | 3 | interface ChartLegendProps { 4 | labels: { text: string; color: string }[]; 5 | } 6 | 7 | export function ChartLegend({ 8 | labels = [ 9 | { text: 'test', color: '#000' }, 10 | { text: 'bla', color: '#ff0' }, 11 | ], 12 | }: ChartLegendProps) { 13 | return ( 14 | 21 | {labels.map((label) => ( 22 | 23 | 26 | 27 | {label.text} 28 | 29 | 30 | ))} 31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /src/modules/staking/GetABPToken.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react'; 2 | import { Trans } from '@lingui/macro'; 3 | import { Box, Button } from '@mui/material'; 4 | import { DarkTooltip } from 'src/components/infoTooltips/DarkTooltip'; 5 | import { GetAPBTokenModal } from './GetABPTokenModal'; 6 | import { TokenIcon } from 'src/components/primitives/TokenIcon'; 7 | 8 | export const GetABPToken = () => { 9 | const [anchorEl, setAnchorEl] = useState(null); 10 | const open = Boolean(anchorEl); 11 | 12 | const handleClick = (event: React.MouseEvent) => { 13 | setAnchorEl(event.currentTarget); 14 | }; 15 | 16 | const handleClose = () => { 17 | setAnchorEl(null); 18 | }; 19 | 20 | return ( 21 | <> 22 | 23 | 36 | 37 | 38 | 39 | ); 40 | }; 41 | -------------------------------------------------------------------------------- /src/static-build/populateCache.ts: -------------------------------------------------------------------------------- 1 | import { governanceContract } from '../modules/governance/utils/governanceProvider'; 2 | import { Ipfs } from './ipfs'; 3 | import { Proposal } from './proposal'; 4 | //import { Vote } from './vote'; 5 | 6 | /* 7 | Voting cache is currently disabled due to issue #992 8 | */ 9 | 10 | export async function populateCache() { 11 | const count = await governanceContract.getProposalsCount(); 12 | const ipfsFetcher = new Ipfs(); 13 | const proposalFetcher = new Proposal(); 14 | //const voteFetcher = new Vote(); 15 | for (let i = 0; i < count; i++) { 16 | const proposal = await proposalFetcher.populate(i); 17 | await ipfsFetcher.populate(i, proposal); 18 | // await voteFetcher.populate(i, proposal.startBlock, proposal.endBlock); 19 | } 20 | } 21 | populateCache().then(() => console.log('finished')); 22 | -------------------------------------------------------------------------------- /src/ui-config/stakeConfig.ts: -------------------------------------------------------------------------------- 1 | import { ChainId, Stake } from '@aave/contract-helpers'; 2 | 3 | export interface StakeConfig { 4 | chainId: ChainId; 5 | stakeDataProvider: string; 6 | tokens: { 7 | [token: string]: { 8 | TOKEN_STAKING: string; 9 | STAKING_REWARD_TOKEN: string; 10 | STAKING_HELPER?: string; 11 | }; 12 | }; 13 | } 14 | 15 | export const stakeConfig: StakeConfig = { 16 | chainId: ChainId.mainnet, 17 | stakeDataProvider: '0xc57450af527d10Fe182521AB39C1AD23c1e1BaDE', 18 | tokens: { 19 | [Stake.aave]: { 20 | TOKEN_STAKING: '0x4da27a545c0c5b758a6ba100e3a049001de870f5', 21 | STAKING_REWARD_TOKEN: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9', 22 | STAKING_HELPER: '0xce0424653fb2fd48ed1b621bdbd60db16b2e388a', 23 | }, 24 | [Stake.bpt]: { 25 | TOKEN_STAKING: '0xa1116930326D21fB917d5A27F1E9943A9595fb47', 26 | STAKING_REWARD_TOKEN: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9', 27 | }, 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /src/uiConfig.ts: -------------------------------------------------------------------------------- 1 | export const uiConfig = { 2 | appLogo: '/aaveLogo.svg', 3 | }; 4 | -------------------------------------------------------------------------------- /src/utils/eMode.ts: -------------------------------------------------------------------------------- 1 | import { t } from '@lingui/macro'; 2 | 3 | export const eModeInfo: { [key: number]: { label: string } } = { 4 | 1: { 5 | label: t`Stablecoin`, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /src/utils/utils.ts: -------------------------------------------------------------------------------- 1 | import { ChainId } from '@aave/contract-helpers'; 2 | 3 | export function hexToAscii(_hex: string): string { 4 | const hex = _hex.toString(); 5 | let str = ''; 6 | for (let n = 0; n < hex.length; n += 2) { 7 | str += String.fromCharCode(parseInt(hex.substr(n, 2), 16)); 8 | } 9 | return str; 10 | } 11 | 12 | export interface CancelablePromise { 13 | promise: Promise; 14 | cancel: () => void; 15 | } 16 | 17 | export const makeCancelable = (promise: Promise) => { 18 | let hasCanceled_ = false; 19 | 20 | const wrappedPromise = new Promise((resolve, reject) => { 21 | promise.then( 22 | (val) => (hasCanceled_ ? reject({ isCanceled: true }) : resolve(val)), 23 | (error) => (hasCanceled_ ? reject({ isCanceled: true }) : reject(error)) 24 | ); 25 | }); 26 | 27 | return { 28 | promise: wrappedPromise, 29 | cancel() { 30 | hasCanceled_ = true; 31 | }, 32 | }; 33 | }; 34 | 35 | export const optimizedPath = (currentChainId: ChainId) => { 36 | return ( 37 | currentChainId === ChainId.arbitrum_one || 38 | currentChainId === ChainId.arbitrum_rinkeby || 39 | currentChainId === ChainId.optimism 40 | // || 41 | // currentChainId === ChainId.optimism_kovan 42 | ); 43 | }; 44 | -------------------------------------------------------------------------------- /svgo.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | multipass: true, 3 | plugins: [ 4 | { 5 | name: 'preset-default', 6 | params: { 7 | overrides: { 8 | // viewBox is required to resize SVGs with CSS. 9 | // @see https://github.com/svg/svgo/issues/1128 10 | removeViewBox: false, 11 | }, 12 | }, 13 | }, 14 | ], 15 | }; 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "target": "es2016", 5 | "module": "esnext", 6 | "jsx": "preserve", 7 | "allowJs": false, 8 | "strict": true, 9 | "moduleResolution": "node", 10 | "allowSyntheticDefaultImports": true, 11 | "noUnusedLocals": true, 12 | "noUnusedParameters": true, 13 | "removeComments": true, 14 | "preserveConstEnums": true, 15 | "sourceMap": true, 16 | "skipLibCheck": true, 17 | "esModuleInterop": true, 18 | "baseUrl": ".", 19 | "typeRoots": ["./node_modules/@types"], 20 | "lib": ["dom", "es2017"], 21 | "forceConsistentCasingInFileNames": true, 22 | "noEmit": true, 23 | "resolveJsonModule": true, 24 | "isolatedModules": true, 25 | "incremental": true, 26 | "useUnknownInCatchVariables": false, 27 | "types": ["cypress", "cypress-wait-until"], 28 | }, 29 | "exclude": [ 30 | "dist", 31 | ".next", 32 | "out", 33 | "node_modules", 34 | "next.config.js", 35 | "postcss.config.js", 36 | "**/*.spec.ts", 37 | "**/*.spec.tsx", 38 | "**/*.test.ts", 39 | "**/*.test.tsx", 40 | "coverage", 41 | "cypress" 42 | ], 43 | "include": ["custom.d.ts", "next-env.d.ts", "**/*.ts", "**/*.tsx"] 44 | } 45 | --------------------------------------------------------------------------------