Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9683f77
Refactor technical fees handling in GmSwapBox components to utilize a…
midas-myth Dec 11, 2025
9e49d26
Merge branch 'release-92' of github.com:gmx-io/gmx-interface into mul…
midas-myth Dec 12, 2025
9dc994e
Refactor technical fees handling in GmSwapBox components to utilize a…
midas-myth Dec 11, 2025
c7c3472
Refactor deposit and withdrawal transaction hooks to improve error ha…
midas-myth Dec 12, 2025
d1c51e1
Refactor deposit transaction logic to remove unnecessary isGlv checks…
midas-myth Dec 12, 2025
69ab4b6
Sync translations
midas-myth Dec 12, 2025
69a0912
Sync translations
midas-myth Dec 23, 2025
cc44b24
Merge branch 'multichain-lp-gmx-acc-fix' into fedev-3074-fix-multicha…
midas-myth Dec 23, 2025
30e0223
Refactor signCreateGlvWithdrawal function to accept AbstractSigner an…
midas-myth Dec 23, 2025
53714db
Refactor technical fees handling in useGmSwapSubmitState and useWithd…
midas-myth Dec 23, 2025
935ffb1
Merge branch 'release' of github.com:gmx-io/gmx-interface into fedev-…
midas-myth Dec 24, 2025
0dfa183
Enhance technical fees handling by adding isDeposit and isGlv flags t…
midas-myth Dec 24, 2025
cf8597c
Refactor gas estimation logic in arbitraryRelayParams.ts to utilize E…
midas-myth Dec 24, 2025
7e90156
Update value calculation in estimateExpressParams to divide maxUint25…
midas-myth Dec 24, 2025
41a2538
Refactor wrapped token data retrieval in useDepositWithdrawalFees to …
midas-myth Dec 24, 2025
62821c3
Merge branch 'release' of github.com:gmx-io/gmx-interface into fedev-…
midas-myth Jan 6, 2026
42cb996
Refactor GmSwap components to centralize operation and mode types
midas-myth Jan 6, 2026
a47dc02
Refactor technical fees handling in GmSwap components
midas-myth Jan 6, 2026
65d9694
Fix estimateArbitraryGasLimit
midas-myth Jan 7, 2026
ec543df
Add useOpenInterestInTokensForBalance field and related enums to Mark…
midas-myth Jan 7, 2026
dabd109
Merge branch 'release' of github.com:gmx-io/gmx-interface into fedev-…
midas-myth Jan 7, 2026
9ebf3bf
Reorder import statements in TradeBox component for consistency
midas-myth Jan 7, 2026
64e15c9
Update WithdrawalView to prevent button state change during loading o…
midas-myth Jan 13, 2026
189478c
Refactor TransferDetailsView and WithdrawalView for token address han…
midas-myth Jan 13, 2026
a331e15
Enhance loading state handling in WithdrawalView to include additiona…
midas-myth Jan 14, 2026
1e42449
Merge branch 'release' of github.com:gmx-io/gmx-interface into fedev-…
midas-myth Jan 14, 2026
967f9c6
Add gas payment network fee display in BridgeOutModal
midas-myth Jan 14, 2026
2841f6a
Sync translations
midas-myth Jan 14, 2026
c37acac
Remove unused fromChainProvider parameter in DepositView and Withdraw…
midas-myth Jan 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions src/components/BridgeModal/BridgeOutModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { t, Trans } from "@lingui/macro";
import { ReactNode, useEffect, useMemo, useState } from "react";
import Skeleton from "react-loading-skeleton";
import { Address, encodeAbiParameters } from "viem";
import { Address, encodeAbiParameters, zeroAddress } from "viem";
import { useAccount } from "wagmi";

import {
Expand All @@ -15,10 +15,15 @@ import { getChainIcon } from "config/icons";
import { getLayerZeroEndpointId, getStargatePoolAddress } from "config/multichain";
import { useGmxAccountSettlementChainId } from "context/GmxAccountContext/hooks";
import { selectMultichainMarketTokenBalances } from "context/PoolsDetailsContext/selectors/selectMultichainMarketTokenBalances";
import { selectDepositMarketTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors";
import {
selectDepositMarketTokensData,
selectTokensData,
} from "context/SyntheticsStateContext/selectors/globalSelectors";
import { useSelector } from "context/SyntheticsStateContext/utils";
import { useArbitraryError, useArbitraryRelayParamsAndPayload } from "domain/multichain/arbitraryRelayParams";
import { getMultichainTransferSendParams } from "domain/multichain/getSendParams";
import type { BridgeOutParams } from "domain/multichain/types";
import { useQuoteSendNativeFee } from "domain/multichain/useQuoteSend";
import { buildAndSignBridgeOutTxn } from "domain/synthetics/express/expressOrderUtils";
import { ExpressTransactionBuilder } from "domain/synthetics/express/types";
import { getGlvOrMarketAddress, GlvOrMarketInfo } from "domain/synthetics/markets";
Expand Down Expand Up @@ -61,6 +66,7 @@ export function BridgeOutModal({
const [bridgeOutInputValue, setBridgeOutInputValue] = useState("");
const [isCreatingTxn, setIsCreatingTxn] = useState(false);

const tokensData = useSelector(selectTokensData);
const depositMarketTokensData = useSelector(selectDepositMarketTokensData);
const glvOrMarketAddress = glvOrMarketInfo ? getGlvOrMarketAddress(glvOrMarketInfo) : undefined;
const marketToken = getTokenData(depositMarketTokensData, glvOrMarketAddress);
Expand Down Expand Up @@ -150,6 +156,53 @@ export function BridgeOutModal({
enabled: isVisible,
});

const sendParams = useMemo(() => {
if (!bridgeOutChain || !account || bridgeOutAmount === undefined || bridgeOutAmount <= 0n) {
return;
}

return getMultichainTransferSendParams({
dstChainId: bridgeOutChain,
account,
amountLD: bridgeOutAmount,
isToGmx: false,
isManualGas: true,
srcChainId: chainId,
});
}, [bridgeOutChain, account, bridgeOutAmount, chainId]);

const transferNativeFee = useQuoteSendNativeFee({
fromChainId: chainId,
toChainId: bridgeOutChain,
sendParams,
fromStargateAddress: bridgeOutParams?.provider,
});

const networkFeeUsd = useMemo(() => {
if (
transferNativeFee === undefined ||
tokensData === undefined ||
tokensData[zeroAddress] === undefined ||
expressTxnParamsAsyncResult.data === undefined
) {
return;
}

const relayFeeUsd = convertToUsd(
expressTxnParamsAsyncResult.data.gasPaymentParams.gasPaymentTokenAmount,
expressTxnParamsAsyncResult.data.gasPaymentParams.gasPaymentToken.decimals,
getMidPrice(expressTxnParamsAsyncResult.data.gasPaymentParams.gasPaymentToken.prices)
)!;

const transferNativeFeeUsd = convertToUsd(
transferNativeFee,
tokensData[zeroAddress].decimals,
tokensData[zeroAddress].prices.minPrice
)!;

return relayFeeUsd + transferNativeFeeUsd;
}, [transferNativeFee, tokensData, expressTxnParamsAsyncResult.data]);

const errors = useArbitraryError(expressTxnParamsAsyncResult.error);
const hasOutdatedUi = useHasOutdatedUi();

Expand Down Expand Up @@ -354,6 +407,9 @@ export function BridgeOutModal({
<Button className="w-full" type="submit" variant="primary-action" disabled={buttonState.disabled}>
{buttonState.text}
</Button>

<SyntheticsInfoRow label={t`Network Fee`} value={formatUsd(networkFeeUsd)} />

<SyntheticsInfoRow
label={t`GMX Account Balance`}
value={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import {
getMarketPoolName,
} from "domain/synthetics/markets";
import { isGlvInfo } from "domain/synthetics/markets/glv";
import { Mode, Operation } from "domain/synthetics/markets/types";
import { formatPercentage } from "lib/numbers";
import { EarnPagePortfolioItemType, sendEarnPortfolioItemClickEvent } from "lib/userAnalytics/earnEvents";
import { ContractsChainId } from "sdk/configs/chains";
import { getNormalizedTokenSymbol } from "sdk/configs/tokens";

import { AmountWithUsdBalance } from "components/AmountWithUsd/AmountWithUsd";
import Button from "components/Button/Button";
import { Mode, Operation } from "components/GmSwap/GmSwapBox/types";
import { MultichainBalanceTooltip } from "components/MultichainBalanceTooltip/MultichainBalanceTooltip";
import { SyntheticsInfoRow } from "components/SyntheticsInfoRow";
import TokenIcon from "components/TokenIcon/TokenIcon";
Expand Down
3 changes: 1 addition & 2 deletions src/components/GmSwap/GmFees/GmFees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cx from "classnames";
import { ReactNode, useMemo } from "react";
import Skeleton from "react-loading-skeleton";

import { Operation } from "domain/synthetics/markets/types";
import { formatDeltaUsd, formatPercentage } from "lib/numbers";
import { getPositiveOrNegativeClass } from "lib/utils";
import { FeeItem } from "sdk/types/fees";
Expand All @@ -12,8 +13,6 @@ import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow";
import { SyntheticsInfoRow } from "components/SyntheticsInfoRow";
import Tooltip from "components/Tooltip/Tooltip";

import { Operation } from "../GmSwapBox/types";

import "./GmFees.scss";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function GmSwapBoxDepositWithdrawal() {

const technicalFees = useTechnicalFees();

const { logicalFees } = useDepositWithdrawalFees({
const logicalFees = useDepositWithdrawalFees({
amounts,
chainId,
gasLimits,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { t, Trans } from "@lingui/macro";
import { useState } from "react";

import { Operation } from "domain/synthetics/markets/types";
import { GmSwapFees } from "domain/synthetics/trade";
import { formatDeltaUsd } from "lib/numbers";

Expand All @@ -9,8 +10,6 @@ import { GmFees } from "components/GmSwap/GmFees/GmFees";
import { SyntheticsInfoRow } from "components/SyntheticsInfoRow";
import { UsdValueWithSkeleton } from "components/UsdValueWithSkeleton/UsdValueWithSkeleton";

import { Operation } from "../types";

export function InfoRows({
isDeposit,
fees,
Expand Down
Loading