@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 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/commands/proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAmC;AACnC,qEAIuC;AACvC,uCAA6C;AAC7C,mDAAoD;AACpD,0CAAoB;AACpB,8CAAwB;AACxB,oDAA8B;AAC9B,8CAAwB;AACxB,0CAA2B;AAC3B,4DAAqC;AACrC,0CAAoB;AACpB,6BAAkC;AAClC,gCAAoC;AACpC,IAAM,IAAI,GAAG;IACX,gBAAS;IACT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,IAAI,CACL,IAAI,CAAC,SAAS,CAAC;oCACb,IAAI,EAAE,OAAO;oCACb,KAAK,EAAE,GAAC,CAAC,OAAO;iCACjB,CAAC,CACH,CAAC;gCAEF,IAAI,GAAC,CAAC,IAAI,KAAK,sBAAsB,EAAE;oCACrC,OAAO,CAAC,KAAK,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;oCACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iCACjB;;;;;qBAEJ,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;gBACV,EAAE,CAAC,KAAK,EAAE,CAAC;aACZ;QACH,CAAC,CAAC,CAAC;QACH,eAAC,WAAW,UAAK,GAAG,UACjB,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,eAAQ,EAAE,cAAI,IAAI,CAAE,EAApB,CAAoB,CAAC;aACjC,OAAO,CAAC,UAAC,EAAE;YACV,IAAA,UAAG,EAAC,OAAO,EAAE,mBAAmB,GAAG,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QACL,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;YAClB,IAAA,UAAG,EAAC,OAAO,EAAE,oCAA6B,GAAG,CAAC,CAAC,CAAC,OAAI,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QACH,OAAO;YACL,KAAK,EAAE,CAAC;QACV,CAAC,CAAC;IACJ,CAAC,CAAC;AAzRF,CAyRE,CAAC;AAEL,qBAAe;IACb,IAAI,MAAA;IACJ,GAAG,KAAA;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
|
+
type: BooleanConstructor;
|
|
40
|
+
desc: string;
|
|
41
|
+
})[];
|
|
42
|
+
job: (opts: ScanCommonOpts & {
|
|
43
|
+
qr: boolean;
|
|
44
|
+
freshAddressIndex: number | null | undefined;
|
|
45
|
+
}) => import("rxjs").Observable<string>;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=receive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.d.ts","sourceRoot":"","sources":["../../src/commands/receive.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAmBpC,cAAc,GAAG;QACrB,EAAE,EAAE,OAAO,CAAC;QACZ,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;KAC9C;;AAnBL,wBA8CE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 scan_1 = require("../scan");
|
|
32
|
+
var qr_1 = require("../qr");
|
|
33
|
+
var errors_1 = require("@ledgerhq/live-common/lib/errors");
|
|
34
|
+
exports["default"] = {
|
|
35
|
+
description: "Receive crypto-assets (verify on device)",
|
|
36
|
+
args: __spreadArray(__spreadArray([], __read(scan_1.scanCommonOpts), false), [
|
|
37
|
+
{
|
|
38
|
+
name: "qr",
|
|
39
|
+
type: Boolean,
|
|
40
|
+
desc: "also display a QR Code"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "freshAddressIndex",
|
|
44
|
+
type: Number,
|
|
45
|
+
desc: "Change fresh address index"
|
|
46
|
+
},
|
|
47
|
+
], false),
|
|
48
|
+
job: function (opts) {
|
|
49
|
+
return (0, scan_1.scan)(opts).pipe((0, operators_1.concatMap)(function (account) {
|
|
50
|
+
var _a;
|
|
51
|
+
return (0, rxjs_1.concat)((0, rxjs_1.of)(opts.freshAddressIndex !== undefined &&
|
|
52
|
+
opts.freshAddressIndex !== null
|
|
53
|
+
? (_a = account.freshAddresses[opts.freshAddressIndex]) === null || _a === void 0 ? void 0 : _a.address
|
|
54
|
+
: account.freshAddress).pipe((0, operators_1.map)(function (address) {
|
|
55
|
+
if (!address)
|
|
56
|
+
throw new errors_1.FreshAddressIndexInvalid();
|
|
57
|
+
return address;
|
|
58
|
+
})), opts.qr ? (0, qr_1.asQR)(account.freshAddress) : rxjs_1.EMPTY, (0, bridge_1.getAccountBridge)(account)
|
|
59
|
+
.receive(account, {
|
|
60
|
+
deviceId: opts.device || "",
|
|
61
|
+
verify: true,
|
|
62
|
+
freshAddressIndex: opts.freshAddressIndex
|
|
63
|
+
})
|
|
64
|
+
.pipe((0, operators_1.ignoreElements)()));
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=receive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../src/commands/receive.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAyC;AACzC,4CAAgE;AAChE,2DAAoE;AACpE,gCAA+C;AAE/C,4BAA6B;AAC7B,2DAA4E;AAC5E,qBAAe;IACb,WAAW,EAAE,0CAA0C;IACvD,IAAI,yCACC,qBAAc;QACjB;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,wBAAwB;SAC/B;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,4BAA4B;SACnC;aACF;IACD,GAAG,EAAE,UACH,IAGC;QAED,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC,IAAI,CACb,IAAA,qBAAS,EAAC,UAAC,OAAO;;YAChB,OAAA,IAAA,aAAM,EACJ,IAAA,SAAE,EACA,IAAI,CAAC,iBAAiB,KAAK,SAAS;gBAClC,IAAI,CAAC,iBAAiB,KAAK,IAAI;gBAC/B,CAAC,CAAC,MAAA,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,0CAAE,OAAO;gBACzD,CAAC,CAAC,OAAO,CAAC,YAAY,CACzB,CAAC,IAAI,CACJ,IAAA,eAAG,EAAC,UAAC,OAAO;gBACV,IAAI,CAAC,OAAO;oBAAE,MAAM,IAAI,iCAAwB,EAAE,CAAC;gBACnD,OAAO,OAAO,CAAC;YACjB,CAAC,CAAC,CACH,EACD,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,SAAI,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAK,EAC5C,IAAA,yBAAgB,EAAC,OAAO,CAAC;iBACtB,OAAO,CAAC,OAAO,EAAE;gBAChB,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;gBAC3B,MAAM,EAAE,IAAI;gBACZ,iBAAiB,EAAE,IAAI,CAAC,iBAA2B;aACpD,CAAC;iBACD,IAAI,CAAC,IAAA,0BAAc,GAAE,CAAC,CAC1B,CAAA;SAAA,CACF,CACF;IAxBD,CAwBC;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
|
+
alias: string;
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
typeDesc: string;
|
|
14
|
+
desc: string;
|
|
15
|
+
})[];
|
|
16
|
+
job: ({ device, file }: {
|
|
17
|
+
device: string;
|
|
18
|
+
file: string;
|
|
19
|
+
}) => import("rxjs").Observable<string>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;gBAgBoC,MAAM;cAAQ,MAAM;;;AAZxD,wBAgBE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var operators_1 = require("rxjs/operators");
|
|
4
|
+
var deviceAccess_1 = require("@ledgerhq/live-common/lib/hw/deviceAccess");
|
|
5
|
+
var scan_1 = require("../scan");
|
|
6
|
+
var stream_1 = require("../stream");
|
|
7
|
+
exports["default"] = {
|
|
8
|
+
description: "Low level exchange with the device. Send APDUs from stdin.",
|
|
9
|
+
args: [
|
|
10
|
+
scan_1.deviceOpt,
|
|
11
|
+
{
|
|
12
|
+
name: "file",
|
|
13
|
+
alias: "f",
|
|
14
|
+
type: String,
|
|
15
|
+
typeDesc: "filename",
|
|
16
|
+
desc: "A file can also be provided. By default stdin is used."
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
job: function (_a) {
|
|
20
|
+
var device = _a.device, file = _a.file;
|
|
21
|
+
return (0, deviceAccess_1.withDevice)(device || "")(function (t) {
|
|
22
|
+
return (0, stream_1.apdusFromFile)(file || "-").pipe((0, operators_1.concatMap)(function (apdu) { return t.exchange(apdu); }));
|
|
23
|
+
}).pipe((0, operators_1.map)(function (res) { return res.toString("hex"); }));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=repl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl.js","sourceRoot":"","sources":["../../src/commands/repl.ts"],"names":[],"mappings":";;AAAA,4CAAgD;AAChD,0EAAuE;AACvE,gCAAoC;AACpC,oCAA0C;AAC1C,qBAAe;IACb,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE;QACJ,gBAAS;QACT;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,wDAAwD;SAC/D;KACF;IACD,GAAG,EAAE,UAAC,EAAkD;YAAhD,MAAM,YAAA,EAAE,IAAI,UAAA;QAClB,OAAA,IAAA,yBAAU,EAAC,MAAM,IAAI,EAAE,CAAC,CAAC,UAAC,CAAC;YACzB,OAAA,IAAA,sBAAa,EAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAA,qBAAS,EAAC,UAAC,IAAI,IAAK,OAAA,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAhB,CAAgB,CAAC,CAAC;QAAtE,CAAsE,CACvE,CAAC,IAAI,CAAC,IAAA,eAAG,EAAC,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAnB,CAAmB,CAAC,CAAC;IAFzC,CAEyC;CAC5C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
typeDesc?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
typeDesc: string;
|
|
18
|
+
desc: string;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
desc: string;
|
|
23
|
+
typeDesc?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
job: ({ "no-device": noDevice, "no-save": noSave, device, lss, rpcHOST, rpcUSER, rpcPASSWORD, rpcTLS, }: {
|
|
26
|
+
"no-device": boolean;
|
|
27
|
+
"no-save": boolean;
|
|
28
|
+
device: string;
|
|
29
|
+
lss: string;
|
|
30
|
+
rpcHOST: string;
|
|
31
|
+
rpcUSER: string;
|
|
32
|
+
rpcPASSWORD: string;
|
|
33
|
+
rpcTLS: boolean;
|
|
34
|
+
}) => import("rxjs").Observable<string>;
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=satstack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satstack.d.ts","sourceRoot":"","sources":["../../src/commands/satstack.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qBAqFiB,OAAO;mBACT,OAAO;gBACV,MAAM;aACT,MAAM;iBACF,MAAM;iBACN,MAAM;qBACF,MAAM;gBACX,OAAO;;;AA1DnB,wBAiHE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
var invariant_1 = __importDefault(require("invariant"));
|
|
8
|
+
var rxjs_1 = require("rxjs");
|
|
9
|
+
var operators_1 = require("rxjs/operators");
|
|
10
|
+
var env_1 = require("@ledgerhq/live-common/lib/env");
|
|
11
|
+
var currencies_1 = require("@ledgerhq/live-common/lib/currencies");
|
|
12
|
+
var descriptor_1 = require("@ledgerhq/live-common/lib/families/bitcoin/descriptor");
|
|
13
|
+
var satstack_1 = require("@ledgerhq/live-common/lib/families/bitcoin/satstack");
|
|
14
|
+
var scan_1 = require("../scan");
|
|
15
|
+
var stream_1 = require("../stream");
|
|
16
|
+
var bitcoin = (0, currencies_1.getCryptoCurrencyById)("bitcoin");
|
|
17
|
+
function requiredNodeConfig(nodeConfig) {
|
|
18
|
+
(0, invariant_1["default"])(nodeConfig, "--rpcHOST,--rpcUSER,--rpcPASSWORD config required");
|
|
19
|
+
var errors = (0, satstack_1.validateRPCNodeConfig)(nodeConfig);
|
|
20
|
+
if (errors.length) {
|
|
21
|
+
throw new Error(errors.map(function (e) { return e.field + ": " + e.error.message; }).join(", "));
|
|
22
|
+
}
|
|
23
|
+
return nodeConfig;
|
|
24
|
+
}
|
|
25
|
+
exports["default"] = {
|
|
26
|
+
description: "SatStack: Generate and manage lss.json file",
|
|
27
|
+
args: [
|
|
28
|
+
scan_1.deviceOpt,
|
|
29
|
+
{
|
|
30
|
+
name: "no-device",
|
|
31
|
+
type: Boolean,
|
|
32
|
+
desc: "disable the scanning of device descriptors"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "no-save",
|
|
36
|
+
type: Boolean,
|
|
37
|
+
desc: "disable the save of the lss file"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "lss",
|
|
41
|
+
type: String,
|
|
42
|
+
typeDesc: "filename",
|
|
43
|
+
desc: "A file to save the sats stack state"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "rpcHOST",
|
|
47
|
+
type: String,
|
|
48
|
+
desc: "host to rpc full node (e.g. 127.0.0.1:8332)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "rpcUSER",
|
|
52
|
+
type: String,
|
|
53
|
+
desc: "username of full node"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "rpcPASSWORD",
|
|
57
|
+
type: String,
|
|
58
|
+
desc: "password of full node"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "rpcTLS",
|
|
62
|
+
type: Boolean,
|
|
63
|
+
desc: "use tls in full node"
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
job: function (_a) {
|
|
67
|
+
var noDevice = _a["no-device"], noSave = _a["no-save"], device = _a.device, lss = _a.lss, rpcHOST = _a.rpcHOST, rpcUSER = _a.rpcUSER, rpcPASSWORD = _a.rpcPASSWORD, rpcTLS = _a.rpcTLS;
|
|
68
|
+
(0, env_1.setEnv)("SATSTACK", true);
|
|
69
|
+
var maybeExistingConfigO = !lss
|
|
70
|
+
? (0, rxjs_1.of)(null)
|
|
71
|
+
: (0, stream_1.jsonFromFile)(lss, true).pipe((0, operators_1.map)(satstack_1.parseSatStackConfig), (0, operators_1.first)(), (0, operators_1.catchError)(function () { return (0, rxjs_1.of)(null); }));
|
|
72
|
+
var maybeDescriptorsO = noDevice
|
|
73
|
+
? (0, rxjs_1.of)([])
|
|
74
|
+
: (0, descriptor_1.scanDescriptors)(device || "", bitcoin).pipe((0, operators_1.reduce)(function (acc, item) { return acc.concat(item); }, []));
|
|
75
|
+
var maybeNodeConfigOverride = rpcHOST
|
|
76
|
+
? requiredNodeConfig({
|
|
77
|
+
host: rpcHOST,
|
|
78
|
+
username: rpcUSER,
|
|
79
|
+
password: rpcPASSWORD,
|
|
80
|
+
tls: !!rpcTLS
|
|
81
|
+
})
|
|
82
|
+
: null;
|
|
83
|
+
return (0, rxjs_1.forkJoin)({
|
|
84
|
+
initialConfig: maybeExistingConfigO,
|
|
85
|
+
descriptors: maybeDescriptorsO,
|
|
86
|
+
checkedRPCNodeConfig: maybeNodeConfigOverride
|
|
87
|
+
? (0, rxjs_1.from)((0, satstack_1.checkRPCNodeConfig)(maybeNodeConfigOverride))
|
|
88
|
+
: (0, rxjs_1.of)(null)
|
|
89
|
+
}).pipe((0, operators_1.map)(function (a) {
|
|
90
|
+
var initialConfig = a.initialConfig, descriptors = a.descriptors;
|
|
91
|
+
var patch = {
|
|
92
|
+
node: requiredNodeConfig(maybeNodeConfigOverride ||
|
|
93
|
+
(initialConfig ? initialConfig.node : null)),
|
|
94
|
+
accounts: descriptors.map(function (descriptor) { return ({
|
|
95
|
+
descriptor: descriptor
|
|
96
|
+
}); })
|
|
97
|
+
};
|
|
98
|
+
var config = initialConfig
|
|
99
|
+
? (0, satstack_1.editSatStackConfig)(initialConfig, patch)
|
|
100
|
+
: patch;
|
|
101
|
+
var str = (0, satstack_1.stringifySatStackConfig)(config);
|
|
102
|
+
if (lss && !noSave) {
|
|
103
|
+
fs_1["default"].writeFileSync(lss, str);
|
|
104
|
+
return lss + " saved!";
|
|
105
|
+
}
|
|
106
|
+
return str;
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=satstack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satstack.js","sourceRoot":"","sources":["../../src/commands/satstack.ts"],"names":[],"mappings":";;;;;AAAA,0CAAoB;AACpB,wDAAkC;AAClC,6BAA0C;AAC1C,4CAAgE;AAChE,qDAAuD;AACvD,mEAA6E;AAC7E,oFAG+D;AAC/D,gFAM6D;AAC7D,gCAAoC;AACpC,oCAAyC;AACzC,IAAM,OAAO,GAAG,IAAA,kCAAqB,EAAC,SAAS,CAAC,CAAC;AAEjD,SAAS,kBAAkB,CAAC,UAAU;IACpC,IAAA,sBAAS,EAAC,UAAU,EAAE,mDAAmD,CAAC,CAAC;IAC3E,IAAM,MAAM,GAAG,IAAA,gCAAqB,EAAC,UAAU,CAAC,CAAC;IAEjD,IAAI,MAAM,CAAC,MAAM,EAAE;QACjB,MAAM,IAAI,KAAK,CACb,MAAM,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAhC,CAAgC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC/D,CAAC;KACH;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,qBAAe;IACb,WAAW,EAAE,6CAA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C,aAAa,EAAE,KAAK,CAAC;gBAC1C,CAAC,CAAC,KAAK,CAAC;YACV,IAAM,GAAG,GAAG,IAAA,kCAAuB,EAAC,MAAM,CAAC,CAAC;YAE5C,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE;gBAClB,eAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBAC3B,OAAO,GAAG,GAAG,SAAS,CAAC;aACxB;YAED,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: {
|
|
4
|
+
name: string;
|
|
5
|
+
type: BooleanConstructor;
|
|
6
|
+
desc: string;
|
|
7
|
+
}[];
|
|
8
|
+
job: ({ continuous }: {
|
|
9
|
+
continuous?: boolean | undefined;
|
|
10
|
+
}) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/families/bitcoin/satstack").SatStackStatus>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=satstackStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satstackStatus.d.ts","sourceRoot":"","sources":["../../src/commands/satstackStatus.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,wBAkBE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var operators_1 = require("rxjs/operators");
|
|
4
|
+
var satstack_1 = require("@ledgerhq/live-common/lib/families/bitcoin/satstack");
|
|
5
|
+
var env_1 = require("@ledgerhq/live-common/lib/env");
|
|
6
|
+
exports["default"] = {
|
|
7
|
+
description: "Check StackSats status",
|
|
8
|
+
args: [
|
|
9
|
+
{
|
|
10
|
+
name: "continuous",
|
|
11
|
+
type: Boolean,
|
|
12
|
+
desc: "enable status polling"
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
job: function (_a) {
|
|
16
|
+
var continuous = _a.continuous;
|
|
17
|
+
(0, env_1.setEnv)("SATSTACK", true);
|
|
18
|
+
if (!continuous) {
|
|
19
|
+
return satstack_1.statusObservable.pipe((0, operators_1.first)());
|
|
20
|
+
}
|
|
21
|
+
return satstack_1.statusObservable;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=satstackStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satstackStatus.js","sourceRoot":"","sources":["../../src/commands/satstackStatus.ts"],"names":[],"mappings":";;AAAA,4CAAuC;AACvC,gFAAuF;AACvF,qDAAuD;AACvD,qBAAe;IACb,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE;QACJ;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,uBAAuB;SAC9B;KACF;IACD,GAAG,EAAE,UAAC,EAAwC;YAAtC,UAAU,gBAAA;QAChB,IAAA,YAAM,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAEzB,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,2BAAgB,CAAC,IAAI,CAAC,IAAA,iBAAK,GAAE,CAAC,CAAC;SACvC;QAED,OAAO,2BAAgB,CAAC;IAC1B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: {
|
|
4
|
+
name: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
desc: string;
|
|
8
|
+
}[];
|
|
9
|
+
job: (opts: Partial<{
|
|
10
|
+
device: string;
|
|
11
|
+
currency: string;
|
|
12
|
+
}>) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/families/bitcoin/descriptor").AccountDescriptor>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=scanDescriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanDescriptors.d.ts","sourceRoot":"","sources":["../../src/commands/scanDescriptors.ts"],"names":[],"mappings":";;;;;;;;gBAaU,QAAQ;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;;AAPN,wBAaE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var scan_1 = require("../scan");
|
|
4
|
+
var currencies_1 = require("@ledgerhq/live-common/lib/currencies");
|
|
5
|
+
var descriptor_1 = require("@ledgerhq/live-common/lib/families/bitcoin/descriptor");
|
|
6
|
+
function requiredCurrency(c) {
|
|
7
|
+
if (!c)
|
|
8
|
+
throw new Error("could not find currency");
|
|
9
|
+
return c;
|
|
10
|
+
}
|
|
11
|
+
exports["default"] = {
|
|
12
|
+
description: "Synchronize accounts with blockchain",
|
|
13
|
+
args: [scan_1.deviceOpt, scan_1.currencyOpt],
|
|
14
|
+
job: function (opts) {
|
|
15
|
+
return (0, descriptor_1.scanDescriptors)(opts.device || "", requiredCurrency((0, currencies_1.findCryptoCurrencyByKeyword)(opts.currency || "bitcoin")));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=scanDescriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanDescriptors.js","sourceRoot":"","sources":["../../src/commands/scanDescriptors.ts"],"names":[],"mappings":";;AAAA,gCAAiD;AACjD,mEAAmF;AACnF,oFAAwF;AAExF,SAAS,gBAAgB,CAAC,CAAC;IACzB,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,qBAAe;IACb,WAAW,EAAE,sCAAsC;IACnD,IAAI,EAAE,CAAC,gBAAS,EAAE,kBAAW,CAAC;IAC9B,GAAG,EAAE,UACH,IAGE;QAEF,OAAA,IAAA,4BAAe,EACb,IAAI,CAAC,MAAM,IAAI,EAAE,EACjB,gBAAgB,CAAC,IAAA,wCAA2B,EAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,CAAC,CAC1E;IAHD,CAGC;CACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import type { ScanCommonOpts } from "../scan";
|
|
3
|
+
import type { InferTransactionsOpts } from "../transaction";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
description: string;
|
|
6
|
+
args: ({
|
|
7
|
+
name: string;
|
|
8
|
+
alias: string;
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
desc: string;
|
|
11
|
+
} | {
|
|
12
|
+
name: string;
|
|
13
|
+
alias: string;
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
desc: string;
|
|
16
|
+
multiple?: undefined;
|
|
17
|
+
typeDesc?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
name: string;
|
|
20
|
+
type: NumberConstructor;
|
|
21
|
+
desc: string;
|
|
22
|
+
multiple?: undefined;
|
|
23
|
+
typeDesc?: undefined;
|
|
24
|
+
alias?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
name: string;
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
desc: string;
|
|
29
|
+
multiple?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
desc: string;
|
|
34
|
+
multiple: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
name: string;
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
desc: string;
|
|
39
|
+
multiple?: undefined;
|
|
40
|
+
})[];
|
|
41
|
+
job: (opts: ScanCommonOpts & InferTransactionsOpts & {
|
|
42
|
+
"ignore-errors": boolean;
|
|
43
|
+
"disable-broadcast": boolean;
|
|
44
|
+
format: string;
|
|
45
|
+
}) => Observable<string>;
|
|
46
|
+
};
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,UAAU,EAAE,MAAM,MAAM,CAAC;AAsBlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAwBlD,cAAc,GAClB,qBAAqB,GAAG;QACtB,eAAe,EAAE,OAAO,CAAC;QACzB,mBAAmB,EAAE,OAAO,CAAC;QAC7B,MAAM,EAAE,MAAM,CAAC;KAChB;;AA3BP,wBAuHE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
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 env_1 = require("@ledgerhq/live-common/lib/env");
|
|
31
|
+
var bridge_1 = require("@ledgerhq/live-common/lib/bridge");
|
|
32
|
+
var account_1 = require("@ledgerhq/live-common/lib/account");
|
|
33
|
+
var transaction_1 = require("@ledgerhq/live-common/lib/transaction");
|
|
34
|
+
var scan_1 = require("../scan");
|
|
35
|
+
var transaction_2 = require("../transaction");
|
|
36
|
+
exports["default"] = {
|
|
37
|
+
description: "Send crypto-assets",
|
|
38
|
+
args: __spreadArray(__spreadArray(__spreadArray([], __read(scan_1.scanCommonOpts), false), __read(transaction_2.inferTransactionsOpts), false), [
|
|
39
|
+
{
|
|
40
|
+
name: "ignore-errors",
|
|
41
|
+
type: Boolean,
|
|
42
|
+
desc: "when using multiple transactions, an error won't stop the flow"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "disable-broadcast",
|
|
46
|
+
type: Boolean,
|
|
47
|
+
desc: "do not broadcast the transaction"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "format",
|
|
51
|
+
type: String,
|
|
52
|
+
desc: "default | json | silent"
|
|
53
|
+
},
|
|
54
|
+
], false),
|
|
55
|
+
job: function (opts) {
|
|
56
|
+
var l = opts.format !== "json" && opts.format !== "silent" // eslint-disable-next-line no-console
|
|
57
|
+
? function (l) { return console.log(l); }
|
|
58
|
+
: function (_l) { };
|
|
59
|
+
return (0, scan_1.scan)(opts).pipe((0, operators_1.tap)(function (account) {
|
|
60
|
+
l("\u2192 FROM ".concat((0, account_1.formatAccount)(account, "basic")));
|
|
61
|
+
}), (0, operators_1.switchMap)(function (account) {
|
|
62
|
+
return (0, rxjs_1.from)((0, transaction_2.inferTransactions)(account, opts)).pipe((0, operators_1.concatMap)(function (inferred) {
|
|
63
|
+
return inferred.reduce(function (acc, _a) {
|
|
64
|
+
var _b = __read(_a, 2), t = _b[0], status = _b[1];
|
|
65
|
+
return (0, rxjs_1.concat)(acc, (0, rxjs_1.from)((0, rxjs_1.defer)(function () {
|
|
66
|
+
var _a;
|
|
67
|
+
l("\u2714\uFE0F transaction ".concat((0, transaction_1.formatTransaction)(t, account)));
|
|
68
|
+
l("STATUS ".concat((0, transaction_1.formatTransactionStatus)(t, status, account)));
|
|
69
|
+
var bridge = (0, bridge_1.getAccountBridge)(account);
|
|
70
|
+
return (_a = bridge
|
|
71
|
+
.signOperation({
|
|
72
|
+
account: account,
|
|
73
|
+
transaction: t,
|
|
74
|
+
deviceId: opts.device || ""
|
|
75
|
+
}))
|
|
76
|
+
.pipe.apply(_a, __spreadArray(__spreadArray([(0, operators_1.map)(transaction_1.toSignOperationEventRaw)], __read((opts["disable-broadcast"] ||
|
|
77
|
+
(0, env_1.getEnv)("DISABLE_TRANSACTION_BROADCAST")
|
|
78
|
+
? []
|
|
79
|
+
: [
|
|
80
|
+
(0, operators_1.concatMap)(function (e) {
|
|
81
|
+
if (e.type === "signed") {
|
|
82
|
+
l("\u2714\uFE0F has been signed! ".concat(JSON.stringify(e.signedOperation)));
|
|
83
|
+
return (0, rxjs_1.from)(bridge
|
|
84
|
+
.broadcast({
|
|
85
|
+
account: account,
|
|
86
|
+
signedOperation: e.signedOperation
|
|
87
|
+
})
|
|
88
|
+
.then(function (op) {
|
|
89
|
+
l("\u2714\uFE0F broadcasted! optimistic operation: ".concat((0, account_1.formatOperation)(account)(
|
|
90
|
+
// @ts-expect-error we are supposed to give an OperationRaw and yet it's an Operation
|
|
91
|
+
(0, account_1.fromOperationRaw)(op, account.id))));
|
|
92
|
+
return op;
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
return (0, rxjs_1.of)(e);
|
|
96
|
+
}),
|
|
97
|
+
])), false), __read((opts["ignore-errors"]
|
|
98
|
+
? [
|
|
99
|
+
(0, operators_1.catchError)(function (e) {
|
|
100
|
+
return (0, rxjs_1.of)({
|
|
101
|
+
type: "error",
|
|
102
|
+
error: e,
|
|
103
|
+
transaction: t
|
|
104
|
+
});
|
|
105
|
+
}),
|
|
106
|
+
]
|
|
107
|
+
: [])), false));
|
|
108
|
+
})));
|
|
109
|
+
}, rxjs_1.EMPTY);
|
|
110
|
+
}), (0, operators_1.mergeMap)(function (obj) {
|
|
111
|
+
return opts.format !== "json" ? rxjs_1.EMPTY : (0, rxjs_1.of)(JSON.stringify(obj));
|
|
112
|
+
}));
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAkE;AAClE,4CAOwB;AACxB,qDAAuD;AACvD,2DAAoE;AACpE,6DAI2C;AAC3C,qEAI+C;AAC/C,gCAA+C;AAG/C,8CAA0E;AAC1E,qBAAe;IACb,WAAW,EAAE,oBAAoB;IACjC,IAAI,uDACC,qBAAc,kBACd,mCAAqB;QACxB;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,gEAAgE;SACvE;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,kCAAkC;SACzC;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,yBAAyB;SAChC;aACF;IACD,GAAG,EAAE,UACH,IAKG;QAEH,IAAM,CAAC,GACL,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,sCAAsC;YACvF,CAAC,CAAC,UAAC,CAAC,IAAK,OAAA,OAAO,CAAC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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
description: string;
|
|
3
|
+
args: ({
|
|
4
|
+
name: string;
|
|
5
|
+
alias: string;
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
desc: string;
|
|
8
|
+
} | {
|
|
9
|
+
name: string;
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
desc: string;
|
|
12
|
+
})[];
|
|
13
|
+
job: (arg: any) => import("rxjs").Observable<import("../../../lib/hw/signMessage/types").Result>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=signMessage.d.ts.map
|