Skip to content

Commit

Permalink
Fix/live 13349 (#7550)
Browse files Browse the repository at this point in the history
* fix(LIVE-13349): fix spendable balance instead of balance

* fix(LIVE-13349): changeset
Co-authored-by: @CremaFR <[email protected]>"
  • Loading branch information
lpaquet-ledger authored Aug 9, 2024
1 parent 760ce85 commit cd440bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-cameras-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

Change to spendable balance tron
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const useUpdateMaxAmount = ({
setIsMaxLoading(false);
if ("currency" in account && account.currency.id === "tron") {
// keep 1.1 TRX for fees and 0.1 TRX for keeping the account alive
if (account?.balance.gt(new BigNumber(1_200_000))) {
setFromAmount(account?.balance.minus(new BigNumber(1_200_000)));
if (account?.spendableBalance.gt(new BigNumber(1_200_000))) {
setFromAmount(account?.spendableBalance.minus(new BigNumber(1_200_000)));
}
} else {
setFromAmount(amount);
Expand Down

0 comments on commit cd440bb

Please sign in to comment.