@ledgerhq/coin-tron 4.1.2-nightly.0 → 4.2.0-nightly.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -0
- package/lib/bridge/getEstimateFees.js +2 -2
- package/lib/logic/constants.d.ts.map +1 -1
- package/lib/logic/constants.js +1 -1
- package/lib/logic/constants.js.map +1 -1
- package/lib-es/bridge/getEstimateFees.js +2 -2
- package/lib-es/logic/constants.d.ts.map +1 -1
- package/lib-es/logic/constants.js +1 -1
- package/lib-es/logic/constants.js.map +1 -1
- package/package.json +3 -3
- package/src/bridge/getEstimateFees.ts +2 -2
- package/src/logic/constants.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-tron@4.1.
|
|
2
|
+
> @ledgerhq/coin-tron@4.1.2-nightly.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-tron
|
|
3
3
|
> tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ledgerhq/coin-tron
|
|
2
2
|
|
|
3
|
+
## 4.2.0-nightly.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#10410](https://github.com/LedgerHQ/ledger-live/pull/10410) [`cefb3de`](https://github.com/LedgerHQ/ledger-live/commit/cefb3de72c4251ee5b9b3dd69563a9b2c2228998) Thanks [@qperrot](https://github.com/qperrot)! - fix: Tron new feeEstimation if no Bandwidth
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`b7d3d59`](https://github.com/LedgerHQ/ledger-live/commit/b7d3d59d299c3d3541d598536651b9047fda4526), [`1535307`](https://github.com/LedgerHQ/ledger-live/commit/1535307f78d345d7f652ac2c91c8a67e62fedef2)]:
|
|
12
|
+
- @ledgerhq/types-live@6.72.0-nightly.1
|
|
13
|
+
- @ledgerhq/coin-framework@5.2.0-nightly.1
|
|
14
|
+
|
|
3
15
|
## 4.1.2-nightly.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -10,13 +10,13 @@ const logic_1 = require("../logic");
|
|
|
10
10
|
// see : https://developers.tron.network/docs/bandwith#section-bandwidth-points-consumption
|
|
11
11
|
// 1. cost around 200 Bandwidth, if not enough check Free Bandwidth
|
|
12
12
|
// 2. If not enough, will cost some TRX
|
|
13
|
-
// 3. normal transfert cost around 0.
|
|
13
|
+
// 3. normal transfert cost around 0.270 TRX
|
|
14
14
|
const getFeesFromBandwidth = (account, transaction) => {
|
|
15
15
|
const { freeUsed, freeLimit, gainedUsed, gainedLimit } = (0, utils_1.extractBandwidthInfo)(transaction.networkInfo);
|
|
16
16
|
const available = freeLimit.minus(freeUsed).plus(gainedLimit).minus(gainedUsed);
|
|
17
17
|
const estimatedBandwidthCost = (0, utils_1.getEstimatedBlockSize)(account, transaction);
|
|
18
18
|
if (available.lt(estimatedBandwidthCost)) {
|
|
19
|
-
return constants_1.STANDARD_FEES_NATIVE; // cost is around 0.
|
|
19
|
+
return constants_1.STANDARD_FEES_NATIVE; // cost is around 0.270 TRX
|
|
20
20
|
}
|
|
21
21
|
return new bignumber_js_1.default(0); // no fee
|
|
22
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,WAAyB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,WAAyB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,WAAwB,CAAC;AAC1D,eAAO,MAAM,eAAe,WAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,WAAgC,CAAC;AACpE,eAAO,MAAM,oBAAoB,WAAgC,CAAC"}
|
package/lib/logic/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STANDARD_FEES_TRC_20 = exports.ACTIVATION_FEES_TRC_20 = exports.ACTIVATION_FEES = exports.STANDARD_FEES_NATIVE = exports.ONE_TRX = void 0;
|
|
4
4
|
const bignumber_js_1 = require("bignumber.js");
|
|
5
5
|
exports.ONE_TRX = new bignumber_js_1.BigNumber(1000000);
|
|
6
|
-
exports.STANDARD_FEES_NATIVE = new bignumber_js_1.BigNumber(
|
|
6
|
+
exports.STANDARD_FEES_NATIVE = new bignumber_js_1.BigNumber(270000);
|
|
7
7
|
exports.ACTIVATION_FEES = exports.ONE_TRX.multipliedBy(1.1); // ONE TRX fee + 0.1 TRX activation cost
|
|
8
8
|
exports.ACTIVATION_FEES_TRC_20 = exports.ONE_TRX.multipliedBy(27.6009);
|
|
9
9
|
exports.STANDARD_FEES_TRC_20 = exports.ONE_TRX.multipliedBy(13.7409);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAE5B,QAAA,OAAO,GAAG,IAAI,wBAAS,CAAC,OAAO,CAAC,CAAC;AACjC,QAAA,oBAAoB,GAAG,IAAI,wBAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAE5B,QAAA,OAAO,GAAG,IAAI,wBAAS,CAAC,OAAO,CAAC,CAAC;AACjC,QAAA,oBAAoB,GAAG,IAAI,wBAAS,CAAC,MAAM,CAAC,CAAC;AAC7C,QAAA,eAAe,GAAG,eAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,wCAAwC;AACrF,QAAA,sBAAsB,GAAG,eAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvD,QAAA,oBAAoB,GAAG,eAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -5,13 +5,13 @@ import { estimateFees, getAccount } from "../logic";
|
|
|
5
5
|
// see : https://developers.tron.network/docs/bandwith#section-bandwidth-points-consumption
|
|
6
6
|
// 1. cost around 200 Bandwidth, if not enough check Free Bandwidth
|
|
7
7
|
// 2. If not enough, will cost some TRX
|
|
8
|
-
// 3. normal transfert cost around 0.
|
|
8
|
+
// 3. normal transfert cost around 0.270 TRX
|
|
9
9
|
const getFeesFromBandwidth = (account, transaction) => {
|
|
10
10
|
const { freeUsed, freeLimit, gainedUsed, gainedLimit } = extractBandwidthInfo(transaction.networkInfo);
|
|
11
11
|
const available = freeLimit.minus(freeUsed).plus(gainedLimit).minus(gainedUsed);
|
|
12
12
|
const estimatedBandwidthCost = getEstimatedBlockSize(account, transaction);
|
|
13
13
|
if (available.lt(estimatedBandwidthCost)) {
|
|
14
|
-
return STANDARD_FEES_NATIVE; // cost is around 0.
|
|
14
|
+
return STANDARD_FEES_NATIVE; // cost is around 0.270 TRX
|
|
15
15
|
}
|
|
16
16
|
return new BigNumber(0); // no fee
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,WAAyB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,WAAyB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,WAAwB,CAAC;AAC1D,eAAO,MAAM,eAAe,WAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,WAAgC,CAAC;AACpE,eAAO,MAAM,oBAAoB,WAAgC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
export const ONE_TRX = new BigNumber(1000000);
|
|
3
|
-
export const STANDARD_FEES_NATIVE = new BigNumber(
|
|
3
|
+
export const STANDARD_FEES_NATIVE = new BigNumber(270000);
|
|
4
4
|
export const ACTIVATION_FEES = ONE_TRX.multipliedBy(1.1); // ONE TRX fee + 0.1 TRX activation cost
|
|
5
5
|
export const ACTIVATION_FEES_TRC_20 = ONE_TRX.multipliedBy(27.6009);
|
|
6
6
|
export const STANDARD_FEES_TRC_20 = ONE_TRX.multipliedBy(13.7409);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/logic/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,wCAAwC;AAClG,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-tron",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-nightly.1",
|
|
4
4
|
"description": "Ledger Tron Coin integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"lodash": "^4.17.21",
|
|
97
97
|
"rxjs": "^7.8.1",
|
|
98
98
|
"tronweb": "^5.3.2",
|
|
99
|
-
"@ledgerhq/coin-framework": "^5.
|
|
99
|
+
"@ledgerhq/coin-framework": "^5.2.0-nightly.1",
|
|
100
100
|
"@ledgerhq/cryptoassets": "^13.18.0",
|
|
101
101
|
"@ledgerhq/devices": "8.4.5",
|
|
102
102
|
"@ledgerhq/errors": "^6.21.0",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@ledgerhq/live-promise": "^0.1.0",
|
|
105
105
|
"@ledgerhq/logs": "^6.12.0",
|
|
106
106
|
"@ledgerhq/types-cryptoassets": "^7.23.0",
|
|
107
|
-
"@ledgerhq/types-live": "^6.72.0-nightly.
|
|
107
|
+
"@ledgerhq/types-live": "^6.72.0-nightly.1"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@agrozyme/types-tronweb": "^5.3.2",
|
|
@@ -10,7 +10,7 @@ import type { TransactionIntent } from "@ledgerhq/coin-framework/api/index";
|
|
|
10
10
|
// see : https://developers.tron.network/docs/bandwith#section-bandwidth-points-consumption
|
|
11
11
|
// 1. cost around 200 Bandwidth, if not enough check Free Bandwidth
|
|
12
12
|
// 2. If not enough, will cost some TRX
|
|
13
|
-
// 3. normal transfert cost around 0.
|
|
13
|
+
// 3. normal transfert cost around 0.270 TRX
|
|
14
14
|
const getFeesFromBandwidth = (account: Account, transaction: Transaction): BigNumber => {
|
|
15
15
|
const { freeUsed, freeLimit, gainedUsed, gainedLimit } = extractBandwidthInfo(
|
|
16
16
|
transaction.networkInfo,
|
|
@@ -19,7 +19,7 @@ const getFeesFromBandwidth = (account: Account, transaction: Transaction): BigNu
|
|
|
19
19
|
const estimatedBandwidthCost = getEstimatedBlockSize(account, transaction);
|
|
20
20
|
|
|
21
21
|
if (available.lt(estimatedBandwidthCost)) {
|
|
22
|
-
return STANDARD_FEES_NATIVE; // cost is around 0.
|
|
22
|
+
return STANDARD_FEES_NATIVE; // cost is around 0.270 TRX
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return new BigNumber(0); // no fee
|
package/src/logic/constants.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
|
|
3
3
|
export const ONE_TRX = new BigNumber(1000000);
|
|
4
|
-
export const STANDARD_FEES_NATIVE = new BigNumber(
|
|
4
|
+
export const STANDARD_FEES_NATIVE = new BigNumber(270000);
|
|
5
5
|
export const ACTIVATION_FEES = ONE_TRX.multipliedBy(1.1); // ONE TRX fee + 0.1 TRX activation cost
|
|
6
6
|
export const ACTIVATION_FEES_TRC_20 = ONE_TRX.multipliedBy(27.6009);
|
|
7
7
|
export const STANDARD_FEES_TRC_20 = ONE_TRX.multipliedBy(13.7409);
|