@ledgerhq/live-cli 21.32.2-nightly.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +520 -0
  2. package/bin/index.js +2 -0
  3. package/lib/cli.d.ts +2 -0
  4. package/lib/cli.d.ts.map +1 -0
  5. package/lib/cli.js +137 -0
  6. package/lib/cli.js.map +1 -0
  7. package/lib/commands/app.d.ts +45 -0
  8. package/lib/commands/app.d.ts.map +1 -0
  9. package/lib/commands/app.js +131 -0
  10. package/lib/commands/app.js.map +1 -0
  11. package/lib/commands/appUninstallAll.d.ts +15 -0
  12. package/lib/commands/appUninstallAll.d.ts.map +1 -0
  13. package/lib/commands/appUninstallAll.js +31 -0
  14. package/lib/commands/appUninstallAll.js.map +1 -0
  15. package/lib/commands/appsCheckAllAppVersions.d.ts +20 -0
  16. package/lib/commands/appsCheckAllAppVersions.d.ts.map +1 -0
  17. package/lib/commands/appsCheckAllAppVersions.js +484 -0
  18. package/lib/commands/appsCheckAllAppVersions.js.map +1 -0
  19. package/lib/commands/appsInstallAll.d.ts +15 -0
  20. package/lib/commands/appsInstallAll.d.ts.map +1 -0
  21. package/lib/commands/appsInstallAll.js +34 -0
  22. package/lib/commands/appsInstallAll.js.map +1 -0
  23. package/lib/commands/appsUpdateTestAll.d.ts +20 -0
  24. package/lib/commands/appsUpdateTestAll.d.ts.map +1 -0
  25. package/lib/commands/appsUpdateTestAll.js +101 -0
  26. package/lib/commands/appsUpdateTestAll.js.map +1 -0
  27. package/lib/commands/balanceHistory.d.ts +50 -0
  28. package/lib/commands/balanceHistory.d.ts.map +1 -0
  29. package/lib/commands/balanceHistory.js +110 -0
  30. package/lib/commands/balanceHistory.js.map +1 -0
  31. package/lib/commands/bot.d.ts +12 -0
  32. package/lib/commands/bot.d.ts.map +1 -0
  33. package/lib/commands/bot.js +33 -0
  34. package/lib/commands/bot.js.map +1 -0
  35. package/lib/commands/botPortfolio.d.ts +15 -0
  36. package/lib/commands/botPortfolio.d.ts.map +1 -0
  37. package/lib/commands/botPortfolio.js +41 -0
  38. package/lib/commands/botPortfolio.js.map +1 -0
  39. package/lib/commands/botTransfer.d.ts +7 -0
  40. package/lib/commands/botTransfer.d.ts.map +1 -0
  41. package/lib/commands/botTransfer.js +376 -0
  42. package/lib/commands/botTransfer.js.map +1 -0
  43. package/lib/commands/broadcast.d.ts +42 -0
  44. package/lib/commands/broadcast.d.ts.map +1 -0
  45. package/lib/commands/broadcast.js +48 -0
  46. package/lib/commands/broadcast.js.map +1 -0
  47. package/lib/commands/cleanSpeculos.d.ts +7 -0
  48. package/lib/commands/cleanSpeculos.d.ts.map +1 -0
  49. package/lib/commands/cleanSpeculos.js +20 -0
  50. package/lib/commands/cleanSpeculos.js.map +1 -0
  51. package/lib/commands/countervalues.d.ts +84 -0
  52. package/lib/commands/countervalues.d.ts.map +1 -0
  53. package/lib/commands/countervalues.js +302 -0
  54. package/lib/commands/countervalues.js.map +1 -0
  55. package/lib/commands/derivation.d.ts +6 -0
  56. package/lib/commands/derivation.d.ts.map +1 -0
  57. package/lib/commands/derivation.js +44 -0
  58. package/lib/commands/derivation.js.map +1 -0
  59. package/lib/commands/devDeviceAppsScenario.d.ts +24 -0
  60. package/lib/commands/devDeviceAppsScenario.d.ts.map +1 -0
  61. package/lib/commands/devDeviceAppsScenario.js +97 -0
  62. package/lib/commands/devDeviceAppsScenario.js.map +1 -0
  63. package/lib/commands/deviceAppVersion.d.ts +19 -0
  64. package/lib/commands/deviceAppVersion.d.ts.map +1 -0
  65. package/lib/commands/deviceAppVersion.js +17 -0
  66. package/lib/commands/deviceAppVersion.js.map +1 -0
  67. package/lib/commands/deviceInfo.d.ts +14 -0
  68. package/lib/commands/deviceInfo.d.ts.map +1 -0
  69. package/lib/commands/deviceInfo.js +17 -0
  70. package/lib/commands/deviceInfo.js.map +1 -0
  71. package/lib/commands/deviceVersion.d.ts +14 -0
  72. package/lib/commands/deviceVersion.d.ts.map +1 -0
  73. package/lib/commands/deviceVersion.js +17 -0
  74. package/lib/commands/deviceVersion.js.map +1 -0
  75. package/lib/commands/discoverDevices.d.ts +23 -0
  76. package/lib/commands/discoverDevices.d.ts.map +1 -0
  77. package/lib/commands/discoverDevices.js +86 -0
  78. package/lib/commands/discoverDevices.js.map +1 -0
  79. package/lib/commands/envs.d.ts +7 -0
  80. package/lib/commands/envs.d.ts.map +1 -0
  81. package/lib/commands/envs.js +15 -0
  82. package/lib/commands/envs.js.map +1 -0
  83. package/lib/commands/estimateMaxSpendable.d.ts +41 -0
  84. package/lib/commands/estimateMaxSpendable.d.ts.map +1 -0
  85. package/lib/commands/estimateMaxSpendable.js +65 -0
  86. package/lib/commands/estimateMaxSpendable.js.map +1 -0
  87. package/lib/commands/exportAccounts.d.ts +48 -0
  88. package/lib/commands/exportAccounts.d.ts.map +1 -0
  89. package/lib/commands/exportAccounts.js +69 -0
  90. package/lib/commands/exportAccounts.js.map +1 -0
  91. package/lib/commands/firmwareRepair.d.ts +22 -0
  92. package/lib/commands/firmwareRepair.d.ts.map +1 -0
  93. package/lib/commands/firmwareRepair.js +23 -0
  94. package/lib/commands/firmwareRepair.js.map +1 -0
  95. package/lib/commands/firmwareUpdate.d.ts +26 -0
  96. package/lib/commands/firmwareUpdate.d.ts.map +1 -0
  97. package/lib/commands/firmwareUpdate.js +154 -0
  98. package/lib/commands/firmwareUpdate.js.map +1 -0
  99. package/lib/commands/generateAppJsonFromDataset.d.ts +7 -0
  100. package/lib/commands/generateAppJsonFromDataset.d.ts.map +1 -0
  101. package/lib/commands/generateAppJsonFromDataset.js +212 -0
  102. package/lib/commands/generateAppJsonFromDataset.js.map +1 -0
  103. package/lib/commands/generateTestScanAccounts.d.ts +49 -0
  104. package/lib/commands/generateTestScanAccounts.d.ts.map +1 -0
  105. package/lib/commands/generateTestScanAccounts.js +60 -0
  106. package/lib/commands/generateTestScanAccounts.js.map +1 -0
  107. package/lib/commands/generateTestTransaction.d.ts +44 -0
  108. package/lib/commands/generateTestTransaction.d.ts.map +1 -0
  109. package/lib/commands/generateTestTransaction.js +118 -0
  110. package/lib/commands/generateTestTransaction.js.map +1 -0
  111. package/lib/commands/genuineCheck.d.ts +15 -0
  112. package/lib/commands/genuineCheck.d.ts.map +1 -0
  113. package/lib/commands/genuineCheck.js +22 -0
  114. package/lib/commands/genuineCheck.js.map +1 -0
  115. package/lib/commands/getAddress.d.ts +28 -0
  116. package/lib/commands/getAddress.d.ts.map +1 -0
  117. package/lib/commands/getAddress.js +53 -0
  118. package/lib/commands/getAddress.js.map +1 -0
  119. package/lib/commands/getTransactionStatus.d.ts +52 -0
  120. package/lib/commands/getTransactionStatus.d.ts.map +1 -0
  121. package/lib/commands/getTransactionStatus.js +86 -0
  122. package/lib/commands/getTransactionStatus.js.map +1 -0
  123. package/lib/commands/liveData.d.ts +49 -0
  124. package/lib/commands/liveData.d.ts.map +1 -0
  125. package/lib/commands/liveData.js +82 -0
  126. package/lib/commands/liveData.js.map +1 -0
  127. package/lib/commands/makeCompoundSummary.d.ts +54 -0
  128. package/lib/commands/makeCompoundSummary.d.ts.map +1 -0
  129. package/lib/commands/makeCompoundSummary.js +190 -0
  130. package/lib/commands/makeCompoundSummary.js.map +1 -0
  131. package/lib/commands/managerListApps.d.ts +21 -0
  132. package/lib/commands/managerListApps.d.ts.map +1 -0
  133. package/lib/commands/managerListApps.js +47 -0
  134. package/lib/commands/managerListApps.js.map +1 -0
  135. package/lib/commands/portfolio.d.ts +66 -0
  136. package/lib/commands/portfolio.d.ts.map +1 -0
  137. package/lib/commands/portfolio.js +138 -0
  138. package/lib/commands/portfolio.js.map +1 -0
  139. package/lib/commands/proxy.d.ts +36 -0
  140. package/lib/commands/proxy.d.ts.map +1 -0
  141. package/lib/commands/proxy.js +413 -0
  142. package/lib/commands/proxy.js.map +1 -0
  143. package/lib/commands/receive.d.ts +48 -0
  144. package/lib/commands/receive.d.ts.map +1 -0
  145. package/lib/commands/receive.js +68 -0
  146. package/lib/commands/receive.js.map +1 -0
  147. package/lib/commands/repl.d.ts +22 -0
  148. package/lib/commands/repl.d.ts.map +1 -0
  149. package/lib/commands/repl.js +26 -0
  150. package/lib/commands/repl.js.map +1 -0
  151. package/lib/commands/satstack.d.ts +37 -0
  152. package/lib/commands/satstack.d.ts.map +1 -0
  153. package/lib/commands/satstack.js +110 -0
  154. package/lib/commands/satstack.js.map +1 -0
  155. package/lib/commands/satstackStatus.d.ts +13 -0
  156. package/lib/commands/satstackStatus.d.ts.map +1 -0
  157. package/lib/commands/satstackStatus.js +24 -0
  158. package/lib/commands/satstackStatus.js.map +1 -0
  159. package/lib/commands/scanDescriptors.d.ts +15 -0
  160. package/lib/commands/scanDescriptors.d.ts.map +1 -0
  161. package/lib/commands/scanDescriptors.js +18 -0
  162. package/lib/commands/scanDescriptors.js.map +1 -0
  163. package/lib/commands/send.d.ts +48 -0
  164. package/lib/commands/send.d.ts.map +1 -0
  165. package/lib/commands/send.js +116 -0
  166. package/lib/commands/send.js.map +1 -0
  167. package/lib/commands/signMessage.d.ts +16 -0
  168. package/lib/commands/signMessage.d.ts.map +1 -0
  169. package/lib/commands/signMessage.js +58 -0
  170. package/lib/commands/signMessage.js.map +1 -0
  171. package/lib/commands/speculosList.d.ts +7 -0
  172. package/lib/commands/speculosList.d.ts.map +1 -0
  173. package/lib/commands/speculosList.js +71 -0
  174. package/lib/commands/speculosList.js.map +1 -0
  175. package/lib/commands/swap.d.ts +55 -0
  176. package/lib/commands/swap.d.ts.map +1 -0
  177. package/lib/commands/swap.js +341 -0
  178. package/lib/commands/swap.js.map +1 -0
  179. package/lib/commands/sync.d.ts +49 -0
  180. package/lib/commands/sync.d.ts.map +1 -0
  181. package/lib/commands/sync.js +135 -0
  182. package/lib/commands/sync.js.map +1 -0
  183. package/lib/commands/testDetectOpCollision.d.ts +41 -0
  184. package/lib/commands/testDetectOpCollision.d.ts.map +1 -0
  185. package/lib/commands/testDetectOpCollision.js +57 -0
  186. package/lib/commands/testDetectOpCollision.js.map +1 -0
  187. package/lib/commands/testGetTrustedInputFromTxHash.d.ts +23 -0
  188. package/lib/commands/testGetTrustedInputFromTxHash.d.ts.map +1 -0
  189. package/lib/commands/testGetTrustedInputFromTxHash.js +114 -0
  190. package/lib/commands/testGetTrustedInputFromTxHash.js.map +1 -0
  191. package/lib/commands/user.d.ts +6 -0
  192. package/lib/commands/user.d.ts.map +1 -0
  193. package/lib/commands/user.js +9 -0
  194. package/lib/commands/user.js.map +1 -0
  195. package/lib/commands/version.d.ts +7 -0
  196. package/lib/commands/version.d.ts.map +1 -0
  197. package/lib/commands/version.js +12 -0
  198. package/lib/commands/version.js.map +1 -0
  199. package/lib/commands/walletconnect.d.ts +62 -0
  200. package/lib/commands/walletconnect.d.ts.map +1 -0
  201. package/lib/commands/walletconnect.js +272 -0
  202. package/lib/commands/walletconnect.js.map +1 -0
  203. package/lib/commands-index.d.ts +1511 -0
  204. package/lib/commands-index.d.ts.map +1 -0
  205. package/lib/commands-index.js +106 -0
  206. package/lib/commands-index.js.map +1 -0
  207. package/lib/live-common-setup-base.d.ts +2 -0
  208. package/lib/live-common-setup-base.d.ts.map +1 -0
  209. package/lib/live-common-setup-base.js +131 -0
  210. package/lib/live-common-setup-base.js.map +1 -0
  211. package/lib/live-common-setup.d.ts +5 -0
  212. package/lib/live-common-setup.d.ts.map +1 -0
  213. package/lib/live-common-setup.js +318 -0
  214. package/lib/live-common-setup.js.map +1 -0
  215. package/lib/qr.d.ts +3 -0
  216. package/lib/qr.d.ts.map +1 -0
  217. package/lib/qr.js +18 -0
  218. package/lib/qr.js.map +1 -0
  219. package/lib/scan.d.ts +71 -0
  220. package/lib/scan.d.ts.map +1 -0
  221. package/lib/scan.js +299 -0
  222. package/lib/scan.js.map +1 -0
  223. package/lib/signedOperation.d.ts +13 -0
  224. package/lib/signedOperation.d.ts.map +1 -0
  225. package/lib/signedOperation.js +31 -0
  226. package/lib/signedOperation.js.map +1 -0
  227. package/lib/stream.d.ts +7 -0
  228. package/lib/stream.d.ts.map +1 -0
  229. package/lib/stream.js +82 -0
  230. package/lib/stream.js.map +1 -0
  231. package/lib/transaction.d.ts +31 -0
  232. package/lib/transaction.d.ts.map +1 -0
  233. package/lib/transaction.js +202 -0
  234. package/lib/transaction.js.map +1 -0
  235. package/package.json +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../src/commands/signMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;eA2Ba,GAAG;;AArBhB,wBAsCE"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ exports.__esModule = true;
17
+ var rxjs_1 = require("rxjs");
18
+ var operators_1 = require("rxjs/operators");
19
+ var derivation_1 = require("@ledgerhq/live-common/lib/derivation");
20
+ var deviceAccess_1 = require("@ledgerhq/live-common/lib/hw/deviceAccess");
21
+ var signMessage_1 = __importDefault(require("@ledgerhq/live-common/lib/hw/signMessage"));
22
+ var scan_1 = require("../scan");
23
+ exports["default"] = {
24
+ description: "Sign a message with the device on specific derivations (advanced)",
25
+ args: [
26
+ scan_1.currencyOpt,
27
+ {
28
+ name: "path",
29
+ type: String,
30
+ desc: "HDD derivation path"
31
+ },
32
+ {
33
+ name: "derivationMode",
34
+ type: String,
35
+ desc: "derivationMode to use"
36
+ },
37
+ {
38
+ name: "message",
39
+ type: String,
40
+ desc: "the message to sign"
41
+ },
42
+ ],
43
+ job: function (arg) {
44
+ return (0, scan_1.inferCurrency)(arg).pipe((0, operators_1.mergeMap)(function (currency) {
45
+ if (!currency) {
46
+ throw new Error("no currency provided");
47
+ }
48
+ if (!arg.path) {
49
+ throw new Error("--path is required");
50
+ }
51
+ (0, derivation_1.asDerivationMode)(arg.derivationMode);
52
+ return (0, deviceAccess_1.withDevice)(arg.device || "")(function (t) {
53
+ return (0, rxjs_1.from)((0, signMessage_1["default"])(t, __assign(__assign({}, arg), { currency: currency })));
54
+ });
55
+ }));
56
+ }
57
+ };
58
+ //# sourceMappingURL=signMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../src/commands/signMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,4CAA0C;AAC1C,mEAAwE;AACxE,0EAAuE;AACvE,yFAAmE;AACnE,gCAAqD;AACrD,qBAAe;IACb,WAAW,EACT,mEAAmE;IACrE,IAAI,EAAE;QACJ,kBAAW;QACX;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;SAC5B;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,uBAAuB;SAC9B;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;SAC5B;KACF;IACD,GAAG,EAAE,UAAC,GAAQ;QACZ,OAAA,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,IAAI,CACrB,IAAA,oBAAQ,EAAC,UAAC,QAAQ;YAChB,IAAI,CAAC,QAAQ,EAAE;gBACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;aACzC;YAED,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;gBACb,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;aACvC;YAED,IAAA,6BAAgB,EAAC,GAAG,CAAC,cAAc,CAAC,CAAC;YACrC,OAAO,IAAA,yBAAU,EAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,UAAC,CAAC;gBACpC,OAAA,IAAA,WAAI,EAAC,IAAA,wBAAW,EAAC,CAAC,wBAAO,GAAG,KAAE,QAAQ,UAAA,IAAG,CAAC;YAA1C,CAA0C,CAC3C,CAAC;QACJ,CAAC,CAAC,CACH;IAfD,CAeC;CACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ description: string;
3
+ args: never[];
4
+ job: () => import("rxjs").Observable<string>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=speculosList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speculosList.d.ts","sourceRoot":"","sources":["../../src/commands/speculosList.ts"],"names":[],"mappings":";;;;;AAOA,wBAYE"}
@@ -0,0 +1,71 @@
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 rxjs_1 = require("rxjs");
43
+ var env_1 = require("@ledgerhq/live-common/lib/env");
44
+ var speculos_1 = require("@ledgerhq/live-common/lib/load/speculos");
45
+ var formatters_1 = require("@ledgerhq/live-common/lib/bot/formatters");
46
+ var invariant_1 = __importDefault(require("invariant"));
47
+ var operators_1 = require("rxjs/operators");
48
+ exports["default"] = {
49
+ description: "list apps available for speculos",
50
+ args: [],
51
+ job: function () {
52
+ function main() {
53
+ return __awaiter(this, void 0, void 0, function () {
54
+ var coinapps, candidates;
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0:
58
+ coinapps = (0, env_1.getEnv)("COINAPPS");
59
+ (0, invariant_1["default"])(coinapps, "COINAPPS is not set");
60
+ return [4 /*yield*/, (0, speculos_1.listAppCandidates)(coinapps)];
61
+ case 1:
62
+ candidates = _a.sent();
63
+ return [2 /*return*/, candidates.map(formatters_1.formatAppCandidate)];
64
+ }
65
+ });
66
+ });
67
+ }
68
+ return (0, rxjs_1.from)(main()).pipe((0, operators_1.mergeAll)());
69
+ }
70
+ };
71
+ //# sourceMappingURL=speculosList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speculosList.js","sourceRoot":"","sources":["../../src/commands/speculosList.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAC5B,qDAAuD;AACvD,oEAA4E;AAC5E,uEAA8E;AAC9E,wDAAkC;AAClC,4CAA0C;AAE1C,qBAAe;IACb,WAAW,EAAE,kCAAkC;IAC/C,IAAI,EAAE,EAAE;IACR,GAAG,EAAE;QACH,SAAe,IAAI;;;;;;4BACX,QAAQ,GAAG,IAAA,YAAM,EAAC,UAAU,CAAC,CAAC;4BACpC,IAAA,sBAAS,EAAC,QAAQ,EAAE,qBAAqB,CAAC,CAAC;4BACxB,qBAAM,IAAA,4BAAiB,EAAC,QAAQ,CAAC,EAAA;;4BAA9C,UAAU,GAAG,SAAiC;4BACpD,sBAAO,UAAU,CAAC,GAAG,CAAC,+BAAkB,CAAC,EAAC;;;;SAC3C;QACD,OAAO,IAAA,WAAI,EAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAA,oBAAQ,GAAE,CAAC,CAAC;IACvC,CAAC;CACF,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { ScanCommonOpts } from "../scan";
2
+ declare type SwapJobOpts = ScanCommonOpts & {
3
+ amount: string;
4
+ useAllAmount: boolean;
5
+ useFloat: boolean;
6
+ wyreUserId?: string;
7
+ _unknown: any;
8
+ deviceId: string;
9
+ tokenId: string;
10
+ };
11
+ declare const _default: {
12
+ description: string;
13
+ args: ({
14
+ name: string;
15
+ alias: string;
16
+ type: StringConstructor;
17
+ desc: string;
18
+ } | {
19
+ name: string;
20
+ type: StringConstructor;
21
+ desc: string;
22
+ multiple: boolean;
23
+ typeDesc?: undefined;
24
+ alias?: undefined;
25
+ } | {
26
+ name: string;
27
+ type: StringConstructor;
28
+ typeDesc: string;
29
+ desc: string;
30
+ multiple?: undefined;
31
+ alias?: undefined;
32
+ } | {
33
+ name: string;
34
+ alias: string;
35
+ type: NumberConstructor;
36
+ desc: string;
37
+ multiple?: undefined;
38
+ typeDesc?: undefined;
39
+ } | {
40
+ name: string;
41
+ type: NumberConstructor;
42
+ desc: string;
43
+ multiple?: undefined;
44
+ typeDesc?: undefined;
45
+ alias?: undefined;
46
+ } | {
47
+ name: string;
48
+ alias: string;
49
+ type: BooleanConstructor;
50
+ desc: string;
51
+ })[];
52
+ job: (opts: SwapJobOpts) => import("rxjs").Observable<void>;
53
+ };
54
+ export default _default;
55
+ //# sourceMappingURL=swap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/commands/swap.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAiB9C,aAAK,WAAW,GAAG,cAAc,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAqTY,WAAW;;AA1CzB,wBA2CE"}
@@ -0,0 +1,341 @@
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 __read = (this && this.__read) || function (o, n) {
39
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
40
+ if (!m) return o;
41
+ var i = m.call(o), r, ar = [], e;
42
+ try {
43
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
+ }
45
+ catch (error) { e = { error: error }; }
46
+ finally {
47
+ try {
48
+ if (r && !r.done && (m = i["return"])) m.call(i);
49
+ }
50
+ finally { if (e) throw e.error; }
51
+ }
52
+ return ar;
53
+ };
54
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
55
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
56
+ if (ar || !(i in from)) {
57
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
58
+ ar[i] = from[i];
59
+ }
60
+ }
61
+ return to.concat(ar || Array.prototype.slice.call(from));
62
+ };
63
+ var __importDefault = (this && this.__importDefault) || function (mod) {
64
+ return (mod && mod.__esModule) ? mod : { "default": mod };
65
+ };
66
+ exports.__esModule = true;
67
+ /* eslint-disable no-console */
68
+ var operators_1 = require("rxjs/operators");
69
+ var account_1 = require("@ledgerhq/live-common/lib/account");
70
+ var cryptoassets_1 = require("@ledgerhq/cryptoassets");
71
+ var rxjs_1 = require("rxjs");
72
+ var bignumber_js_1 = require("bignumber.js");
73
+ var command_line_args_1 = __importDefault(require("command-line-args"));
74
+ var promise_1 = require("@ledgerhq/live-common/lib/promise");
75
+ var scan_1 = require("../scan");
76
+ var swap_1 = require("@ledgerhq/live-common/lib/exchange/swap");
77
+ var swap_2 = require("@ledgerhq/live-common/lib/exchange/swap");
78
+ var bridge_1 = require("@ledgerhq/live-common/lib/bridge");
79
+ var account_2 = require("@ledgerhq/live-common/lib/account");
80
+ var currencies_1 = require("@ledgerhq/live-common/lib/currencies");
81
+ var invariant_1 = __importDefault(require("invariant"));
82
+ var exec = function (opts) { return __awaiter(void 0, void 0, void 0, function () {
83
+ var amount, useAllAmount, tokenId, useFloat, _a, wyreUserId, _b, deviceId, secondAccountOpts, fromParentAccount, fromAccount, token, subAccounts, subAccount, formattedAmount, toParentAccount, toAccount, tokenId2, token, subAccounts, subAccount, bridge, transaction, amount_1, exchange, exchangeRates, exchangeRate, initSwapResult, mainFromAccount, signedOperation, operation;
84
+ return __generator(this, function (_c) {
85
+ switch (_c.label) {
86
+ case 0:
87
+ amount = opts.amount, useAllAmount = opts.useAllAmount, tokenId = opts.tokenId, useFloat = opts.useFloat, _a = opts.wyreUserId, wyreUserId = _a === void 0 ? "" : _a, _b = opts.deviceId, deviceId = _b === void 0 ? "" : _b;
88
+ (0, invariant_1["default"])(amount || useAllAmount, "\u2716 amount in satoshis is needed or --useAllAmount ");
89
+ (0, invariant_1["default"])(opts._unknown, "\u2716 second account information is missing");
90
+ (0, invariant_1["default"])(!wyreUserId || wyreUserId.length === 14, "Provider wyre user id is not valid");
91
+ secondAccountOpts = (0, command_line_args_1["default"])(__spreadArray(__spreadArray([], __read(scan_1.scanCommonOpts), false), [
92
+ {
93
+ name: "tokenId",
94
+ alias: "t",
95
+ type: String,
96
+ desc: "use a token account children of the account"
97
+ },
98
+ ], false), {
99
+ argv: opts._unknown.map(function (a, i) { return (i % 2 ? a : a.replace("_2", "")); })
100
+ });
101
+ console.log("• Open the source currency app");
102
+ return [4 /*yield*/, (0, promise_1.delay)(8000)];
103
+ case 1:
104
+ _c.sent();
105
+ fromParentAccount = null;
106
+ return [4 /*yield*/, (0, scan_1.scan)(opts)
107
+ .pipe((0, operators_1.take)(1))
108
+ .toPromise()];
109
+ case 2:
110
+ fromAccount = _c.sent();
111
+ (0, invariant_1["default"])(fromAccount, "\u2716 No account found, is the right currency app open?");
112
+ if (!fromAccount) {
113
+ throw new Error("\u2716 No account found, is the right currency app open?");
114
+ }
115
+ //Are we asking for a token account?
116
+ if (tokenId) {
117
+ token = (0, cryptoassets_1.findTokenById)(tokenId);
118
+ (0, invariant_1["default"])(token, "\u2716 No token currency found with id ".concat(tokenId));
119
+ if (!token)
120
+ throw new Error("\u2716 No token currency found with id ".concat(tokenId));
121
+ subAccounts = (0, account_1.accountWithMandatoryTokens)(fromAccount, [token]).subAccounts || [];
122
+ subAccount = subAccounts.find(function (t) {
123
+ var currency = (0, account_1.getAccountCurrency)(t);
124
+ return tokenId === currency.id;
125
+ });
126
+ // We have a token account, keep track of both now;
127
+ fromParentAccount = fromAccount;
128
+ fromAccount = subAccount;
129
+ (0, invariant_1["default"])(fromAccount, "\u2716 No account found, is the right currency app open?");
130
+ if (!fromAccount) {
131
+ throw new Error("\u2716 No account found, is the right currency app open?");
132
+ }
133
+ }
134
+ if (fromParentAccount) {
135
+ console.log("\t:parentId:\t\t", fromParentAccount.id);
136
+ }
137
+ console.log("\t:id:\t\t", fromAccount.id);
138
+ formattedAmount = (0, currencies_1.formatCurrencyUnit)((0, account_2.getAccountUnit)(fromAccount), fromAccount.balance, {
139
+ disableRounding: true,
140
+ alwaysShowSign: false,
141
+ showCode: true
142
+ });
143
+ if (fromAccount.type !== "ChildAccount") {
144
+ console.log("\t:balance:\t", fromAccount.spendableBalance.toString(), " [ ".concat(formattedAmount, " ]"));
145
+ }
146
+ (0, invariant_1["default"])(fromAccount.balance.gte(new bignumber_js_1.BigNumber(amount)), "\u2716 Not enough balance");
147
+ console.log("• Open the destination currency app");
148
+ return [4 /*yield*/, (0, promise_1.delay)(8000)];
149
+ case 3:
150
+ _c.sent();
151
+ toParentAccount = null;
152
+ return [4 /*yield*/, (0, scan_1.scan)(secondAccountOpts)
153
+ .pipe((0, operators_1.take)(1))
154
+ .toPromise()];
155
+ case 4:
156
+ toAccount = _c.sent();
157
+ (0, invariant_1["default"])(toAccount, "\u2716 No account found");
158
+ tokenId2 = secondAccountOpts.tokenId;
159
+ //Are we asking for a token account?
160
+ if (tokenId2) {
161
+ token = (0, cryptoassets_1.findTokenById)(tokenId2);
162
+ (0, invariant_1["default"])(token, "\u2716 No token currency found with id ".concat(tokenId2));
163
+ if (!token) {
164
+ throw new Error("\u2716 No token currency found with id ".concat(tokenId2));
165
+ }
166
+ subAccounts = (0, account_1.accountWithMandatoryTokens)(toAccount, [token]).subAccounts || [];
167
+ subAccount = subAccounts.find(function (t) {
168
+ var currency = (0, account_1.getAccountCurrency)(t);
169
+ return tokenId2 === currency.id;
170
+ });
171
+ // We have a token account, keep track of both now;
172
+ toParentAccount = toAccount;
173
+ toAccount = subAccount;
174
+ (0, invariant_1["default"])(fromAccount, "\u2716 No account found");
175
+ }
176
+ (0, invariant_1["default"])(toAccount, "\u2716 No account found");
177
+ if (!toAccount)
178
+ throw new Error("\u2716 No account found");
179
+ if (toParentAccount) {
180
+ console.log("\t:parentId:\t\t", toParentAccount.id);
181
+ }
182
+ console.log("\t:id:\t\t", toAccount.id);
183
+ bridge = (0, bridge_1.getAccountBridge)(fromAccount, fromParentAccount);
184
+ transaction = bridge.createTransaction((0, account_1.getMainAccount)(fromAccount, fromParentAccount));
185
+ transaction = bridge.updateTransaction(transaction, {
186
+ recipient: (0, cryptoassets_1.getAbandonSeedAddress)((0, account_1.getAccountCurrency)((0, account_1.getMainAccount)(fromAccount, fromParentAccount)).id),
187
+ subAccountId: fromParentAccount ? fromAccount.id : undefined
188
+ });
189
+ if (!!useAllAmount) return [3 /*break*/, 5];
190
+ transaction = bridge.updateTransaction(transaction, {
191
+ amount: new bignumber_js_1.BigNumber(amount)
192
+ });
193
+ return [3 /*break*/, 7];
194
+ case 5: return [4 /*yield*/, bridge.estimateMaxSpendable({
195
+ account: fromAccount,
196
+ parentAccount: fromParentAccount,
197
+ transaction: transaction
198
+ })];
199
+ case 6:
200
+ amount_1 = _c.sent();
201
+ transaction = bridge.updateTransaction(transaction, {
202
+ amount: amount_1
203
+ });
204
+ _c.label = 7;
205
+ case 7: return [4 /*yield*/, bridge.prepareTransaction((0, account_1.getMainAccount)(fromAccount, fromParentAccount), transaction)];
206
+ case 8:
207
+ transaction = _c.sent();
208
+ exchange = {
209
+ fromAccount: fromAccount,
210
+ fromParentAccount: fromParentAccount,
211
+ toAccount: toAccount,
212
+ toParentAccount: toParentAccount
213
+ };
214
+ return [4 /*yield*/, (0, swap_2.getExchangeRates)(exchange, transaction, wyreUserId)];
215
+ case 9:
216
+ exchangeRates = _c.sent();
217
+ console.log({ exchangeRates: exchangeRates });
218
+ exchangeRate = exchangeRates.find(function (er) {
219
+ if (er.tradeMethod === (useFloat ? "float" : "fixed") &&
220
+ (!wyreUserId || er.provider === "wyre")) {
221
+ return true;
222
+ }
223
+ return false;
224
+ });
225
+ (0, invariant_1["default"])(exchangeRate, "\u2716 No valid rate available");
226
+ console.log("Using first ".concat(useFloat ? "float" : "fixed", " rate:\n"), exchangeRate);
227
+ console.log({
228
+ transaction: transaction,
229
+ amount: transaction.amount.toString()
230
+ });
231
+ console.log("• Open the Exchange app");
232
+ return [4 /*yield*/, (0, promise_1.delay)(8000)];
233
+ case 10:
234
+ _c.sent();
235
+ return [4 /*yield*/, (0, swap_1.initSwap)({
236
+ exchange: exchange,
237
+ exchangeRate: exchangeRate,
238
+ transaction: transaction,
239
+ deviceId: deviceId,
240
+ userId: wyreUserId
241
+ })
242
+ .pipe((0, operators_1.tap)(function (e) {
243
+ switch (e.type) {
244
+ case "init-swap-requested":
245
+ console.log("• Confirm swap operation on your device");
246
+ break;
247
+ case "init-swap-error":
248
+ console.log(e);
249
+ (0, invariant_1["default"])(false, "Something went wrong confirming the swap");
250
+ // $FlowFixMe
251
+ break;
252
+ case "init-swap-result":
253
+ console.log(e);
254
+ }
255
+ if (e.type === "init-swap-requested")
256
+ console.log("• Confirm swap operation on your device");
257
+ }), (0, operators_1.filter)(function (e) { return e.type === "init-swap-result"; }), (0, operators_1.map)(function (e) {
258
+ if (e.type === "init-swap-result") {
259
+ return e.initSwapResult;
260
+ }
261
+ }))
262
+ .toPromise()];
263
+ case 11:
264
+ initSwapResult = _c.sent();
265
+ transaction = initSwapResult.transaction;
266
+ console.log("Device app switch & silent signing");
267
+ return [4 /*yield*/, (0, promise_1.delay)(8000)];
268
+ case 12:
269
+ _c.sent();
270
+ mainFromAccount = (0, account_1.getMainAccount)(fromAccount, fromParentAccount);
271
+ return [4 /*yield*/, bridge
272
+ .signOperation({
273
+ account: mainFromAccount,
274
+ deviceId: deviceId,
275
+ transaction: transaction
276
+ })
277
+ .pipe((0, operators_1.tap)(function (e) { return console.log(e); }), (0, operators_1.first)(function (e) { return e.type === "signed"; }), (0, operators_1.map)(function (e) {
278
+ if (e.type === "signed") {
279
+ return e.signedOperation;
280
+ }
281
+ }))
282
+ .toPromise()];
283
+ case 13:
284
+ signedOperation = _c.sent();
285
+ console.log("Broadcasting");
286
+ return [4 /*yield*/, bridge.broadcast({
287
+ account: mainFromAccount,
288
+ signedOperation: signedOperation
289
+ })];
290
+ case 14:
291
+ operation = _c.sent();
292
+ console.log({
293
+ operation: operation
294
+ });
295
+ return [2 /*return*/];
296
+ }
297
+ });
298
+ }); };
299
+ exports["default"] = {
300
+ description: "Perform an arbitrary swap between two currencies on the same seed",
301
+ args: __spreadArray([
302
+ {
303
+ name: "mock",
304
+ alias: "m",
305
+ type: Boolean,
306
+ desc: "Whether or not to use the real backend or a mocked version"
307
+ },
308
+ {
309
+ name: "amount",
310
+ alias: "a",
311
+ type: Number,
312
+ desc: "Amount in satoshi units to send"
313
+ },
314
+ {
315
+ name: "useAllAmount",
316
+ alias: "u",
317
+ type: Boolean,
318
+ desc: "Attempt to send all using the emulated max amount calculation"
319
+ },
320
+ {
321
+ name: "wyreUserId",
322
+ alias: "w",
323
+ type: String,
324
+ desc: "If provided, will attempt to use Wyre provider with given userId"
325
+ },
326
+ {
327
+ name: "tokenId",
328
+ alias: "t",
329
+ type: String,
330
+ desc: "Use a token account children of the account"
331
+ },
332
+ {
333
+ name: "useFloat",
334
+ alias: "f",
335
+ type: Boolean,
336
+ desc: "Use first floating rate returned. Defaults to false."
337
+ }
338
+ ], __read(scan_1.scanCommonOpts), false),
339
+ job: function (opts) { return (0, rxjs_1.from)(exec(opts)); }
340
+ };
341
+ //# sourceMappingURL=swap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swap.js","sourceRo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EAAA;;gBAHI,SAAS,GAAG,SAGhB;gBACF,OAAO,CAAC,GAAG,CAAC;oBACV,SAAS,WAAA;iBACV,CAAC,CAAC;;;;KACJ,CAAC;AAEF,qBAAe;IACb,WAAW,EACT,mEAAmE;IACrE,IAAI;QACF;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,4DAA4D;SACnE;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,iCAAiC;SACxC;QACD;YACE,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,+DAA+D;SACtE;QACD;YACE,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,kEAAkE;SACzE;QACD;YACE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,6CAA6C;SACpD;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,sDAAsD;SAC7D;cACE,qBAAc,SAClB;IACD,GAAG,EAAE,UAAC,IAAiB,IAAK,OAAA,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAhB,CAAgB;CAC7C,CAAC"}
@@ -0,0 +1,49 @@
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: StringConstructor;
41
+ typeDesc: string;
42
+ desc: string;
43
+ })[];
44
+ job: (opts: ScanCommonOpts & {
45
+ format: string;
46
+ }) => import("rxjs").Observable<any>;
47
+ };
48
+ export default _default;
49
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAcpC,cAAc,GAAG;QACrB,MAAM,EAAE,MAAM,CAAC;KAChB;;AAfL,wBA6CE"}