@ledgerhq/live-cli 24.18.6-nightly.0 → 24.18.6-nightly.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.
Files changed (2) hide show
  1. package/lib/cli.js +21 -6
  2. package/package.json +2 -2
package/lib/cli.js CHANGED
@@ -530283,7 +530283,7 @@ var require_package8 = __commonJS({
530283
530283
  module2.exports = {
530284
530284
  name: "@ledgerhq/live-common",
530285
530285
  description: "Common ground for the Ledger Live apps",
530286
- version: "34.35.2-nightly.0",
530286
+ version: "34.36.0-nightly.1",
530287
530287
  repository: {
530288
530288
  type: "git",
530289
530289
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -537083,7 +537083,7 @@ var require_package9 = __commonJS({
537083
537083
  "package.json"(exports2, module2) {
537084
537084
  module2.exports = {
537085
537085
  name: "@ledgerhq/live-cli",
537086
- version: "24.18.6-nightly.0",
537086
+ version: "24.18.6-nightly.1",
537087
537087
  description: "ledger-live CLI version",
537088
537088
  repository: {
537089
537089
  type: "git",
@@ -600203,6 +600203,7 @@ var xpub_default = Xpub;
600203
600203
  var import_findLast = __toESM(require("lodash/findLast"));
600204
600204
  var import_filter = __toESM(require("lodash/filter"));
600205
600205
  var import_uniqBy = __toESM(require("lodash/uniqBy"));
600206
+ init_lib_es2();
600206
600207
  var import_findIndex = __toESM(require("lodash/findIndex"));
600207
600208
  var BitcoinLikeStorage = class {
600208
600209
  txs = [];
@@ -600224,6 +600225,9 @@ var BitcoinLikeStorage = class {
600224
600225
  txsSize() {
600225
600226
  return this.txs.length;
600226
600227
  }
600228
+ getTxs() {
600229
+ return [...this.txs];
600230
+ }
600227
600231
  hasPendingTx(txFilter) {
600228
600232
  const index = `${txFilter.account}-${txFilter.index}`;
600229
600233
  return !!this.accountIndex[index] && this.accountIndex[index].map((i85) => this.txs[i85]).some((tx) => !tx.block);
@@ -600274,6 +600278,12 @@ var BitcoinLikeStorage = class {
600274
600278
  const indexAddress = tx.address;
600275
600279
  const index = `${indexAddress}-${tx.id}`;
600276
600280
  if (this.txs[this.primaryIndex[index]]) {
600281
+ const existing = this.txs[this.primaryIndex[index]];
600282
+ if (!existing.block && tx.block) {
600283
+ log2("bitcoin[storage]", `appendTxs, replacing with ${index}, pending->confirmed`);
600284
+ this.txs[this.primaryIndex[index]] = tx;
600285
+ return;
600286
+ }
600277
600287
  return;
600278
600288
  }
600279
600289
  const idx = this.txs.push(tx) - 1;
@@ -601164,6 +601174,11 @@ var perCoinLogic = {
601164
601174
  })
601165
601175
  }
601166
601176
  };
601177
+ function inferTransactionSequenceNumberFromInputs(accountInputs) {
601178
+ if (accountInputs.length === 0)
601179
+ return void 0;
601180
+ return Math.min(...accountInputs.map((input) => input.sequence ?? 4294967294));
601181
+ }
601167
601182
  var mapTxToOperations = (tx, currencyId, accountId2, accountAddresses, changeAddresses) => {
601168
601183
  const operations = [];
601169
601184
  const txId = tx.id;
@@ -601192,7 +601207,7 @@ var mapTxToOperations = (tx, currencyId, accountId2, accountAddresses, changeAdd
601192
601207
  }
601193
601208
  }
601194
601209
  }
601195
- const transactionSequenceNumber = accountInputs.length > 0 && accountInputs[0].sequence || void 0;
601210
+ const transactionSequenceNumber = inferTransactionSequenceNumberFromInputs(accountInputs);
601196
601211
  const hasSpentNothing = value5.eq(0);
601197
601212
  const changeOutputIndex = tx.outputs.length === 0 ? 0 : tx.outputs.map((o47) => o47.output_index).reduce((p58, c56) => p58 > c56 ? p58 : c56);
601198
601213
  for (const output5 of tx.outputs) {
@@ -806331,7 +806346,7 @@ async function rawEncode2(contents) {
806331
806346
  branch: block2.hash,
806332
806347
  contents
806333
806348
  });
806334
- return forgedBytes;
806349
+ return Buffer.concat([Buffer.from("03", "hex"), Buffer.from(forgedBytes, "hex")]).toString("hex");
806335
806350
  }
806336
806351
 
806337
806352
  // ../../libs/coin-modules/coin-tezos/lib-es/logic/estimateFees.js
@@ -806958,7 +806973,7 @@ var buildSignOperation19 = (signerContext3) => ({ account: account3, deviceId, t
806958
806973
  public_key_hash: publicKeyHash
806959
806974
  });
806960
806975
  const forgedBytes = await rawEncode2(contents);
806961
- const signature4 = await ledgerSigner.sign(Buffer.concat([Buffer.from("03", "hex"), Buffer.from(forgedBytes, "hex")]).toString("hex"));
806976
+ const signature4 = await ledgerSigner.sign(forgedBytes);
806962
806977
  return {
806963
806978
  type: type5,
806964
806979
  signature: signature4
@@ -809355,7 +809370,7 @@ var import_bignumber284 = __toESM(require("bignumber.js"));
809355
809370
  // ../../libs/coin-modules/coin-tron/lib-es/logic/constants.js
809356
809371
  var import_bignumber280 = require("bignumber.js");
809357
809372
  var ONE_TRX = new import_bignumber280.BigNumber(1e6);
809358
- var STANDARD_FEES_NATIVE = new import_bignumber280.BigNumber(2e3);
809373
+ var STANDARD_FEES_NATIVE = new import_bignumber280.BigNumber(27e4);
809359
809374
  var ACTIVATION_FEES = ONE_TRX.multipliedBy(1.1);
809360
809375
  var ACTIVATION_FEES_TRC_20 = ONE_TRX.multipliedBy(27.6009);
809361
809376
  var STANDARD_FEES_TRC_20 = ONE_TRX.multipliedBy(13.7409);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.18.6-nightly.0",
3
+ "version": "24.18.6-nightly.1",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,7 +56,7 @@
56
56
  "ts-node": "10.9.2",
57
57
  "tsup": "7.3.0",
58
58
  "@ledgerhq/types-cryptoassets": "^7.23.0",
59
- "@ledgerhq/types-live": "^6.72.0-nightly.0"
59
+ "@ledgerhq/types-live": "^6.72.0-nightly.1"
60
60
  },
61
61
  "publishConfig": {
62
62
  "directory": "dist"