@ledgerhq/coin-tron 5.1.0-nightly.2 → 5.1.0
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 +19 -18
- package/lib/logic/listOperations.d.ts.map +1 -1
- package/lib/logic/listOperations.js +4 -7
- package/lib/logic/listOperations.js.map +1 -1
- package/lib-es/logic/listOperations.d.ts.map +1 -1
- package/lib-es/logic/listOperations.js +4 -7
- package/lib-es/logic/listOperations.js.map +1 -1
- package/package.json +8 -8
- package/src/logic/listOperations.ts +4 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-tron@5.
|
|
2
|
+
> @ledgerhq/coin-tron@5.1.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,35 +1,36 @@
|
|
|
1
1
|
# @ledgerhq/coin-tron
|
|
2
2
|
|
|
3
|
-
## 5.1.0
|
|
3
|
+
## 5.1.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#11016](https://github.com/LedgerHQ/ledger-live/pull/11016) [`a8b4f57`](https://github.com/LedgerHQ/ledger-live/commit/a8b4f57bf7d82e6c2444a65901e927c3c3d64412) Thanks [@jnicoulaud-ledger](https://github.com/jnicoulaud-ledger)! - [coin-modules] add coin-framework staking API + SUI implementation
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
- Updated dependencies [[`
|
|
12
|
-
- @ledgerhq/cryptoassets@13.25.0
|
|
13
|
-
- @ledgerhq/
|
|
14
|
-
- @ledgerhq/
|
|
11
|
+
- Updated dependencies [[`0c8486e`](https://github.com/LedgerHQ/ledger-live/commit/0c8486ea830e9e2abf1dfc5d108117e1db733072), [`354fa83`](https://github.com/LedgerHQ/ledger-live/commit/354fa83c8107cf8e6b56a8b306569ee65980e10c), [`a8b4f57`](https://github.com/LedgerHQ/ledger-live/commit/a8b4f57bf7d82e6c2444a65901e927c3c3d64412), [`67e2a7c`](https://github.com/LedgerHQ/ledger-live/commit/67e2a7c5a74d000f22684254778dfec5b8b5163d)]:
|
|
12
|
+
- @ledgerhq/cryptoassets@13.25.0
|
|
13
|
+
- @ledgerhq/errors@6.24.0
|
|
14
|
+
- @ledgerhq/coin-framework@6.1.0
|
|
15
|
+
- @ledgerhq/types-live@6.81.0
|
|
16
|
+
- @ledgerhq/devices@8.5.0
|
|
17
|
+
- @ledgerhq/live-network@2.0.15
|
|
15
18
|
|
|
16
|
-
## 5.0
|
|
19
|
+
## 5.1.0-next.0
|
|
17
20
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
- Updated dependencies [[`d41fc9c`](https://github.com/LedgerHQ/ledger-live/commit/d41fc9c458050ef1234c04af9642321c41cecda1)]:
|
|
21
|
-
- @ledgerhq/cryptoassets@13.25.0-nightly.1
|
|
22
|
-
- @ledgerhq/types-live@6.80.0
|
|
23
|
-
- @ledgerhq/coin-framework@6.0.1-nightly.1
|
|
21
|
+
### Minor Changes
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
- [#11016](https://github.com/LedgerHQ/ledger-live/pull/11016) [`a8b4f57`](https://github.com/LedgerHQ/ledger-live/commit/a8b4f57bf7d82e6c2444a65901e927c3c3d64412) Thanks [@jnicoulaud-ledger](https://github.com/jnicoulaud-ledger)! - [coin-modules] add coin-framework staking API + SUI implementation
|
|
26
24
|
|
|
27
25
|
### Patch Changes
|
|
28
26
|
|
|
29
|
-
- Updated dependencies []:
|
|
30
|
-
- @ledgerhq/
|
|
31
|
-
- @ledgerhq/
|
|
32
|
-
- @ledgerhq/
|
|
27
|
+
- Updated dependencies [[`0c8486e`](https://github.com/LedgerHQ/ledger-live/commit/0c8486ea830e9e2abf1dfc5d108117e1db733072), [`354fa83`](https://github.com/LedgerHQ/ledger-live/commit/354fa83c8107cf8e6b56a8b306569ee65980e10c), [`a8b4f57`](https://github.com/LedgerHQ/ledger-live/commit/a8b4f57bf7d82e6c2444a65901e927c3c3d64412), [`67e2a7c`](https://github.com/LedgerHQ/ledger-live/commit/67e2a7c5a74d000f22684254778dfec5b8b5163d)]:
|
|
28
|
+
- @ledgerhq/cryptoassets@13.25.0-next.0
|
|
29
|
+
- @ledgerhq/errors@6.24.0-next.0
|
|
30
|
+
- @ledgerhq/coin-framework@6.1.0-next.0
|
|
31
|
+
- @ledgerhq/types-live@6.81.0-next.0
|
|
32
|
+
- @ledgerhq/devices@8.5.0-next.0
|
|
33
|
+
- @ledgerhq/live-network@2.0.15-next.0
|
|
33
34
|
|
|
34
35
|
## 5.0.0
|
|
35
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.d.ts","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAS/D,MAAM,MAAM,OAAO,GAAG;IAKpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAInB,CAAC;AAEX,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"listOperations.d.ts","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAS/D,MAAM,MAAM,OAAO,GAAG;IAKpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAInB,CAAC;AAEX,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,CAuBhC"}
|
|
@@ -11,21 +11,18 @@ exports.defaultOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
async function listOperations(address, options) {
|
|
13
13
|
// there is a possible optimisation here: when height is 0, set the minTimestamp to 0
|
|
14
|
-
const
|
|
15
|
-
const order = options?.order ?? exports.defaultOptions.order;
|
|
16
|
-
const softLimit = options?.softLimit ?? exports.defaultOptions.softLimit;
|
|
17
|
-
const block = await (0, network_1.getBlock)(minHeight);
|
|
14
|
+
const block = await (0, network_1.getBlock)(options.minHeight);
|
|
18
15
|
const minTimestamp = block.time?.getTime() ?? network_1.defaultFetchParams.minTimestamp;
|
|
19
16
|
const fetchParams = {
|
|
20
17
|
...network_1.defaultFetchParams,
|
|
21
18
|
minTimestamp: minTimestamp,
|
|
22
|
-
order: order,
|
|
23
|
-
hintGlobalLimit: softLimit,
|
|
19
|
+
order: options.order,
|
|
20
|
+
hintGlobalLimit: options.softLimit,
|
|
24
21
|
};
|
|
25
22
|
// under the hood, the network fetches native transactions and trc20 transactions separately
|
|
26
23
|
// that same predicate is used to stop fetching both calls
|
|
27
24
|
// that's why we have a "soft" limit, with the guarantee of total number of transactions to be less than 2 * softLimit
|
|
28
|
-
const untilLimitReached = ops => ops.length < softLimit;
|
|
25
|
+
const untilLimitReached = ops => ops.length < options.softLimit;
|
|
29
26
|
const txs = await (0, network_1.fetchTronAccountTxs)(address, untilLimitReached, {}, fetchParams);
|
|
30
27
|
return [
|
|
31
28
|
txs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":";;;AAyBA,
|
|
1
|
+
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":";;;AAyBA,wCA0BC;AAlDD,wCAKoB;AACpB,6EAAsF;AAYzE,QAAA,cAAc,GAAY;IACrC,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM;CACL,CAAC;AAEJ,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,OAAgB;IAEhB,qFAAqF;IACrF,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,4BAAkB,CAAC,YAAY,CAAC;IAC9E,MAAM,WAAW,GAAG;QAClB,GAAG,4BAAkB;QACrB,YAAY,EAAE,YAAY;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,eAAe,EAAE,OAAO,CAAC,SAAS;KACnC,CAAC;IAEF,4FAA4F;IAC5F,0DAA0D;IAC1D,sHAAsH;IACtH,MAAM,iBAAiB,GAA8B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAE3F,MAAM,GAAG,GAAG,MAAM,IAAA,6BAAmB,EAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IACnF,OAAO;QACL,GAAG;YACD,wCAAwC;aACvC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,iDAA6B,EAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACxD,EAAE;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.d.ts","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAS/D,MAAM,MAAM,OAAO,GAAG;IAKpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAInB,CAAC;AAEX,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"listOperations.d.ts","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAS/D,MAAM,MAAM,OAAO,GAAG;IAKpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAInB,CAAC;AAEX,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,CAuBhC"}
|
|
@@ -7,21 +7,18 @@ export const defaultOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
export async function listOperations(address, options) {
|
|
9
9
|
// there is a possible optimisation here: when height is 0, set the minTimestamp to 0
|
|
10
|
-
const
|
|
11
|
-
const order = options?.order ?? defaultOptions.order;
|
|
12
|
-
const softLimit = options?.softLimit ?? defaultOptions.softLimit;
|
|
13
|
-
const block = await getBlock(minHeight);
|
|
10
|
+
const block = await getBlock(options.minHeight);
|
|
14
11
|
const minTimestamp = block.time?.getTime() ?? defaultFetchParams.minTimestamp;
|
|
15
12
|
const fetchParams = {
|
|
16
13
|
...defaultFetchParams,
|
|
17
14
|
minTimestamp: minTimestamp,
|
|
18
|
-
order: order,
|
|
19
|
-
hintGlobalLimit: softLimit,
|
|
15
|
+
order: options.order,
|
|
16
|
+
hintGlobalLimit: options.softLimit,
|
|
20
17
|
};
|
|
21
18
|
// under the hood, the network fetches native transactions and trc20 transactions separately
|
|
22
19
|
// that same predicate is used to stop fetching both calls
|
|
23
20
|
// that's why we have a "soft" limit, with the guarantee of total number of transactions to be less than 2 * softLimit
|
|
24
|
-
const untilLimitReached = ops => ops.length < softLimit;
|
|
21
|
+
const untilLimitReached = ops => ops.length < options.softLimit;
|
|
25
22
|
const txs = await fetchTronAccountTxs(address, untilLimitReached, {}, fetchParams);
|
|
26
23
|
return [
|
|
27
24
|
txs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAEnB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAYtF,MAAM,CAAC,MAAM,cAAc,GAAY;IACrC,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM;CACL,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,OAAgB;IAEhB,qFAAqF;IACrF,MAAM,
|
|
1
|
+
{"version":3,"file":"listOperations.js","sourceRoot":"","sources":["../../src/logic/listOperations.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAEnB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAYtF,MAAM,CAAC,MAAM,cAAc,GAAY;IACrC,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,MAAM;CACL,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAe,EACf,OAAgB;IAEhB,qFAAqF;IACrF,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,kBAAkB,CAAC,YAAY,CAAC;IAC9E,MAAM,WAAW,GAAG;QAClB,GAAG,kBAAkB;QACrB,YAAY,EAAE,YAAY;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,eAAe,EAAE,OAAO,CAAC,SAAS;KACnC,CAAC;IAEF,4FAA4F;IAC5F,0DAA0D;IAC1D,sHAAsH;IACtH,MAAM,iBAAiB,GAA8B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAE3F,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;IACnF,OAAO;QACL,GAAG;YACD,wCAAwC;aACvC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,6BAA6B,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACxD,EAAE;KACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/coin-tron",
|
|
3
|
-
"version": "5.1.0
|
|
3
|
+
"version": "5.1.0",
|
|
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": "^6.1.0
|
|
100
|
-
"@ledgerhq/cryptoassets": "^13.25.0
|
|
101
|
-
"@ledgerhq/
|
|
102
|
-
"@ledgerhq/
|
|
99
|
+
"@ledgerhq/coin-framework": "^6.1.0",
|
|
100
|
+
"@ledgerhq/cryptoassets": "^13.25.0",
|
|
101
|
+
"@ledgerhq/devices": "8.5.0",
|
|
102
|
+
"@ledgerhq/errors": "^6.24.0",
|
|
103
|
+
"@ledgerhq/live-network": "^2.0.15",
|
|
103
104
|
"@ledgerhq/live-promise": "^0.1.1",
|
|
104
|
-
"@ledgerhq/
|
|
105
|
+
"@ledgerhq/logs": "^6.13.0",
|
|
105
106
|
"@ledgerhq/types-cryptoassets": "^7.25.0",
|
|
106
|
-
"@ledgerhq/types-live": "^6.81.0
|
|
107
|
-
"@ledgerhq/logs": "^6.13.0"
|
|
107
|
+
"@ledgerhq/types-live": "^6.81.0"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@agrozyme/types-tronweb": "^5.3.2",
|
|
@@ -28,23 +28,19 @@ export async function listOperations(
|
|
|
28
28
|
options: Options,
|
|
29
29
|
): Promise<[Operation[], string]> {
|
|
30
30
|
// there is a possible optimisation here: when height is 0, set the minTimestamp to 0
|
|
31
|
-
const
|
|
32
|
-
const order = options?.order ?? defaultOptions.order;
|
|
33
|
-
const softLimit = options?.softLimit ?? defaultOptions.softLimit;
|
|
34
|
-
|
|
35
|
-
const block = await getBlock(minHeight);
|
|
31
|
+
const block = await getBlock(options.minHeight);
|
|
36
32
|
const minTimestamp = block.time?.getTime() ?? defaultFetchParams.minTimestamp;
|
|
37
33
|
const fetchParams = {
|
|
38
34
|
...defaultFetchParams,
|
|
39
35
|
minTimestamp: minTimestamp,
|
|
40
|
-
order: order,
|
|
41
|
-
hintGlobalLimit: softLimit,
|
|
36
|
+
order: options.order,
|
|
37
|
+
hintGlobalLimit: options.softLimit,
|
|
42
38
|
};
|
|
43
39
|
|
|
44
40
|
// under the hood, the network fetches native transactions and trc20 transactions separately
|
|
45
41
|
// that same predicate is used to stop fetching both calls
|
|
46
42
|
// that's why we have a "soft" limit, with the guarantee of total number of transactions to be less than 2 * softLimit
|
|
47
|
-
const untilLimitReached: FetchTxsContinuePredicate = ops => ops.length < softLimit;
|
|
43
|
+
const untilLimitReached: FetchTxsContinuePredicate = ops => ops.length < options.softLimit;
|
|
48
44
|
|
|
49
45
|
const txs = await fetchTronAccountTxs(address, untilLimitReached, {}, fetchParams);
|
|
50
46
|
return [
|