diff --git a/src/app/components/UserAssets/Vesting/VestingWithdrawForm.tsx b/src/app/components/UserAssets/Vesting/VestingWithdrawForm.tsx index 951de61e5..446a7d8c6 100644 --- a/src/app/components/UserAssets/Vesting/VestingWithdrawForm.tsx +++ b/src/app/components/UserAssets/Vesting/VestingWithdrawForm.tsx @@ -18,6 +18,7 @@ import { VestingUnlockScheduleDialog } from './VestingUnlockScheduleDialog'; import { gasLimit } from 'utils/classifiers'; import { TransactionDialog } from 'app/components/TransactionDialog'; import { Icon } from 'app/components/Icon'; +import { TxFeeCalculator } from 'app/pages/MarginTradePage/components/TxFeeCalculator'; type VestingWithdrawFormProps = { vesting: FullVesting; @@ -50,18 +51,19 @@ export const VestingWithdrawForm: React.FC = ({ [vesting], ); + const txConfig = useMemo( + () => ({ + from: account, + gas: gasLimit[vestingTxType], + }), + [account, vestingTxType], + ); + const handleSubmit = useCallback(() => { if (!tx.loading) { - send( - [address.toLowerCase()], - { - from: account, - gas: gasLimit[vestingTxType], - }, - { type: vestingTxType }, - ); + send([address.toLowerCase()], txConfig, { type: vestingTxType }); } - }, [account, address, send, tx, vestingTxType]); + }, [address, send, tx, vestingTxType, txConfig]); const [scheduleOpen, setScheduleOpen] = useState(false); const openSchedule = useCallback(event => { @@ -119,9 +121,13 @@ export const VestingWithdrawForm: React.FC = ({ /> -
- {t(translations.common.fee, { amount: '0.000019' })} -
+
diff --git a/src/app/containers/StakePage/components/VestingContract.tsx b/src/app/containers/StakePage/components/VestingContract.tsx index e53bb29cb..f73ac77d8 100644 --- a/src/app/containers/StakePage/components/VestingContract.tsx +++ b/src/app/containers/StakePage/components/VestingContract.tsx @@ -64,6 +64,10 @@ const getTokenContractNameByVestingType = (type: VestGroup) => { } }; +const withdrawTxConfig = { + gas: gasLimit[TxType.SOV_WITHDRAW_VESTING], +}; + export const VestingContract: React.FC = ({ vestingAddress, type, @@ -187,9 +191,7 @@ export const VestingContract: React.FC = ({ const handleWithdraw = useCallback( (receiver: string) => { - send([receiver], { - gas: gasLimit[TxType.SOV_WITHDRAW_VESTING], - }); + send([receiver], withdrawTxConfig); }, [send], ); @@ -366,6 +368,7 @@ export const VestingContract: React.FC = ({ vestingType={type} onCloseModal={() => setShowWithdraw(false)} onWithdraw={handleWithdraw} + txConfig={withdrawTxConfig} /> } diff --git a/src/app/containers/StakePage/components/WithdrawVesting.tsx b/src/app/containers/StakePage/components/WithdrawVesting.tsx index 7ffa1125d..fd13effb0 100644 --- a/src/app/containers/StakePage/components/WithdrawVesting.tsx +++ b/src/app/containers/StakePage/components/WithdrawVesting.tsx @@ -10,12 +10,14 @@ import { discordInvite } from 'utils/classifiers'; import { useMaintenance } from 'app/hooks/useMaintenance'; import { ErrorBadge } from 'app/components/Form/ErrorBadge'; import { VestGroup } from 'app/components/UserAssets/Vesting/types'; +import type { TransactionConfig } from 'web3-core'; interface IWithdrawVestingProps { vesting: string; vestingType: VestGroup; onCloseModal: () => void; onWithdraw: (receiver: string) => void; + txConfig: TransactionConfig; } export const WithdrawVesting: React.FC = ({ @@ -23,6 +25,7 @@ export const WithdrawVesting: React.FC = ({ vestingType, onCloseModal, onWithdraw, + txConfig, }) => { const { t } = useTranslation(); const account = useAccount(); @@ -87,6 +90,7 @@ export const WithdrawVesting: React.FC = ({