From ca4c11893ef5c55514c4aad9c7eecd3a2b20a578 Mon Sep 17 00:00:00 2001 From: pranavjadhav007 Date: Thu, 24 Jul 2025 18:28:28 +0530 Subject: [PATCH] Check for account balance in place of sufficient funds in cosmos gas calculation --- src/screens/ApproveTransfer.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/screens/ApproveTransfer.tsx b/src/screens/ApproveTransfer.tsx index 8a5c54a..b0f37c3 100644 --- a/src/screens/ApproveTransfer.tsx +++ b/src/screens/ApproveTransfer.tsx @@ -548,7 +548,7 @@ const ApproveTransfer = ({ route }: ApproveTransferProps) => { if (!cosmosStargateClient) { return; } - if (!isSufficientFunds) { + if (!balance) { return; } @@ -567,13 +567,15 @@ const ApproveTransfer = ({ route }: ApproveTransferProps) => { if (!(error instanceof Error)) { throw error; } - + if (window.Android?.onTransferError) { + window.Android.onTransferError(`Not able to estimate gas`); + } setTxError(error.message); setIsTxErrorDialogOpen(true); } }; getCosmosGas(); - }, [cosmosStargateClient, isSufficientFunds, sendMsg, transaction,txMemo]); + }, [cosmosStargateClient, balance, sendMsg, transaction, txMemo]); useEffect(() => { if (balance && !isSufficientFunds && !fees) {