This commit is contained in:
2026-06-26 16:01:44 +03:00
parent 564f21552d
commit 7e3493005b
11 changed files with 187 additions and 170 deletions

File diff suppressed because one or more lines are too long

1
dist/assets/index-CzU7MdbY.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

161
dist/assets/index-NvuTFZg0.js vendored Normal file

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View File

@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
<script type="module" crossorigin src="/assets/index-DFLADCGY.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BP0dDjYZ.css">
<script type="module" crossorigin src="/assets/index-NvuTFZg0.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CzU7MdbY.css">
</head>
<body>
<div id="root"></div>

View File

@@ -154,6 +154,7 @@ export function BridgeForm() {
const { data: relayQuote } = useRelayQuote(relayQuotePayload)
const serviceFee = relayQuote?.appCommission?.usd?.toString()
const serviceFeeToken = relayQuote?.appCommission?.inToken
const displayToAmount = relayQuote
? relayQuote.details.currencyOut.amountFormatted
@@ -245,7 +246,7 @@ export function BridgeForm() {
hideNetworkSelect
/>
<BridgeInfoPanel serviceFee={serviceFee} />
<BridgeInfoPanel serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
<PrimaryButton label={isPending ? 'Загрузка...' : 'Подтвердить бридж'} onClick={handleConfirm} disabled={!quotePayload || isPending} />

View File

@@ -1,12 +1,18 @@
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
import styles from './BridgeInfoPanel.module.css'
interface Props {
serviceFee?: string
serviceFeeToken?: { symbol: string; amount: string }
}
export function BridgeInfoPanel({ serviceFee }: Props) {
export function BridgeInfoPanel({ serviceFee, serviceFeeToken }: Props) {
const rows = [
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—' },
{
label: serviceFeeToken ? `СЕРВИСНЫЙ СБОР (${serviceFeeToken.symbol})` : 'СЕРВИСНЫЙ СБОР В ТОКЕНАХ',
value: serviceFeeToken ? truncateDecimals(serviceFeeToken.amount, 8) : '—',
},
]
return (

View File

@@ -121,7 +121,9 @@ export function useSwapForm() {
}
function setPercent(p: number) {
setFromAmountRaw((fromToken.balance * p / 100).toFixed(4))
// На «МАКС»/100% оставляем запас на комиссию сети — выставляем 99% баланса (молча, без уведомления юзера).
const effective = p >= 100 ? 99 : p
setFromAmountRaw((fromToken.balance * effective / 100).toFixed(4))
}
function swapTokens() {

View File

@@ -110,6 +110,7 @@ export function SwapForm() {
: quoteData?.fees.gas.amountUsd
const serviceFee = quoteData?.appCommission?.usd?.toString()
const serviceFeeToken = quoteData?.appCommission?.inToken
const isButtonDisabled = isTrxNetwork
? parsedAmount <= 0 || isFetchingTrxQuote
@@ -155,7 +156,7 @@ export function SwapForm() {
onTokenChange={setToToken}
/>
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} />
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
<PrimaryButton
label={isSwapping || isFetchingTrxQuote ? 'Загрузка...' : undefined}

View File

@@ -1,16 +1,23 @@
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
import styles from './SwapInfoPanel.module.css'
interface Props {
gasFee?: string
serviceFee?: string
serviceFeeToken?: { symbol: string; amount: string }
}
export function SwapInfoPanel({ gasFee, serviceFee }: Props) {
export function SwapInfoPanel({ gasFee, serviceFee, serviceFeeToken }: Props) {
const rows = [
{ label: 'ПРОВАЙДЕР', value: 'ЛУЧШИЙ', link: false },
{ label: 'СКОЛЬЖЕНИЕ', value: 'АВТО (0.5%)', link: true },
{ label: 'СЕТЕВОЙ СБОР', value: gasFee ? `$${gasFee}` : '—', link: false },
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—', link: false },
{
label: serviceFeeToken ? `СЕРВИСНЫЙ СБОР (${serviceFeeToken.symbol})` : 'СЕРВИСНЫЙ СБОР В ТОКЕНАХ',
value: serviceFeeToken ? truncateDecimals(serviceFeeToken.amount, 8) : '—',
link: false,
},
]
return (

File diff suppressed because one or more lines are too long