@ledgerhq/live-common 34.7.0 → 34.7.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/lib/families/bitcoin/setup.d.ts.map +1 -1
- package/lib/families/bitcoin/setup.js +1 -5
- package/lib/families/bitcoin/setup.js.map +1 -1
- package/lib-es/families/bitcoin/setup.d.ts.map +1 -1
- package/lib-es/families/bitcoin/setup.js +1 -5
- package/lib-es/families/bitcoin/setup.js.map +1 -1
- package/package.json +2 -2
- package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +60 -6
- package/src/families/bitcoin/setup.ts +0 -6
- package/lib/performance.d.ts +0 -10
- package/lib/performance.d.ts.map +0 -1
- package/lib/performance.js +0 -61
- package/lib/performance.js.map +0 -1
- package/lib/performance.test.d.ts +0 -2
- package/lib/performance.test.d.ts.map +0 -1
- package/lib/performance.test.js +0 -28
- package/lib/performance.test.js.map +0 -1
- package/lib-es/performance.d.ts +0 -10
- package/lib-es/performance.d.ts.map +0 -1
- package/lib-es/performance.js +0 -56
- package/lib-es/performance.js.map +0 -1
- package/lib-es/performance.test.d.ts +0 -2
- package/lib-es/performance.test.d.ts.map +0 -1
- package/lib-es/performance.test.js +0 -26
- package/lib-es/performance.test.js.map +0 -1
- package/src/performance.test.ts +0 -26
- package/src/performance.ts +0 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAqB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAqB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAKxE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAMzD,QAAA,MAAM,aAAa,EAAE,aAOlB,CAAC;AAMJ,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,EAAE,iBAAiB,CAGlE,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,WAAW,CAKjD;AAED,QAAA,MAAM,aAAa;;CAElB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,QAMf,CAAC;AAEF,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;CAAiB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -12,7 +12,6 @@ const cli_transaction_1 = __importDefault(require("@ledgerhq/coin-bitcoin/cli-tr
|
|
|
12
12
|
const hw_getAddress_1 = __importDefault(require("@ledgerhq/coin-bitcoin/hw-getAddress"));
|
|
13
13
|
const hw_signMessage_1 = require("@ledgerhq/coin-bitcoin/hw-signMessage");
|
|
14
14
|
const deviceAccess_1 = require("../../hw/deviceAccess");
|
|
15
|
-
const performance_1 = require("../../performance");
|
|
16
15
|
const config_1 = require("../../config");
|
|
17
16
|
const createSigner = (transport, currency) => {
|
|
18
17
|
return new hw_app_btc_1.default({ transport, currency: currency.id });
|
|
@@ -22,10 +21,7 @@ exports.signerContext = signerContext;
|
|
|
22
21
|
const getCurrencyConfig = (currency) => {
|
|
23
22
|
return { info: (0, config_1.getCurrencyConfiguration)(currency) };
|
|
24
23
|
};
|
|
25
|
-
const
|
|
26
|
-
startSpan: performance_1.startSpan,
|
|
27
|
-
};
|
|
28
|
-
const bridge = (0, js_1.createBridges)(signerContext, perfLogger, getCurrencyConfig);
|
|
24
|
+
const bridge = (0, js_1.createBridges)(signerContext, getCurrencyConfig);
|
|
29
25
|
exports.bridge = bridge;
|
|
30
26
|
function createMessageSigner() {
|
|
31
27
|
return (transport, account, messageData) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":";AAAA,wFAAwF;;;;;;AAExF,+BAA4C;AAI5C,sEAAuC;AACvC,yDAAiE;AAEjE,6FAAkE;AAClE,yFAAmE;AACnE,0EAAoE;AAGpE,wDAAmD;
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":";AAAA,wFAAwF;;;;;;AAExF,+BAA4C;AAI5C,sEAAuC;AACvC,yDAAiE;AAEjE,6FAAkE;AAClE,yFAAmE;AACnE,0EAAoE;AAGpE,wDAAmD;AAEnD,yCAAwD;AAIxD,MAAM,YAAY,GAAG,CAAC,SAAoB,EAAE,QAAwB,EAAE,EAAE;IACtE,OAAO,IAAI,oBAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,aAAa,GAAkB,CACnC,QAAgB,EAChB,MAAsB,EACtB,EAA+B,EACnB,EAAE,CACd,IAAA,qBAAc,EACZ,IAAA,yBAAU,EAAC,QAAQ,CAAC,CAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAC1F,CAAC;AAgCgD,sCAAa;AA9BjE,MAAM,iBAAiB,GAA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AE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAqB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAqB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAKxE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAMzD,QAAA,MAAM,aAAa,EAAE,aAOlB,CAAC;AAMJ,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,EAAE,iBAAiB,CAGlE,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,WAAW,CAKjD;AAED,QAAA,MAAM,aAAa;;CAElB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,QAMf,CAAC;AAEF,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;CAAiB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -6,7 +6,6 @@ import makeCliTools from "@ledgerhq/coin-bitcoin/cli-transaction";
|
|
|
6
6
|
import bitcoinResolver from "@ledgerhq/coin-bitcoin/hw-getAddress";
|
|
7
7
|
import { signMessage } from "@ledgerhq/coin-bitcoin/hw-signMessage";
|
|
8
8
|
import { withDevice } from "../../hw/deviceAccess";
|
|
9
|
-
import { startSpan } from "../../performance";
|
|
10
9
|
import { getCurrencyConfiguration } from "../../config";
|
|
11
10
|
const createSigner = (transport, currency) => {
|
|
12
11
|
return new Btc({ transport, currency: currency.id });
|
|
@@ -15,10 +14,7 @@ const signerContext = (deviceId, crypto, fn) => firstValueFrom(withDevice(device
|
|
|
15
14
|
const getCurrencyConfig = (currency) => {
|
|
16
15
|
return { info: getCurrencyConfiguration(currency) };
|
|
17
16
|
};
|
|
18
|
-
const
|
|
19
|
-
startSpan,
|
|
20
|
-
};
|
|
21
|
-
const bridge = createBridges(signerContext, perfLogger, getCurrencyConfig);
|
|
17
|
+
const bridge = createBridges(signerContext, getCurrencyConfig);
|
|
22
18
|
export function createMessageSigner() {
|
|
23
19
|
return (transport, account, messageData) => {
|
|
24
20
|
const signerContext = (_, crypto, fn) => fn(createSigner(transport, crypto));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAExF,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5C,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,eAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/families/bitcoin/setup.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAExF,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5C,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAClE,OAAO,eAAe,MAAM,sC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,GAAa,CACzB,SAAoB,EACpB,UAA6B,EACH,EAAE;IAC5B,MAAM,aAAa,GAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5F,OAAO,eAAe,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-common",
|
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
|
4
|
-
"version": "34.7.
|
|
4
|
+
"version": "34.7.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
"yargs": "^17.0.0",
|
|
189
189
|
"zod": "^3.22.4",
|
|
190
190
|
"@ledgerhq/coin-algorand": "^0.5.4",
|
|
191
|
-
"@ledgerhq/coin-bitcoin": "^0.7.
|
|
191
|
+
"@ledgerhq/coin-bitcoin": "^0.7.3",
|
|
192
192
|
"@ledgerhq/coin-cardano": "^0.1.4",
|
|
193
193
|
"@ledgerhq/coin-evm": "^2.1.4",
|
|
194
194
|
"@ledgerhq/coin-framework": "^0.17.0",
|
|
@@ -9438,7 +9438,7 @@ exports[`bitcoin_cash currency bridge scanAccounts bitcoin_cash seed 1 1`] = `
|
|
|
9438
9438
|
"xpub": "xpub6BuPWhjLqutPV8SF4RMrrn8c3t7uBZbz4CBbThpbg9GYjqRMncra9mjgSfWSK7uMDz37hhzJ8wvkbDDQQJt6VgwLoszvmPiSBtLA1bPLLSn",
|
|
9439
9439
|
},
|
|
9440
9440
|
{
|
|
9441
|
-
"balance": "
|
|
9441
|
+
"balance": "100774",
|
|
9442
9442
|
"bitcoinResources": {},
|
|
9443
9443
|
"currencyId": "bitcoin_cash",
|
|
9444
9444
|
"derivationMode": "",
|
|
@@ -9446,10 +9446,10 @@ exports[`bitcoin_cash currency bridge scanAccounts bitcoin_cash seed 1 1`] = `
|
|
|
9446
9446
|
"freshAddressPath": "44'/145'/0'/0/23",
|
|
9447
9447
|
"id": "js:2:bitcoin_cash:xpub6D7pqJa4V3SFSigcsRaFL2mpfG7469osrMkk4ieR2uk8y1v3nuQUD8W8v36PLWQtVRSggSQM7jLpGNKH7sqCaoPSJEp9wZCVkRnMWoiUUXa:",
|
|
9448
9448
|
"index": 0,
|
|
9449
|
-
"operationsCount":
|
|
9449
|
+
"operationsCount": 67,
|
|
9450
9450
|
"pendingOperations": [],
|
|
9451
9451
|
"seedIdentifier": "04884ed3fe628a8487f782f97f38e7a9f014e624f1ea679951cf3a67445ea33fb334f4cc19e6c421b3ef9943d526cd4fbfebacebe8a62cc45db79a33d3ab04bd47",
|
|
9452
|
-
"spendableBalance": "
|
|
9452
|
+
"spendableBalance": "100774",
|
|
9453
9453
|
"swapHistory": [],
|
|
9454
9454
|
"syncHash": undefined,
|
|
9455
9455
|
"used": true,
|
|
@@ -11312,6 +11312,24 @@ exports[`bitcoin_cash currency bridge scanAccounts bitcoin_cash seed 1 2`] = `
|
|
|
11312
11312
|
"type": "IN",
|
|
11313
11313
|
"value": "599434",
|
|
11314
11314
|
},
|
|
11315
|
+
{
|
|
11316
|
+
"accountId": "js:2:bitcoin_cash:xpub6D7pqJa4V3SFSigcsRaFL2mpfG7469osrMkk4ieR2uk8y1v3nuQUD8W8v36PLWQtVRSggSQM7jLpGNKH7sqCaoPSJEp9wZCVkRnMWoiUUXa:",
|
|
11317
|
+
"blockHash": "0000000000000000003d037b815760feb7df62117b3882d2f53d1af949d0ed7f",
|
|
11318
|
+
"blockHeight": 855031,
|
|
11319
|
+
"extra": {},
|
|
11320
|
+
"fee": "277",
|
|
11321
|
+
"hasFailed": false,
|
|
11322
|
+
"hash": "d69e7f7a220a998d29b13fdec9b9a157c92d89997c6f0d7302014165566689f8",
|
|
11323
|
+
"id": "js:2:bitcoin_cash:xpub6D7pqJa4V3SFSigcsRaFL2mpfG7469osrMkk4ieR2uk8y1v3nuQUD8W8v36PLWQtVRSggSQM7jLpGNKH7sqCaoPSJEp9wZCVkRnMWoiUUXa:-d69e7f7a220a998d29b13fdec9b9a157c92d89997c6f0d7302014165566689f8-IN",
|
|
11324
|
+
"recipients": [
|
|
11325
|
+
"qp28czls5tlvfpmxhpeyt7fx9wfnhpl2a5pzga4cwa",
|
|
11326
|
+
],
|
|
11327
|
+
"senders": [
|
|
11328
|
+
"qp62arrql0hvg5mu8f8mp3cnmn8pp2tfmcr5q6ndql",
|
|
11329
|
+
],
|
|
11330
|
+
"type": "IN",
|
|
11331
|
+
"value": "1000",
|
|
11332
|
+
},
|
|
11315
11333
|
{
|
|
11316
11334
|
"accountId": "js:2:bitcoin_cash:xpub6D7pqJa4V3SFSigcsRaFL2mpfG7469osrMkk4ieR2uk8y1v3nuQUD8W8v36PLWQtVRSggSQM7jLpGNKH7sqCaoPSJEp9wZCVkRnMWoiUUXa:",
|
|
11317
11335
|
"blockHash": "00000000000000000201065d6543396afc932549b02510721592dccaff7cbdbc",
|
|
@@ -19375,7 +19393,7 @@ exports[`litecoin currency bridge scanAccounts litecoin seed 1 1`] = `
|
|
|
19375
19393
|
"xpub": "Ltub2ZDyeYFtDj5kL5kYEcBGiDwhXQtZNefG3k4XvAtoMfD5cHxa93WMr6zLGnLb11LCgUXpxWTZRVPv2Roh2vdxesTpgFYayeNNVJb7wmCfD3x",
|
|
19376
19394
|
},
|
|
19377
19395
|
{
|
|
19378
|
-
"balance": "
|
|
19396
|
+
"balance": "483964",
|
|
19379
19397
|
"bitcoinResources": {},
|
|
19380
19398
|
"currencyId": "litecoin",
|
|
19381
19399
|
"derivationMode": "segwit",
|
|
@@ -19383,10 +19401,10 @@ exports[`litecoin currency bridge scanAccounts litecoin seed 1 1`] = `
|
|
|
19383
19401
|
"freshAddressPath": "49'/2'/0'/0/25",
|
|
19384
19402
|
"id": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit",
|
|
19385
19403
|
"index": 0,
|
|
19386
|
-
"operationsCount":
|
|
19404
|
+
"operationsCount": 53,
|
|
19387
19405
|
"pendingOperations": [],
|
|
19388
19406
|
"seedIdentifier": "04921553e9c4ff6ef39e98f2e8a7719d76e6ecdc67cbb65dcdfd4d04b7e0386524daf087032c6a2ab4280d343d8f4d086e1ef78d9acc1e2464282feb75abf624aa",
|
|
19389
|
-
"spendableBalance": "
|
|
19407
|
+
"spendableBalance": "483964",
|
|
19390
19408
|
"swapHistory": [],
|
|
19391
19409
|
"syncHash": undefined,
|
|
19392
19410
|
"used": true,
|
|
@@ -19854,6 +19872,24 @@ exports[`litecoin currency bridge scanAccounts litecoin seed 1 2`] = `
|
|
|
19854
19872
|
"type": "OUT",
|
|
19855
19873
|
"value": "21800",
|
|
19856
19874
|
},
|
|
19875
|
+
{
|
|
19876
|
+
"accountId": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit",
|
|
19877
|
+
"blockHash": "398564d222e0075bfce3ec282cba68911f30002b2977e7a35fd248e2c49ee01f",
|
|
19878
|
+
"blockHeight": 2721804,
|
|
19879
|
+
"extra": {},
|
|
19880
|
+
"fee": "327",
|
|
19881
|
+
"hasFailed": false,
|
|
19882
|
+
"hash": "19a733d3cd66111de0bd8297a07a247ba786c9571b00d0b611c4359e9f2cf0d1",
|
|
19883
|
+
"id": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit-19a733d3cd66111de0bd8297a07a247ba786c9571b00d0b611c4359e9f2cf0d1-IN",
|
|
19884
|
+
"recipients": [
|
|
19885
|
+
"MGWgRF4qLAHtYhEe6VcQNeQRxVhPd3evHc",
|
|
19886
|
+
],
|
|
19887
|
+
"senders": [
|
|
19888
|
+
"MGV7YgucxkwsTmB167poMS7yX5tY68FAt2",
|
|
19889
|
+
],
|
|
19890
|
+
"type": "IN",
|
|
19891
|
+
"value": "12000",
|
|
19892
|
+
},
|
|
19857
19893
|
{
|
|
19858
19894
|
"accountId": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit",
|
|
19859
19895
|
"blockHash": "44d1cdfe6831b62152d83ded24aac350878e628b0f65b6a2cac773481916722d",
|
|
@@ -20538,6 +20574,24 @@ exports[`litecoin currency bridge scanAccounts litecoin seed 1 2`] = `
|
|
|
20538
20574
|
"type": "OUT",
|
|
20539
20575
|
"value": "1015860",
|
|
20540
20576
|
},
|
|
20577
|
+
{
|
|
20578
|
+
"accountId": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit",
|
|
20579
|
+
"blockHash": "af5e73eb01066e4fdd9bd7b42d7b88b5e4774ed45cb569a4f60e774918ad631e",
|
|
20580
|
+
"blockHeight": 2721801,
|
|
20581
|
+
"extra": {},
|
|
20582
|
+
"fee": "327",
|
|
20583
|
+
"hasFailed": false,
|
|
20584
|
+
"hash": "d856eb791a03d93bd19d8153a0997358e6c396152d5c72ba162b70c8baac5616",
|
|
20585
|
+
"id": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit-d856eb791a03d93bd19d8153a0997358e6c396152d5c72ba162b70c8baac5616-IN",
|
|
20586
|
+
"recipients": [
|
|
20587
|
+
"MGWgRF4qLAHtYhEe6VcQNeQRxVhPd3evHc",
|
|
20588
|
+
],
|
|
20589
|
+
"senders": [
|
|
20590
|
+
"MGhyc5uFXviT4SZRJLk6oYCJV5zENaGVZB",
|
|
20591
|
+
],
|
|
20592
|
+
"type": "IN",
|
|
20593
|
+
"value": "10120",
|
|
20594
|
+
},
|
|
20541
20595
|
{
|
|
20542
20596
|
"accountId": "js:2:litecoin:Ltub2ZoEDG8AmPfD8oGoFEvfsKWjeyiXh6TiKYjgLnoVxfeECfQteY6sDF1AuH1iW6ekue2PSwdbbvG2NpFPzLqcgNgteHZPNo6zGthjcAmwxT3:segwit",
|
|
20543
20597
|
"blockHash": "d1ee2556cf97c5126be0576ac1f1fc1b6e80f4588f7e18e9a5afc11d801030f1",
|
|
@@ -13,7 +13,6 @@ import { signMessage } from "@ledgerhq/coin-bitcoin/hw-signMessage";
|
|
|
13
13
|
import { BitcoinAccount, Transaction, TransactionStatus } from "@ledgerhq/coin-bitcoin/types";
|
|
14
14
|
import { GetAddressOptions, Resolver } from "../../hw/getAddress/types";
|
|
15
15
|
import { withDevice } from "../../hw/deviceAccess";
|
|
16
|
-
import { startSpan } from "../../performance";
|
|
17
16
|
import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
|
|
18
17
|
import { getCurrencyConfiguration } from "../../config";
|
|
19
18
|
import { BitcoinConfigInfo } from "@ledgerhq/coin-bitcoin/lib/config";
|
|
@@ -36,13 +35,8 @@ const getCurrencyConfig = (currency: CryptoCurrency) => {
|
|
|
36
35
|
return { info: getCurrencyConfiguration<BitcoinConfigInfo>(currency) };
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
const perfLogger = {
|
|
40
|
-
startSpan,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
38
|
const bridge: Bridge<Transaction, BitcoinAccount, TransactionStatus> = createBridges(
|
|
44
39
|
signerContext,
|
|
45
|
-
perfLogger,
|
|
46
40
|
getCurrencyConfig,
|
|
47
41
|
);
|
|
48
42
|
|
package/lib/performance.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type Unsubscribe = () => void;
|
|
2
|
-
export declare function connectLogsToSentry(Sentry: any): Unsubscribe;
|
|
3
|
-
export declare function startSpan(op: string, description?: string, rest?: {
|
|
4
|
-
tags?: any;
|
|
5
|
-
data?: any;
|
|
6
|
-
}): {
|
|
7
|
-
finish: () => void;
|
|
8
|
-
};
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=performance.d.ts.map
|
package/lib/performance.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../src/performance.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,WAAW,CA4B5D;AAGD,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE;IACL,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GACA;IACD,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAeA"}
|
package/lib/performance.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startSpan = exports.connectLogsToSentry = void 0;
|
|
4
|
-
// Provide helpers to track performance spans through our internal logs
|
|
5
|
-
const logs_1 = require("@ledgerhq/logs");
|
|
6
|
-
function connectLogsToSentry(Sentry) {
|
|
7
|
-
let apduSpan;
|
|
8
|
-
const spans = {};
|
|
9
|
-
return (0, logs_1.listen)(l => {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
if (!l)
|
|
12
|
-
return;
|
|
13
|
-
if (l.type === "apdu") {
|
|
14
|
-
if ((_a = l.message) === null || _a === void 0 ? void 0 : _a.startsWith("=>")) {
|
|
15
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
16
|
-
apduSpan = t === null || t === void 0 ? void 0 : t.startChild({
|
|
17
|
-
op: "apdu",
|
|
18
|
-
description: l.message.slice(0, 11),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
else if ((_b = l.message) === null || _b === void 0 ? void 0 : _b.startsWith("<=")) {
|
|
22
|
-
apduSpan === null || apduSpan === void 0 ? void 0 : apduSpan.finish();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
else if (l.type === "perf-span") {
|
|
26
|
-
const { data } = l;
|
|
27
|
-
if (!data)
|
|
28
|
-
return;
|
|
29
|
-
const { id, starts, span } = data;
|
|
30
|
-
if (starts) {
|
|
31
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
32
|
-
spans[id] = t === null || t === void 0 ? void 0 : t.startChild(Object.assign(Object.assign({}, span), { description: l.message || "" }));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
const span = spans[id];
|
|
36
|
-
span === null || span === void 0 ? void 0 : span.finish();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
exports.connectLogsToSentry = connectLogsToSentry;
|
|
42
|
-
let idCounter = 0;
|
|
43
|
-
function startSpan(op, description, rest) {
|
|
44
|
-
let id = ++idCounter;
|
|
45
|
-
const span = Object.assign({ op }, rest);
|
|
46
|
-
(0, logs_1.log)("perf-span", description || "", {
|
|
47
|
-
id,
|
|
48
|
-
starts: true,
|
|
49
|
-
span,
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
finish: () => {
|
|
53
|
-
if (!id)
|
|
54
|
-
return;
|
|
55
|
-
(0, logs_1.log)("perf-span", description || "", { id });
|
|
56
|
-
id = 0;
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
exports.startSpan = startSpan;
|
|
61
|
-
//# sourceMappingURL=performance.js.map
|
package/lib/performance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.js","sourceRoot":"","sources":["../src/performance.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AACvE,yCAA6C;AAI7C,SAAgB,mBAAmB,CAAC,MAAW;IAC7C,IAAI,QAAQ,CAAC;IACb,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,OAAO,IAAA,aAAM,EAAC,CAAC,CAAC,EAAE;;QAChB,IAAI,CAAC,CAAC;YAAE,OAAO;QACf,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE;YACrB,IAAI,MAAA,CAAC,CAAC,OAAO,0CAAE,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC/B,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC;gBACtD,QAAQ,GAAG,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,UAAU,CAAC;oBACvB,EAAE,EAAE,MAAM;oBACV,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;iBACpC,CAAC,CAAC;aACJ;iBAAM,IAAI,MAAA,CAAC,CAAC,OAAO,0CAAE,UAAU,CAAC,IAAI,CAAC,EAAE;gBACtC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,EAAE,CAAC;aACpB;SACF;aAAM,IAAI,C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@@
|
|
|
1
|
-
{"version":3,"file":"performance.test.d.ts","sourceRoot":"","sources":["../src/performance.test.ts"],"names":[],"mappings":""}
|
package/lib/performance.test.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const performance_1 = require("./performance");
|
|
4
|
-
test("connectLogsToSentry", () => {
|
|
5
|
-
const finish = jest.fn();
|
|
6
|
-
const startChild = jest.fn(arg => ({ arg, finish }));
|
|
7
|
-
const getSpan = jest.fn(() => ({ startChild }));
|
|
8
|
-
const Sentry = {
|
|
9
|
-
getCurrentHub: () => ({
|
|
10
|
-
getScope: () => ({ getSpan }),
|
|
11
|
-
}),
|
|
12
|
-
};
|
|
13
|
-
(0, performance_1.connectLogsToSentry)(Sentry);
|
|
14
|
-
const span = (0, performance_1.startSpan)("op", "desc", { tags: { foo: 42 } });
|
|
15
|
-
expect(startChild.mock.calls.length).toBe(1);
|
|
16
|
-
expect(startChild.mock.calls[0][0]).toMatchObject({
|
|
17
|
-
op: "op",
|
|
18
|
-
description: "desc",
|
|
19
|
-
tags: { foo: 42 },
|
|
20
|
-
});
|
|
21
|
-
expect(finish.mock.calls.length).toBe(0);
|
|
22
|
-
span.finish();
|
|
23
|
-
(0, performance_1.startSpan)("ignored");
|
|
24
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
25
|
-
span.finish();
|
|
26
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=performance.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.test.js","sourceRoot":"","sources":["../src/performance.test.ts"],"names":[],"mappings":";;AAAA,+CAA+D;AAE/D,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAA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CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
package/lib-es/performance.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type Unsubscribe = () => void;
|
|
2
|
-
export declare function connectLogsToSentry(Sentry: any): Unsubscribe;
|
|
3
|
-
export declare function startSpan(op: string, description?: string, rest?: {
|
|
4
|
-
tags?: any;
|
|
5
|
-
data?: any;
|
|
6
|
-
}): {
|
|
7
|
-
finish: () => void;
|
|
8
|
-
};
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../src/performance.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,WAAW,CA4B5D;AAGD,wBAAgB,SAAS,CACvB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE;IACL,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GACA;IACD,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAeA"}
|
package/lib-es/performance.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Provide helpers to track performance spans through our internal logs
|
|
2
|
-
import { log, listen } from "@ledgerhq/logs";
|
|
3
|
-
export function connectLogsToSentry(Sentry) {
|
|
4
|
-
let apduSpan;
|
|
5
|
-
const spans = {};
|
|
6
|
-
return listen(l => {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
if (!l)
|
|
9
|
-
return;
|
|
10
|
-
if (l.type === "apdu") {
|
|
11
|
-
if ((_a = l.message) === null || _a === void 0 ? void 0 : _a.startsWith("=>")) {
|
|
12
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
13
|
-
apduSpan = t === null || t === void 0 ? void 0 : t.startChild({
|
|
14
|
-
op: "apdu",
|
|
15
|
-
description: l.message.slice(0, 11),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
else if ((_b = l.message) === null || _b === void 0 ? void 0 : _b.startsWith("<=")) {
|
|
19
|
-
apduSpan === null || apduSpan === void 0 ? void 0 : apduSpan.finish();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else if (l.type === "perf-span") {
|
|
23
|
-
const { data } = l;
|
|
24
|
-
if (!data)
|
|
25
|
-
return;
|
|
26
|
-
const { id, starts, span } = data;
|
|
27
|
-
if (starts) {
|
|
28
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
29
|
-
spans[id] = t === null || t === void 0 ? void 0 : t.startChild(Object.assign(Object.assign({}, span), { description: l.message || "" }));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
const span = spans[id];
|
|
33
|
-
span === null || span === void 0 ? void 0 : span.finish();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
let idCounter = 0;
|
|
39
|
-
export function startSpan(op, description, rest) {
|
|
40
|
-
let id = ++idCounter;
|
|
41
|
-
const span = Object.assign({ op }, rest);
|
|
42
|
-
log("perf-span", description || "", {
|
|
43
|
-
id,
|
|
44
|
-
starts: true,
|
|
45
|
-
span,
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
finish: () => {
|
|
49
|
-
if (!id)
|
|
50
|
-
return;
|
|
51
|
-
log("perf-span", description || "", { id });
|
|
52
|
-
id = 0;
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=performance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.js","sourceRoot":"","sources":["../src/performance.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MA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CAAC;aACtE;iBAAM;gBACL,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;gBACvB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAE,CAAC;aAChB;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,MAAM,UAAU,SAAS,CACvB,EAAU,EACV,WAAoB,EACpB,IAGC;IAID,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC;IACrB,MAAM,IAAI,mBAAU,EAAE,IAAK,IAAI,CAAE,CAAC;IAClC,GAAG,CAAC,WAAW,EAAE,WAAW,IAAI,EAAE,EAAE;QAClC,EAAE;QACF,MAAM,EAAE,IAAI;QACZ,IAAI;KACL,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,GAAG,EAAE;YACX,IAAI,CAAC,EAAE;gBAAE,OAAO;YAChB,GAAG,CAAC,WAAW,EAAE,WAAW,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC5C,EAAE,GAAG,CAAC,CAAC;QACT,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.test.d.ts","sourceRoot":"","sources":["../src/performance.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { connectLogsToSentry, startSpan } from "./performance";
|
|
2
|
-
test("connectLogsToSentry", () => {
|
|
3
|
-
const finish = jest.fn();
|
|
4
|
-
const startChild = jest.fn(arg => ({ arg, finish }));
|
|
5
|
-
const getSpan = jest.fn(() => ({ startChild }));
|
|
6
|
-
const Sentry = {
|
|
7
|
-
getCurrentHub: () => ({
|
|
8
|
-
getScope: () => ({ getSpan }),
|
|
9
|
-
}),
|
|
10
|
-
};
|
|
11
|
-
connectLogsToSentry(Sentry);
|
|
12
|
-
const span = startSpan("op", "desc", { tags: { foo: 42 } });
|
|
13
|
-
expect(startChild.mock.calls.length).toBe(1);
|
|
14
|
-
expect(startChild.mock.calls[0][0]).toMatchObject({
|
|
15
|
-
op: "op",
|
|
16
|
-
description: "desc",
|
|
17
|
-
tags: { foo: 42 },
|
|
18
|
-
});
|
|
19
|
-
expect(finish.mock.calls.length).toBe(0);
|
|
20
|
-
span.finish();
|
|
21
|
-
startSpan("ignored");
|
|
22
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
23
|
-
span.finish();
|
|
24
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=performance.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"performance.test.js","sourceRoot":"","sources":["../src/performance.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG;QACb,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;YACpB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;SAC9B,CAAC;KACH,CAAC;IACF,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;QAChD,EAAE,EAAE,IAAI;QACR,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;IACd,SAAS,CAAC,SAAS,CAAC,CAAC;IACrB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;IACd,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
package/src/performance.test.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { connectLogsToSentry, startSpan } from "./performance";
|
|
2
|
-
|
|
3
|
-
test("connectLogsToSentry", () => {
|
|
4
|
-
const finish = jest.fn();
|
|
5
|
-
const startChild = jest.fn(arg => ({ arg, finish }));
|
|
6
|
-
const getSpan = jest.fn(() => ({ startChild }));
|
|
7
|
-
const Sentry = {
|
|
8
|
-
getCurrentHub: () => ({
|
|
9
|
-
getScope: () => ({ getSpan }),
|
|
10
|
-
}),
|
|
11
|
-
};
|
|
12
|
-
connectLogsToSentry(Sentry);
|
|
13
|
-
const span = startSpan("op", "desc", { tags: { foo: 42 } });
|
|
14
|
-
expect(startChild.mock.calls.length).toBe(1);
|
|
15
|
-
expect(startChild.mock.calls[0][0]).toMatchObject({
|
|
16
|
-
op: "op",
|
|
17
|
-
description: "desc",
|
|
18
|
-
tags: { foo: 42 },
|
|
19
|
-
});
|
|
20
|
-
expect(finish.mock.calls.length).toBe(0);
|
|
21
|
-
span.finish();
|
|
22
|
-
startSpan("ignored");
|
|
23
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
24
|
-
span.finish();
|
|
25
|
-
expect(finish.mock.calls.length).toBe(1);
|
|
26
|
-
});
|
package/src/performance.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Provide helpers to track performance spans through our internal logs
|
|
2
|
-
import { log, listen } from "@ledgerhq/logs";
|
|
3
|
-
|
|
4
|
-
type Unsubscribe = () => void;
|
|
5
|
-
|
|
6
|
-
export function connectLogsToSentry(Sentry: any): Unsubscribe {
|
|
7
|
-
let apduSpan;
|
|
8
|
-
const spans = {};
|
|
9
|
-
return listen(l => {
|
|
10
|
-
if (!l) return;
|
|
11
|
-
if (l.type === "apdu") {
|
|
12
|
-
if (l.message?.startsWith("=>")) {
|
|
13
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
14
|
-
apduSpan = t?.startChild({
|
|
15
|
-
op: "apdu",
|
|
16
|
-
description: l.message.slice(0, 11),
|
|
17
|
-
});
|
|
18
|
-
} else if (l.message?.startsWith("<=")) {
|
|
19
|
-
apduSpan?.finish();
|
|
20
|
-
}
|
|
21
|
-
} else if (l.type === "perf-span") {
|
|
22
|
-
const { data } = l;
|
|
23
|
-
if (!data) return;
|
|
24
|
-
const { id, starts, span } = data;
|
|
25
|
-
if (starts) {
|
|
26
|
-
const t = Sentry.getCurrentHub().getScope().getSpan();
|
|
27
|
-
spans[id] = t?.startChild({ ...span, description: l.message || "" });
|
|
28
|
-
} else {
|
|
29
|
-
const span = spans[id];
|
|
30
|
-
span?.finish();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let idCounter = 0;
|
|
37
|
-
export function startSpan(
|
|
38
|
-
op: string,
|
|
39
|
-
description?: string,
|
|
40
|
-
rest?: {
|
|
41
|
-
tags?: any;
|
|
42
|
-
data?: any;
|
|
43
|
-
},
|
|
44
|
-
): {
|
|
45
|
-
finish: () => void;
|
|
46
|
-
} {
|
|
47
|
-
let id = ++idCounter;
|
|
48
|
-
const span: any = { op, ...rest };
|
|
49
|
-
log("perf-span", description || "", {
|
|
50
|
-
id,
|
|
51
|
-
starts: true,
|
|
52
|
-
span,
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
finish: () => {
|
|
56
|
-
if (!id) return;
|
|
57
|
-
log("perf-span", description || "", { id });
|
|
58
|
-
id = 0;
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
}
|