From 53169dfd01cc5a5f361545e9d5ffd2f457174438 Mon Sep 17 00:00:00 2001 From: Michael Merz Date: Thu, 9 Mar 2023 11:42:48 -0500 Subject: [PATCH] fix: decimal places on stake form and quickstake form --- src/txs/stake/QuickStakeForm.tsx | 2 +- src/txs/stake/StakeForm.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/txs/stake/QuickStakeForm.tsx b/src/txs/stake/QuickStakeForm.tsx index a2e0f85e2..cbabb2032 100644 --- a/src/txs/stake/QuickStakeForm.tsx +++ b/src/txs/stake/QuickStakeForm.tsx @@ -113,8 +113,8 @@ const QuickStakeForm = (props: Props) => { ) const token = action === QuickStakeAction.DELEGATE ? baseAsset : "" - const tx = { + decimals: readNativeDenom(token)?.decimals, token, amount, balance, diff --git a/src/txs/stake/StakeForm.tsx b/src/txs/stake/StakeForm.tsx index 75f4b70ff..ad984c10d 100644 --- a/src/txs/stake/StakeForm.tsx +++ b/src/txs/stake/StakeForm.tsx @@ -16,6 +16,7 @@ import { getPlaceholder, toInput } from "../utils" import validate from "../validate" import Tx from "txs/Tx" import { useInterchainAddresses } from "auth/hooks/useAddress" +import { useNativeDenoms } from "data/token" interface TxValues { source?: ValAddress @@ -41,6 +42,7 @@ const StakeForm = (props: Props) => { const { tab, destination, balances, validators, delegations, chainID } = props const { t } = useTranslation() + const readNativeDenom = useNativeDenoms() const addresses = useInterchainAddresses() const address = addresses?.[chainID] const networks = useNetwork() @@ -123,6 +125,7 @@ const StakeForm = (props: Props) => { const token = tab === StakeAction.DELEGATE ? baseAsset : "" const tx = { + decimals: readNativeDenom(token)?.decimals, token, amount, balance,