add staking page
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useState } from 'react'
|
||||
import { Notification } from '@shared/ui'
|
||||
import { truncateDecimals } from '@shared/lib/utils/truncateDecimals'
|
||||
import { ChainToggle } from './ChainToggle'
|
||||
import { StakeCard } from './StakeCard'
|
||||
import { PositionsPanel } from './PositionsPanel'
|
||||
@@ -34,12 +35,16 @@ export function StakingWidget() {
|
||||
setAmount('')
|
||||
}
|
||||
|
||||
function handleStake() {
|
||||
// stakeAmountHuman — это сумма стейка A (= введённое − газ), её и отправляем на бэкенд.
|
||||
function handleStake(stakeAmountHuman: string) {
|
||||
stakeM.mutate(
|
||||
{ chain, amountHuman: amount },
|
||||
{ chain, amountHuman: stakeAmountHuman },
|
||||
{
|
||||
onSuccess: () => {
|
||||
setToast({ status: 'success', message: `Стейкинг ${amount} ${CHAIN_META[chain].symbol} выполнен` })
|
||||
setToast({
|
||||
status: 'success',
|
||||
message: `Стейкинг ${truncateDecimals(stakeAmountHuman, 6)} ${CHAIN_META[chain].symbol} выполнен`,
|
||||
})
|
||||
setAmount('')
|
||||
},
|
||||
onError: (e) => setToast({ status: 'error', message: getStakingErrorMessage(e) }),
|
||||
|
||||
Reference in New Issue
Block a user