@ledgerhq/live-cli 24.17.1 → 24.17.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 (2) hide show
  1. package/lib/cli.js +58 -24
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -440198,7 +440198,7 @@ var require_BitString = __commonJS({
440198
440198
  exports2.BitString = void 0;
440199
440199
  var paddedBits_1 = require_paddedBits();
440200
440200
  var symbol_inspect_1 = __importDefault(require_symbol());
440201
- var BitString = class _BitString {
440201
+ var BitString2 = class _BitString {
440202
440202
  /**
440203
440203
  * Checks if supplied object is BitString
440204
440204
  * @param src is unknow object
@@ -440331,9 +440331,9 @@ var require_BitString = __commonJS({
440331
440331
  }
440332
440332
  }
440333
440333
  };
440334
- exports2.BitString = BitString;
440334
+ exports2.BitString = BitString2;
440335
440335
  _a7 = symbol_inspect_1.default;
440336
- BitString.EMPTY = new BitString(Buffer.alloc(0), 0, 0);
440336
+ BitString2.EMPTY = new BitString2(Buffer.alloc(0), 0, 0);
440337
440337
  }
440338
440338
  });
440339
440339
 
@@ -440621,7 +440621,7 @@ var require_BitReader = __commonJS({
440621
440621
  exports2.BitReader = void 0;
440622
440622
  var Address_1 = require_Address();
440623
440623
  var ExternalAddress_1 = require_ExternalAddress();
440624
- var BitReader = class _BitReader {
440624
+ var BitReader2 = class _BitReader {
440625
440625
  constructor(bits2, offset2 = 0) {
440626
440626
  this._checkpoints = [];
440627
440627
  this._bits = bits2;
@@ -441054,7 +441054,7 @@ var require_BitReader = __commonJS({
441054
441054
  return Number(src2);
441055
441055
  }
441056
441056
  };
441057
- exports2.BitReader = BitReader;
441057
+ exports2.BitReader = BitReader2;
441058
441058
  }
441059
441059
  });
441060
441060
 
@@ -442195,7 +442195,7 @@ var require_Slice = __commonJS({
442195
442195
  var Dictionary_1 = require_Dictionary();
442196
442196
  var Builder_1 = require_Builder();
442197
442197
  var strings_1 = require_strings();
442198
- var Slice = class _Slice {
442198
+ var Slice2 = class _Slice {
442199
442199
  constructor(reader, refs) {
442200
442200
  this[_a7] = () => this.toString();
442201
442201
  this._reader = reader.clone();
@@ -442674,7 +442674,7 @@ var require_Slice = __commonJS({
442674
442674
  return this.asCell().toString();
442675
442675
  }
442676
442676
  };
442677
- exports2.Slice = Slice;
442677
+ exports2.Slice = Slice2;
442678
442678
  _a7 = symbol_inspect_1.default;
442679
442679
  }
442680
442680
  });
@@ -528250,7 +528250,7 @@ var require_package8 = __commonJS({
528250
528250
  module2.exports = {
528251
528251
  name: "@ledgerhq/live-common",
528252
528252
  description: "Common ground for the Ledger Live apps",
528253
- version: "34.31.0",
528253
+ version: "34.31.1-nightly.0",
528254
528254
  repository: {
528255
528255
  type: "git",
528256
528256
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -535051,7 +535051,7 @@ var require_package9 = __commonJS({
535051
535051
  "package.json"(exports2, module2) {
535052
535052
  module2.exports = {
535053
535053
  name: "@ledgerhq/live-cli",
535054
- version: "24.17.1",
535054
+ version: "24.17.2-nightly.0",
535055
535055
  description: "ledger-live CLI version",
535056
535056
  repository: {
535057
535057
  type: "git",
@@ -715087,7 +715087,8 @@ var getOperationType6 = (pallet, palletMethod) => {
715087
715087
  };
715088
715088
  var getExtra = (type5, extrinsic) => {
715089
715089
  const extra = {
715090
- palletMethod: `${extrinsic.section}.${extrinsic.method}`
715090
+ palletMethod: `${extrinsic.section}.${extrinsic.method}`,
715091
+ index: extrinsic.index
715091
715092
  };
715092
715093
  switch (type5) {
715093
715094
  case "IN":
@@ -756950,7 +756951,8 @@ var MODE_TO_PALLET_METHOD = {
756950
756951
  };
756951
756952
  var getExtra2 = (type5, account3, transaction) => {
756952
756953
  const extra = {
756953
- palletMethod: MODE_TO_PALLET_METHOD[transaction.mode]
756954
+ palletMethod: MODE_TO_PALLET_METHOD[transaction.mode],
756955
+ index: 0
756954
756956
  };
756955
756957
  if (transaction.mode == "send" && transaction.useAllAmount) {
756956
756958
  extra.palletMethod = MODE_TO_PALLET_METHOD["sendMax"];
@@ -778910,7 +778912,8 @@ async function formatOperation(rawOperation, accountId2, addr) {
778910
778912
  blockHash,
778911
778913
  extra: {
778912
778914
  ledgerOpType: type5,
778913
- blockTime: new Date(blockTime)
778915
+ blockTime: new Date(blockTime),
778916
+ index: rawOperation.id
778914
778917
  }
778915
778918
  };
778916
778919
  if (rawOperation.paging_token) {
@@ -779541,7 +779544,8 @@ async function craftTransaction2(account3, transaction) {
779541
779544
  const craftedTransaction = transactionBuilder.setTimeout(0).build();
779542
779545
  return {
779543
779546
  transaction: craftedTransaction,
779544
- xdr: craftedTransaction.toXDR()
779547
+ xdr: craftedTransaction.toXDR(),
779548
+ signatureBase: craftedTransaction.signatureBase().toString("base64")
779545
779549
  };
779546
779550
  }
779547
779551
  function buildMemo(memoType, memoValue) {
@@ -779605,7 +779609,8 @@ async function buildOptimisticOperation15(account3, transaction) {
779605
779609
  transactionSequenceNumber: transactionSequenceNumber?.plus(1).toNumber(),
779606
779610
  extra: {
779607
779611
  ledgerOpType: type5,
779608
- blockTime: /* @__PURE__ */ new Date()
779612
+ blockTime: /* @__PURE__ */ new Date(),
779613
+ index: "0"
779609
779614
  }
779610
779615
  };
779611
779616
  const { subAccountId } = transaction;
@@ -800407,18 +800412,47 @@ function mapJettonTxToOps(accountId2, addr, addressBook) {
800407
800412
  return ops;
800408
800413
  };
800409
800414
  }
800415
+ function dataToSlice(data6) {
800416
+ let buffer2;
800417
+ if (typeof data6 === "string") {
800418
+ buffer2 = Buffer.from(data6, "base64");
800419
+ try {
800420
+ return import_core18.Cell.fromBoc(buffer2)[0].beginParse();
800421
+ } catch (err) {
800422
+ return new import_core18.Slice(new import_core18.BitReader(new import_core18.BitString(buffer2, 0, buffer2.length * 8)), []);
800423
+ }
800424
+ }
800425
+ return void 0;
800426
+ }
800427
+ function loadSnakeBytes(slice3) {
800428
+ let buffer2 = Buffer.alloc(0);
800429
+ while (slice3.remainingBits >= 8) {
800430
+ buffer2 = Buffer.concat([buffer2, slice3.loadBuffer(slice3.remainingBits / 8)]);
800431
+ if (slice3.remainingRefs) {
800432
+ slice3 = slice3.loadRef().beginParse();
800433
+ } else {
800434
+ break;
800435
+ }
800436
+ }
800437
+ return buffer2;
800438
+ }
800410
800439
  function decodeForwardPayload(payload) {
800411
800440
  if (!payload)
800412
800441
  return "";
800413
- const decodedBuffer = Buffer.from(payload, "base64");
800414
- const cell = import_core18.Cell.fromBoc(decodedBuffer)[0];
800415
- const slice3 = cell.beginParse();
800416
- const opcode = slice3.loadUint(32);
800417
- if (opcode !== 0) {
800442
+ try {
800443
+ const slice3 = dataToSlice(payload);
800444
+ if (!slice3)
800445
+ return "";
800446
+ const opcode = slice3.loadUint(32);
800447
+ if (opcode !== 0) {
800448
+ return "";
800449
+ }
800450
+ const buffer2 = loadSnakeBytes(slice3);
800451
+ const comment2 = buffer2.toString("utf-8");
800452
+ return comment2;
800453
+ } catch (error2) {
800418
800454
  return "";
800419
800455
  }
800420
- const comment2 = slice3.loadStringTail();
800421
- return comment2;
800422
800456
  }
800423
800457
 
800424
800458
  // ../../libs/coin-modules/coin-ton/lib-es/logic.js
@@ -805419,8 +805453,8 @@ var convertToCoreOperation = (address4) => (operation) => {
805419
805453
  signingPubKey: SigningPubKey
805420
805454
  };
805421
805455
  let op = {
805456
+ id: hash12,
805422
805457
  asset: { type: "native" },
805423
- operationIndex: 0,
805424
805458
  tx: {
805425
805459
  hash: hash12,
805426
805460
  fees: fee,
@@ -814527,11 +814561,11 @@ var buildSignOperation24 = (signerContext3) => ({ account: account3, deviceId, t
814527
814561
  transaction
814528
814562
  })
814529
814563
  };
814564
+ const publicKeyResult = await signerContext3(deviceId, (signer) => signer.getPublicKey(account3.freshAddressPath));
814565
+ const publicKey3 = new Ed25519PublicKey3(publicKeyResult.publicKey);
814530
814566
  const { unsigned: unsigned2 } = await buildTransaction10(account3, transactionToSign);
814531
814567
  const signData = messageWithIntent("TransactionData", unsigned2);
814532
814568
  const { signature: signature3 } = await signerContext3(deviceId, (signer) => signer.signTransaction(account3.freshAddressPath, signData));
814533
- const publicKeyResult = await signerContext3(deviceId, (signer) => signer.getPublicKey(account3.freshAddressPath));
814534
- const publicKey3 = new Ed25519PublicKey3(publicKeyResult.publicKey);
814535
814569
  const serializedSignature = toSerializedSignature({
814536
814570
  signature: signature3,
814537
814571
  signatureScheme: "ED25519",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.17.1",
3
+ "version": "24.17.2-nightly.0",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",