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

Can't send transactions leaving the account with less than 0.05 LSK #2023

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,17 +316,11 @@ const validateTransactionParams = async transaction => {

if (transaction.params.tokenID) {
const senderAddress = getLisk32AddressFromPublicKey(transaction.senderPublicKey);
const {
data: { extraCommandFees },
} = await getTokenConstants();
const {
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
Loading