diff --git a/changes/fabo_fix-fees-for-0-balance b/changes/fabo_fix-fees-for-0-balance new file mode 100644 index 0000000000..d32703c6dd --- /dev/null +++ b/changes/fabo_fix-fees-for-0-balance @@ -0,0 +1 @@ +[Fixed] Handle fees if user has 0 balance in that token @faboweb \ No newline at end of file diff --git a/data/network-fees.js b/data/network-fees.js index 567bf8f3f1..8e4caf3a6a 100644 --- a/data/network-fees.js +++ b/data/network-fees.js @@ -332,7 +332,7 @@ const getCosmosFee = async (network, cosmosSource, senderAddress, messageType, m ), denom: feeDenom } - const selectedBalance = balances.find(({denom}) => denom === feeDenom) + const selectedBalance = balances.find(({denom}) => denom === feeDenom) || { amount: 0, denom: feeDenom } if ( Number(transactionAmount) + Number(estimatedFee.amount) > Number(selectedBalance.amount) &&