@ledgerhq/live-cli 24.28.0-nightly.20251113102200 → 24.28.0-nightly.20251114023758
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.
- package/lib/cli.js +50 -34
- package/package.json +2 -2
package/lib/cli.js
CHANGED
|
@@ -520289,7 +520289,7 @@ var require_package7 = __commonJS({
|
|
|
520289
520289
|
module2.exports = {
|
|
520290
520290
|
name: "@ledgerhq/live-common",
|
|
520291
520291
|
description: "Common ground for the Ledger Live apps",
|
|
520292
|
-
version: "34.53.0-nightly.
|
|
520292
|
+
version: "34.53.0-nightly.20251114023758",
|
|
520293
520293
|
repository: {
|
|
520294
520294
|
type: "git",
|
|
520295
520295
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -520628,7 +520628,7 @@ var require_package8 = __commonJS({
|
|
|
520628
520628
|
"package.json"(exports2, module2) {
|
|
520629
520629
|
module2.exports = {
|
|
520630
520630
|
name: "@ledgerhq/live-cli",
|
|
520631
|
-
version: "24.28.0-nightly.
|
|
520631
|
+
version: "24.28.0-nightly.20251114023758",
|
|
520632
520632
|
description: "ledger-live CLI version",
|
|
520633
520633
|
repository: {
|
|
520634
520634
|
type: "git",
|
|
@@ -543589,6 +543589,7 @@ var PostOnboardingActionId;
|
|
|
543589
543589
|
PostOnboardingActionId2["migrateAssetsMock"] = "migrateAssetsMock";
|
|
543590
543590
|
PostOnboardingActionId2["personalizeMock"] = "personalizeMock";
|
|
543591
543591
|
PostOnboardingActionId2["recoverMock"] = "recoverMock";
|
|
543592
|
+
PostOnboardingActionId2["syncAccountsMock"] = "syncAccountsMock";
|
|
543592
543593
|
})(PostOnboardingActionId || (PostOnboardingActionId = {}));
|
|
543593
543594
|
|
|
543594
543595
|
// ../../libs/ledgerjs/packages/types-live/lib-es/storyly.js
|
|
@@ -694413,7 +694414,6 @@ var CHANGE_ADDRESS_TYPE = 1;
|
|
|
694413
694414
|
var INITIAL_BALANCE = (0, import_bignumber209.BigNumber)(0);
|
|
694414
694415
|
var GAP_LIMIT = 20;
|
|
694415
694416
|
var SCAN_BATCH_SIZE = 200;
|
|
694416
|
-
var MAX_TX_INPUTS = 88;
|
|
694417
694417
|
async function scanAddresses(compressedPublicKey, chainCode, startIndex) {
|
|
694418
694418
|
const kaspaBip32 = new KaspaBIP32(compressedPublicKey, chainCode);
|
|
694419
694419
|
const accountAddresses = {
|
|
@@ -694463,11 +694463,7 @@ async function scanAddresses(compressedPublicKey, chainCode, startIndex) {
|
|
|
694463
694463
|
updateAddressesData(addresses, accountAddresses, type4, keepScanning);
|
|
694464
694464
|
}
|
|
694465
694465
|
}
|
|
694466
|
-
|
|
694467
|
-
...accountAddresses.usedChangeAddresses,
|
|
694468
|
-
...accountAddresses.usedReceiveAddresses
|
|
694469
|
-
].sort((a67, b18) => b18.balance.minus(a67.balance).toNumber()).slice(0, MAX_TX_INPUTS).map((utxo) => utxo.balance).reduce((acc, v36) => acc.plus(v36), (0, import_bignumber209.BigNumber)(0));
|
|
694470
|
-
accountAddresses.spendableBalance = spendableBalance;
|
|
694466
|
+
accountAddresses.spendableBalance = accountAddresses.totalBalance;
|
|
694471
694467
|
return accountAddresses;
|
|
694472
694468
|
}
|
|
694473
694469
|
function updateAddressesData(addresses, accountAddresses, type4, keepScanning) {
|
|
@@ -694598,12 +694594,21 @@ var import_bignumber213 = require("bignumber.js");
|
|
|
694598
694594
|
|
|
694599
694595
|
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/utxos/lib.js
|
|
694600
694596
|
var import_bignumber212 = require("bignumber.js");
|
|
694601
|
-
|
|
694602
|
-
|
|
694597
|
+
|
|
694598
|
+
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/constants.js
|
|
694603
694599
|
var MAX_UTXOS_PER_TX = 88;
|
|
694600
|
+
var DEFAULT_MASS_1_OUTPUT = 506;
|
|
694601
|
+
var MASS_PER_INPUT = 1118;
|
|
694602
|
+
var MASS_PER_OUTPUT = 412;
|
|
694603
|
+
var MASS_LIMIT_PER_TX = 1e5;
|
|
694604
|
+
var MAX_DISCARD = 2e7;
|
|
694605
|
+
|
|
694606
|
+
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/utxos/lib.js
|
|
694604
694607
|
var calcMaxSpendableAmount = (utxos, isEcdsaRecipient, feerate = 1) => {
|
|
694605
|
-
|
|
694606
|
-
|
|
694608
|
+
sortUtxos(utxos);
|
|
694609
|
+
const utxoSubset = utxos.slice(0, MAX_UTXOS_PER_TX);
|
|
694610
|
+
const maxInputAmount = sumUtxoAmounts(utxoSubset);
|
|
694611
|
+
let maxSpendableAmount = maxInputAmount.minus((0, import_bignumber212.BigNumber)(DEFAULT_MASS_1_OUTPUT + utxoSubset.length * MASS_PER_INPUT).times(feerate));
|
|
694607
694612
|
if (isEcdsaRecipient) {
|
|
694608
694613
|
maxSpendableAmount = maxSpendableAmount.minus((0, import_bignumber212.BigNumber)(11));
|
|
694609
694614
|
}
|
|
@@ -694615,6 +694620,15 @@ var sumBigNumber = (values) => {
|
|
|
694615
694620
|
var sumUtxoAmounts = (utxos) => {
|
|
694616
694621
|
return utxos.reduce((acc, v36) => acc.plus(v36.utxoEntry.amount), (0, import_bignumber212.BigNumber)(0));
|
|
694617
694622
|
};
|
|
694623
|
+
var sortUtxos = (utxos) => {
|
|
694624
|
+
utxos.sort((a67, b18) => {
|
|
694625
|
+
const transactionComparison = a67.utxoEntry.blockDaaScore.localeCompare(b18.utxoEntry.blockDaaScore);
|
|
694626
|
+
if (transactionComparison !== 0) {
|
|
694627
|
+
return transactionComparison;
|
|
694628
|
+
}
|
|
694629
|
+
return a67.utxoEntry.amount.minus(b18.utxoEntry.amount).toNumber();
|
|
694630
|
+
});
|
|
694631
|
+
};
|
|
694618
694632
|
|
|
694619
694633
|
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/massCalcluation.js
|
|
694620
694634
|
var C27 = (0, import_bignumber213.BigNumber)(10 ** 12);
|
|
@@ -694642,21 +694656,14 @@ function calcStorageMass(inputs, outputs) {
|
|
|
694642
694656
|
|
|
694643
694657
|
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/utxos/selection.js
|
|
694644
694658
|
var import_bignumber214 = require("bignumber.js");
|
|
694645
|
-
var MASS_LIMIT_PER_TX = 1e5;
|
|
694646
|
-
var MASS_PER_INPUT = 1118;
|
|
694647
|
-
var MASS_PER_OUTPUT = 412;
|
|
694648
|
-
var MAX_UTXOS_PER_TX2 = 88;
|
|
694649
|
-
var MAX_DISCARD = 2e7;
|
|
694650
694659
|
var selectUtxos = (utxos, isEcdsaRecipient, amount, feerate = 1) => {
|
|
694651
694660
|
sortUtxos(utxos);
|
|
694652
|
-
|
|
694653
|
-
|
|
694654
|
-
}
|
|
694655
|
-
if (calcMaxSpendableAmount(utxos, isEcdsaRecipient, feerate).isLessThan(amount)) {
|
|
694661
|
+
const utxoSubset = utxos.slice(0, MAX_UTXOS_PER_TX);
|
|
694662
|
+
if (calcMaxSpendableAmount(utxoSubset, isEcdsaRecipient, feerate).isLessThan(amount)) {
|
|
694656
694663
|
throw new Error(`UTXO total amount is not sufficient for sending amount ${amount}`);
|
|
694657
694664
|
}
|
|
694658
|
-
for (let i58 = 0; i58 <
|
|
694659
|
-
const selectedUtxos =
|
|
694665
|
+
for (let i58 = 0; i58 < utxoSubset.length; i58++) {
|
|
694666
|
+
const selectedUtxos = utxoSubset.slice(0, i58 + 1);
|
|
694660
694667
|
const selectedUtxoAmount = sumUtxoAmounts(selectedUtxos);
|
|
694661
694668
|
const minMass = calcComputeMass(i58 + 1, false, isEcdsaRecipient);
|
|
694662
694669
|
const minFee = minMass * feerate;
|
|
@@ -694685,15 +694692,6 @@ var selectUtxos = (utxos, isEcdsaRecipient, amount, feerate = 1) => {
|
|
|
694685
694692
|
}
|
|
694686
694693
|
throw new Error("UTXOs can't be determined to fulfill the specified amount");
|
|
694687
694694
|
};
|
|
694688
|
-
var sortUtxos = (utxos) => {
|
|
694689
|
-
utxos.sort((a67, b18) => {
|
|
694690
|
-
const transactionComparison = a67.utxoEntry.blockDaaScore.localeCompare(b18.utxoEntry.blockDaaScore);
|
|
694691
|
-
if (transactionComparison !== 0) {
|
|
694692
|
-
return transactionComparison;
|
|
694693
|
-
}
|
|
694694
|
-
return a67.utxoEntry.amount.minus(b18.utxoEntry.amount).toNumber();
|
|
694695
|
-
});
|
|
694696
|
-
};
|
|
694697
694695
|
|
|
694698
694696
|
// ../../libs/coin-modules/coin-kaspa/lib-es/logic/getFeeRate.js
|
|
694699
694697
|
var import_bignumber215 = require("bignumber.js");
|
|
@@ -694724,6 +694722,16 @@ var estimateMaxSpendable15 = async ({ account: account3, parentAccount, transact
|
|
|
694724
694722
|
|
|
694725
694723
|
// ../../libs/coin-modules/coin-kaspa/lib-es/bridge/getTransactionStatus.js
|
|
694726
694724
|
init_lib_es();
|
|
694725
|
+
|
|
694726
|
+
// ../../libs/coin-modules/coin-kaspa/lib-es/types/errors.js
|
|
694727
|
+
init_lib_es();
|
|
694728
|
+
var NotEnoughFeeError = createCustomErrorClass("NotEnoughFeeError");
|
|
694729
|
+
var TransactionMassExceededError = createCustomErrorClass("TransactionMassExceededError");
|
|
694730
|
+
var EmptyRecipientError = createCustomErrorClass("EmptyRecipientError");
|
|
694731
|
+
var ReducedAmountUtxoWarning = createCustomErrorClass("ReducedAmountUtxoWarning");
|
|
694732
|
+
var UtxoLimitReachedError = createCustomErrorClass("UtxoLimitReachedError");
|
|
694733
|
+
|
|
694734
|
+
// ../../libs/coin-modules/coin-kaspa/lib-es/bridge/getTransactionStatus.js
|
|
694727
694735
|
var import_bignumber217 = require("bignumber.js");
|
|
694728
694736
|
var getCachedUtxos = makeLRUCache(async (account3) => {
|
|
694729
694737
|
const { compressedPublicKey, chainCode } = parseExtendedPublicKey(Buffer.from(account3.xpub, "hex"));
|
|
@@ -694765,9 +694773,16 @@ var getTransactionStatus14 = async (account3, transaction) => {
|
|
|
694765
694773
|
if (transaction.amount.lt(2e7)) {
|
|
694766
694774
|
errors.dustLimit = new DustLimit("");
|
|
694767
694775
|
}
|
|
694776
|
+
if (utxos.length > MAX_UTXOS_PER_TX) {
|
|
694777
|
+
warnings3.amount = new ReducedAmountUtxoWarning();
|
|
694778
|
+
}
|
|
694768
694779
|
}
|
|
694769
694780
|
if (transaction.amount.gt(maxSpendableAmount) || maxSpendableAmount.eq(0)) {
|
|
694770
|
-
|
|
694781
|
+
if (utxos.length > MAX_UTXOS_PER_TX && account3.balance.gt(transaction.amount)) {
|
|
694782
|
+
errors.amount = new UtxoLimitReachedError();
|
|
694783
|
+
} else {
|
|
694784
|
+
errors.amount = new NotEnoughBalance();
|
|
694785
|
+
}
|
|
694771
694786
|
}
|
|
694772
694787
|
if (Object.keys(errors).length === 0) {
|
|
694773
694788
|
const result2 = selectUtxos(utxos, transaction.recipient.length > 67, transaction.amount, getFeeRate(transaction).toNumber() || 1);
|
|
@@ -796970,6 +796985,7 @@ async function listOperations7(address3, { limit, minHeight, token, order }) {
|
|
|
796970
796985
|
const serverInfo = await getServerInfos();
|
|
796971
796986
|
const ledgers = serverInfo.info.complete_ledgers.split("-");
|
|
796972
796987
|
const minLedgerVersion = Number(ledgers[0]);
|
|
796988
|
+
const maxLedgerVersion = Number(ledgers[1]);
|
|
796973
796989
|
let forward = false;
|
|
796974
796990
|
if (order && order === "asc") {
|
|
796975
796991
|
forward = true;
|
|
@@ -796989,7 +797005,7 @@ async function listOperations7(address3, { limit, minHeight, token, order }) {
|
|
|
796989
797005
|
marker: JSON.parse(token)
|
|
796990
797006
|
};
|
|
796991
797007
|
}
|
|
796992
|
-
if (minHeight !== void 0) {
|
|
797008
|
+
if (minHeight !== void 0 && minHeight <= maxLedgerVersion) {
|
|
796993
797009
|
options24 = {
|
|
796994
797010
|
...options24,
|
|
796995
797011
|
// if there is no ops, it might be after a clear and we prefer to pull from the oldest possible history
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-cli",
|
|
3
|
-
"version": "24.28.0-nightly.
|
|
3
|
+
"version": "24.28.0-nightly.20251114023758",
|
|
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.89.0-nightly.
|
|
62
|
+
"@ledgerhq/types-live": "^6.89.0-nightly.20251114023758"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"directory": "dist"
|