Skip to content

Commit

Permalink
Bugfix/tron activation fee (#7087)
Browse files Browse the repository at this point in the history
* fix tron activation cost

* chore: changeset

* chore: fix tests
  • Loading branch information
CremaFR authored Jun 13, 2024
1 parent ceb3c25 commit 6b3c8ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-laws-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

fixed tron activation fee
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ const tron: CurrenciesData<Transaction> = {
warnings: {
fee: new TronUnexpectedFees("Estimated fees"),
},
totalSpent: new BigNumber("2000000"),
estimatedFees: new BigNumber("1000000"),
totalSpent: new BigNumber("2100000"),
estimatedFees: new BigNumber("1100000"),
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion libs/ledger-live-common/src/families/tron/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BigNumber } from "bignumber.js";

export const ONE_TRX = new BigNumber(1000000);
export const ACTIVATION_FEES = new BigNumber(1000000);
export const ACTIVATION_FEES = new BigNumber(1100000); // ONE TRX fee + 0.1 TRX activation cost

0 comments on commit 6b3c8ca

Please sign in to comment.