@ledgerhq/live-cli 21.32.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/README.md +520 -0
- package/bin/index.js +2 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +137 -0
- package/lib/cli.js.map +1 -0
- package/lib/commands/app.d.ts +45 -0
- package/lib/commands/app.d.ts.map +1 -0
- package/lib/commands/app.js +131 -0
- package/lib/commands/app.js.map +1 -0
- package/lib/commands/appUninstallAll.d.ts +15 -0
- package/lib/commands/appUninstallAll.d.ts.map +1 -0
- package/lib/commands/appUninstallAll.js +31 -0
- package/lib/commands/appUninstallAll.js.map +1 -0
- package/lib/commands/appsCheckAllAppVersions.d.ts +20 -0
- package/lib/commands/appsCheckAllAppVersions.d.ts.map +1 -0
- package/lib/commands/appsCheckAllAppVersions.js +484 -0
- package/lib/commands/appsCheckAllAppVersions.js.map +1 -0
- package/lib/commands/appsInstallAll.d.ts +15 -0
- package/lib/commands/appsInstallAll.d.ts.map +1 -0
- package/lib/commands/appsInstallAll.js +34 -0
- package/lib/commands/appsInstallAll.js.map +1 -0
- package/lib/commands/appsUpdateTestAll.d.ts +20 -0
- package/lib/commands/appsUpdateTestAll.d.ts.map +1 -0
- package/lib/commands/appsUpdateTestAll.js +101 -0
- package/lib/commands/appsUpdateTestAll.js.map +1 -0
- package/lib/commands/balanceHistory.d.ts +50 -0
- package/lib/commands/balanceHistory.d.ts.map +1 -0
- package/lib/commands/balanceHistory.js +110 -0
- package/lib/commands/balanceHistory.js.map +1 -0
- package/lib/commands/bot.d.ts +12 -0
- package/lib/commands/bot.d.ts.map +1 -0
- package/lib/commands/bot.js +33 -0
- package/lib/commands/bot.js.map +1 -0
- package/lib/commands/botPortfolio.d.ts +15 -0
- package/lib/commands/botPortfolio.d.ts.map +1 -0
- package/lib/commands/botPortfolio.js +41 -0
- package/lib/commands/botPortfolio.js.map +1 -0
- package/lib/commands/botTransfer.d.ts +7 -0
- package/lib/commands/botTransfer.d.ts.map +1 -0
- package/lib/commands/botTransfer.js +376 -0
- package/lib/commands/botTransfer.js.map +1 -0
- package/lib/commands/broadcast.d.ts +42 -0
- package/lib/commands/broadcast.d.ts.map +1 -0
- package/lib/commands/broadcast.js +48 -0
- package/lib/commands/broadcast.js.map +1 -0
- package/lib/commands/cleanSpeculos.d.ts +7 -0
- package/lib/commands/cleanSpeculos.d.ts.map +1 -0
- package/lib/commands/cleanSpeculos.js +20 -0
- package/lib/commands/cleanSpeculos.js.map +1 -0
- package/lib/commands/countervalues.d.ts +84 -0
- package/lib/commands/countervalues.d.ts.map +1 -0
- package/lib/commands/countervalues.js +302 -0
- package/lib/commands/countervalues.js.map +1 -0
- package/lib/commands/derivation.d.ts +6 -0
- package/lib/commands/derivation.d.ts.map +1 -0
- package/lib/commands/derivation.js +44 -0
- package/lib/commands/derivation.js.map +1 -0
- package/lib/commands/devDeviceAppsScenario.d.ts +24 -0
- package/lib/commands/devDeviceAppsScenario.d.ts.map +1 -0
- package/lib/commands/devDeviceAppsScenario.js +97 -0
- package/lib/commands/devDeviceAppsScenario.js.map +1 -0
- package/lib/commands/deviceAppVersion.d.ts +19 -0
- package/lib/commands/deviceAppVersion.d.ts.map +1 -0
- package/lib/commands/deviceAppVersion.js +17 -0
- package/lib/commands/deviceAppVersion.js.map +1 -0
- package/lib/commands/deviceInfo.d.ts +14 -0
- package/lib/commands/deviceInfo.d.ts.map +1 -0
- package/lib/commands/deviceInfo.js +17 -0
- package/lib/commands/deviceInfo.js.map +1 -0
- package/lib/commands/deviceVersion.d.ts +14 -0
- package/lib/commands/deviceVersion.d.ts.map +1 -0
- package/lib/commands/deviceVersion.js +17 -0
- package/lib/commands/deviceVersion.js.map +1 -0
- package/lib/commands/discoverDevices.d.ts +23 -0
- package/lib/commands/discoverDevices.d.ts.map +1 -0
- package/lib/commands/discoverDevices.js +86 -0
- package/lib/commands/discoverDevices.js.map +1 -0
- package/lib/commands/envs.d.ts +7 -0
- package/lib/commands/envs.d.ts.map +1 -0
- package/lib/commands/envs.js +15 -0
- package/lib/commands/envs.js.map +1 -0
- package/lib/commands/estimateMaxSpendable.d.ts +41 -0
- package/lib/commands/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/commands/estimateMaxSpendable.js +65 -0
- package/lib/commands/estimateMaxSpendable.js.map +1 -0
- package/lib/commands/exportAccounts.d.ts +48 -0
- package/lib/commands/exportAccounts.d.ts.map +1 -0
- package/lib/commands/exportAccounts.js +69 -0
- package/lib/commands/exportAccounts.js.map +1 -0
- package/lib/commands/firmwareRepair.d.ts +22 -0
- package/lib/commands/firmwareRepair.d.ts.map +1 -0
- package/lib/commands/firmwareRepair.js +23 -0
- package/lib/commands/firmwareRepair.js.map +1 -0
- package/lib/commands/firmwareUpdate.d.ts +26 -0
- package/lib/commands/firmwareUpdate.d.ts.map +1 -0
- package/lib/commands/firmwareUpdate.js +154 -0
- package/lib/commands/firmwareUpdate.js.map +1 -0
- package/lib/commands/generateAppJsonFromDataset.d.ts +7 -0
- package/lib/commands/generateAppJsonFromDataset.d.ts.map +1 -0
- package/lib/commands/generateAppJsonFromDataset.js +212 -0
- package/lib/commands/generateAppJsonFromDataset.js.map +1 -0
- package/lib/commands/generateTestScanAccounts.d.ts +49 -0
- package/lib/commands/generateTestScanAccounts.d.ts.map +1 -0
- package/lib/commands/generateTestScanAccounts.js +60 -0
- package/lib/commands/generateTestScanAccounts.js.map +1 -0
- package/lib/commands/generateTestTransaction.d.ts +44 -0
- package/lib/commands/generateTestTransaction.d.ts.map +1 -0
- package/lib/commands/generateTestTransaction.js +118 -0
- package/lib/commands/generateTestTransaction.js.map +1 -0
- package/lib/commands/genuineCheck.d.ts +15 -0
- package/lib/commands/genuineCheck.d.ts.map +1 -0
- package/lib/commands/genuineCheck.js +22 -0
- package/lib/commands/genuineCheck.js.map +1 -0
- package/lib/commands/getAddress.d.ts +28 -0
- package/lib/commands/getAddress.d.ts.map +1 -0
- package/lib/commands/getAddress.js +53 -0
- package/lib/commands/getAddress.js.map +1 -0
- package/lib/commands/getTransactionStatus.d.ts +52 -0
- package/lib/commands/getTransactionStatus.d.ts.map +1 -0
- package/lib/commands/getTransactionStatus.js +86 -0
- package/lib/commands/getTransactionStatus.js.map +1 -0
- package/lib/commands/liveData.d.ts +49 -0
- package/lib/commands/liveData.d.ts.map +1 -0
- package/lib/commands/liveData.js +82 -0
- package/lib/commands/liveData.js.map +1 -0
- package/lib/commands/makeCompoundSummary.d.ts +54 -0
- package/lib/commands/makeCompoundSummary.d.ts.map +1 -0
- package/lib/commands/makeCompoundSummary.js +190 -0
- package/lib/commands/makeCompoundSummary.js.map +1 -0
- package/lib/commands/managerListApps.d.ts +21 -0
- package/lib/commands/managerListApps.d.ts.map +1 -0
- package/lib/commands/managerListApps.js +47 -0
- package/lib/commands/managerListApps.js.map +1 -0
- package/lib/commands/portfolio.d.ts +66 -0
- package/lib/commands/portfolio.d.ts.map +1 -0
- package/lib/commands/portfolio.js +138 -0
- package/lib/commands/portfolio.js.map +1 -0
- package/lib/commands/proxy.d.ts +36 -0
- package/lib/commands/proxy.d.ts.map +1 -0
- package/lib/commands/proxy.js +413 -0
- package/lib/commands/proxy.js.map +1 -0
- package/lib/commands/receive.d.ts +48 -0
- package/lib/commands/receive.d.ts.map +1 -0
- package/lib/commands/receive.js +68 -0
- package/lib/commands/receive.js.map +1 -0
- package/lib/commands/repl.d.ts +22 -0
- package/lib/commands/repl.d.ts.map +1 -0
- package/lib/commands/repl.js +26 -0
- package/lib/commands/repl.js.map +1 -0
- package/lib/commands/satstack.d.ts +37 -0
- package/lib/commands/satstack.d.ts.map +1 -0
- package/lib/commands/satstack.js +110 -0
- package/lib/commands/satstack.js.map +1 -0
- package/lib/commands/satstackStatus.d.ts +13 -0
- package/lib/commands/satstackStatus.d.ts.map +1 -0
- package/lib/commands/satstackStatus.js +24 -0
- package/lib/commands/satstackStatus.js.map +1 -0
- package/lib/commands/scanDescriptors.d.ts +15 -0
- package/lib/commands/scanDescriptors.d.ts.map +1 -0
- package/lib/commands/scanDescriptors.js +18 -0
- package/lib/commands/scanDescriptors.js.map +1 -0
- package/lib/commands/send.d.ts +48 -0
- package/lib/commands/send.d.ts.map +1 -0
- package/lib/commands/send.js +116 -0
- package/lib/commands/send.js.map +1 -0
- package/lib/commands/signMessage.d.ts +16 -0
- package/lib/commands/signMessage.d.ts.map +1 -0
- package/lib/commands/signMessage.js +58 -0
- package/lib/commands/signMessage.js.map +1 -0
- package/lib/commands/speculosList.d.ts +7 -0
- package/lib/commands/speculosList.d.ts.map +1 -0
- package/lib/commands/speculosList.js +71 -0
- package/lib/commands/speculosList.js.map +1 -0
- package/lib/commands/swap.d.ts +55 -0
- package/lib/commands/swap.d.ts.map +1 -0
- package/lib/commands/swap.js +341 -0
- package/lib/commands/swap.js.map +1 -0
- package/lib/commands/sync.d.ts +49 -0
- package/lib/commands/sync.d.ts.map +1 -0
- package/lib/commands/sync.js +135 -0
- package/lib/commands/sync.js.map +1 -0
- package/lib/commands/testDetectOpCollision.d.ts +41 -0
- package/lib/commands/testDetectOpCollision.d.ts.map +1 -0
- package/lib/commands/testDetectOpCollision.js +57 -0
- package/lib/commands/testDetectOpCollision.js.map +1 -0
- package/lib/commands/testGetTrustedInputFromTxHash.d.ts +23 -0
- package/lib/commands/testGetTrustedInputFromTxHash.d.ts.map +1 -0
- package/lib/commands/testGetTrustedInputFromTxHash.js +114 -0
- package/lib/commands/testGetTrustedInputFromTxHash.js.map +1 -0
- package/lib/commands/user.d.ts +6 -0
- package/lib/commands/user.d.ts.map +1 -0
- package/lib/commands/user.js +9 -0
- package/lib/commands/user.js.map +1 -0
- package/lib/commands/version.d.ts +7 -0
- package/lib/commands/version.d.ts.map +1 -0
- package/lib/commands/version.js +12 -0
- package/lib/commands/version.js.map +1 -0
- package/lib/commands/walletconnect.d.ts +62 -0
- package/lib/commands/walletconnect.d.ts.map +1 -0
- package/lib/commands/walletconnect.js +272 -0
- package/lib/commands/walletconnect.js.map +1 -0
- package/lib/commands-index.d.ts +1511 -0
- package/lib/commands-index.d.ts.map +1 -0
- package/lib/commands-index.js +106 -0
- package/lib/commands-index.js.map +1 -0
- package/lib/live-common-setup-base.d.ts +2 -0
- package/lib/live-common-setup-base.d.ts.map +1 -0
- package/lib/live-common-setup-base.js +131 -0
- package/lib/live-common-setup-base.js.map +1 -0
- package/lib/live-common-setup.d.ts +5 -0
- package/lib/live-common-setup.d.ts.map +1 -0
- package/lib/live-common-setup.js +318 -0
- package/lib/live-common-setup.js.map +1 -0
- package/lib/qr.d.ts +3 -0
- package/lib/qr.d.ts.map +1 -0
- package/lib/qr.js +18 -0
- package/lib/qr.js.map +1 -0
- package/lib/scan.d.ts +71 -0
- package/lib/scan.d.ts.map +1 -0
- package/lib/scan.js +299 -0
- package/lib/scan.js.map +1 -0
- package/lib/signedOperation.d.ts +13 -0
- package/lib/signedOperation.d.ts.map +1 -0
- package/lib/signedOperation.js +31 -0
- package/lib/signedOperation.js.map +1 -0
- package/lib/stream.d.ts +7 -0
- package/lib/stream.d.ts.map +1 -0
- package/lib/stream.js +82 -0
- package/lib/stream.js.map +1 -0
- package/lib/transaction.d.ts +31 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +202 -0
- package/lib/transaction.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
args: ({
|
|
3
|
+
name: string;
|
|
4
|
+
alias: string;
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
desc: string;
|
|
7
|
+
} | {
|
|
8
|
+
name: string;
|
|
9
|
+
alias: string;
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
desc: string;
|
|
12
|
+
})[];
|
|
13
|
+
job: ({ module, interactive, }: Partial<{
|
|
14
|
+
module: string;
|
|
15
|
+
interactive: boolean;
|
|
16
|
+
}>) => import("rxjs").Observable<{
|
|
17
|
+
type: "add" | "remove";
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}> | import("rxjs").Observable<string>;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=discoverDevices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discoverDevices.d.ts","sourceRoot":"","sources":["../../src/commands/discoverDevices.ts"],"names":[],"mappings":";;;;;;;;;;;;;gBAqBY,MAAM;qBACD,OAAO;;;;;;;AApBxB,wBAkEE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
27
|
+
exports.__esModule = true;
|
|
28
|
+
var operators_1 = require("rxjs/operators");
|
|
29
|
+
var hw_1 = require("@ledgerhq/live-common/lib/hw");
|
|
30
|
+
exports["default"] = {
|
|
31
|
+
args: [
|
|
32
|
+
{
|
|
33
|
+
name: "module",
|
|
34
|
+
alias: "m",
|
|
35
|
+
type: String,
|
|
36
|
+
desc: "filter a specific module (either hid | ble)"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "interactive",
|
|
40
|
+
alias: "i",
|
|
41
|
+
type: Boolean,
|
|
42
|
+
desc: "interactive mode that accumulate the events instead of showing them"
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
job: function (_a) {
|
|
46
|
+
var module = _a.module, interactive = _a.interactive;
|
|
47
|
+
var events = (0, hw_1.discoverDevices)(function (m) {
|
|
48
|
+
return !module ? true : module.split(",").includes(m.id);
|
|
49
|
+
});
|
|
50
|
+
if (!interactive)
|
|
51
|
+
return events;
|
|
52
|
+
return events
|
|
53
|
+
.pipe((0, operators_1.scan)(function (acc, value) {
|
|
54
|
+
var copy;
|
|
55
|
+
if (value.type === "remove") {
|
|
56
|
+
copy = acc.filter(function (a) { return a.id === value.id; });
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
var existing = acc.find(function (o) { return o.id === value.id; });
|
|
60
|
+
if (existing) {
|
|
61
|
+
var i = acc.indexOf(existing);
|
|
62
|
+
copy = __spreadArray([], __read(acc), false);
|
|
63
|
+
if (value.name) {
|
|
64
|
+
copy[i] = value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
copy = acc.concat({
|
|
69
|
+
id: value.id,
|
|
70
|
+
name: value.name
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return copy;
|
|
75
|
+
}, []))
|
|
76
|
+
.pipe((0, operators_1.tap)(function () {
|
|
77
|
+
// eslint-disable-next-line no-console
|
|
78
|
+
console.clear();
|
|
79
|
+
}), (0, operators_1.map)(function (acc) {
|
|
80
|
+
return acc
|
|
81
|
+
.map(function (o) { return "".concat((o.name || "(no name)").padEnd(40), " ").concat(o.id); })
|
|
82
|
+
.join("\n");
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=discoverDevices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discoverDevices.js","sourceRoot":"","sources":["../../src/commands/discoverDevices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA0D;AAC1D,mDAA+D;AAC/D,qBAAe;IACb,IAAI,EAAE;QACJ;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,6CAA6C;SACpD;QACD;YACE,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,qEAAqE;SAC5E;KACF;IACD,GAAG,EAAE,UAAC,EAMJ;YALA,MAAM,YAAA,EACN,WAAW,iBAAA;QAKX,IAAM,MAAM,GAAG,IAAA,oBAAe,EAAC,UAAC,CAAC;YAC/B,OAAA,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAAjD,CAAiD,CAClD,CAAC;QACF,IAAI,CAAC,WAAW;YAAE,OAAO,MAAM,CAAC;QAChC,OAAO,MAAM;aACV,IAAI,CACH,IAAA,gBAAM,EAAC,UAAC,GAAU,EAAE,KAAK;YACvB,IAAI,IAAI,CAAC;YAET,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC3B,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAjB,CAAiB,CAAC,CAAC;aAC7C;iBAAM;gBACL,IAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAjB,CAAiB,CAAC,CAAC;gBAEpD,IAAI,QAAQ,EAAE;oBACZ,IAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAChC,IAAI,4BAAO,GAAG,SAAC,CAAC;oBAEhB,IAAI,KAAK,CAAC,IAAI,EAAE;wBACd,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;qBACjB;iBACF;qBAAM;oBACL,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC;wBAChB,EAAE,EAAE,KAAK,CAAC,EAAE;wBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;qBACjB,CAAC,CAAC;iBACJ;aACF;YAED,OAAO,IAAI,CAAC;QACd,CAAC,EAAE,EAAE,CAAC,CACP;aACA,IAAI,CACH,IAAA,eAAG,EAAC;YACF,sCAAsC;YACtC,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC,CAAC,EACF,IAAA,eAAG,EAAC,UAAC,GAAG;YACN,OAAA,GAAG;iBACA,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,UAAG,CAAC,CAAC,CAAC,IAAI,IAAI,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,cAAI,CAAC,CAAC,EAAE,CAAE,EAA/C,CAA+C,CAAC;iBAC3D,IAAI,CAAC,IAAI,CAAC;QAFb,CAEa,CACd,CACF,CAAC;IACN,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envs.d.ts","sourceRoot":"","sources":["../../src/commands/envs.ts"],"names":[],"mappings":";;;;;AAOA,wBAYE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var rxjs_1 = require("rxjs");
|
|
4
|
+
var operators_1 = require("rxjs/operators");
|
|
5
|
+
var env_1 = require("@ledgerhq/live-common/lib/env");
|
|
6
|
+
exports["default"] = {
|
|
7
|
+
description: "Print available environment variables",
|
|
8
|
+
args: [],
|
|
9
|
+
job: function () {
|
|
10
|
+
return (0, rxjs_1.from)((0, env_1.getAllEnvNames)()).pipe((0, operators_1.map)(function (name) {
|
|
11
|
+
return "# ".concat(name, " ").concat((0, env_1.getEnvDesc)(name), "\n").concat(name, "=").concat(JSON.stringify((0, env_1.getEnv)(name)), "\n");
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=envs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envs.js","sourceRoot":"","sources":["../../src/commands/envs.ts"],"names":[],"mappings":";;AAAA,6BAA4B;AAC5B,4CAAqC;AACrC,qDAIuC;AACvC,qBAAe;IACb,WAAW,EAAE,uCAAuC;IACpD,IAAI,EAAE,EAAE;IACR,GAAG,EAAE;QACH,OAAA,IAAA,WAAI,EAAC,IAAA,oBAAc,GAAE,CAAC,CAAC,IAAI,CACzB,IAAA,eAAG,EACD,UAAC,IAAI;YACH,OAAA,YAAK,IAAI,cAAI,IAAA,gBAAU,EAAC,IAAI,CAAC,eAAK,IAAI,cAAI,IAAI,CAAC,SAAS,CACtD,IAAA,YAAM,EAAC,IAAI,CAAC,CACb,OAAI;QAFL,CAEK,CACR,CACF;IAPD,CAOC;CACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ScanCommonOpts } from "../scan";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
description: string;
|
|
4
|
+
args: ({
|
|
5
|
+
name: string;
|
|
6
|
+
alias: string;
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
desc: string;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
desc: string;
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
typeDesc?: undefined;
|
|
15
|
+
alias?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
typeDesc: string;
|
|
20
|
+
desc: string;
|
|
21
|
+
multiple?: undefined;
|
|
22
|
+
alias?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
alias: string;
|
|
26
|
+
type: NumberConstructor;
|
|
27
|
+
desc: string;
|
|
28
|
+
multiple?: undefined;
|
|
29
|
+
typeDesc?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
desc: string;
|
|
34
|
+
multiple?: undefined;
|
|
35
|
+
typeDesc?: undefined;
|
|
36
|
+
alias?: undefined;
|
|
37
|
+
})[];
|
|
38
|
+
job: (opts: ScanCommonOpts) => import("rxjs").Observable<string>;
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
41
|
+
//# sourceMappingURL=estimateMaxSpendable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateMaxSpendable.d.ts","sourceRoot":"","sources":["../../src/commands/estimateMaxSpendable.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAehC,cAAc;;AAH5B,wBA6BE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
27
|
+
exports.__esModule = true;
|
|
28
|
+
var rxjs_1 = require("rxjs");
|
|
29
|
+
var operators_1 = require("rxjs/operators");
|
|
30
|
+
var bridge_1 = require("@ledgerhq/live-common/lib/bridge");
|
|
31
|
+
var account_1 = require("@ledgerhq/live-common/lib/account");
|
|
32
|
+
var currencies_1 = require("@ledgerhq/live-common/lib/currencies");
|
|
33
|
+
var scan_1 = require("../scan");
|
|
34
|
+
var format = function (account, value) {
|
|
35
|
+
var unit = (0, account_1.getAccountUnit)(account);
|
|
36
|
+
var name = (0, account_1.getAccountName)(account);
|
|
37
|
+
var amount = (0, currencies_1.formatCurrencyUnit)(unit, value, {
|
|
38
|
+
showCode: true,
|
|
39
|
+
disableRounding: true
|
|
40
|
+
});
|
|
41
|
+
return "".concat(name, ": ").concat(amount);
|
|
42
|
+
};
|
|
43
|
+
exports["default"] = {
|
|
44
|
+
description: "estimate the max spendable of an account",
|
|
45
|
+
args: __spreadArray([], __read(scan_1.scanCommonOpts), false),
|
|
46
|
+
job: function (opts) {
|
|
47
|
+
return (0, scan_1.scan)(opts).pipe((0, operators_1.concatMap)(function (account) {
|
|
48
|
+
var bridge = (0, bridge_1.getAccountBridge)(account);
|
|
49
|
+
return rxjs_1.concat.apply(void 0, __spreadArray([(0, rxjs_1.from)(bridge
|
|
50
|
+
.estimateMaxSpendable({
|
|
51
|
+
account: account,
|
|
52
|
+
parentAccount: null
|
|
53
|
+
})
|
|
54
|
+
.then(function (maxSpendable) { return format(account, maxSpendable); }))], __read((account.subAccounts || []).map(function (subAccount) {
|
|
55
|
+
return (0, rxjs_1.from)(bridge
|
|
56
|
+
.estimateMaxSpendable({
|
|
57
|
+
account: subAccount,
|
|
58
|
+
parentAccount: account
|
|
59
|
+
})
|
|
60
|
+
.then(function (maxSpendable) { return " " + format(subAccount, maxSpendable); }));
|
|
61
|
+
})), false));
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=estimateMaxSpendable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateMaxSpendable.js","sourceRoot":"","sources":["../../src/commands/estimateMaxSpendable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAoC;AACpC,4CAA2C;AAC3C,2DAAoE;AACpE,6DAG2C;AAC3C,mEAA0E;AAC1E,gCAA+C;AAG/C,IAAM,MAAM,GAAG,UAAC,OAAO,EAAE,KAAK;IAC5B,IAAM,IAAI,GAAG,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAC;IACrC,IAAM,IAAI,GAAG,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAC;IACrC,IAAM,MAAM,GAAG,IAAA,+BAAkB,EAAC,IAAI,EAAE,KAAK,EAAE;QAC7C,QAAQ,EAAE,IAAI;QACd,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;IACH,OAAO,UAAG,IAAI,eAAK,MAAM,CAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,qBAAe;IACb,WAAW,EAAE,0CAA0C;IACvD,IAAI,2BAAM,qBAAc,SAAC;IACzB,GAAG,EAAE,UAAC,IAAoB;QACxB,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC,IAAI,CACb,IAAA,qBAAS,EAAC,UAAC,OAAO;YAChB,IAAM,MAAM,GAAG,IAAA,yBAAgB,EAAC,OAAO,CAAC,CAAC;YACzC,OAAO,aAAM,8BACX,IAAA,WAAI,EACF,MAAM;qBACH,oBAAoB,CAAC;oBACpB,OAAO,SAAA;oBACP,aAAa,EAAE,IAAI;iBACpB,CAAC;qBACD,IAAI,CAAC,UAAC,YAAY,IAAK,OAAA,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,EAA7B,CAA6B,CAAC,CACzD,UACE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,UAAU;gBAC5C,OAAA,IAAA,WAAI,EACF,MAAM;qBACH,oBAAoB,CAAC;oBACpB,OAAO,EAAE,UAAU;oBACnB,aAAa,EAAE,OAAO;iBACvB,CAAC;qBACD,IAAI,CAAC,UAAC,YAAY,IAAK,OAAA,IAAI,GAAG,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,EAAvC,CAAuC,CAAC,CACnE;YAPD,CAOC,CACF,WACD;QACJ,CAAC,CAAC,CACH;IAxBD,CAwBC;CACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ScanCommonOpts } from "../scan";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
description: string;
|
|
4
|
+
args: ({
|
|
5
|
+
name: string;
|
|
6
|
+
alias: string;
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
desc: string;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
desc: string;
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
typeDesc?: undefined;
|
|
15
|
+
alias?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
typeDesc: string;
|
|
20
|
+
desc: string;
|
|
21
|
+
multiple?: undefined;
|
|
22
|
+
alias?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
alias: string;
|
|
26
|
+
type: NumberConstructor;
|
|
27
|
+
desc: string;
|
|
28
|
+
multiple?: undefined;
|
|
29
|
+
typeDesc?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: NumberConstructor;
|
|
33
|
+
desc: string;
|
|
34
|
+
multiple?: undefined;
|
|
35
|
+
typeDesc?: undefined;
|
|
36
|
+
alias?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
name: string;
|
|
39
|
+
alias: string;
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
desc: string;
|
|
42
|
+
})[];
|
|
43
|
+
job: (opts: ScanCommonOpts & Partial<{
|
|
44
|
+
out: boolean;
|
|
45
|
+
}>) => import("rxjs").Observable<unknown>;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=exportAccounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportAccounts.d.ts","sourceRoot":"","sources":["../../src/commands/exportAccounts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAcpC,cAAc,GAClB,QAAQ;QACN,GAAG,EAAE,OAAO,CAAC;KACd,CAAC;;AAfR,wBA+CE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
27
|
+
exports.__esModule = true;
|
|
28
|
+
var rxjs_1 = require("rxjs");
|
|
29
|
+
var operators_1 = require("rxjs/operators");
|
|
30
|
+
var qrloop_1 = require("qrloop");
|
|
31
|
+
var cross_1 = require("@ledgerhq/live-common/lib/cross");
|
|
32
|
+
var qr_1 = require("../qr");
|
|
33
|
+
var scan_1 = require("../scan");
|
|
34
|
+
exports["default"] = {
|
|
35
|
+
description: "Export given accounts to Live QR or console for importing",
|
|
36
|
+
args: __spreadArray(__spreadArray([], __read(scan_1.scanCommonOpts), false), [
|
|
37
|
+
{
|
|
38
|
+
name: "out",
|
|
39
|
+
alias: "o",
|
|
40
|
+
type: Boolean,
|
|
41
|
+
desc: "output to console"
|
|
42
|
+
},
|
|
43
|
+
], false),
|
|
44
|
+
job: function (opts) {
|
|
45
|
+
return (0, scan_1.scan)(opts).pipe((0, operators_1.reduce)(function (accounts, account) { return accounts.concat(account); }, []), (0, operators_1.mergeMap)(function (accounts) {
|
|
46
|
+
var data = (0, cross_1.encode)({
|
|
47
|
+
accounts: accounts,
|
|
48
|
+
settings: {
|
|
49
|
+
pairExchanges: {},
|
|
50
|
+
currenciesSettings: {}
|
|
51
|
+
},
|
|
52
|
+
exporterName: "ledger-live-cli",
|
|
53
|
+
exporterVersion: "0.0.0"
|
|
54
|
+
});
|
|
55
|
+
var frames = (0, qrloop_1.dataToFrames)(data, 80, 4);
|
|
56
|
+
if (opts.out) {
|
|
57
|
+
return (0, rxjs_1.of)(Buffer.from(JSON.stringify(frames)).toString("base64"));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
var qrObservables_1 = frames.map(function (str) {
|
|
61
|
+
return (0, qr_1.asQR)(str).pipe((0, operators_1.shareReplay)());
|
|
62
|
+
});
|
|
63
|
+
return (0, rxjs_1.interval)(300).pipe((0, operators_1.mergeMap)(function (i) { return qrObservables_1[i % qrObservables_1.length]; }));
|
|
64
|
+
}
|
|
65
|
+
}), (0, operators_1.tap)(function () { return console.clear(); }) // eslint-disable-line no-console
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=exportAccounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportAccounts.js","sourceRoot":"","sources":["../../src/commands/exportAccounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAoC;AACpC,4CAAoE;AACpE,iCAAsC;AACtC,yDAAyD;AACzD,4BAA6B;AAC7B,gCAA+C;AAG/C,qBAAe;IACb,WAAW,EAAE,2DAA2D;IACxE,IAAI,yCACC,qBAAc;QACjB;YACE,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,mBAAmB;SAC1B;aACF;IACD,GAAG,EAAE,UACH,IAGI;QAEJ,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC,IAAI,CACb,IAAA,kBAAM,EACJ,UAAC,QAAQ,EAAE,OAAO,IAAK,OAAA,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAxB,CAAwB,EAC/C,EAAE,CACH,EACD,IAAA,oBAAQ,EAAC,UAAC,QAAQ;YAChB,IAAM,IAAI,GAAG,IAAA,cAAM,EAAC;gBAClB,QAAQ,UAAA;gBACR,QAAQ,EAAE;oBACR,aAAa,EAAE,EAAE;oBACjB,kBAAkB,EAAE,EAAE;iBACvB;gBACD,YAAY,EAAE,iBAAiB;gBAC/B,eAAe,EAAE,OAAO;aACzB,CAAC,CAAC;YACH,IAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAEzC,IAAI,IAAI,CAAC,GAAG,EAAE;gBACZ,OAAO,IAAA,SAAE,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;aACnE;iBAAM;gBACL,IAAM,eAAa,GAAG,MAAM,CAAC,GAAG,CAAC,UAAC,GAAG;oBACnC,OAAA,IAAA,SAAI,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,uBAAW,GAAE,CAAC;gBAA7B,CAA6B,CAC9B,CAAC;gBACF,OAAO,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAC,IAAI,CACvB,IAAA,oBAAQ,EAAC,UAAC,CAAC,IAAK,OAAA,eAAa,CAAC,CAAC,GAAG,eAAa,CAAC,MAAM,CAAC,EAAvC,CAAuC,CAAC,CACzD,CAAC;aACH;QACH,CAAC,CAAC,EACF,IAAA,eAAG,EAAC,cAAM,OAAA,OAAO,CAAC,KAAK,EAAE,EAAf,CAAe,CAAC,CAAC,iCAAiC;SAC7D;IA7BD,CA6BC;CACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: ({
|
|
4
|
+
name: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
descOpt: string;
|
|
8
|
+
desc: string;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
desc: string;
|
|
13
|
+
})[];
|
|
14
|
+
job: ({ device, forceMCU, }: Partial<{
|
|
15
|
+
device: string;
|
|
16
|
+
forceMCU: string;
|
|
17
|
+
}>) => import("rxjs").Observable<{
|
|
18
|
+
progress: number;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=firmwareRepair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firmwareRepair.d.ts","sourceRoot":"","sources":["../../src/commands/firmwareRepair.ts"],"names":[],"mappings":";;;;;;;;;;;;;;gBAgBY,MAAM;kBACJ,MAAM;;;;;AAfpB,wBAiBE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var firmwareUpdate_repair_1 = __importDefault(require("@ledgerhq/live-common/lib/hw/firmwareUpdate-repair"));
|
|
7
|
+
var scan_1 = require("../scan");
|
|
8
|
+
exports["default"] = {
|
|
9
|
+
description: "Repair a firmware update",
|
|
10
|
+
args: [
|
|
11
|
+
scan_1.deviceOpt,
|
|
12
|
+
{
|
|
13
|
+
name: "forceMCU",
|
|
14
|
+
type: String,
|
|
15
|
+
desc: "force a mcu version to install"
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
job: function (_a) {
|
|
19
|
+
var device = _a.device, forceMCU = _a.forceMCU;
|
|
20
|
+
return (0, firmwareUpdate_repair_1["default"])(device || "", forceMCU);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=firmwareRepair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firmwareRepair.js","sourceRoot":"","sources":["../../src/commands/firmwareRepair.ts"],"names":[],"mappings":";;;;;AAAA,6GAAsF;AACtF,gCAAoC;AACpC,qBAAe;IACb,WAAW,EAAE,0BAA0B;IACvC,IAAI,EAAE;QACJ,gBAAS;QACT;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,gCAAgC;SACvC;KACF;IACD,GAAG,EAAE,UAAC,EAMJ;YALA,MAAM,YAAA,EACN,QAAQ,cAAA;QAIH,OAAA,IAAA,kCAAoB,EAAC,MAAM,IAAI,EAAE,EAAE,QAAQ,CAAC;IAA5C,CAA4C;CACpD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: ({
|
|
4
|
+
name: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
descOpt: string;
|
|
8
|
+
desc: string;
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
desc: string;
|
|
13
|
+
} | {
|
|
14
|
+
name: string;
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
desc: string;
|
|
17
|
+
})[];
|
|
18
|
+
job: ({ device, osuVersion, "to-my-own-risk": toMyOwnRisk, listOSUs, }: Partial<{
|
|
19
|
+
device: string;
|
|
20
|
+
osuVersion: string;
|
|
21
|
+
"to-my-own-risk": boolean;
|
|
22
|
+
listOSUs: boolean;
|
|
23
|
+
}>) => import("rxjs").Observable<unknown>;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=firmwareUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["../../src/commands/firmwareUpdate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;gBAqGY,MAAM;oBACF,MAAM;0BACA,OAAO;kBACf,OAAO;;;AA7BrB,wBA0DE"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
exports.__esModule = true;
|
|
42
|
+
var invariant_1 = __importDefault(require("invariant"));
|
|
43
|
+
var rxjs_1 = require("rxjs");
|
|
44
|
+
var operators_1 = require("rxjs/operators");
|
|
45
|
+
var errors_1 = require("@ledgerhq/errors");
|
|
46
|
+
var Manager_1 = __importDefault(require("@ledgerhq/live-common/lib/api/Manager"));
|
|
47
|
+
var network_1 = __importDefault(require("@ledgerhq/live-common/lib/network"));
|
|
48
|
+
var env_1 = require("@ledgerhq/live-common/lib/env");
|
|
49
|
+
var provider_1 = require("@ledgerhq/live-common/lib/manager/provider");
|
|
50
|
+
var manager_1 = __importDefault(require("@ledgerhq/live-common/lib/manager"));
|
|
51
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/lib/hw/deviceAccess");
|
|
52
|
+
var getDeviceInfo_1 = __importDefault(require("@ledgerhq/live-common/lib/hw/getDeviceInfo"));
|
|
53
|
+
var firmwareUpdate_prepare_1 = __importDefault(require("@ledgerhq/live-common/lib/hw/firmwareUpdate-prepare"));
|
|
54
|
+
var firmwareUpdate_main_1 = __importDefault(require("@ledgerhq/live-common/lib/hw/firmwareUpdate-main"));
|
|
55
|
+
var scan_1 = require("../scan");
|
|
56
|
+
var listFirmwareOSU = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
57
|
+
var data;
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
switch (_a.label) {
|
|
60
|
+
case 0: return [4 /*yield*/, (0, network_1["default"])({
|
|
61
|
+
method: "GET",
|
|
62
|
+
url: "".concat((0, env_1.getEnv)("MANAGER_API_BASE"), "/firmware_osu_versions")
|
|
63
|
+
})];
|
|
64
|
+
case 1:
|
|
65
|
+
data = (_a.sent()).data;
|
|
66
|
+
return [2 /*return*/, data];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
var customGetLatestFirmwareForDevice = function (deviceInfo, osuVersion) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
+
var mcusPromise, deviceVersion, osu, data, final, mcus, currentMcuVersion, shouldFlashMCU;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
mcusPromise = Manager_1["default"].getMcus();
|
|
76
|
+
return [4 /*yield*/, Manager_1["default"].getDeviceVersion(deviceInfo.targetId, (0, provider_1.getProviderId)(deviceInfo))];
|
|
77
|
+
case 1:
|
|
78
|
+
deviceVersion = _a.sent();
|
|
79
|
+
if (!deviceInfo.isOSU) return [3 /*break*/, 3];
|
|
80
|
+
return [4 /*yield*/, Manager_1["default"].getCurrentOSU({
|
|
81
|
+
deviceId: deviceVersion.id,
|
|
82
|
+
provider: (0, provider_1.getProviderId)(deviceInfo),
|
|
83
|
+
version: deviceInfo.version
|
|
84
|
+
})];
|
|
85
|
+
case 2:
|
|
86
|
+
osu = _a.sent();
|
|
87
|
+
return [3 /*break*/, 5];
|
|
88
|
+
case 3: return [4 /*yield*/, listFirmwareOSU()];
|
|
89
|
+
case 4:
|
|
90
|
+
data = _a.sent();
|
|
91
|
+
osu = data.find(function (d) {
|
|
92
|
+
return d.device_versions.includes(deviceVersion.id) && d.name === osuVersion;
|
|
93
|
+
});
|
|
94
|
+
_a.label = 5;
|
|
95
|
+
case 5:
|
|
96
|
+
if (!osu) {
|
|
97
|
+
return [2 /*return*/, null];
|
|
98
|
+
}
|
|
99
|
+
return [4 /*yield*/, Manager_1["default"].getFinalFirmwareById(osu.next_se_firmware_final_version)];
|
|
100
|
+
case 6:
|
|
101
|
+
final = _a.sent();
|
|
102
|
+
return [4 /*yield*/, mcusPromise];
|
|
103
|
+
case 7:
|
|
104
|
+
mcus = _a.sent();
|
|
105
|
+
currentMcuVersion = mcus.find(function (mcu) { return mcu.name === deviceInfo.mcuVersion; });
|
|
106
|
+
if (!currentMcuVersion)
|
|
107
|
+
throw new errors_1.UnknownMCU();
|
|
108
|
+
shouldFlashMCU = !final.mcu_versions.includes(currentMcuVersion.id);
|
|
109
|
+
return [2 /*return*/, {
|
|
110
|
+
final: final,
|
|
111
|
+
osu: osu,
|
|
112
|
+
shouldFlashMCU: shouldFlashMCU
|
|
113
|
+
}];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}); };
|
|
117
|
+
var disclaimer = "this is a developer feature that allow to flash anything, we are not responsible of your actions, by flashing your device you might reset your seed or block your device";
|
|
118
|
+
exports["default"] = {
|
|
119
|
+
description: "Perform a firmware update",
|
|
120
|
+
args: [
|
|
121
|
+
scan_1.deviceOpt,
|
|
122
|
+
{
|
|
123
|
+
name: "to-my-own-risk",
|
|
124
|
+
type: Boolean,
|
|
125
|
+
desc: disclaimer
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "osuVersion",
|
|
129
|
+
type: String,
|
|
130
|
+
desc: "(to your own risk) provide yourself an OSU version to flash the device with"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "listOSUs",
|
|
134
|
+
type: Boolean,
|
|
135
|
+
desc: "list all available OSUs (for all devices, beta and prod versions)"
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
job: function (_a) {
|
|
139
|
+
var device = _a.device, osuVersion = _a.osuVersion, toMyOwnRisk = _a["to-my-own-risk"], listOSUs = _a.listOSUs;
|
|
140
|
+
return ((0, invariant_1["default"])(!osuVersion || toMyOwnRisk, "--to-my-own-risk is required: " + disclaimer),
|
|
141
|
+
listOSUs
|
|
142
|
+
? (0, rxjs_1.from)(listFirmwareOSU()).pipe((0, operators_1.mergeMap)(function (d) { return (0, rxjs_1.from)(d.map(function (d) { return d.name; })); }))
|
|
143
|
+
: (0, deviceAccess_1.withDevice)(device || "")(function (t) { return (0, rxjs_1.from)((0, getDeviceInfo_1["default"])(t)); }).pipe((0, operators_1.mergeMap)(osuVersion
|
|
144
|
+
? function (deviceInfo) {
|
|
145
|
+
return customGetLatestFirmwareForDevice(deviceInfo, osuVersion);
|
|
146
|
+
}
|
|
147
|
+
: manager_1["default"].getLatestFirmwareForDevice), (0, operators_1.mergeMap)(function (firmware) {
|
|
148
|
+
if (!firmware)
|
|
149
|
+
return (0, rxjs_1.of)("already up to date");
|
|
150
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)("firmware: ".concat(firmware.final.name, "\nOSU: ").concat(firmware.osu.name, " (hash: ").concat(firmware.osu.hash, ")")), (0, firmwareUpdate_prepare_1["default"])(device || "", firmware), (0, firmwareUpdate_main_1["default"])(device || "", firmware));
|
|
151
|
+
})));
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=firmwareUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firmwareUpdate.js","sourceRoot":"","sources":["../../src/commands/firmwareUpdate.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateAppJsonFromDataset.d.ts","sourceRoot":"","sources":["../../src/commands/generateAppJsonFromDataset.ts"],"names":[],"mappings":";;;;;AAiNA,wBAKE"}
|