@ledgerhq/live-cli 24.26.1-nightly.1 → 24.26.1-nightly.2

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 +52 -16
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -515377,7 +515377,7 @@ var require_package7 = __commonJS({
515377
515377
  module2.exports = {
515378
515378
  name: "@ledgerhq/live-common",
515379
515379
  description: "Common ground for the Ledger Live apps",
515380
- version: "34.52.0-nightly.1",
515380
+ version: "34.52.0-nightly.2",
515381
515381
  repository: {
515382
515382
  type: "git",
515383
515383
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -515711,7 +515711,7 @@ var require_package8 = __commonJS({
515711
515711
  "package.json"(exports2, module2) {
515712
515712
  module2.exports = {
515713
515713
  name: "@ledgerhq/live-cli",
515714
- version: "24.26.1-nightly.1",
515714
+ version: "24.26.1-nightly.2",
515715
515715
  description: "ledger-live CLI version",
515716
515716
  repository: {
515717
515717
  type: "git",
@@ -586511,6 +586511,9 @@ function createApi(config4) {
586511
586511
  },
586512
586512
  getRewards(_address, _cursor) {
586513
586513
  throw new Error("getRewards is not supported");
586514
+ },
586515
+ getValidators(_cursor) {
586516
+ throw new Error("getValidators is not supported");
586514
586517
  }
586515
586518
  };
586516
586519
  }
@@ -817952,9 +817955,6 @@ function transactionToOperation3(accountId2, address3, transaction) {
817952
817955
  value: getOperationAmount(address3, transaction, coinType)
817953
817956
  };
817954
817957
  }
817955
- function absoluteAmount(balanceChange) {
817956
- return new import_bignumber302.BigNumber(balanceChange?.amount || 0).abs();
817957
- }
817958
817958
  function toBlockInfo(checkpoint) {
817959
817959
  const info6 = {
817960
817960
  height: Number(checkpoint.sequenceNumber),
@@ -817972,25 +817972,31 @@ function toBlockInfo(checkpoint) {
817972
817972
  return info6;
817973
817973
  }
817974
817974
  function toBlockTransaction(transaction) {
817975
+ const operationFee = getOperationFee(transaction);
817975
817976
  return {
817976
817977
  hash: transaction.digest,
817977
817978
  failed: transaction.effects?.status.status !== "success",
817978
- operations: transaction.balanceChanges?.flatMap((change2) => toBlockOperation(transaction, change2)) || [],
817979
- fees: BigInt(getOperationFee(transaction).toString()),
817979
+ operations: transaction.balanceChanges?.flatMap((change2) => toBlockOperation(transaction, change2, operationFee)) || [],
817980
+ fees: BigInt(operationFee.toString()),
817980
817981
  feesPayer: transaction.transaction?.data.sender || ""
817981
817982
  };
817982
817983
  }
817983
- function toBlockOperation(transaction, change2) {
817984
+ function removeFeesFromAmountForNative(change2, fees2) {
817985
+ if (change2.coinType === DEFAULT_COIN_TYPE)
817986
+ return (0, import_bignumber302.BigNumber)(change2.amount).plus(fees2);
817987
+ return (0, import_bignumber302.BigNumber)(change2.amount);
817988
+ }
817989
+ function toBlockOperation(transaction, change2, fees2) {
817984
817990
  if (typeof change2.owner === "string" || !("AddressOwner" in change2.owner))
817985
817991
  return [];
817986
817992
  const address3 = change2.owner.AddressOwner;
817987
817993
  const operationType = getOperationType9(address3, transaction);
817988
- function transferOp(peer) {
817994
+ function transferOp(peer, amount) {
817989
817995
  const op = {
817990
817996
  type: "transfer",
817991
817997
  address: address3,
817992
817998
  asset: toSuiAsset(change2.coinType),
817993
- amount: BigInt(change2.amount)
817999
+ amount
817994
818000
  };
817995
818001
  if (peer)
817996
818002
  op.peer = peer;
@@ -817998,9 +818004,13 @@ function toBlockOperation(transaction, change2) {
817998
818004
  }
817999
818005
  switch (operationType) {
818000
818006
  case "IN":
818001
- return [transferOp(getOperationSenders2(transaction.transaction?.data).at(0))];
818007
+ return [
818008
+ transferOp(getOperationSenders2(transaction.transaction?.data).at(0), BigInt(change2.amount))
818009
+ ];
818002
818010
  case "OUT":
818003
- return [transferOp(getOperationRecipients2(transaction.transaction?.data).at(0))];
818011
+ return [
818012
+ transferOp(getOperationRecipients2(transaction.transaction?.data).at(0), BigInt(removeFeesFromAmountForNative(change2, fees2).toString()))
818013
+ ];
818004
818014
  case "DELEGATE":
818005
818015
  case "UNDELEGATE":
818006
818016
  return [
@@ -818009,11 +818019,18 @@ function toBlockOperation(transaction, change2) {
818009
818019
  operationType,
818010
818020
  address: change2.owner.AddressOwner,
818011
818021
  asset: toSuiAsset(change2.coinType),
818012
- amount: BigInt(absoluteAmount(change2).toString())
818022
+ amount: BigInt(removeFeesFromAmountForNative(change2, fees2).toString())
818013
818023
  }
818014
818024
  ];
818015
818025
  default:
818016
- return [];
818026
+ return [
818027
+ {
818028
+ type: "transfer",
818029
+ address: address3,
818030
+ asset: toSuiAsset(change2.coinType),
818031
+ amount: BigInt(change2.amount)
818032
+ }
818033
+ ];
818017
818034
  }
818018
818035
  }
818019
818036
  function toSuiAsset(coinType) {
@@ -818299,7 +818316,8 @@ var network_default3 = {
818299
818316
  paymentInfo: paymentInfo3,
818300
818317
  createTransaction: createTransaction25,
818301
818318
  executeTransactionBlock,
818302
- getStakes: getStakes2
818319
+ getStakes: getStakes2,
818320
+ getValidators: getValidators6
818303
818321
  };
818304
818322
 
818305
818323
  // ../../libs/coin-modules/coin-sui/lib-es/logic/craftTransaction.js
@@ -828613,6 +828631,9 @@ function createApi2(config4) {
828613
828631
  },
828614
828632
  getRewards(_address, _cursor) {
828615
828633
  throw new Error("getRewards is not supported");
828634
+ },
828635
+ getValidators(_cursor) {
828636
+ throw new Error("getValidators is not supported");
828616
828637
  }
828617
828638
  };
828618
828639
  }
@@ -829557,7 +829578,10 @@ function createApi3(config4) {
829557
829578
  getTransactionStatus: {
829558
829579
  throwIfPendingOperation: true
829559
829580
  }
829560
- })
829581
+ }),
829582
+ getValidators(_cursor) {
829583
+ throw new Error("getValidators is not supported");
829584
+ }
829561
829585
  };
829562
829586
  }
829563
829587
  async function craft2(transactionIntent, customFees) {
@@ -829671,6 +829695,9 @@ function createApi4(config4) {
829671
829695
  },
829672
829696
  getRewards(_address, _cursor) {
829673
829697
  throw new Error("getRewards is not supported");
829698
+ },
829699
+ getValidators(_cursor) {
829700
+ throw new Error("getValidators is not supported");
829674
829701
  }
829675
829702
  };
829676
829703
  }
@@ -829714,6 +829741,9 @@ function createApi5(config4, currencyId) {
829714
829741
  getRewards(_address, _cursor) {
829715
829742
  throw new Error("getRewards is not supported");
829716
829743
  },
829744
+ getValidators(_cursor) {
829745
+ throw new Error("getValidators is not supported");
829746
+ },
829717
829747
  getSequence: (address3) => getSequence(currency24, address3),
829718
829748
  validateIntent: (intent, customFees) => validateIntent(currency24, intent, customFees),
829719
829749
  getTokenFromAsset: (asset) => getTokenFromAsset(currency24, asset),
@@ -849805,6 +849835,9 @@ function createApi6(config4) {
849805
849835
  },
849806
849836
  getRewards(_address, _cursor) {
849807
849837
  throw new Error("getRewards is not supported");
849838
+ },
849839
+ getValidators(_cursor) {
849840
+ throw new Error("getValidators is not supported");
849808
849841
  }
849809
849842
  };
849810
849843
  }
@@ -850143,6 +850176,9 @@ var getNetworkAlpacaApi = (networkFamily) => ({
850143
850176
  },
850144
850177
  getRewards(_address, _cursor) {
850145
850178
  throw new Error("getRewards is not supported");
850179
+ },
850180
+ getValidators(_cursor) {
850181
+ throw new Error("getValidators is not supported");
850146
850182
  }
850147
850183
  });
850148
850184
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.26.1-nightly.1",
3
+ "version": "24.26.1-nightly.2",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",