@ledgerhq/live-cli 24.11.0 → 24.11.1-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 (152) hide show
  1. package/lib/cli.js +33 -63
  2. package/lib/cli.js.map +1 -1
  3. package/lib/commands/blockchain/bot.js +7 -7
  4. package/lib/commands/blockchain/bot.js.map +1 -1
  5. package/lib/commands/blockchain/botPortfolio.js +22 -26
  6. package/lib/commands/blockchain/botPortfolio.js.map +1 -1
  7. package/lib/commands/blockchain/botTransfer.js +219 -392
  8. package/lib/commands/blockchain/botTransfer.js.map +1 -1
  9. package/lib/commands/blockchain/broadcast.js +11 -42
  10. package/lib/commands/blockchain/broadcast.js.map +1 -1
  11. package/lib/commands/blockchain/confirmOp.js +12 -52
  12. package/lib/commands/blockchain/confirmOp.js.map +1 -1
  13. package/lib/commands/blockchain/derivation.js +31 -33
  14. package/lib/commands/blockchain/derivation.js.map +1 -1
  15. package/lib/commands/blockchain/estimateMaxSpendable.js +27 -56
  16. package/lib/commands/blockchain/estimateMaxSpendable.js.map +1 -1
  17. package/lib/commands/blockchain/generateTestScanAccounts.js +29 -37
  18. package/lib/commands/blockchain/generateTestScanAccounts.js.map +1 -1
  19. package/lib/commands/blockchain/generateTestTransaction.js +70 -96
  20. package/lib/commands/blockchain/generateTestTransaction.js.map +1 -1
  21. package/lib/commands/blockchain/getAddress.js +20 -24
  22. package/lib/commands/blockchain/getAddress.js.map +1 -1
  23. package/lib/commands/blockchain/getTransactionStatus.js +31 -69
  24. package/lib/commands/blockchain/getTransactionStatus.js.map +1 -1
  25. package/lib/commands/blockchain/receive.js +14 -42
  26. package/lib/commands/blockchain/receive.js.map +1 -1
  27. package/lib/commands/blockchain/satstack.js +30 -33
  28. package/lib/commands/blockchain/satstack.js.map +1 -1
  29. package/lib/commands/blockchain/satstackStatus.js +4 -5
  30. package/lib/commands/blockchain/satstackStatus.js.map +1 -1
  31. package/lib/commands/blockchain/scanDescriptors.js +8 -14
  32. package/lib/commands/blockchain/scanDescriptors.js.map +1 -1
  33. package/lib/commands/blockchain/send.js +61 -90
  34. package/lib/commands/blockchain/send.js.map +1 -1
  35. package/lib/commands/blockchain/signMessage.d.ts +1 -1
  36. package/lib/commands/blockchain/signMessage.js +15 -40
  37. package/lib/commands/blockchain/signMessage.js.map +1 -1
  38. package/lib/commands/blockchain/sync.js +27 -120
  39. package/lib/commands/blockchain/sync.js.map +1 -1
  40. package/lib/commands/blockchain/testDetectOpCollision.js +15 -48
  41. package/lib/commands/blockchain/testDetectOpCollision.js.map +1 -1
  42. package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js +37 -86
  43. package/lib/commands/blockchain/testGetTrustedInputFromTxHash.js.map +1 -1
  44. package/lib/commands/device/app.js +42 -76
  45. package/lib/commands/device/app.js.map +1 -1
  46. package/lib/commands/device/appUninstallAll.d.ts +1 -1
  47. package/lib/commands/device/appUninstallAll.js +22 -29
  48. package/lib/commands/device/appUninstallAll.js.map +1 -1
  49. package/lib/commands/device/appsCheckAllAppVersions.js +208 -361
  50. package/lib/commands/device/appsCheckAllAppVersions.js.map +1 -1
  51. package/lib/commands/device/appsInstallAll.js +15 -24
  52. package/lib/commands/device/appsInstallAll.js.map +1 -1
  53. package/lib/commands/device/appsUpdateTestAll.js +69 -80
  54. package/lib/commands/device/appsUpdateTestAll.js.map +1 -1
  55. package/lib/commands/device/cleanSpeculos.js +4 -4
  56. package/lib/commands/device/cleanSpeculos.js.map +1 -1
  57. package/lib/commands/device/customLockScreenFetch.js +37 -84
  58. package/lib/commands/device/customLockScreenFetch.js.map +1 -1
  59. package/lib/commands/device/customLockScreenFetchAndRestore.js +46 -110
  60. package/lib/commands/device/customLockScreenFetchAndRestore.js.map +1 -1
  61. package/lib/commands/device/customLockScreenFetchHash.js +5 -7
  62. package/lib/commands/device/customLockScreenFetchHash.js.map +1 -1
  63. package/lib/commands/device/customLockScreenLoad.js +25 -72
  64. package/lib/commands/device/customLockScreenLoad.js.map +1 -1
  65. package/lib/commands/device/customLockScreenRemove.js +5 -7
  66. package/lib/commands/device/customLockScreenRemove.js.map +1 -1
  67. package/lib/commands/device/devDeviceAppsScenario.js +33 -65
  68. package/lib/commands/device/devDeviceAppsScenario.js.map +1 -1
  69. package/lib/commands/device/deviceAppVersion.js +5 -8
  70. package/lib/commands/device/deviceAppVersion.js.map +1 -1
  71. package/lib/commands/device/deviceInfo.js +5 -8
  72. package/lib/commands/device/deviceInfo.js.map +1 -1
  73. package/lib/commands/device/deviceSDKFirmwareUpdate.js +22 -68
  74. package/lib/commands/device/deviceSDKFirmwareUpdate.js.map +1 -1
  75. package/lib/commands/device/deviceSDKGetBatteryStatuses.js +7 -8
  76. package/lib/commands/device/deviceSDKGetBatteryStatuses.js.map +1 -1
  77. package/lib/commands/device/deviceSDKGetDeviceInfo.js +6 -7
  78. package/lib/commands/device/deviceSDKGetDeviceInfo.js.map +1 -1
  79. package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js +8 -9
  80. package/lib/commands/device/deviceSDKToggleOnboardingEarlyCheck.js.map +1 -1
  81. package/lib/commands/device/deviceVersion.js +5 -8
  82. package/lib/commands/device/deviceVersion.js.map +1 -1
  83. package/lib/commands/device/discoverDevices.js +15 -50
  84. package/lib/commands/device/discoverDevices.js.map +1 -1
  85. package/lib/commands/device/firmwareRepair.js +3 -6
  86. package/lib/commands/device/firmwareRepair.js.map +1 -1
  87. package/lib/commands/device/firmwareUpdate.js +63 -123
  88. package/lib/commands/device/firmwareUpdate.js.map +1 -1
  89. package/lib/commands/device/genuineCheck.js +7 -12
  90. package/lib/commands/device/genuineCheck.js.map +1 -1
  91. package/lib/commands/device/getBatteryStatus.js +5 -9
  92. package/lib/commands/device/getBatteryStatus.js.map +1 -1
  93. package/lib/commands/device/getDeviceRunningMode.js +7 -10
  94. package/lib/commands/device/getDeviceRunningMode.js.map +1 -1
  95. package/lib/commands/device/i18n.js +27 -79
  96. package/lib/commands/device/i18n.js.map +1 -1
  97. package/lib/commands/device/listApps.d.ts +1 -1
  98. package/lib/commands/device/listApps.js +7 -12
  99. package/lib/commands/device/listApps.js.map +1 -1
  100. package/lib/commands/device/managerListApps.js +21 -28
  101. package/lib/commands/device/managerListApps.js.map +1 -1
  102. package/lib/commands/device/proxy.js +242 -350
  103. package/lib/commands/device/proxy.js.map +1 -1
  104. package/lib/commands/device/reinstallConfigurationConsent.js +36 -126
  105. package/lib/commands/device/reinstallConfigurationConsent.js.map +1 -1
  106. package/lib/commands/device/repl.js +5 -10
  107. package/lib/commands/device/repl.js.map +1 -1
  108. package/lib/commands/device/speculosList.js +12 -58
  109. package/lib/commands/device/speculosList.js.map +1 -1
  110. package/lib/commands/live/balanceHistory.js +44 -79
  111. package/lib/commands/live/balanceHistory.js.map +1 -1
  112. package/lib/commands/live/countervalues.js +111 -207
  113. package/lib/commands/live/countervalues.js.map +1 -1
  114. package/lib/commands/live/envs.js +4 -6
  115. package/lib/commands/live/envs.js.map +1 -1
  116. package/lib/commands/live/exportAccounts.js +30 -56
  117. package/lib/commands/live/exportAccounts.js.map +1 -1
  118. package/lib/commands/live/ledgerKeyRingProtocol.d.ts +1 -1
  119. package/lib/commands/live/ledgerKeyRingProtocol.js +63 -103
  120. package/lib/commands/live/ledgerKeyRingProtocol.js.map +1 -1
  121. package/lib/commands/live/ledgerSync.js +20 -60
  122. package/lib/commands/live/ledgerSync.js.map +1 -1
  123. package/lib/commands/live/liveData.js +34 -60
  124. package/lib/commands/live/liveData.js.map +1 -1
  125. package/lib/commands/live/portfolio.js +68 -98
  126. package/lib/commands/live/portfolio.js.map +1 -1
  127. package/lib/commands/live/synchronousOnboarding.js +6 -9
  128. package/lib/commands/live/synchronousOnboarding.js.map +1 -1
  129. package/lib/commands/live/user.js +4 -4
  130. package/lib/commands/live/user.js.map +1 -1
  131. package/lib/commands/live/version.js +2 -4
  132. package/lib/commands/live/version.js.map +1 -1
  133. package/lib/commands/ptx/swap.js +194 -282
  134. package/lib/commands/ptx/swap.js.map +1 -1
  135. package/lib/commands-index.d.ts +9 -9
  136. package/lib/commands-index.js +64 -64
  137. package/lib/commands-index.js.map +1 -1
  138. package/lib/live-common-setup-base.js +26 -48
  139. package/lib/live-common-setup-base.js.map +1 -1
  140. package/lib/live-common-setup.js +66 -123
  141. package/lib/live-common-setup.js.map +1 -1
  142. package/lib/qr.js +6 -10
  143. package/lib/qr.js.map +1 -1
  144. package/lib/scan.js +84 -92
  145. package/lib/scan.js.map +1 -1
  146. package/lib/signedOperation.js +6 -6
  147. package/lib/signedOperation.js.map +1 -1
  148. package/lib/stream.js +57 -68
  149. package/lib/stream.js.map +1 -1
  150. package/lib/transaction.js +60 -142
  151. package/lib/transaction.js.map +1 -1
  152. package/package.json +2 -2
@@ -1,293 +1,204 @@
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
- }
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
4
  };
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);
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable no-console */
7
+ const operators_1 = require("rxjs/operators");
8
+ const index_1 = require("@ledgerhq/live-common/account/index");
9
+ const cryptoassets_1 = require("@ledgerhq/cryptoassets");
10
+ const rxjs_1 = require("rxjs");
11
+ const bignumber_js_1 = require("bignumber.js");
12
+ const command_line_args_1 = __importDefault(require("command-line-args"));
13
+ const promise_1 = require("@ledgerhq/live-common/promise");
14
+ const scan_1 = require("../../scan");
15
+ const index_2 = require("@ledgerhq/live-common/exchange/swap/index");
16
+ const index_3 = require("@ledgerhq/live-common/bridge/index");
17
+ const index_4 = require("@ledgerhq/live-common/currencies/index");
18
+ const invariant_1 = __importDefault(require("invariant"));
19
+ const exec = async (opts) => {
20
+ const { amount, useAllAmount, tokenId, useFloat, deviceId = "" } = opts;
21
+ (0, invariant_1.default)(amount || useAllAmount, `✖ amount in satoshis is needed or --useAllAmount `);
22
+ (0, invariant_1.default)(opts._unknown, `✖ second account information is missing`);
23
+ //Remove suffix from arguments before passing them to sync.
24
+ const secondAccountOpts = (0, command_line_args_1.default)([
25
+ ...scan_1.scanCommonOpts,
26
+ {
27
+ name: "tokenId",
28
+ alias: "t",
29
+ type: String,
30
+ desc: "use a token account children of the account",
31
+ },
32
+ ], {
33
+ argv: opts._unknown.map((a, i) => (i % 2 ? a : a.replace("_2", ""))),
34
+ });
35
+ console.log("• Open the source currency app");
36
+ await (0, promise_1.delay)(8000);
37
+ let fromParentAccount = null;
38
+ let fromAccount = await (0, rxjs_1.firstValueFrom)((0, scan_1.scan)(opts).pipe((0, operators_1.take)(1)));
39
+ (0, invariant_1.default)(fromAccount, `✖ No account found, is the right currency app open?`);
40
+ if (!fromAccount) {
41
+ throw new Error(`✖ No account found, is the right currency app open?`);
44
42
  }
45
- catch (error) { e = { error: error }; }
46
- finally {
47
- try {
48
- if (r && !r.done && (m = i["return"])) m.call(i);
43
+ //Are we asking for a token account?
44
+ if (tokenId) {
45
+ const token = (0, cryptoassets_1.findTokenById)(tokenId);
46
+ (0, invariant_1.default)(token, `✖ No token currency found with id ${tokenId}`);
47
+ if (!token)
48
+ throw new Error(`✖ No token currency found with id ${tokenId}`);
49
+ const subAccounts = (0, index_1.accountWithMandatoryTokens)(fromAccount, [token]).subAccounts || [];
50
+ const subAccount = subAccounts.find(t => {
51
+ const currency = (0, index_1.getAccountCurrency)(t);
52
+ return tokenId === currency.id;
53
+ });
54
+ // We have a token account, keep track of both now;
55
+ fromParentAccount = fromAccount;
56
+ fromAccount = subAccount;
57
+ (0, invariant_1.default)(fromAccount, `✖ No account found, is the right currency app open?`);
58
+ if (!fromAccount) {
59
+ throw new Error(`✖ No account found, is the right currency app open?`);
49
60
  }
50
- finally { if (e) throw e.error; }
51
61
  }
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];
62
+ if (fromParentAccount) {
63
+ console.log("\t:parentId:\t\t", fromParentAccount.id);
64
+ }
65
+ console.log("\t:id:\t\t", fromAccount.id);
66
+ const formattedAmount = (0, index_4.formatCurrencyUnit)((0, index_1.getAccountCurrency)(fromAccount).units[0], fromAccount.balance, {
67
+ disableRounding: true,
68
+ alwaysShowSign: false,
69
+ showCode: true,
70
+ });
71
+ console.log("\t:balance:\t", fromAccount.spendableBalance.toString(), ` [ ${formattedAmount} ]`);
72
+ (0, invariant_1.default)(fromAccount.balance.gte(new bignumber_js_1.BigNumber(amount)), `✖ Not enough balance`);
73
+ console.log("• Open the destination currency app");
74
+ await (0, promise_1.delay)(8000);
75
+ let toParentAccount = null;
76
+ let toAccount = await (0, rxjs_1.firstValueFrom)((0, scan_1.scan)(secondAccountOpts).pipe((0, operators_1.take)(1)));
77
+ if (!toAccount) {
78
+ throw new Error(`✖ No account found`);
79
+ }
80
+ const { tokenId: tokenId2 } = secondAccountOpts;
81
+ //Are we asking for a token account?
82
+ if (tokenId2) {
83
+ const token = (0, cryptoassets_1.findTokenById)(tokenId2);
84
+ if (!token) {
85
+ throw new Error(`✖ No token currency found with id ${tokenId2}`);
59
86
  }
87
+ const subAccounts = (0, index_1.accountWithMandatoryTokens)(toAccount, [token]).subAccounts || [];
88
+ const subAccount = subAccounts.find(t => {
89
+ const currency = (0, index_1.getAccountCurrency)(t);
90
+ return tokenId2 === currency.id;
91
+ });
92
+ // We have a token account, keep track of both now;
93
+ toParentAccount = toAccount;
94
+ toAccount = subAccount;
95
+ (0, invariant_1.default)(fromAccount, `✖ No account found`);
60
96
  }
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
- Object.defineProperty(exports, "__esModule", { value: true });
67
- /* eslint-disable no-console */
68
- var operators_1 = require("rxjs/operators");
69
- var index_1 = require("@ledgerhq/live-common/account/index");
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/promise");
75
- var scan_1 = require("../../scan");
76
- var index_2 = require("@ledgerhq/live-common/exchange/swap/index");
77
- var index_3 = require("@ledgerhq/live-common/bridge/index");
78
- var index_4 = require("@ledgerhq/live-common/currencies/index");
79
- var invariant_1 = __importDefault(require("invariant"));
80
- var exec = function (opts) { return __awaiter(void 0, void 0, void 0, function () {
81
- var amount, useAllAmount, tokenId, useFloat, _a, 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;
82
- return __generator(this, function (_b) {
83
- switch (_b.label) {
84
- case 0:
85
- amount = opts.amount, useAllAmount = opts.useAllAmount, tokenId = opts.tokenId, useFloat = opts.useFloat, _a = opts.deviceId, deviceId = _a === void 0 ? "" : _a;
86
- (0, invariant_1.default)(amount || useAllAmount, "\u2716 amount in satoshis is needed or --useAllAmount ");
87
- (0, invariant_1.default)(opts._unknown, "\u2716 second account information is missing");
88
- secondAccountOpts = (0, command_line_args_1.default)(__spreadArray(__spreadArray([], __read(scan_1.scanCommonOpts), false), [
89
- {
90
- name: "tokenId",
91
- alias: "t",
92
- type: String,
93
- desc: "use a token account children of the account",
94
- },
95
- ], false), {
96
- argv: opts._unknown.map(function (a, i) { return (i % 2 ? a : a.replace("_2", "")); }),
97
- });
98
- console.log("• Open the source currency app");
99
- return [4 /*yield*/, (0, promise_1.delay)(8000)];
100
- case 1:
101
- _b.sent();
102
- fromParentAccount = null;
103
- return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, scan_1.scan)(opts).pipe((0, operators_1.take)(1)))];
104
- case 2:
105
- fromAccount = _b.sent();
106
- (0, invariant_1.default)(fromAccount, "\u2716 No account found, is the right currency app open?");
107
- if (!fromAccount) {
108
- throw new Error("\u2716 No account found, is the right currency app open?");
109
- }
110
- //Are we asking for a token account?
111
- if (tokenId) {
112
- token = (0, cryptoassets_1.findTokenById)(tokenId);
113
- (0, invariant_1.default)(token, "\u2716 No token currency found with id ".concat(tokenId));
114
- if (!token)
115
- throw new Error("\u2716 No token currency found with id ".concat(tokenId));
116
- subAccounts = (0, index_1.accountWithMandatoryTokens)(fromAccount, [token]).subAccounts || [];
117
- subAccount = subAccounts.find(function (t) {
118
- var currency = (0, index_1.getAccountCurrency)(t);
119
- return tokenId === currency.id;
120
- });
121
- // We have a token account, keep track of both now;
122
- fromParentAccount = fromAccount;
123
- fromAccount = subAccount;
124
- (0, invariant_1.default)(fromAccount, "\u2716 No account found, is the right currency app open?");
125
- if (!fromAccount) {
126
- throw new Error("\u2716 No account found, is the right currency app open?");
127
- }
128
- }
129
- if (fromParentAccount) {
130
- console.log("\t:parentId:\t\t", fromParentAccount.id);
131
- }
132
- console.log("\t:id:\t\t", fromAccount.id);
133
- formattedAmount = (0, index_4.formatCurrencyUnit)((0, index_1.getAccountCurrency)(fromAccount).units[0], fromAccount.balance, {
134
- disableRounding: true,
135
- alwaysShowSign: false,
136
- showCode: true,
137
- });
138
- console.log("\t:balance:\t", fromAccount.spendableBalance.toString(), " [ ".concat(formattedAmount, " ]"));
139
- (0, invariant_1.default)(fromAccount.balance.gte(new bignumber_js_1.BigNumber(amount)), "\u2716 Not enough balance");
140
- console.log("• Open the destination currency app");
141
- return [4 /*yield*/, (0, promise_1.delay)(8000)];
142
- case 3:
143
- _b.sent();
144
- toParentAccount = null;
145
- return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, scan_1.scan)(secondAccountOpts).pipe((0, operators_1.take)(1)))];
146
- case 4:
147
- toAccount = _b.sent();
148
- if (!toAccount) {
149
- throw new Error("\u2716 No account found");
150
- }
151
- tokenId2 = secondAccountOpts.tokenId;
152
- //Are we asking for a token account?
153
- if (tokenId2) {
154
- token = (0, cryptoassets_1.findTokenById)(tokenId2);
155
- if (!token) {
156
- throw new Error("\u2716 No token currency found with id ".concat(tokenId2));
157
- }
158
- subAccounts = (0, index_1.accountWithMandatoryTokens)(toAccount, [token]).subAccounts || [];
159
- subAccount = subAccounts.find(function (t) {
160
- var currency = (0, index_1.getAccountCurrency)(t);
161
- return tokenId2 === currency.id;
162
- });
163
- // We have a token account, keep track of both now;
164
- toParentAccount = toAccount;
165
- toAccount = subAccount;
166
- (0, invariant_1.default)(fromAccount, "\u2716 No account found");
167
- }
168
- (0, invariant_1.default)(toAccount, "\u2716 No account found");
169
- if (!toAccount)
170
- throw new Error("\u2716 No account found");
171
- if (toParentAccount) {
172
- console.log("\t:parentId:\t\t", toParentAccount.id);
173
- }
174
- console.log("\t:id:\t\t", toAccount.id);
175
- bridge = (0, index_3.getAccountBridge)(fromAccount, fromParentAccount);
176
- transaction = bridge.createTransaction((0, index_1.getMainAccount)(fromAccount, fromParentAccount));
177
- transaction = bridge.updateTransaction(transaction, {
178
- recipient: (0, cryptoassets_1.getAbandonSeedAddress)((0, index_1.getAccountCurrency)((0, index_1.getMainAccount)(fromAccount, fromParentAccount)).id),
179
- subAccountId: fromParentAccount ? fromAccount.id : undefined,
180
- });
181
- if (!!useAllAmount) return [3 /*break*/, 5];
182
- transaction = bridge.updateTransaction(transaction, {
183
- amount: new bignumber_js_1.BigNumber(amount),
184
- });
185
- return [3 /*break*/, 7];
186
- case 5: return [4 /*yield*/, bridge.estimateMaxSpendable({
187
- account: fromAccount,
188
- parentAccount: fromParentAccount,
189
- transaction: transaction,
190
- })];
191
- case 6:
192
- amount_1 = _b.sent();
193
- transaction = bridge.updateTransaction(transaction, {
194
- amount: amount_1,
195
- });
196
- _b.label = 7;
197
- case 7: return [4 /*yield*/, bridge.prepareTransaction((0, index_1.getMainAccount)(fromAccount, fromParentAccount), transaction)];
198
- case 8:
199
- transaction = _b.sent();
200
- exchange = {
201
- fromAccount: fromAccount,
202
- fromParentAccount: fromParentAccount,
203
- fromCurrency: fromAccount.type === "TokenAccount" ? fromAccount.token : fromAccount.currency,
204
- toAccount: toAccount,
205
- toParentAccount: toParentAccount,
206
- toCurrency: toAccount.type === "TokenAccount" ? toAccount.token : toAccount.currency,
207
- };
208
- return [4 /*yield*/, (0, index_2.getExchangeRates)({ exchange: exchange, transaction: transaction })];
209
- case 9:
210
- exchangeRates = _b.sent();
211
- console.log({ exchangeRates: exchangeRates });
212
- exchangeRate = exchangeRates.find(function (er) {
213
- if (er.tradeMethod === (useFloat ? "float" : "fixed")) {
214
- return true;
215
- }
216
- return false;
217
- });
218
- (0, invariant_1.default)(exchangeRate, "\u2716 No valid rate available");
219
- console.log("Using first ".concat(useFloat ? "float" : "fixed", " rate:\n"), exchangeRate);
220
- console.log({
221
- transaction: transaction,
222
- amount: transaction.amount.toString(),
223
- });
224
- console.log("• Open the Exchange app");
225
- return [4 /*yield*/, (0, promise_1.delay)(8000)];
226
- case 10:
227
- _b.sent();
228
- return [4 /*yield*/, (0, rxjs_1.firstValueFrom)((0, index_2.initSwap)({
229
- exchange: exchange,
230
- exchangeRate: exchangeRate,
231
- transaction: transaction,
232
- deviceId: deviceId,
233
- }).pipe((0, operators_1.tap)(function (e) {
234
- switch (e.type) {
235
- case "init-swap-requested":
236
- console.log("• Confirm swap operation on your device");
237
- break;
238
- case "init-swap-error":
239
- console.log(e);
240
- (0, invariant_1.default)(false, "Something went wrong confirming the swap");
241
- // $FlowFixMe
242
- break;
243
- case "init-swap-result":
244
- console.log(e);
245
- }
246
- if (e.type === "init-swap-requested")
247
- console.log("• Confirm swap operation on your device");
248
- }), (0, operators_1.filter)(function (e) { return e.type === "init-swap-result"; }), (0, operators_1.map)(function (e) {
249
- if (e.type === "init-swap-result") {
250
- return e.initSwapResult;
251
- }
252
- })))];
253
- case 11:
254
- initSwapResult = _b.sent();
255
- transaction = initSwapResult.transaction;
256
- console.log("Device app switch & silent signing");
257
- return [4 /*yield*/, (0, promise_1.delay)(8000)];
258
- case 12:
259
- _b.sent();
260
- mainFromAccount = (0, index_1.getMainAccount)(fromAccount, fromParentAccount);
261
- return [4 /*yield*/, (0, rxjs_1.firstValueFrom)(bridge
262
- .signOperation({
263
- account: mainFromAccount,
264
- deviceId: deviceId,
265
- transaction: transaction,
266
- })
267
- .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) {
268
- if (e.type === "signed") {
269
- return e.signedOperation;
270
- }
271
- })))];
272
- case 13:
273
- signedOperation = _b.sent();
274
- console.log("Broadcasting");
275
- return [4 /*yield*/, bridge.broadcast({
276
- account: mainFromAccount,
277
- signedOperation: signedOperation,
278
- })];
279
- case 14:
280
- operation = _b.sent();
281
- console.log({
282
- operation: operation,
283
- });
284
- return [2 /*return*/];
97
+ (0, invariant_1.default)(toAccount, `✖ No account found`);
98
+ if (!toAccount)
99
+ throw new Error(`✖ No account found`);
100
+ if (toParentAccount) {
101
+ console.log("\t:parentId:\t\t", toParentAccount.id);
102
+ }
103
+ console.log("\t:id:\t\t", toAccount.id);
104
+ const bridge = (0, index_3.getAccountBridge)(fromAccount, fromParentAccount);
105
+ let transaction = bridge.createTransaction((0, index_1.getMainAccount)(fromAccount, fromParentAccount));
106
+ transaction = bridge.updateTransaction(transaction, {
107
+ recipient: (0, cryptoassets_1.getAbandonSeedAddress)((0, index_1.getAccountCurrency)((0, index_1.getMainAccount)(fromAccount, fromParentAccount)).id),
108
+ subAccountId: fromParentAccount ? fromAccount.id : undefined,
109
+ });
110
+ if (!useAllAmount) {
111
+ transaction = bridge.updateTransaction(transaction, {
112
+ amount: new bignumber_js_1.BigNumber(amount),
113
+ });
114
+ }
115
+ else {
116
+ const amount = await bridge.estimateMaxSpendable({
117
+ account: fromAccount,
118
+ parentAccount: fromParentAccount,
119
+ transaction,
120
+ });
121
+ transaction = bridge.updateTransaction(transaction, {
122
+ amount,
123
+ });
124
+ }
125
+ transaction = await bridge.prepareTransaction((0, index_1.getMainAccount)(fromAccount, fromParentAccount), transaction);
126
+ const exchange = {
127
+ fromAccount,
128
+ fromParentAccount,
129
+ fromCurrency: fromAccount.type === "TokenAccount" ? fromAccount.token : fromAccount.currency,
130
+ toAccount,
131
+ toParentAccount,
132
+ toCurrency: toAccount.type === "TokenAccount" ? toAccount.token : toAccount.currency,
133
+ };
134
+ const exchangeRates = await (0, index_2.getExchangeRates)({ exchange, transaction });
135
+ console.log({ exchangeRates });
136
+ const exchangeRate = exchangeRates.find(er => {
137
+ if (er.tradeMethod === (useFloat ? "float" : "fixed")) {
138
+ return true;
285
139
  }
140
+ return false;
286
141
  });
287
- }); };
142
+ (0, invariant_1.default)(exchangeRate, `✖ No valid rate available`);
143
+ console.log(`Using first ${useFloat ? "float" : "fixed"} rate:\n`, exchangeRate);
144
+ console.log({
145
+ transaction,
146
+ amount: transaction.amount.toString(),
147
+ });
148
+ console.log("• Open the Exchange app");
149
+ await (0, promise_1.delay)(8000);
150
+ const initSwapResult = await (0, rxjs_1.firstValueFrom)((0, index_2.initSwap)({
151
+ exchange,
152
+ exchangeRate: exchangeRate,
153
+ transaction,
154
+ deviceId,
155
+ }).pipe((0, operators_1.tap)((e) => {
156
+ switch (e.type) {
157
+ case "init-swap-requested":
158
+ console.log("• Confirm swap operation on your device");
159
+ break;
160
+ case "init-swap-error":
161
+ console.log(e);
162
+ (0, invariant_1.default)(false, "Something went wrong confirming the swap");
163
+ // $FlowFixMe
164
+ break;
165
+ case "init-swap-result":
166
+ console.log(e);
167
+ }
168
+ if (e.type === "init-swap-requested")
169
+ console.log("• Confirm swap operation on your device");
170
+ }), (0, operators_1.filter)((e) => e.type === "init-swap-result"), (0, operators_1.map)((e) => {
171
+ if (e.type === "init-swap-result") {
172
+ return e.initSwapResult;
173
+ }
174
+ })));
175
+ transaction = initSwapResult.transaction;
176
+ console.log("Device app switch & silent signing");
177
+ await (0, promise_1.delay)(8000);
178
+ const mainFromAccount = (0, index_1.getMainAccount)(fromAccount, fromParentAccount);
179
+ const signedOperation = await (0, rxjs_1.firstValueFrom)(bridge
180
+ .signOperation({
181
+ account: mainFromAccount,
182
+ deviceId,
183
+ transaction,
184
+ })
185
+ .pipe((0, operators_1.tap)(e => console.log(e)), (0, operators_1.first)((e) => e.type === "signed"), (0, operators_1.map)((e) => {
186
+ if (e.type === "signed") {
187
+ return e.signedOperation;
188
+ }
189
+ })));
190
+ console.log("Broadcasting");
191
+ const operation = await bridge.broadcast({
192
+ account: mainFromAccount,
193
+ signedOperation: signedOperation,
194
+ });
195
+ console.log({
196
+ operation,
197
+ });
198
+ };
288
199
  exports.default = {
289
200
  description: "Perform an arbitrary swap between two currencies on the same seed",
290
- args: __spreadArray([
201
+ args: [
291
202
  {
292
203
  name: "mock",
293
204
  alias: "m",
@@ -317,8 +228,9 @@ exports.default = {
317
228
  alias: "f",
318
229
  type: Boolean,
319
230
  desc: "Use first floating rate returned. Defaults to false.",
320
- }
321
- ], __read(scan_1.scanCommonOpts), false),
322
- job: function (opts) { return (0, rxjs_1.from)(exec(opts)); },
231
+ },
232
+ ...scan_1.scanCommonOpts,
233
+ ],
234
+ job: (opts) => (0, rxjs_1.from)(exec(opts)),
323
235
  };
324
236
  //# sourceMappingURL=swap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"swap.js","sourceRoot":"","sources":["../../../src/commands/ptx/swap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA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ACV,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,sDAAsD;SAC7D;QACD,GAAG,qBAAc;KAClB;IACD,GAAG,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC"}
@@ -380,7 +380,7 @@ declare const _default: {
380
380
  type: BooleanConstructor;
381
381
  desc: string;
382
382
  }[];
383
- job: ({ continuous }: import("./commands/blockchain/satstackStatus").SatstackStatusJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/families/bitcoin/satstack").SatStackStatus>;
383
+ job: ({ continuous }: import("./commands/blockchain/satstackStatus").SatstackStatusJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/families/bitcoin/satstack").SatStackStatus>;
384
384
  };
385
385
  scanDescriptors: {
386
386
  description: string;
@@ -477,7 +477,7 @@ declare const _default: {
477
477
  desc: string;
478
478
  default: string;
479
479
  })[];
480
- job: (opts: import("./commands/blockchain/signMessage").SignMessageJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/hw/signMessage/types").Result>;
480
+ job: (opts: import("./commands/blockchain/signMessage").SignMessageJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/hw/signMessage/types").Result>;
481
481
  };
482
482
  sync: {
483
483
  description: string;
@@ -635,7 +635,7 @@ declare const _default: {
635
635
  }[];
636
636
  job: ({ device }: Partial<{
637
637
  device: string;
638
- }>) => import("rxjs").Observable<string | import("@ledgerhq/live-common/apps").State>;
638
+ }>) => import("rxjs").Observable<string | import("@ledgerhq/live-common/lib/apps/types").State>;
639
639
  };
640
640
  appsCheckAllAppVersions: {
641
641
  description: string;
@@ -663,7 +663,7 @@ declare const _default: {
663
663
  }[];
664
664
  job: ({ device }: Partial<{
665
665
  device: string;
666
- }>) => import("rxjs").Observable<import("@ledgerhq/live-common/apps").State>;
666
+ }>) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/apps/types").State>;
667
667
  };
668
668
  appsUpdateTestAll: {
669
669
  description: string;
@@ -925,7 +925,7 @@ declare const _default: {
925
925
  job: ({ module, interactive }: Partial<{
926
926
  module: string;
927
927
  interactive: boolean;
928
- }>) => import("@ledgerhq/live-common/hw").Discovery | import("rxjs").Observable<string>;
928
+ }>) => import("@ledgerhq/live-common/lib/hw/index").Discovery | import("rxjs").Observable<string>;
929
929
  };
930
930
  firmwareRepair: {
931
931
  description: string;
@@ -1004,7 +1004,7 @@ declare const _default: {
1004
1004
  desc: string;
1005
1005
  type: NumberConstructor;
1006
1006
  })[];
1007
- job: ({ device, unresponsiveTimeoutMs, cantOpenDeviceRetryLimit, }: Partial<import("./commands/device/getDeviceRunningMode").GetDeviceRunningModeJobOpts>) => import("rxjs").Observable<import("@ledgerhq/live-common/hw/getDeviceRunningMode").GetDeviceRunningModeResult | null>;
1007
+ job: ({ device, unresponsiveTimeoutMs, cantOpenDeviceRetryLimit, }: Partial<import("./commands/device/getDeviceRunningMode").GetDeviceRunningModeJobOpts>) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/hw/getDeviceRunningMode").GetDeviceRunningModeResult | null>;
1008
1008
  };
1009
1009
  i18n: {
1010
1010
  description: string;
@@ -1033,7 +1033,7 @@ declare const _default: {
1033
1033
  }[];
1034
1034
  job: ({ device }: Partial<{
1035
1035
  device: string;
1036
- }>) => import("rxjs").Observable<import("@ledgerhq/live-common/apps").ListAppResponse>;
1036
+ }>) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/apps/types").ListAppResponse>;
1037
1037
  };
1038
1038
  managerListApps: {
1039
1039
  description: string;
@@ -1319,7 +1319,7 @@ declare const _default: {
1319
1319
  default: string;
1320
1320
  desc: string;
1321
1321
  })[];
1322
- job: ({ device, initMemberCredentials, getKeyRingTree, encryptUserData, decryptUserData, getMembers, restoreKeyRingTree, destroyKeyRingTree, pubKey, privateKey, rootId, walletSyncEncryptionKey, applicationPath, message, applicationId, name, apiBaseUrl, }: import("./commands/live/ledgerKeyRingProtocol").LedgerKeyRingProtocolJobOpts) => Promise<string | void | import("@ledgerhq/ledger-key-ring-protocol/types").MemberCredentials | import("@ledgerhq/ledger-key-ring-protocol/types").Trustchain | import("@ledgerhq/ledger-key-ring-protocol/types").TrustchainMember[]>;
1322
+ job: ({ device, initMemberCredentials, getKeyRingTree, encryptUserData, decryptUserData, getMembers, restoreKeyRingTree, destroyKeyRingTree, pubKey, privateKey, rootId, walletSyncEncryptionKey, applicationPath, message, applicationId, name, apiBaseUrl, }: import("./commands/live/ledgerKeyRingProtocol").LedgerKeyRingProtocolJobOpts) => Promise<string | void | import("@ledgerhq/ledger-key-ring-protocol/lib/types").MemberCredentials | import("@ledgerhq/ledger-key-ring-protocol/lib/types").Trustchain | import("@ledgerhq/ledger-key-ring-protocol/lib/types").TrustchainMember[]>;
1323
1323
  };
1324
1324
  ledgerSync: {
1325
1325
  description: string;
@@ -1470,7 +1470,7 @@ declare const _default: {
1470
1470
  desc: string;
1471
1471
  type: NumberConstructor;
1472
1472
  })[];
1473
- job: ({ device, pollingPeriodMs, }: import("./commands/live/synchronousOnboarding").SynchronousOnboardingJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/hw/getOnboardingStatePolling").OnboardingStatePollingResult | null>;
1473
+ job: ({ device, pollingPeriodMs, }: import("./commands/live/synchronousOnboarding").SynchronousOnboardingJobOpts) => import("rxjs").Observable<import("@ledgerhq/live-common/lib/hw/getOnboardingStatePolling").OnboardingStatePollingResult | null>;
1474
1474
  };
1475
1475
  user: {
1476
1476
  args: never[];