Skip to content

Commit

Permalink
Merge branch 'master' into copy-error-extended
Browse files Browse the repository at this point in the history
  • Loading branch information
jvonasek authored Dec 6, 2024
2 parents c9fab7e + 1859bfa commit ae4ff89
Show file tree
Hide file tree
Showing 28 changed files with 151 additions and 232 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@emotion/styled": "^11.10.4",
"@ethersproject/address": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@galacticcouncil/apps": "^9.0.2",
"@galacticcouncil/apps": "^9.1.0",
"@galacticcouncil/math-lbp": "^1.0.0",
"@galacticcouncil/math-liquidity-mining": "^1.0.0",
"@galacticcouncil/math-omnipool": "^1.0.0",
Expand All @@ -47,15 +47,15 @@
"@galacticcouncil/math-xyk": "^1.0.0",
"@galacticcouncil/sdk": "^5.0.1",
"@galacticcouncil/ui": "^5.2.3",
"@galacticcouncil/xcm-cfg": "^5.5.1",
"@galacticcouncil/xcm-cfg": "^5.6.0",
"@galacticcouncil/xcm-core": "^5.4.0",
"@galacticcouncil/xcm-sdk": "^7.0.0",
"@hookform/resolvers": "^3.3.4",
"@lit-labs/react": "^1.1.0",
"@polkadot/api": "14.0.1",
"@polkadot/apps-config": "^0.132.1",
"@polkadot/extension-inject": "^0.48.2",
"@polkadot/networks": "^13.2.2",
"@polkadot/networks": "^13.2.3",
"@polkadot/ui-shared": "^3.1.4",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.5",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@
"staking.dashboard.rewards.legend.current": "Current rewards",
"staking.dashboard.rewards.legend.future": "Rewards after voting",
"staking.dashboard.rewards.legend.tooltip": "You have to vote max conviction with whole staking position",
"staking.dashboard.graph.axisY": "Paylable Percentage",
"staking.dashboard.graph.axisY": "Payable Percentage",
"staking.dashboard.graph.axisX": "Days",
"staking.dashboard.rewards.button": "Claim",
"staking.dashboard.stats.chart.label": "Staked HDX",
Expand Down
10 changes: 1 addition & 9 deletions src/sections/lending/components/caps/DebtCeilingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ export const DebtCeilingStatus = ({
Debt ceiling limits the amount possible to borrow against this
asset by protocol users. Debt ceiling is specific to assets in
isolation mode and is denoted in USD.
</span>{" "}
<a
target="_blank"
href="https://docs.aave.com/faq/aave-v3-features#how-does-isolation-mode-affect-my-borrowing-power"
rel="noreferrer"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</a>
</span>
</span>
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip"
import { Text } from "components/Typography/Text/Text"
import { Link } from "sections/lending/components/primitives/Link"
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"

type BorrowCapMaxedTooltipProps = {
Expand All @@ -16,16 +15,8 @@ export const BorrowCapMaxedTooltip = ({
<InfoTooltip
text={
<Text>
<span>
Protocol borrow cap at 100% for this asset. Further borrowing
unavailable.
</span>{" "}
<Link
href="https://docs.aave.com/developers/whats-new/supply-borrow-caps"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
Protocol borrow cap at 100% for this asset. Further borrowing
unavailable.
</Text>
}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip"
import { Link } from "sections/lending/components/primitives/Link"
import { Text } from "components/Typography/Text/Text"

type DebtCeilingMaxedTooltipProps = {
Expand All @@ -16,16 +15,8 @@ export const DebtCeilingMaxedTooltip = ({
<InfoTooltip
text={
<Text>
<span>
Protocol debt ceiling is at 100% for this asset. Futher borrowing
against this asset is unavailable.
</span>{" "}
<Link
href="https://docs.aave.com/faq/aave-v3-features#how-does-isolation-mode-affect-my-borrowing-power"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
Protocol debt ceiling is at 100% for this asset. Futher borrowing
against this asset is unavailable.
</Text>
}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"
import { Link } from "sections/lending/components/primitives/Link"
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip"
import { Text } from "components/Typography/Text/Text"

Expand All @@ -16,16 +15,8 @@ export const SupplyCapMaxedTooltip = ({
<InfoTooltip
text={
<Text>
<span>
Protocol supply cap at 100% for this asset. Further supply
unavailable.
</span>{" "}
<Link
href="https://docs.aave.com/developers/whats-new/supply-borrow-caps"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
Protocol supply cap at 100% for this asset. Further supply
unavailable.
</Text>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,8 @@ export const EmodeModalContent = ({ mode }: EmodeModalContentProps) => {
{user.userEmodeCategoryId === 0 && (
<Alert variant="warning" sx={{ mt: 12 }}>
<Text>
<span>
Enabling E-Mode only allows you to borrow assets belonging to the
selected category. Please visit our{" "}
<a
href="https://docs.aave.com/faq/aave-v3-features#high-efficiency-mode-e-mode"
target="_blank"
rel="noopener noreferrer"
>
FAQ guide
</a>{" "}
to learn more about how it works and the applied restrictions.
</span>
Enabling E-Mode only allows you to borrow assets belonging to the
selected category.
</Text>
</Alert>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"
import { Alert } from "components/Alert"
import { Link } from "sections/lending/components/primitives/Link"

type BorrowCapWarningProps = {
borrowCap: AssetCapData
Expand Down Expand Up @@ -29,13 +28,7 @@ export const BorrowCapWarning = ({

return (
<Alert {...rest} variant="warning">
{renderText()}{" "}
<Link
href="https://docs.aave.com/developers/whats-new/supply-borrow-caps"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
{renderText()}
</Alert>
)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"
import { Alert } from "components/Alert"
import { Link } from "sections/lending/components/primitives/Link"

type DebtCeilingWarningProps = {
debtCeiling: AssetCapData
Expand Down Expand Up @@ -29,13 +28,7 @@ export const DebtCeilingWarning = ({

return (
<Alert variant={debtCeiling.isMaxed ? "error" : "warning"} {...rest}>
{renderText()}{" "}
<Link
href="https://docs.aave.com/faq/aave-v3-features#how-does-isolation-mode-affect-my-borrowing-power"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
{renderText()}
</Alert>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ export const IsolationModeWarning = ({
In Isolation mode, you cannot supply other assets as collateral. A
global debt ceiling limits the borrowing power of the isolated asset. To
exit isolation mode disable {asset ? asset : ""} as collateral before
borrowing another asset. Read more in our{" "}
<Link href="https://docs.aave.com/faq/aave-v3-features#isolation-mode">
FAQ
</Link>
borrowing another asset.
</Text>
</Alert>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AssetCapData } from "sections/lending/hooks/useAssetCaps"
import { Link } from "sections/lending/components/primitives/Link"
import { Alert } from "components/Alert"

type SupplyCapWarningProps = {
Expand Down Expand Up @@ -33,13 +32,7 @@ export const SupplyCapWarning = ({

return (
<Alert variant={severity} {...rest}>
{renderText()}{" "}
<Link
href="https://docs.aave.com/developers/whats-new/supply-borrow-caps"
css={{ textDecoration: "underline" }}
>
<span>Learn more</span>
</Link>
{renderText()}
</Alert>
)
}
13 changes: 0 additions & 13 deletions src/sections/lending/ui/isolation-mode/IsolationBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,6 @@ const IsolationModeTooltipTemplate = ({ content }: { content: ReactNode }) => {
<Text fs={12} lh={18} sx={{ mb: 6 }}>
{content}
</Text>
<Text fs={12} lh={18}>
<span>
Learn more in our{" "}
<a
target="_blank"
href="https://docs.aave.com/faq/aave-v3-features#isolation-mode"
rel="noreferrer"
css={{ textDecoration: "underline" }}
>
FAQ guide
</a>
</span>
</Text>
</div>
)
}
10 changes: 1 addition & 9 deletions src/sections/lending/ui/reserve-overview/BorrowInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,7 @@ export const BorrowInfo = ({
<InfoTooltip
text={
<Text fs={12}>
{t("lending.tooltip.borrowCap")}{" "}
<a
css={{ textDecoration: "underline" }}
target="_blank"
href="https://docs.aave.com/developers/whats-new/supply-borrow-caps"
rel="noreferrer"
>
{t("lending.learnMore")}
</a>
{t("lending.tooltip.borrowCap")}
</Text>
}
>
Expand Down
9 changes: 1 addition & 8 deletions src/sections/lending/ui/reserve-overview/SupplyInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,7 @@ export const SupplyInfo = ({
{t("lending.supply.isolatedCollateral.title")}
</Text>
<Text fs={13}>
{t("lending.supply.isolatedCollateral.description")}{" "}
<a
target="_blank"
href="https://docs.aave.com/faq/aave-v3-features#isolation-mode"
rel="noreferrer"
>
{t("lending.learnMore")}
</a>
{t("lending.supply.isolatedCollateral.description")}
</Text>
</Alert>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ export const LiquidationRiskParametresInfoModal = ({
<>
<Text color="basic400" fs={14} lh={20} sx={{ mb: 32 }}>
{t("lending.risk.description")}
<br />
<a
href="https://docs.aave.com/faq/"
css={{ textDecoration: "underline" }}
sx={{ color: "brightBlue100" }}
>
{t("lending.learnMore")}
</a>
</Text>
<InfoWrapper
topTitle={t("lending.risk.hf.title")}
Expand Down
3 changes: 2 additions & 1 deletion src/sections/lending/ui/transactions/AssetInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ export const AssetInput = <T extends Asset = Asset>({
<div
sx={{
flex: "row",
align: "center",
justify: "space-between",
gap: 10,
}}
>
{!onSelect || assets.length === 1 ? (
Expand Down Expand Up @@ -232,6 +232,7 @@ export const AssetInput = <T extends Asset = Asset>({
id={name}
name={name}
placeholder="0.00"
sx={{ width: "100%" }}
disabled={disabled || disableInput}
value={value}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export const PoolAddLiquidityInformationCard = () => {
<Text fs={13} lh={16}>
{t("liquidity.add.modal.information.text")}
</Text>
<SLink href={`${DOC_LINK}/omnipool_impermanent_loss`} target="_blank">
<SLink
href={`${DOC_LINK}/products/trading/pools/learn_amm#impermanent-loss`}
target="_blank"
>
{t("liquidity.add.modal.information.linkText")}
</SLink>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/sections/staking/StakingPage.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,9 @@ export const useClaimReward = () => {
stakePosition.accumulatedSlashPoints.toString(),
)

const extraPaylablePercentage = wasm.sigmoid(extraPoints, a, b)
const extraPayablePercentage = wasm.sigmoid(extraPoints, a, b)

extraPayablePercentageHuman = scaleHuman(extraPaylablePercentage, "q")
extraPayablePercentageHuman = scaleHuman(extraPayablePercentage, "q")
.multipliedBy(100)
.toString()
}
Expand All @@ -571,7 +571,7 @@ export const useClaimReward = () => {
BN(payablePercentageHuman).gte(chartPoints.y) &&
(arr[i + 1] ? BN(payablePercentageHuman).lt(arr[i + 1].y) : true)

//calculate paylable percentage if vote ongoing referendas
// calculate payable percentage if vote ongoing referendas
const currentSecondary = extraPayablePercentageHuman
? BN(extraPayablePercentageHuman).gte(chartPoints.y) &&
(arr[i + 1] ? BN(extraPayablePercentageHuman).lt(arr[i + 1].y) : true)
Expand Down
6 changes: 3 additions & 3 deletions src/sections/transaction/ReviewTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ReviewTransaction = (props: Transaction) => {
txLink,
txHash,
bridge,
} = useSendTx()
} = useSendTx(props.xcallMeta)

if (!isLoaded) return null

Expand Down Expand Up @@ -145,9 +145,9 @@ export const ReviewTransaction = (props: Transaction) => {
props.onSubmitted?.()
sendEvmTx(data)
}}
onSigned={(tx, xcallMeta) => {
onSigned={(tx) => {
props.onSubmitted?.()
sendTx({ tx, xcallMeta })
sendTx({ tx })
}}
onPermitDispatched={(permit) => {
props.onSubmitted?.()
Expand Down
Loading

0 comments on commit ae4ff89

Please sign in to comment.