@ledgerhq/live-cli 24.10.3-nightly.0 → 24.10.3-nightly.2
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/cli.js +33 -63
- package/lib/cli.js.map +1 -1
- package/lib/commands/blockchain/bot.js +7 -7
- package/lib/commands/blockchain/bot.js.map +1 -1
- package/lib/commands/blockchain/botPortfolio.js +22 -26
- package/lib/commands/blockchain/botPortfolio.js.map +1 -1
- package/lib/commands/blockchain/botTransfer.js +219 -392
- package/lib/commands/blockchain/botTransfer.js.map +1 -1
- package/lib/commands/blockchain/broadcast.js +11 -42
- package/lib/commands/blockchain/broadcast.js.map +1 -1
- package/lib/commands/blockchain/confirmOp.js +12 -52
- package/lib/commands/blockchain/confirmOp.js.map +1 -1
- package/lib/commands/blockchain/derivation.js +31 -33
- package/lib/commands/blockchain/derivation.js.map +1 -1
- package/lib/commands/blockchain/estimateMaxSpendable.js +27 -56
- package/lib/commands/blockchain/estimateMaxSpendable.js.map +1 -1
- package/lib/commands/blockchain/generateTestScanAccounts.js +29 -37
- package/lib/commands/blockchain/generateTestScanAccounts.js.map +1 -1
- package/lib/commands/blockchain/generateTestTransaction.js +70 -96
- package/lib/commands/blockchain/generateTestTransaction.js.map +1 -1
- package/lib/commands/blockchain/getAddress.js +20 -24
- package/lib/commands/blockchain/getAddress.js.map +1 -1
- package/lib/commands/blockchain/getTransactionStatus.js +31 -69
- package/lib/commands/blockchain/getTransactionStatus.js.map +1 -1
- package/lib/commands/blockchain/receive.js +14 -42
- package/lib/commands/blockchain/receive.js.map +1 -1
- package/lib/commands/blockchain/satstack.js +30 -33
- package/lib/commands/blockchain/satstack.js.map +1 -1
- package/lib/commands/blockchain/satstackStatus.js +4 -5
- package/lib/commands/blockchain/satstackStatus.js.map +1 -1
- package/lib/commands/blockchain/scanDescriptors.js +8 -14
- package/lib/commands/blockchain/scanDescriptors.js.map +1 -1
- package/lib/commands/blockchain/send.js +61 -90
- package/lib/commands/blockchain/send.js.map +1 -1
- package/lib/commands/blockchain/signMessage.d.ts +1 -1
- package/lib/commands/blockchain/signMessage.js +15 -40
- package/lib/commands/blockchain/signMessage.js.map +1 -1
- package/lib/commands/blockchain/sync.js +27 -120
- package/lib/commands/blockchain/sync.js.map +1 -1
- package/lib/commands/blockchain/testDetectOpCollision.js +15 -48
- package/lib/commands/blockchain/testDetectOpCollision.js.map +1 -1
- package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js +37 -86
- package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js.map +1 -1
- package/lib/commands/device/app.js +42 -76
- package/lib/commands/device/app.js.map +1 -1
- package/lib/commands/device/appUninstallAll.d.ts +1 -1
- package/lib/commands/device/appUninstallAll.js +22 -29
- package/lib/commands/device/appUninstallAll.js.map +1 -1
- package/lib/commands/device/appsCheckAllAppVersions.js +208 -361
- package/lib/commands/device/appsCheckAllAppVersions.js.map +1 -1
- package/lib/commands/device/appsInstallAll.js +15 -24
- package/lib/commands/device/appsInstallAll.js.map +1 -1
- package/lib/commands/device/appsUpdateTestAll.js +69 -80
- package/lib/commands/device/appsUpdateTestAll.js.map +1 -1
- package/lib/commands/device/cleanSpeculos.js +4 -4
- package/lib/commands/device/cleanSpeculos.js.map +1 -1
- package/lib/commands/device/customLockScreenFetch.js +37 -84
- package/lib/commands/device/customLockScreenFetch.js.map +1 -1
- package/lib/commands/device/customLockScreenFetchAndRestore.js +46 -110
- package/lib/commands/device/customLockScreenFetchAndRestore.js.map +1 -1
- package/lib/commands/device/customLockScreenFetchHash.js +5 -7
- package/lib/commands/device/customLockScreenFetchHash.js.map +1 -1
- package/lib/commands/device/customLockScreenLoad.js +25 -72
- package/lib/commands/device/customLockScreenLoad.js.map +1 -1
- package/lib/commands/device/customLockScreenRemove.js +5 -7
- package/lib/commands/device/customLockScreenRemove.js.map +1 -1
- package/lib/commands/device/devDeviceAppsScenario.js +33 -65
- package/lib/commands/device/devDeviceAppsScenario.js.map +1 -1
- package/lib/commands/device/deviceAppVersion.js +5 -8
- package/lib/commands/device/deviceAppVersion.js.map +1 -1
- package/lib/commands/device/deviceInfo.js +5 -8
- package/lib/commands/device/deviceInfo.js.map +1 -1
- package/lib/commands/device/deviceSDKFirmwareUpdate.js +22 -68
- package/lib/commands/device/deviceSDKFirmwareUpdate.js.map +1 -1
- package/lib/commands/device/deviceSDKGetBatteryStatuses.js +7 -8
- package/lib/commands/device/deviceSDKGetBatteryStatuses.js.map +1 -1
- package/lib/commands/device/deviceSDKGetDeviceInfo.js +6 -7
- package/lib/commands/device/deviceSDKGetDeviceInfo.js.map +1 -1
- package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js +8 -9
- package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js.map +1 -1
- package/lib/commands/device/deviceVersion.js +5 -8
- package/lib/commands/device/deviceVersion.js.map +1 -1
- package/lib/commands/device/discoverDevices.js +15 -50
- package/lib/commands/device/discoverDevices.js.map +1 -1
- package/lib/commands/device/firmwareRepair.js +3 -6
- package/lib/commands/device/firmwareRepair.js.map +1 -1
- package/lib/commands/device/firmwareUpdate.js +63 -123
- package/lib/commands/device/firmwareUpdate.js.map +1 -1
- package/lib/commands/device/genuineCheck.js +7 -12
- package/lib/commands/device/genuineCheck.js.map +1 -1
- package/lib/commands/device/getBatteryStatus.js +5 -9
- package/lib/commands/device/getBatteryStatus.js.map +1 -1
- package/lib/commands/device/getDeviceRunningMode.js +7 -10
- package/lib/commands/device/getDeviceRunningMode.js.map +1 -1
- package/lib/commands/device/i18n.js +27 -79
- package/lib/commands/device/i18n.js.map +1 -1
- package/lib/commands/device/listApps.d.ts +1 -1
- package/lib/commands/device/listApps.js +7 -12
- package/lib/commands/device/listApps.js.map +1 -1
- package/lib/commands/device/managerListApps.js +21 -28
- package/lib/commands/device/managerListApps.js.map +1 -1
- package/lib/commands/device/proxy.js +242 -350
- package/lib/commands/device/proxy.js.map +1 -1
- package/lib/commands/device/reinstallConfigurationConsent.js +36 -126
- package/lib/commands/device/reinstallConfigurationConsent.js.map +1 -1
- package/lib/commands/device/repl.js +5 -10
- package/lib/commands/device/repl.js.map +1 -1
- package/lib/commands/device/speculosList.js +12 -58
- package/lib/commands/device/speculosList.js.map +1 -1
- package/lib/commands/live/balanceHistory.js +44 -79
- package/lib/commands/live/balanceHistory.js.map +1 -1
- package/lib/commands/live/countervalues.js +111 -207
- package/lib/commands/live/countervalues.js.map +1 -1
- package/lib/commands/live/envs.js +4 -6
- package/lib/commands/live/envs.js.map +1 -1
- package/lib/commands/live/exportAccounts.js +30 -56
- package/lib/commands/live/exportAccounts.js.map +1 -1
- package/lib/commands/live/ledgerKeyRingProtocol.d.ts +1 -1
- package/lib/commands/live/ledgerKeyRingProtocol.js +63 -103
- package/lib/commands/live/ledgerKeyRingProtocol.js.map +1 -1
- package/lib/commands/live/ledgerSync.js +20 -60
- package/lib/commands/live/ledgerSync.js.map +1 -1
- package/lib/commands/live/liveData.js +34 -60
- package/lib/commands/live/liveData.js.map +1 -1
- package/lib/commands/live/portfolio.js +68 -98
- package/lib/commands/live/portfolio.js.map +1 -1
- package/lib/commands/live/synchronousOnboarding.js +6 -9
- package/lib/commands/live/synchronousOnboarding.js.map +1 -1
- package/lib/commands/live/user.js +4 -4
- package/lib/commands/live/user.js.map +1 -1
- package/lib/commands/live/version.js +2 -4
- package/lib/commands/live/version.js.map +1 -1
- package/lib/commands/ptx/swap.js +194 -282
- package/lib/commands/ptx/swap.js.map +1 -1
- package/lib/commands-index.d.ts +9 -9
- package/lib/commands-index.js +64 -64
- package/lib/commands-index.js.map +1 -1
- package/lib/live-common-setup-base.js +26 -48
- package/lib/live-common-setup-base.js.map +1 -1
- package/lib/live-common-setup.js +66 -123
- package/lib/live-common-setup.js.map +1 -1
- package/lib/qr.js +6 -10
- package/lib/qr.js.map +1 -1
- package/lib/scan.js +84 -92
- package/lib/scan.js.map +1 -1
- package/lib/signedOperation.js +6 -6
- package/lib/signedOperation.js.map +1 -1
- package/lib/stream.js +57 -68
- package/lib/stream.js.map +1 -1
- package/lib/transaction.js +60 -142
- package/lib/transaction.js.map +1 -1
- package/package.json +3 -3
|
@@ -22,122 +22,58 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
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;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
27
|
};
|
|
64
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
29
|
/* eslint-disable no-console */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
hash = crypto_1.default.createHash("sha256").update(hexImage).digest("hex");
|
|
98
|
-
console.log("Computing hash for input file");
|
|
99
|
-
console.log(hash);
|
|
100
|
-
console.log("Extracting hash from device");
|
|
101
|
-
return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(function (t) { return (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t)); }))];
|
|
102
|
-
case 1:
|
|
103
|
-
currentHash = _a.sent();
|
|
104
|
-
if (currentHash === hash) {
|
|
105
|
-
console.log("Hashes match, skip backup step because we can use the one we have");
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
console.log("Hashes don't match, fetch image before updating");
|
|
109
|
-
}
|
|
110
|
-
console.log("Delete the current image (simulate the wipe from fw update)");
|
|
111
|
-
return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(function (t) { return (0, rxjs_1.from)(t.exchange(Buffer.from("e063000000", "hex"))); }))];
|
|
112
|
-
case 2:
|
|
113
|
-
_a.sent();
|
|
114
|
-
console.log("Restoring the image we backedup");
|
|
115
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
116
|
-
return (0, customLockScreenLoad_1.default)({
|
|
117
|
-
deviceId: deviceId,
|
|
118
|
-
request: { hexImage: hexImageWithoutHeader, deviceModelId: clsSupportedDeviceModelId },
|
|
119
|
-
}).subscribe(function (x) { return console.log(x); }, function (e) {
|
|
120
|
-
console.error(e);
|
|
121
|
-
resolve();
|
|
122
|
-
}, function () {
|
|
123
|
-
console.log("Image loaded.");
|
|
124
|
-
resolve();
|
|
125
|
-
});
|
|
126
|
-
})];
|
|
127
|
-
case 3:
|
|
128
|
-
_a.sent();
|
|
129
|
-
return [2 /*return*/];
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}); })];
|
|
133
|
-
case 2:
|
|
134
|
-
// TODO: rework without double resolving promise
|
|
135
|
-
// eslint-disable-next-line
|
|
136
|
-
_b.sent();
|
|
137
|
-
return [2 /*return*/];
|
|
30
|
+
const rxjs_1 = require("rxjs");
|
|
31
|
+
const fs_1 = __importDefault(require("fs"));
|
|
32
|
+
const scan_1 = require("../../scan");
|
|
33
|
+
const customLockScreenFetchHash_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenFetchHash"));
|
|
34
|
+
const customLockScreenLoad_1 = __importStar(require("@ledgerhq/live-common/hw/customLockScreenLoad"));
|
|
35
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
36
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
37
|
+
const isCustomLockScreenSupported_1 = require("@ledgerhq/live-common/device/use-cases/isCustomLockScreenSupported");
|
|
38
|
+
const screenSpecs_1 = require("@ledgerhq/live-common/device/use-cases/screenSpecs");
|
|
39
|
+
const exec = async (opts) => {
|
|
40
|
+
const { fileInput, device: deviceId = "", deviceModelId } = opts;
|
|
41
|
+
if (!(0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(deviceModelId)) {
|
|
42
|
+
console.error("This device model does not support custom lock screen");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const clsSupportedDeviceModelId = deviceModelId;
|
|
46
|
+
const hexImageWithoutHeader = fs_1.default.readFileSync(fileInput, "utf-8");
|
|
47
|
+
const hexImage = await (0, customLockScreenLoad_1.generateCustomLockScreenImageFormat)(hexImageWithoutHeader, true, true, (0, screenSpecs_1.getScreenSpecs)(clsSupportedDeviceModelId));
|
|
48
|
+
// TODO: rework without double resolving promise
|
|
49
|
+
// eslint-disable-next-line
|
|
50
|
+
await new Promise(async () => {
|
|
51
|
+
const hash = crypto_1.default.createHash("sha256").update(hexImage).digest("hex");
|
|
52
|
+
console.log("Computing hash for input file");
|
|
53
|
+
console.log(hash);
|
|
54
|
+
console.log("Extracting hash from device");
|
|
55
|
+
const currentHash = await (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(t => (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t))));
|
|
56
|
+
if (currentHash === hash) {
|
|
57
|
+
console.log("Hashes match, skip backup step because we can use the one we have");
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.log("Hashes don't match, fetch image before updating");
|
|
138
61
|
}
|
|
62
|
+
console.log("Delete the current image (simulate the wipe from fw update)");
|
|
63
|
+
await (0, rxjs_1.firstValueFrom)((0, deviceAccess_1.withDevice)(deviceId)(t => (0, rxjs_1.from)(t.exchange(Buffer.from("e063000000", "hex")))));
|
|
64
|
+
console.log("Restoring the image we backedup");
|
|
65
|
+
await new Promise(resolve => (0, customLockScreenLoad_1.default)({
|
|
66
|
+
deviceId,
|
|
67
|
+
request: { hexImage: hexImageWithoutHeader, deviceModelId: clsSupportedDeviceModelId },
|
|
68
|
+
}).subscribe(x => console.log(x), e => {
|
|
69
|
+
console.error(e);
|
|
70
|
+
resolve();
|
|
71
|
+
}, () => {
|
|
72
|
+
console.log(`Image loaded.`);
|
|
73
|
+
resolve();
|
|
74
|
+
}));
|
|
139
75
|
});
|
|
140
|
-
}
|
|
76
|
+
};
|
|
141
77
|
exports.default = {
|
|
142
78
|
description: "Conditionally backup, delete, and restore a custom lock screen picture",
|
|
143
79
|
args: [
|
|
@@ -154,6 +90,6 @@ exports.default = {
|
|
|
154
90
|
desc: "The device model id to use",
|
|
155
91
|
},
|
|
156
92
|
],
|
|
157
|
-
job:
|
|
93
|
+
job: (opts) => (0, rxjs_1.from)(exec(opts)),
|
|
158
94
|
};
|
|
159
95
|
//# sourceMappingURL=customLockScreenFetchAndRestore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenFetchAndRestore.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchAndRestore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customLockScreenFetchAndRestore.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchAndRestore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,+BAA4C;AAC5C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,EAAE,4BAA4B;SACnC;KACF;IACD,GAAG,EAAE,CAAC,IAA4C,EAAO,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAC7E,CAAC"}
|
|
@@ -4,15 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const scan_1 = require("../../scan");
|
|
9
|
+
const customLockScreenFetchHash_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenFetchHash"));
|
|
10
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
11
11
|
exports.default = {
|
|
12
12
|
description: "Fetch the hash of the custom lock screen",
|
|
13
13
|
args: [scan_1.deviceOpt],
|
|
14
|
-
job:
|
|
15
|
-
return (0, deviceAccess_1.withDevice)(arg.device || "")(function (t) { return (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t)); });
|
|
16
|
-
},
|
|
14
|
+
job: (arg) => (0, deviceAccess_1.withDevice)(arg.device || "")(t => (0, rxjs_1.from)((0, customLockScreenFetchHash_1.default)(t))),
|
|
17
15
|
};
|
|
18
16
|
//# sourceMappingURL=customLockScreenFetchHash.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenFetchHash.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchHash.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"customLockScreenFetchHash.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenFetchHash.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,+BAA4B;AAE5B,qCAAuC;AACvC,mHAA2F;AAC3F,wEAAmE;AAInE,kBAAe;IACb,WAAW,EAAE,0CAA0C;IACvD,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,CAAC,GAAqC,EAAO,EAAE,CAClD,IAAA,yBAAU,EAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,WAAI,EAAC,IAAA,mCAAyB,EAAC,CAAC,CAAC,CAAC,CAAC;CACxE,CAAC"}
|
|
@@ -1,79 +1,32 @@
|
|
|
1
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
4
|
};
|
|
41
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, function () {
|
|
67
|
-
console.log("Image loaded.");
|
|
68
|
-
resolve();
|
|
69
|
-
});
|
|
70
|
-
})];
|
|
71
|
-
case 1:
|
|
72
|
-
_b.sent();
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}); };
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const customLockScreenLoad_1 = __importDefault(require("@ledgerhq/live-common/hw/customLockScreenLoad"));
|
|
9
|
+
const scan_1 = require("../../scan");
|
|
10
|
+
const isCustomLockScreenSupported_1 = require("@ledgerhq/live-common/device/use-cases/isCustomLockScreenSupported");
|
|
11
|
+
const exec = async (opts) => {
|
|
12
|
+
const { fileInput, device: deviceId = "", deviceModelId } = opts;
|
|
13
|
+
if (!(0, isCustomLockScreenSupported_1.isCustomLockScreenSupported)(deviceModelId)) {
|
|
14
|
+
console.error("This device model does not support custom lock screen");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const clsSupportedDeviceModelId = deviceModelId;
|
|
18
|
+
const hexImage = fs_1.default.readFileSync(fileInput, "utf-8");
|
|
19
|
+
await new Promise(resolve => (0, customLockScreenLoad_1.default)({
|
|
20
|
+
deviceId,
|
|
21
|
+
request: { hexImage, deviceModelId: clsSupportedDeviceModelId },
|
|
22
|
+
}).subscribe(x => console.log(x), e => {
|
|
23
|
+
console.error(e);
|
|
24
|
+
resolve();
|
|
25
|
+
}, () => {
|
|
26
|
+
console.log(`Image loaded.`);
|
|
27
|
+
resolve();
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
77
30
|
exports.default = {
|
|
78
31
|
description: "Test lock screen customization by loading an image",
|
|
79
32
|
args: [
|
|
@@ -90,6 +43,6 @@ exports.default = {
|
|
|
90
43
|
desc: "The device model id to use",
|
|
91
44
|
},
|
|
92
45
|
],
|
|
93
|
-
job:
|
|
46
|
+
job: (opts) => (0, rxjs_1.from)(exec(opts)),
|
|
94
47
|
};
|
|
95
48
|
//# sourceMappingURL=customLockScreenLoad.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenLoad.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenLoad.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"customLockScreenLoad.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenLoad.ts"],"names":[],"mappings":";;;;;AAAA,+BAA4B;AAC5B,4CAAoB;AAEpB,yGAAiF;AACjF,qCAAuC;AACvC,oHAG4E;AAQ5E,MAAM,IAAI,GAAG,KAAK,EAAE,IAAiC,EAAE,EAAE;IACvD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACjE,IAAI,CAAC,IAAA,yDAA2B,EAAC,aAA8B,CAAC,EAAE,CAAC;QACjE,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IACD,MAAM,yBAAyB,GAAG,aAA0C,CAAC;IAC7E,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAErD,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE,CAChC,IAAA,8BAAoB,EAAC;QACnB,QAAQ;QACR,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,EAAE;KAChE,CAAC,CAAC,SAAS,CACV,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EACnB,CAAC,CAAC,EAAE;QACF,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC,EACD,GAAG,EAAE;QACH,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC,CACF,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe;IACb,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE;QACJ,gBAAS;QACT;YACE,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,0FAA0F;SACjG;QACD;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,4BAA4B;SACnC;KACF;IACD,GAAG,EAAE,CAAC,IAAiC,EAAO,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAClE,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const rxjs_1 = require("rxjs");
|
|
4
|
+
const customLockScreenRemove_1 = require("@ledgerhq/live-common/hw/customLockScreenRemove");
|
|
5
|
+
const scan_1 = require("../../scan");
|
|
6
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
7
7
|
exports.default = {
|
|
8
8
|
description: "Remove custom lock screen",
|
|
9
9
|
args: [scan_1.deviceOpt],
|
|
10
|
-
job:
|
|
11
|
-
return (0, deviceAccess_1.withDevice)((arg === null || arg === void 0 ? void 0 : arg.device) || "")(function (t) { return (0, rxjs_1.from)((0, customLockScreenRemove_1.command)(t)); });
|
|
12
|
-
},
|
|
10
|
+
job: (arg) => (0, deviceAccess_1.withDevice)(arg?.device || "")(t => (0, rxjs_1.from)((0, customLockScreenRemove_1.command)(t))),
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=customLockScreenRemove.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customLockScreenRemove.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenRemove.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"customLockScreenRemove.js","sourceRoot":"","sources":["../../../src/commands/device/customLockScreenRemove.ts"],"names":[],"mappings":";;AAAA,+BAA4B;AAE5B,4FAAoG;AACpG,qCAAuC;AACvC,wEAAmE;AAInE,kBAAe;IACb,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,CAAC,GAAkC,EAAO,EAAE,CAC/C,IAAA,yBAAU,EAAC,GAAG,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,WAAI,EAAC,IAAA,gCAAsB,EAAC,CAAC,CAAC,CAAC,CAAC;CACtE,CAAC"}
|
|
@@ -1,67 +1,40 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
4
|
};
|
|
30
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
7
|
+
const operators_1 = require("rxjs/operators");
|
|
8
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
9
|
+
const getDeviceInfo_1 = __importDefault(require("@ledgerhq/live-common/hw/getDeviceInfo"));
|
|
10
|
+
const index_1 = require("@ledgerhq/live-common/apps/index");
|
|
11
|
+
const api_1 = __importDefault(require("@ledgerhq/live-common/manager/api"));
|
|
12
|
+
const listAppsUseCase_1 = require("@ledgerhq/live-common/device/use-cases/listAppsUseCase");
|
|
13
|
+
const execWithTransport_1 = require("@ledgerhq/live-common/device/use-cases/execWithTransport");
|
|
14
|
+
const installApp_1 = __importDefault(require("@ledgerhq/live-common/hw/installApp"));
|
|
15
|
+
const scan_1 = require("../../scan");
|
|
41
16
|
// how to add a scenario:
|
|
42
17
|
// wget https://manager.api.live.ledger.com/api/applications
|
|
43
18
|
// then find in that json the apps you are looking for (with a provider 1)
|
|
44
19
|
// with JS: obj.flatMap(a => a.application_versions).filter(a => a.version==="1.3.16" && a.providers.includes(1))
|
|
45
20
|
// array of applicationversion ids
|
|
46
|
-
|
|
21
|
+
const scenarios = {
|
|
47
22
|
"nanos160-outdated-apps": [1679, 222, 2783, 3295, 3305],
|
|
48
23
|
"nanos160-outdated-bitcoin-apps": [
|
|
49
24
|
3295, 3305, 3319, 3325, 3302, 3324, 3298, 3297, 3318, 3309, 3322, 3304, 3296, 3308, 3299, 3300,
|
|
50
25
|
3312, 3303, 3301, 3315, 3314, 3323,
|
|
51
26
|
],
|
|
52
27
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
apps.forEach(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return rxjs_1.concat.apply(void 0, __spreadArray([], __read(scene
|
|
62
|
-
.map(function (id) { return appVersionsPerId[id]; })
|
|
28
|
+
const scenariosValues = Object.keys(scenarios).join(" | ");
|
|
29
|
+
const installScenario = (apps, transport, deviceInfo, scene) => {
|
|
30
|
+
const appVersionsPerId = {};
|
|
31
|
+
apps.forEach(a => a.application_versions.forEach(av => {
|
|
32
|
+
appVersionsPerId[av.id] = av;
|
|
33
|
+
}));
|
|
34
|
+
return (0, rxjs_1.concat)(...scene
|
|
35
|
+
.map(id => appVersionsPerId[id])
|
|
63
36
|
.filter(Boolean)
|
|
64
|
-
.map(
|
|
37
|
+
.map(app => (0, rxjs_1.defer)(() => (0, installApp_1.default)(transport, deviceInfo.targetId, app))));
|
|
65
38
|
};
|
|
66
39
|
exports.default = {
|
|
67
40
|
description: "dev feature to enter into a specific device apps scenario",
|
|
@@ -74,23 +47,18 @@ exports.default = {
|
|
|
74
47
|
desc: scenariosValues,
|
|
75
48
|
},
|
|
76
49
|
],
|
|
77
|
-
job:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return (0, rxjs_1.concat)((0, index_1.runAll)(s, exec).pipe((0, operators_1.ignoreElements)()), (0, rxjs_1.from)(api_1.default.listApps()));
|
|
91
|
-
}), (0, operators_1.mergeMap)(function (apps) { return installScenario(apps, t, deviceInfo, scene); }));
|
|
92
|
-
}));
|
|
93
|
-
});
|
|
94
|
-
},
|
|
50
|
+
job: ({ device, scenario }) => (0, deviceAccess_1.withDevice)(device || "")(t => {
|
|
51
|
+
const scene = scenarios[scenario || ""];
|
|
52
|
+
if (!scene)
|
|
53
|
+
throw new Error("scenario is not found. available --scenario are: " + scenariosValues);
|
|
54
|
+
const exec = (0, execWithTransport_1.execWithTransport)(t);
|
|
55
|
+
// $FlowFixMe
|
|
56
|
+
return (0, rxjs_1.from)((0, getDeviceInfo_1.default)(t)).pipe((0, operators_1.mergeMap)(deviceInfo => (0, listAppsUseCase_1.listAppsUseCase)(t, deviceInfo).pipe((0, operators_1.filter)(e => e.type === "result"), (0, operators_1.map)(e => e.result), (0, operators_1.mergeMap)(listAppsResult => {
|
|
57
|
+
const s = (0, index_1.reducer)((0, index_1.initState)(listAppsResult), {
|
|
58
|
+
type: "wipe",
|
|
59
|
+
});
|
|
60
|
+
return (0, rxjs_1.concat)((0, index_1.runAll)(s, exec).pipe((0, operators_1.ignoreElements)()), (0, rxjs_1.from)(api_1.default.listApps()));
|
|
61
|
+
}), (0, operators_1.mergeMap)(apps => installScenario(apps, t, deviceInfo, scene)))));
|
|
62
|
+
}),
|
|
95
63
|
};
|
|
96
64
|
//# sourceMappingURL=devDeviceAppsScenario.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devDeviceAppsScenario.js","sourceRoot":"","sources":["../../../src/commands/device/devDeviceAppsScenario.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devDeviceAppsScenario.js","sourceRoot":"","sources":["../../../src/commands/device/devDeviceAppsScenario.ts"],"names":[],"mappings":";;;;;AAAA,+BAAuD;AACvD,8CAAuE;AACvE,wEAAmE;AACnE,2FAAmE;AACnE,4DAA8F;AAC9F,4EAA2D;AAC3D,4FAAyF;AACzF,gGAA6F;AAC7F,qFAA6D;AAC7D,qCAAyD;AAIzD,yBAAyB;AACzB,4DAA4D;AAC5D,0EAA0E;AAC1E,iHAAiH;AACjH,kCAAkC;AAClC,MAAM,SAAS,GAA6B;IAC1C,wBAAwB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACvD,gCAAgC,EAAE;QAChC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI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3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
7
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
8
|
+
const getAppAndVersion_1 = __importDefault(require("@ledgerhq/live-common/hw/getAppAndVersion"));
|
|
9
|
+
const scan_1 = require("../../scan");
|
|
10
10
|
exports.default = {
|
|
11
11
|
args: [scan_1.deviceOpt],
|
|
12
|
-
job:
|
|
13
|
-
var device = _a.device;
|
|
14
|
-
return (0, deviceAccess_1.withDevice)(device || "")(function (t) { return (0, rxjs_1.from)((0, getAppAndVersion_1.default)(t)); });
|
|
15
|
-
},
|
|
12
|
+
job: ({ device }) => (0, deviceAccess_1.withDevice)(device || "")(t => (0, rxjs_1.from)((0, getAppAndVersion_1.default)(t))),
|
|
16
13
|
};
|
|
17
14
|
//# sourceMappingURL=deviceAppVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceAppVersion.js","sourceRoot":"","sources":["../../../src/commands/device/deviceAppVersion.ts"],"names":[],"mappings":";;;;;AAAA
|
|
1
|
+
{"version":3,"file":"deviceAppVersion.js","sourceRoot":"","sources":["../../../src/commands/device/deviceAppVersion.ts"],"names":[],"mappings":";;;;;AAAA,+BAA4B;AAC5B,wEAAmE;AACnE,iGAAyE;AACzE,qCAAyD;AAIzD,kBAAe;IACb,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,CAAC,EAAE,MAAM,EAA2B,EAAE,EAAE,CAC3C,IAAA,yBAAU,EAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,WAAI,EAAC,IAAA,0BAAgB,EAAC,CAAC,CAAC,CAAC,CAAC;CAC3D,CAAC"}
|
|
@@ -3,15 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
7
|
+
const deviceAccess_1 = require("@ledgerhq/live-common/hw/deviceAccess");
|
|
8
|
+
const getDeviceInfo_1 = __importDefault(require("@ledgerhq/live-common/hw/getDeviceInfo"));
|
|
9
|
+
const scan_1 = require("../../scan");
|
|
10
10
|
exports.default = {
|
|
11
11
|
args: [scan_1.deviceOpt],
|
|
12
|
-
job:
|
|
13
|
-
var device = _a.device;
|
|
14
|
-
return (0, deviceAccess_1.withDevice)(device || "")(function (t) { return (0, rxjs_1.from)((0, getDeviceInfo_1.default)(t)); });
|
|
15
|
-
},
|
|
12
|
+
job: ({ device }) => (0, deviceAccess_1.withDevice)(device || "")(t => (0, rxjs_1.from)((0, getDeviceInfo_1.default)(t))),
|
|
16
13
|
};
|
|
17
14
|
//# sourceMappingURL=deviceInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceInfo.js","sourceRoot":"","sources":["../../../src/commands/device/deviceInfo.ts"],"names":[],"mappings":";;;;;AAAA
|
|
1
|
+
{"version":3,"file":"deviceInfo.js","sourceRoot":"","sources":["../../../src/commands/device/deviceInfo.ts"],"names":[],"mappings":";;;;;AAAA,+BAA4B;AAC5B,wEAAmE;AACnE,2FAAmE;AACnE,qCAAyD;AAIzD,kBAAe;IACb,IAAI,EAAE,CAAC,gBAAS,CAAC;IACjB,GAAG,EAAE,CAAC,EAAE,MAAM,EAAqB,EAAE,EAAE,CAAC,IAAA,yBAAU,EAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,WAAI,EAAC,IAAA,uBAAa,EAAC,CAAC,CAAC,CAAC,CAAC;CAC9F,CAAC"}
|