Skip to content

Commit

Permalink
fix: avoid negative free balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Oct 28, 2023
1 parent 72c3079 commit 8fd61dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/library/Hooks/useBondGreatestFee/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const useBondGreatestFee = ({ bondFor }: Props) => {

// estimate the largest possible tx fee based on users free balance.
const txLargestFee = async () => {
const bond = freeBalance.minus(feeReserve).toString();
const bond = BigNumber.max(freeBalance.minus(feeReserve), 0).toString();

let tx = null;
if (!api) {
Expand Down

0 comments on commit 8fd61dd

Please sign in to comment.