@ledgerhq/live-cli 24.21.0-nightly.1 → 24.21.0-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.
- package/lib/cli.js +11 -25
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -516678,7 +516678,7 @@ var require_package8 = __commonJS({
|
|
|
516678
516678
|
module2.exports = {
|
|
516679
516679
|
name: "@ledgerhq/live-common",
|
|
516680
516680
|
description: "Common ground for the Ledger Live apps",
|
|
516681
|
-
version: "34.44.0-nightly.
|
|
516681
|
+
version: "34.44.0-nightly.2",
|
|
516682
516682
|
repository: {
|
|
516683
516683
|
type: "git",
|
|
516684
516684
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -523481,7 +523481,7 @@ var require_package9 = __commonJS({
|
|
|
523481
523481
|
"package.json"(exports2, module2) {
|
|
523482
523482
|
module2.exports = {
|
|
523483
523483
|
name: "@ledgerhq/live-cli",
|
|
523484
|
-
version: "24.21.0-nightly.
|
|
523484
|
+
version: "24.21.0-nightly.2",
|
|
523485
523485
|
description: "ledger-live CLI version",
|
|
523486
523486
|
repository: {
|
|
523487
523487
|
type: "git",
|
|
@@ -688006,6 +688006,7 @@ var getAccountShape8 = async (info6) => {
|
|
|
688006
688006
|
balance: accountBalance.balance,
|
|
688007
688007
|
spendableBalance: accountBalance.balance,
|
|
688008
688008
|
operations: operations2,
|
|
688009
|
+
operationsCount: operations2.length,
|
|
688009
688010
|
// NOTE: there are no "blocks" in hedera
|
|
688010
688011
|
// Set a value just so that operations are considered confirmed according to isConfirmedOperation
|
|
688011
688012
|
blockHeight: 10
|
|
@@ -690055,12 +690056,14 @@ var getAccountShape9 = async (info6) => {
|
|
|
690055
690056
|
const balance = await fetchBalances(address4);
|
|
690056
690057
|
const rawTxs = await fetchTxs2(address4);
|
|
690057
690058
|
const tokenAccounts = await buildTokenAccounts(address4, accountId2, info6.initialAccount);
|
|
690059
|
+
const operations2 = (0, import_flatMap9.default)(processTxs(rawTxs), mapTxToOps2(accountId2, info6)).sort((a65, b16) => b16.date.getTime() - a65.date.getTime());
|
|
690058
690060
|
const result2 = {
|
|
690059
690061
|
id: accountId2,
|
|
690060
690062
|
subAccounts: tokenAccounts,
|
|
690061
690063
|
balance: new import_bignumber185.BigNumber(balance.total_balance),
|
|
690062
690064
|
spendableBalance: new import_bignumber185.BigNumber(balance.spendable_balance),
|
|
690063
|
-
operations:
|
|
690065
|
+
operations: operations2,
|
|
690066
|
+
operationsCount: operations2.length,
|
|
690064
690067
|
blockHeight: blockHeight.current_block_identifier.index
|
|
690065
690068
|
};
|
|
690066
690069
|
return result2;
|
|
@@ -701691,7 +701694,7 @@ function getOperationType6(transaction, address4) {
|
|
|
701691
701694
|
}
|
|
701692
701695
|
}
|
|
701693
701696
|
function getOperationValue2(transaction, type4) {
|
|
701694
|
-
const amount = transaction.actions[0]
|
|
701697
|
+
const amount = transaction.actions[0]?.data?.deposit || 0;
|
|
701695
701698
|
if (type4 === "OUT") {
|
|
701696
701699
|
return new import_bignumber221.BigNumber(amount).plus(transaction.fee);
|
|
701697
701700
|
}
|
|
@@ -702703,7 +702706,6 @@ var PolkadotBondMinimumAmount = createCustomErrorClass("PolkadotBondMinimumAmoun
|
|
|
702703
702706
|
var PolkadotBondMinimumAmountWarning = createCustomErrorClass("PolkadotBondMinimumAmountWarning");
|
|
702704
702707
|
var PolkadotMaxUnbonding = createCustomErrorClass("PolkadotMaxUnbonding");
|
|
702705
702708
|
var PolkadotValidatorsRequired = createCustomErrorClass("PolkadotValidatorsRequired");
|
|
702706
|
-
var PolkadotDoMaxSendInstead = createCustomErrorClass("PolkadotDoMaxSendInstead");
|
|
702707
702709
|
|
|
702708
702710
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/preload.js
|
|
702709
702711
|
var import_bignumber234 = require("bignumber.js");
|
|
@@ -708555,10 +708557,6 @@ var calculateAmount4 = ({ account: account3, transaction }) => {
|
|
|
708555
708557
|
}
|
|
708556
708558
|
return amount.lt(0) ? new import_bignumber232.BigNumber(0) : amount;
|
|
708557
708559
|
};
|
|
708558
|
-
var getMinimumBalance2 = (a65) => {
|
|
708559
|
-
const lockedBalance = a65.balance.minus(a65.spendableBalance);
|
|
708560
|
-
return lockedBalance.lte(EXISTENTIAL_DEPOSIT2) ? EXISTENTIAL_DEPOSIT2.minus(lockedBalance) : new import_bignumber232.BigNumber(0);
|
|
708561
|
-
};
|
|
708562
708560
|
|
|
708563
708561
|
// ../../node_modules/.pnpm/@polkadot+types@11.2.1/node_modules/@polkadot/types/interfaces/definitions.js
|
|
708564
708562
|
var definitions_exports = {};
|
|
@@ -749912,15 +749910,7 @@ var getSendTransactionStatus4 = async (account3, transaction) => {
|
|
|
749912
749910
|
if (amount.lte(0) && !transaction.useAllAmount) {
|
|
749913
749911
|
errors.amount = new AmountRequired();
|
|
749914
749912
|
}
|
|
749915
|
-
|
|
749916
|
-
const leftover = account3.spendableBalance.minus(totalSpent);
|
|
749917
|
-
if (minimumBalanceExistential.gt(0) && leftover.lt(minimumBalanceExistential) && leftover.gt(0)) {
|
|
749918
|
-
errors.amount = new PolkadotDoMaxSendInstead("", {
|
|
749919
|
-
minimumBalance: formatCurrencyUnit(account3.currency.units[0], EXISTENTIAL_DEPOSIT2, {
|
|
749920
|
-
showCode: true
|
|
749921
|
-
})
|
|
749922
|
-
});
|
|
749923
|
-
} else if (!errors.amount && !transaction.useAllAmount && account3.spendableBalance.isZero()) {
|
|
749913
|
+
if (!errors.amount && !transaction.useAllAmount && account3.spendableBalance.isZero()) {
|
|
749924
749914
|
errors.amount = new NotEnoughBalance();
|
|
749925
749915
|
} else if (totalSpent.gt(account3.spendableBalance)) {
|
|
749926
749916
|
errors.amount = new NotEnoughBalance();
|
|
@@ -772366,11 +772356,11 @@ var StellarSourceHasMultiSign = createCustomErrorClass("StellarSourceHasMultiSig
|
|
|
772366
772356
|
var import_bignumber264 = __toESM(require("bignumber.js"));
|
|
772367
772357
|
var currency = getCryptoCurrencyById("stellar");
|
|
772368
772358
|
async function getAccountSpendableBalance2(balance, account3) {
|
|
772369
|
-
const minimumBalance =
|
|
772359
|
+
const minimumBalance = getMinimumBalance2(account3);
|
|
772370
772360
|
const { recommendedFee } = await fetchBaseFee();
|
|
772371
772361
|
return import_bignumber264.default.max(balance.minus(minimumBalance).minus(recommendedFee), 0);
|
|
772372
772362
|
}
|
|
772373
|
-
var
|
|
772363
|
+
var getMinimumBalance2 = (account3) => {
|
|
772374
772364
|
return parseCurrencyUnit(currency.units[0], getReservedBalance(account3).toString());
|
|
772375
772365
|
};
|
|
772376
772366
|
function getReservedBalance(account3) {
|
|
@@ -794088,6 +794078,7 @@ var getAccountShape17 = async ({ initialAccount, rest, currency: currency24, der
|
|
|
794088
794078
|
xpub: publicKey3,
|
|
794089
794079
|
freshAddress: address4,
|
|
794090
794080
|
operations: operations2,
|
|
794081
|
+
operationsCount: operations2.length,
|
|
794091
794082
|
balance,
|
|
794092
794083
|
subAccounts,
|
|
794093
794084
|
spendableBalance: balance,
|
|
@@ -825394,11 +825385,6 @@ var polkadot3 = {
|
|
|
825394
825385
|
(0, import_invariant95.default)(account3.spendableBalance.gte(EXISTENTIAL_DEPOSIT4.plus(POLKADOT_MIN_SAFE)), "send is too low to activate account");
|
|
825395
825386
|
amount = EXISTENTIAL_DEPOSIT4;
|
|
825396
825387
|
}
|
|
825397
|
-
const minimumBalanceExistential = getMinimumBalance2(account3);
|
|
825398
|
-
const leftover = account3.spendableBalance.minus(amount.plus(POLKADOT_MIN_SAFE));
|
|
825399
|
-
if (minimumBalanceExistential.gt(0) && leftover.lt(minimumBalanceExistential) && leftover.gt(0)) {
|
|
825400
|
-
throw new Error("risk of PolkadotDoMaxSendInstead");
|
|
825401
|
-
}
|
|
825402
825388
|
return {
|
|
825403
825389
|
transaction: bridge28.createTransaction(account3),
|
|
825404
825390
|
updates: [
|