Skip to content

Commit

Permalink
fix(LIVE-10131): swap tron swapping issue with other pairs than eth a…
Browse files Browse the repository at this point in the history
…nd edge cases to investigate part 2 (#6824)

* fix(LIVE-10131): take 1 TRX off the balance to prevent insufficient balance

* feat(LIVE-10131): changeset

* feat(LIVE-10131): pr review

* feat(LIVE-10131): switch case statement

* Revert "feat(LIVE-10131): switch case statement"

This reverts commit dab329d.
  • Loading branch information
cng-ledger committed May 10, 2024
1 parent 62ac935 commit 796f7d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-islands-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

fix(LIVE-10131): take 1 TRX off the swappable amount to prevent insufficient balance when max toggle is on
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const useUpdateMaxAmount = ({
let additionalFees;
if (tx.family === "evm" && next) {
additionalFees = new BigNumber(5000000000000000); // 0,005 ETH/BNB/MATIC
} else if (tx.family === "tron" && next) {
// https://github.com/tronprotocol/documentation/blob/master/TRX/Tron-overview.md
// 1 TRX=1,000,000 sun.
additionalFees = new BigNumber(1).multipliedBy(1_000_000); // 1 TRX
}
return {
...tx,
Expand Down

0 comments on commit 796f7d8

Please sign in to comment.