@ledgerhq/coin-tron 4.1.2-next.2 → 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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @ledgerhq/coin-tron@4.1.2-next.1 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-tron
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,34 +1,24 @@
1
1
  # @ledgerhq/coin-tron
2
2
 
3
- ## 4.1.2-next.2
3
+ ## 4.2.0-nightly.1
4
4
 
5
- ### Patch Changes
6
-
7
- - Updated dependencies [[`ebbbd47`](https://github.com/LedgerHQ/ledger-live/commit/ebbbd47efe76d82047a956cb5849be5831f58772)]:
8
- - @ledgerhq/logs@6.13.0-next.1
9
- - @ledgerhq/coin-framework@5.2.0-next.2
10
- - @ledgerhq/devices@8.4.6-next.1
11
- - @ledgerhq/live-network@2.0.9-next.1
12
- - @ledgerhq/live-promise@0.1.1-next.1
5
+ ### Minor Changes
13
6
 
14
- ## 4.1.2-next.1
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
15
8
 
16
9
  ### Patch Changes
17
10
 
18
- - Updated dependencies [[`f29e4ba`](https://github.com/LedgerHQ/ledger-live/commit/f29e4bae00a4bf470a0c1ca143e505b731543f95)]:
19
- - @ledgerhq/logs@6.13.0-next.0
20
- - @ledgerhq/coin-framework@5.2.0-next.1
21
- - @ledgerhq/devices@8.4.6-next.0
22
- - @ledgerhq/live-network@2.0.9-next.0
23
- - @ledgerhq/live-promise@0.1.1-next.0
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
24
14
 
25
- ## 4.1.2-next.0
15
+ ## 4.1.2-nightly.0
26
16
 
27
17
  ### Patch Changes
28
18
 
29
- - Updated dependencies [[`4ddfe60`](https://github.com/LedgerHQ/ledger-live/commit/4ddfe6060ab8e4e5c0bb89da91e08a02d8ca50e6), [`f42f353`](https://github.com/LedgerHQ/ledger-live/commit/f42f353a593d0a1cd0a237648765080c85d0eea7), [`1a4e5e5`](https://github.com/LedgerHQ/ledger-live/commit/1a4e5e5913fe5e12d6127b36f3849e4c81e5e50e)]:
30
- - @ledgerhq/types-live@6.72.0-next.0
31
- - @ledgerhq/coin-framework@5.2.0-next.0
19
+ - Updated dependencies [[`1a4e5e5`](https://github.com/LedgerHQ/ledger-live/commit/1a4e5e5913fe5e12d6127b36f3849e4c81e5e50e)]:
20
+ - @ledgerhq/types-live@6.72.0-nightly.0
21
+ - @ledgerhq/coin-framework@5.1.1-nightly.0
32
22
 
33
23
  ## 4.1.1
34
24
 
@@ -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.002 TRX
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.002 TRX
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,WAAsB,CAAC;AACxD,eAAO,MAAM,eAAe,WAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,WAAgC,CAAC;AACpE,eAAO,MAAM,oBAAoB,WAAgC,CAAC"}
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"}
@@ -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(2000);
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,IAAI,CAAC,CAAC;AAC3C,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"}
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.002 TRX
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.002 TRX
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,WAAsB,CAAC;AACxD,eAAO,MAAM,eAAe,WAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,WAAgC,CAAC;AACpE,eAAO,MAAM,oBAAoB,WAAgC,CAAC"}
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(2000);
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,IAAI,CAAC,CAAC;AACxD,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"}
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.1.2-next.2",
3
+ "version": "4.2.0-nightly.1",
4
4
  "description": "Ledger Tron Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
@@ -96,15 +96,15 @@
96
96
  "lodash": "^4.17.21",
97
97
  "rxjs": "^7.8.1",
98
98
  "tronweb": "^5.3.2",
99
- "@ledgerhq/coin-framework": "^5.2.0-next.2",
99
+ "@ledgerhq/coin-framework": "^5.2.0-nightly.1",
100
100
  "@ledgerhq/cryptoassets": "^13.18.0",
101
- "@ledgerhq/devices": "8.4.6-next.1",
101
+ "@ledgerhq/devices": "8.4.5",
102
102
  "@ledgerhq/errors": "^6.21.0",
103
- "@ledgerhq/live-network": "^2.0.9-next.1",
104
- "@ledgerhq/live-promise": "^0.1.1-next.1",
105
- "@ledgerhq/logs": "^6.13.0-next.1",
103
+ "@ledgerhq/live-network": "^2.0.8",
104
+ "@ledgerhq/live-promise": "^0.1.0",
105
+ "@ledgerhq/logs": "^6.12.0",
106
106
  "@ledgerhq/types-cryptoassets": "^7.23.0",
107
- "@ledgerhq/types-live": "^6.72.0-next.0"
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.002 TRX
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.002 TRX
22
+ return STANDARD_FEES_NATIVE; // cost is around 0.270 TRX
23
23
  }
24
24
 
25
25
  return new BigNumber(0); // no fee
@@ -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(2000);
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);