@ledgerhq/live-cli 24.29.0-nightly.20251126160702 → 24.29.0-nightly.20251127103328

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 +61 -31
  2. package/package.json +2 -2
package/lib/cli.js CHANGED
@@ -543581,7 +543581,7 @@ var require_package8 = __commonJS({
543581
543581
  module2.exports = {
543582
543582
  name: "@ledgerhq/live-common",
543583
543583
  description: "Common ground for the Ledger Live apps",
543584
- version: "34.54.0-nightly.20251126160702",
543584
+ version: "34.54.0-nightly.20251127103328",
543585
543585
  repository: {
543586
543586
  type: "git",
543587
543587
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -543934,7 +543934,7 @@ var require_package9 = __commonJS({
543934
543934
  "package.json"(exports2, module2) {
543935
543935
  module2.exports = {
543936
543936
  name: "@ledgerhq/live-cli",
543937
- version: "24.29.0-nightly.20251126160702",
543937
+ version: "24.29.0-nightly.20251127103328",
543938
543938
  description: "ledger-live CLI version",
543939
543939
  repository: {
543940
543940
  type: "git",
@@ -615704,7 +615704,13 @@ function isAccountEmpty2(account3) {
615704
615704
  var txInfoToOperationAdapter = (accountId2, partyId) => (txInfo) => {
615705
615705
  const { transaction_hash, uid, block: { height, hash: hash9 }, senders, recipients, transaction_timestamp, fee: { value: fee }, transfers: [{ value: transferValue, details }] } = txInfo;
615706
615706
  let type4 = "UNKNOWN";
615707
- if (txInfo.type === "Send" && transferValue === "0") {
615707
+ if (details.operationType === "transfer-proposal") {
615708
+ type4 = "TRANSFER_PROPOSAL";
615709
+ } else if (details.operationType === "transfer-rejected") {
615710
+ type4 = "TRANSFER_REJECTED";
615711
+ } else if (details.operationType === "transfer-withdrawn") {
615712
+ type4 = "TRANSFER_WITHDRAWN";
615713
+ } else if (txInfo.type === "Send" && transferValue === "0") {
615708
615714
  type4 = "FEES";
615709
615715
  } else if (txInfo.type === "Send") {
615710
615716
  type4 = senders.includes(partyId) ? "OUT" : "IN";
@@ -698544,6 +698550,26 @@ async function estimateContractCallGas(senderEvmAddress, recipientEvmAddress, co
698544
698550
  });
698545
698551
  return new import_bignumber191.default(res.data.result);
698546
698552
  }
698553
+ async function getTransactionsByTimestampRange(startTimestamp, endTimestamp) {
698554
+ const transactions3 = [];
698555
+ const params = new URLSearchParams({
698556
+ limit: "100",
698557
+ order: "desc"
698558
+ });
698559
+ params.append("timestamp", `gte:${startTimestamp}`);
698560
+ params.append("timestamp", `lt:${endTimestamp}`);
698561
+ let nextPath = `/api/v1/transactions?${params.toString()}`;
698562
+ while (nextPath) {
698563
+ const res = await lib_es_default({
698564
+ method: "GET",
698565
+ url: `${API_URL}${nextPath}`
698566
+ });
698567
+ const newTransactions = res.data.transactions;
698568
+ transactions3.push(...newTransactions);
698569
+ nextPath = res.data.links.next;
698570
+ }
698571
+ return transactions3;
698572
+ }
698547
698573
  var apiClient = {
698548
698574
  getAccountsForPublicKey,
698549
698575
  getAccount: getAccount3,
@@ -698554,7 +698580,8 @@ var apiClient = {
698554
698580
  getContractCallResult,
698555
698581
  findTransactionByContractCall,
698556
698582
  getERC20Balance,
698557
- estimateContractCallGas
698583
+ estimateContractCallGas,
698584
+ getTransactionsByTimestampRange
698558
698585
  };
698559
698586
 
698560
698587
  // ../../libs/coin-modules/coin-hedera/lib-es/logic/utils.js
@@ -698660,13 +698687,16 @@ var safeParseAccountId = (address3) => {
698660
698687
  return [new InvalidAddress("", { currencyName }), null];
698661
698688
  }
698662
698689
  };
698690
+ function getBlockHash(blockHeight) {
698691
+ return (0, import_crypto42.createHash)("sha256").update(blockHeight.toString()).digest("hex");
698692
+ }
698663
698693
  function getSyntheticBlock(consensusTimestamp, blockWindowSeconds = SYNTHETIC_BLOCK_WINDOW_SECONDS) {
698664
698694
  const seconds2 = Math.floor(Number(consensusTimestamp));
698665
698695
  if (Number.isNaN(seconds2) || seconds2 === 0) {
698666
698696
  throw new Error(`Invalid consensus timestamp: ${consensusTimestamp}`);
698667
698697
  }
698668
698698
  const blockHeight = Math.floor(seconds2 / blockWindowSeconds);
698669
- const blockHash = (0, import_crypto42.createHash)("sha256").update(blockHeight.toString()).digest("hex");
698699
+ const blockHash = getBlockHash(blockHeight);
698670
698700
  const blockTime = new Date(seconds2 * 1e3);
698671
698701
  return { blockHeight, blockHash, blockTime };
698672
698702
  }
@@ -709261,7 +709291,7 @@ init_lib_es();
709261
709291
  var getAddress7 = (a134) => ({ address: a134.freshAddress, derivationPath: a134.freshAddressPath });
709262
709292
 
709263
709293
  // ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/getTransactionStatus.js
709264
- var import_utils263 = require("@zondax/ledger-live-icp/utils");
709294
+ var import_utils265 = require("@zondax/ledger-live-icp/utils");
709265
709295
 
709266
709296
  // ../../libs/coin-modules/coin-internet_computer/lib-es/errors.js
709267
709297
  init_lib_es();
@@ -709277,19 +709307,19 @@ var getTransactionStatus12 = async (account3, transaction) => {
709277
709307
  let { amount } = transaction;
709278
709308
  if (!recipient) {
709279
709309
  errors2.recipient = new RecipientRequired();
709280
- } else if (!(await (0, import_utils263.validateAddress)(recipient)).isValid) {
709310
+ } else if (!(await (0, import_utils265.validateAddress)(recipient)).isValid) {
709281
709311
  errors2.recipient = new InvalidAddress("", {
709282
709312
  currencyName: account3.currency.name
709283
709313
  });
709284
709314
  } else if (recipient.toLowerCase() === address3.toLowerCase()) {
709285
709315
  errors2.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
709286
709316
  }
709287
- if (!(await (0, import_utils263.validateAddress)(address3)).isValid) {
709317
+ if (!(await (0, import_utils265.validateAddress)(address3)).isValid) {
709288
709318
  errors2.sender = new InvalidAddress("", {
709289
709319
  currencyName: account3.currency.name
709290
709320
  });
709291
709321
  }
709292
- if (!(0, import_utils263.validateMemo)(transaction.memo).isValid) {
709322
+ if (!(0, import_utils265.validateMemo)(transaction.memo).isValid) {
709293
709323
  errors2.transaction = new InvalidMemoICP();
709294
709324
  }
709295
709325
  const estimatedFees = transaction.fees;
@@ -709378,7 +709408,7 @@ var createTransaction14 = () => {
709378
709408
  init_lib_es2();
709379
709409
  var import_ledger_live_icp2 = require("@zondax/ledger-live-icp");
709380
709410
  var import_bignumber214 = __toESM(require("bignumber.js"));
709381
- var import_utils264 = require("@zondax/ledger-live-icp/utils");
709411
+ var import_utils266 = require("@zondax/ledger-live-icp/utils");
709382
709412
  var import_agent = require("@zondax/ledger-live-icp/agent");
709383
709413
  var import_invariant37 = __toESM(require("invariant"));
709384
709414
  var fetchBlockHeight3 = async () => {
@@ -709396,7 +709426,7 @@ var fetchBlockHeight3 = async () => {
709396
709426
  });
709397
709427
  (0, import_invariant37.default)(blockHeightRes.status === "replied", "[ICP](fetchBlockHeight) Query failed");
709398
709428
  const decodedIdl = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(queryBlocksIdlFunc, blockHeightRes.reply.arg);
709399
- const decoded = (0, import_utils264.fromNullable)(decodedIdl);
709429
+ const decoded = (0, import_utils266.fromNullable)(decodedIdl);
709400
709430
  (0, import_invariant37.default)(decoded, "[ICP](fetchBlockHeight) Decoding failed");
709401
709431
  return (0, import_bignumber214.default)(decoded.chain_length.toString());
709402
709432
  };
@@ -709428,7 +709458,7 @@ var fetchBalance2 = async (address3) => {
709428
709458
  return (0, import_bignumber214.default)(0);
709429
709459
  }
709430
709460
  const decodedBalance = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(getBalanceIdlFunc, balanceRes.reply.arg);
709431
- const balance2 = (0, import_utils264.fromNullable)(decodedBalance);
709461
+ const balance2 = (0, import_utils266.fromNullable)(decodedBalance);
709432
709462
  if (!balance2) {
709433
709463
  return (0, import_bignumber214.default)(0);
709434
709464
  }
@@ -709455,7 +709485,7 @@ var fetchTxns = async (address3, startBlockHeight, stopBlockHeight = BigInt(0))
709455
709485
  });
709456
709486
  (0, import_invariant37.default)(transactionsRes.status === "replied", "[ICP](fetchTxns) Query failed");
709457
709487
  const decodedTransactions = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(getTransactionsIdlFunc, transactionsRes.reply.arg);
709458
- const response = (0, import_utils264.fromNullable)(decodedTransactions);
709488
+ const response = (0, import_utils266.fromNullable)(decodedTransactions);
709459
709489
  (0, import_invariant37.default)(response, "[ICP](fetchTxns) Decoding failed");
709460
709490
  if (response.Ok.transactions.length === 0) {
709461
709491
  return [];
@@ -709621,7 +709651,7 @@ var mapTxToOps3 = (accountId2, address3, fee = ICP_FEES) => {
709621
709651
 
709622
709652
  // ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/signOperation.js
709623
709653
  var import_rxjs40 = require("rxjs");
709624
- var import_utils267 = require("@zondax/ledger-live-icp/utils");
709654
+ var import_utils269 = require("@zondax/ledger-live-icp/utils");
709625
709655
  var import_agent2 = require("@zondax/ledger-live-icp/agent");
709626
709656
 
709627
709657
  // ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/buildOptimisticOperation.js
@@ -709660,7 +709690,7 @@ var signICPTransaction = async (unsignedTxn, derivationPath, signerContext4, acc
709660
709690
  signature: Buffer.from(signatures.signatureRS).toString("hex"),
709661
709691
  callBody: {
709662
709692
  content: unsignedTxn,
709663
- sender_pubkey: (0, import_utils267.pubkeyToDer)(account3.xpub),
709693
+ sender_pubkey: (0, import_utils269.pubkeyToDer)(account3.xpub),
709664
709694
  sender_sig: signatures.signatureRS
709665
709695
  }
709666
709696
  };
@@ -709672,7 +709702,7 @@ var buildSignOperation12 = (signerContext4) => ({ account: account3, transaction
709672
709702
  const { xpub } = account3;
709673
709703
  (0, import_invariant39.default)(xpub, "[ICP](signOperation) Account xpub is required");
709674
709704
  const { derivationPath } = getAddress7(account3);
709675
- const { unsignedTransaction, transferRawRequest } = (0, import_utils267.createUnsignedSendTransaction)(transaction, xpub);
709705
+ const { unsignedTransaction, transferRawRequest } = (0, import_utils269.createUnsignedSendTransaction)(transaction, xpub);
709676
709706
  o102.next({
709677
709707
  type: "device-signature-requested"
709678
709708
  });
@@ -709685,7 +709715,7 @@ var buildSignOperation12 = (signerContext4) => ({ account: account3, transaction
709685
709715
  o102.next({
709686
709716
  type: "device-signature-granted"
709687
709717
  });
709688
- const hash9 = (0, import_utils267.hashTransaction)({
709718
+ const hash9 = (0, import_utils269.hashTransaction)({
709689
709719
  from: account3.freshAddress,
709690
709720
  to: transaction.recipient,
709691
709721
  amount: transferRawRequest.amount.e8s,
@@ -714751,7 +714781,7 @@ function makeCliTools15() {
714751
714781
  }
714752
714782
 
714753
714783
  // ../../libs/ledgerjs/packages/hw-app-near/lib-es/Near.js
714754
- var import_utils270 = __toESM(require_utils38());
714784
+ var import_utils272 = __toESM(require_utils38());
714755
714785
  var import_key_pair = __toESM(require_key_pair2());
714756
714786
 
714757
714787
  // ../../libs/ledgerjs/packages/hw-app-near/lib-es/utils.js
@@ -714787,7 +714817,7 @@ var Near = class {
714787
714817
  await client.getAddress(path4);
714788
714818
  }
714789
714819
  const rawPublicKey = await client.getPublicKey(path4, false);
714790
- const publicKey4 = new import_utils270.PublicKey({
714820
+ const publicKey4 = new import_utils272.PublicKey({
714791
714821
  keyType: import_key_pair.KeyType.ED25519,
714792
714822
  data: rawPublicKey
714793
714823
  });
@@ -755853,7 +755883,7 @@ __export(chain_exports, {
755853
755883
  bestNumber: () => bestNumber,
755854
755884
  bestNumberFinalized: () => bestNumberFinalized,
755855
755885
  bestNumberLag: () => bestNumberLag,
755856
- getBlock: () => getBlock,
755886
+ getBlock: () => getBlock2,
755857
755887
  getBlockByNumber: () => getBlockByNumber,
755858
755888
  getHeader: () => getHeader,
755859
755889
  subscribeFinalizedBlocks: () => subscribeFinalizedBlocks,
@@ -756018,7 +756048,7 @@ function createSignedBlockExtended(registry, block2, events2, validators7, autho
756018
756048
  }
756019
756049
 
756020
756050
  // ../../node_modules/.pnpm/@polkadot+api-derive@11.2.1/node_modules/@polkadot/api-derive/chain/getBlock.js
756021
- function getBlock(instanceId, api7) {
756051
+ function getBlock2(instanceId, api7) {
756022
756052
  return memo2(instanceId, (blockHash) => (0, import_rxjs72.combineLatest)([
756023
756053
  api7.rpc.chain.getBlock(blockHash),
756024
756054
  api7.queryAt(blockHash)
@@ -797080,7 +797110,7 @@ async function getLastBlock2() {
797080
797110
  const data6 = await fetch11(`/wallet/getnowblock`);
797081
797111
  return toBlock(data6);
797082
797112
  }
797083
- async function getBlock2(blockNumber) {
797113
+ async function getBlock3(blockNumber) {
797084
797114
  const data6 = await fetch11(`/wallet/getblock?id_or_num=${encodeURIComponent(blockNumber)}`);
797085
797115
  const ret2 = toBlock(data6);
797086
797116
  if (!ret2.height) {
@@ -797973,7 +798003,7 @@ async function listOperations5(address3, options24) {
797973
798003
  const minHeight = options24?.minHeight ?? defaultOptions5.minHeight;
797974
798004
  const order = options24?.order ?? defaultOptions5.order;
797975
798005
  const softLimit = options24?.softLimit ?? defaultOptions5.softLimit;
797976
- const block2 = await getBlock2(minHeight);
798006
+ const block2 = await getBlock3(minHeight);
797977
798007
  const minTimestamp = block2.time?.getTime() ?? defaultFetchParams.minTimestamp;
797978
798008
  const fetchParams = {
797979
798009
  ...defaultFetchParams,
@@ -815030,11 +815060,11 @@ var filterOperations2 = (sendOps, receiveOps, order, shouldFilter = true) => {
815030
815060
  const result2 = [...sendOps.operations, ...receiveOps.operations].sort((a134, b27) => Number(b27.timestampMs) - Number(a134.timestampMs)).filter((op) => Number(op.timestampMs) >= filterTimestamp);
815031
815061
  return { operations: (0, import_unionBy.default)(result2, (tx) => tx.digest), cursor: nextCursor };
815032
815062
  };
815033
- var getBlockInfo = async (id5) => withApi2(async (api7) => {
815063
+ var getBlockInfo2 = async (id5) => withApi2(async (api7) => {
815034
815064
  const checkpoint = await api7.getCheckpoint({ id: id5 });
815035
815065
  return toBlockInfo(checkpoint);
815036
815066
  });
815037
- var getBlock3 = async (id5) => withApi2(async (api7) => {
815067
+ var getBlock4 = async (id5) => withApi2(async (api7) => {
815038
815068
  const checkpoint = await api7.getCheckpoint({ id: id5 });
815039
815069
  const rawTxs = await queryTransactionsByDigest({ api: api7, digests: checkpoint.transactions });
815040
815070
  return {
@@ -815256,8 +815286,8 @@ var network_default3 = {
815256
815286
  getAccountBalances,
815257
815287
  getAllBalancesCached,
815258
815288
  getOperations: getOperations6,
815259
- getBlock: getBlock3,
815260
- getBlockInfo,
815289
+ getBlock: getBlock4,
815290
+ getBlockInfo: getBlockInfo2,
815261
815291
  getStakesRaw,
815262
815292
  paymentInfo: paymentInfo3,
815263
815293
  createTransaction: createTransaction25,
@@ -816547,7 +816577,7 @@ var getAccount11 = async (address3) => {
816547
816577
  spendableBalance
816548
816578
  };
816549
816579
  };
816550
- var getBlockInfo3 = async (blockHeight) => {
816580
+ var getBlockInfo4 = async (blockHeight) => {
816551
816581
  const data6 = await rosettaGetBlockInfo(blockHeight);
816552
816582
  return data6;
816553
816583
  };
@@ -816605,7 +816635,7 @@ var mapRosettaTxnToOperation = async (accountId2, address3, txn) => {
816605
816635
  const hash9 = txn.transaction.transaction_identifier.hash;
816606
816636
  const blockHeight = txn.block_identifier.index;
816607
816637
  const blockHash = txn.block_identifier.hash;
816608
- const date = new Date(txn.timestamp ?? (await getBlockInfo3(blockHeight)).block.timestamp);
816638
+ const date = new Date(txn.timestamp ?? (await getBlockInfo4(blockHeight)).block.timestamp);
816609
816639
  const memo3 = txn.transaction.metadata?.memo || "";
816610
816640
  let value2 = new import_bignumber339.default(0);
816611
816641
  let fee = new import_bignumber339.default(0);
@@ -846102,7 +846132,7 @@ var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddre
846102
846132
  var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
846103
846133
 
846104
846134
  // ../../libs/coin-modules/coin-tezos/lib-es/utils.js
846105
- var import_utils386 = __toESM(require_utils47());
846135
+ var import_utils388 = __toESM(require_utils47());
846106
846136
  var DUST_MARGIN_MUTEZ = 500;
846107
846137
  var MIN_SUGGESTED_FEE_SMALL_TRANSFER = 489;
846108
846138
  var OP_SIZE_XTZ_TRANSFER = 154;
@@ -846147,7 +846177,7 @@ function normalizePublicKeyForAddress(maybeKey, address3) {
846147
846177
  }
846148
846178
  const compressedPubKeyLength = 33;
846149
846179
  if (keyBuf.length > compressedPubKeyLength) {
846150
- return b58Encode((0, import_utils386.compressPublicKey)(keyBuf, derivationType), prefix3);
846180
+ return b58Encode((0, import_utils388.compressPublicKey)(keyBuf, derivationType), prefix3);
846151
846181
  } else {
846152
846182
  return b58Encode(keyBuf, prefix3);
846153
846183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.29.0-nightly.20251126160702",
3
+ "version": "24.29.0-nightly.20251127103328",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",
@@ -59,7 +59,7 @@
59
59
  "tsup": "7.3.0",
60
60
  "yaml": "2.8.1",
61
61
  "@ledgerhq/types-cryptoassets": "^7.30.0",
62
- "@ledgerhq/types-live": "^6.90.0-nightly.20251126160702"
62
+ "@ledgerhq/types-live": "^6.90.0-nightly.20251127103328"
63
63
  },
64
64
  "publishConfig": {
65
65
  "directory": "dist"