fix
This commit is contained in:
1
dist/assets/index-BP0dDjYZ.css
vendored
1
dist/assets/index-BP0dDjYZ.css
vendored
File diff suppressed because one or more lines are too long
1
dist/assets/index-CzU7MdbY.css
vendored
Normal file
1
dist/assets/index-CzU7MdbY.css
vendored
Normal file
File diff suppressed because one or more lines are too long
161
dist/assets/index-DFLADCGY.js
vendored
161
dist/assets/index-DFLADCGY.js
vendored
File diff suppressed because one or more lines are too long
161
dist/assets/index-NvuTFZg0.js
vendored
Normal file
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
4
dist/index.html
vendored
@@ -5,8 +5,8 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DFLADCGY.js"></script>
|
<script type="module" crossorigin src="/assets/index-NvuTFZg0.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BP0dDjYZ.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CzU7MdbY.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ export function BridgeForm() {
|
|||||||
const { data: relayQuote } = useRelayQuote(relayQuotePayload)
|
const { data: relayQuote } = useRelayQuote(relayQuotePayload)
|
||||||
|
|
||||||
const serviceFee = relayQuote?.appCommission?.usd?.toString()
|
const serviceFee = relayQuote?.appCommission?.usd?.toString()
|
||||||
|
const serviceFeeToken = relayQuote?.appCommission?.inToken
|
||||||
|
|
||||||
const displayToAmount = relayQuote
|
const displayToAmount = relayQuote
|
||||||
? relayQuote.details.currencyOut.amountFormatted
|
? relayQuote.details.currencyOut.amountFormatted
|
||||||
@@ -245,7 +246,7 @@ export function BridgeForm() {
|
|||||||
hideNetworkSelect
|
hideNetworkSelect
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BridgeInfoPanel serviceFee={serviceFee} />
|
<BridgeInfoPanel serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
||||||
|
|
||||||
<PrimaryButton label={isPending ? 'Загрузка...' : 'Подтвердить бридж'} onClick={handleConfirm} disabled={!quotePayload || isPending} />
|
<PrimaryButton label={isPending ? 'Загрузка...' : 'Подтвердить бридж'} onClick={handleConfirm} disabled={!quotePayload || isPending} />
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
|
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
|
||||||
import styles from './BridgeInfoPanel.module.css'
|
import styles from './BridgeInfoPanel.module.css'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
serviceFee?: string
|
serviceFee?: string
|
||||||
|
serviceFeeToken?: { symbol: string; amount: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BridgeInfoPanel({ serviceFee }: Props) {
|
export function BridgeInfoPanel({ serviceFee, serviceFeeToken }: Props) {
|
||||||
const rows = [
|
const rows = [
|
||||||
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—' },
|
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—' },
|
||||||
|
{
|
||||||
|
label: serviceFeeToken ? `СЕРВИСНЫЙ СБОР (${serviceFeeToken.symbol})` : 'СЕРВИСНЫЙ СБОР В ТОКЕНАХ',
|
||||||
|
value: serviceFeeToken ? truncateDecimals(serviceFeeToken.amount, 8) : '—',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -121,7 +121,9 @@ export function useSwapForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setPercent(p: number) {
|
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() {
|
function swapTokens() {
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ export function SwapForm() {
|
|||||||
: quoteData?.fees.gas.amountUsd
|
: quoteData?.fees.gas.amountUsd
|
||||||
|
|
||||||
const serviceFee = quoteData?.appCommission?.usd?.toString()
|
const serviceFee = quoteData?.appCommission?.usd?.toString()
|
||||||
|
const serviceFeeToken = quoteData?.appCommission?.inToken
|
||||||
|
|
||||||
const isButtonDisabled = isTrxNetwork
|
const isButtonDisabled = isTrxNetwork
|
||||||
? parsedAmount <= 0 || isFetchingTrxQuote
|
? parsedAmount <= 0 || isFetchingTrxQuote
|
||||||
@@ -155,7 +156,7 @@ export function SwapForm() {
|
|||||||
onTokenChange={setToToken}
|
onTokenChange={setToToken}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} />
|
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
||||||
|
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
label={isSwapping || isFetchingTrxQuote ? 'Загрузка...' : undefined}
|
label={isSwapping || isFetchingTrxQuote ? 'Загрузка...' : undefined}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
|
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
|
||||||
import styles from './SwapInfoPanel.module.css'
|
import styles from './SwapInfoPanel.module.css'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
gasFee?: string
|
gasFee?: string
|
||||||
serviceFee?: string
|
serviceFee?: string
|
||||||
|
serviceFeeToken?: { symbol: string; amount: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SwapInfoPanel({ gasFee, serviceFee }: Props) {
|
export function SwapInfoPanel({ gasFee, serviceFee, serviceFeeToken }: Props) {
|
||||||
const rows = [
|
const rows = [
|
||||||
{ label: 'ПРОВАЙДЕР', value: 'ЛУЧШИЙ', link: false },
|
{ label: 'ПРОВАЙДЕР', value: 'ЛУЧШИЙ', link: false },
|
||||||
{ label: 'СКОЛЬЖЕНИЕ', value: 'АВТО (0.5%)', link: true },
|
{ label: 'СКОЛЬЖЕНИЕ', value: 'АВТО (0.5%)', link: true },
|
||||||
{ label: 'СЕТЕВОЙ СБОР', value: gasFee ? `$${gasFee}` : '—', link: false },
|
{ label: 'СЕТЕВОЙ СБОР', value: gasFee ? `$${gasFee}` : '—', link: false },
|
||||||
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—', link: false },
|
{ label: 'СЕРВИСНЫЙ СБОР', value: serviceFee ? `$${serviceFee}` : '—', link: false },
|
||||||
|
{
|
||||||
|
label: serviceFeeToken ? `СЕРВИСНЫЙ СБОР (${serviceFeeToken.symbol})` : 'СЕРВИСНЫЙ СБОР В ТОКЕНАХ',
|
||||||
|
value: serviceFeeToken ? truncateDecimals(serviceFeeToken.amount, 8) : '—',
|
||||||
|
link: false,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user