Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🐛 Fix balance validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Feb 19, 2024
1 parent 68a16b0 commit 93386b7
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,7 @@ const validateTransactionParams = async transaction => {
data: [balanceInfo],
} = await getTokenBalances({ address: senderAddress, tokenID: transaction.params.tokenID });

if (
BigInt(balanceInfo.availableBalance) <
BigInt(transaction.params.amount) + BigInt(extraCommandFees.userAccountInitializationFee)
) {
if (BigInt(balanceInfo.availableBalance) < BigInt(transaction.params.amount)) {
throw new ValidationException(
`${senderAddress} has insufficient balance for ${transaction.params.tokenID} to send the transaction.`,
);
Expand Down

0 comments on commit 93386b7

Please sign in to comment.