@ledgerhq/live-cli 24.30.0-nightly.20251220023811 → 24.30.0-nightly.20251223024125
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 +48 -8
- package/package.json +3 -3
package/lib/cli.js
CHANGED
|
@@ -543744,7 +543744,7 @@ var require_package8 = __commonJS({
|
|
|
543744
543744
|
module2.exports = {
|
|
543745
543745
|
name: "@ledgerhq/live-common",
|
|
543746
543746
|
description: "Common ground for the Ledger Live apps",
|
|
543747
|
-
version: "34.55.0-nightly.
|
|
543747
|
+
version: "34.55.0-nightly.20251223024125",
|
|
543748
543748
|
repository: {
|
|
543749
543749
|
type: "git",
|
|
543750
543750
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -544084,7 +544084,7 @@ var require_package9 = __commonJS({
|
|
|
544084
544084
|
"package.json"(exports2, module2) {
|
|
544085
544085
|
module2.exports = {
|
|
544086
544086
|
name: "@ledgerhq/live-cli",
|
|
544087
|
-
version: "24.30.0-nightly.
|
|
544087
|
+
version: "24.30.0-nightly.20251223024125",
|
|
544088
544088
|
description: "ledger-live CLI version",
|
|
544089
544089
|
repository: {
|
|
544090
544090
|
type: "git",
|
|
@@ -683096,6 +683096,7 @@ var ESTIMATED_FEE_SAFETY_RATE = 2;
|
|
|
683096
683096
|
var DEFAULT_GAS_LIMIT2 = new import_bignumber187.default(1e5);
|
|
683097
683097
|
var DEFAULT_GAS_PRICE_TINYBARS = new import_bignumber187.default(100);
|
|
683098
683098
|
var HEDERA_MAINNET_CHAIN_ID = 295;
|
|
683099
|
+
var MEMO_CHARACTER_LIMIT = 100;
|
|
683099
683100
|
var HEDERA_DELEGATION_STATUS;
|
|
683100
683101
|
(function(HEDERA_DELEGATION_STATUS2) {
|
|
683101
683102
|
HEDERA_DELEGATION_STATUS2["Inactive"] = "inactive";
|
|
@@ -683541,6 +683542,7 @@ var HederaRecipientEvmAddressVerificationRequired = createCustomErrorClass("Hede
|
|
|
683541
683542
|
var HederaRedundantStakingNodeIdError = createCustomErrorClass("HederaRedundantStakingNodeIdError");
|
|
683542
683543
|
var HederaInvalidStakingNodeIdError = createCustomErrorClass("HederaInvalidStakingNodeIdError");
|
|
683543
683544
|
var HederaNoStakingRewardsError = createCustomErrorClass("HederaNoStakingRewardsError");
|
|
683545
|
+
var HederaMemoIsTooLong = createCustomErrorClass("HederaMemoIsTooLong");
|
|
683544
683546
|
|
|
683545
683547
|
// ../../libs/coin-modules/coin-hedera/lib-es/network/api.js
|
|
683546
683548
|
var API_URL = getEnv("API_HEDERA_MIRROR");
|
|
@@ -684623,6 +684625,12 @@ function validateRecipient3(account3, recipient) {
|
|
|
684623
684625
|
}
|
|
684624
684626
|
return null;
|
|
684625
684627
|
}
|
|
684628
|
+
function validateMemo(memo3) {
|
|
684629
|
+
if (memo3 && memo3.length > MEMO_CHARACTER_LIMIT) {
|
|
684630
|
+
return new HederaMemoIsTooLong(void 0, { maxLength: MEMO_CHARACTER_LIMIT });
|
|
684631
|
+
}
|
|
684632
|
+
return null;
|
|
684633
|
+
}
|
|
684626
684634
|
async function handleTokenAssociateTransaction(account3, transaction) {
|
|
684627
684635
|
const errors2 = {};
|
|
684628
684636
|
const warnings3 = {};
|
|
@@ -684636,6 +684644,10 @@ async function handleTokenAssociateTransaction(account3, transaction) {
|
|
|
684636
684644
|
const amount = (0, import_bignumber195.default)(0);
|
|
684637
684645
|
const totalSpent = amount.plus(estimatedFees.tinybars);
|
|
684638
684646
|
const isAssociationFlow = isTokenAssociationRequired(account3, transaction.properties.token);
|
|
684647
|
+
const memoError = validateMemo(transaction.memo);
|
|
684648
|
+
if (memoError) {
|
|
684649
|
+
errors2.memo = memoError;
|
|
684650
|
+
}
|
|
684639
684651
|
if (isAssociationFlow) {
|
|
684640
684652
|
const hbarBalance = account3.balance.dividedBy(10 ** account3.currency.units[0].magnitude);
|
|
684641
684653
|
const currentWorthInUSD = usdRate ? hbarBalance.multipliedBy(usdRate) : new import_bignumber195.default(0);
|
|
@@ -684665,9 +684677,13 @@ async function handleHTSTokenTransaction(account3, subAccount, transaction) {
|
|
|
684665
684677
|
})
|
|
684666
684678
|
]);
|
|
684667
684679
|
const recipientError = validateRecipient3(account3, transaction.recipient);
|
|
684680
|
+
const memoError = validateMemo(transaction.memo);
|
|
684668
684681
|
if (recipientError) {
|
|
684669
684682
|
errors2.recipient = recipientError;
|
|
684670
684683
|
}
|
|
684684
|
+
if (memoError) {
|
|
684685
|
+
errors2.memo = memoError;
|
|
684686
|
+
}
|
|
684671
684687
|
if (!errors2.recipient) {
|
|
684672
684688
|
try {
|
|
684673
684689
|
const hasRecipientTokenAssociated = await checkAccountTokenAssociationStatus(transaction.recipient, subAccount.token);
|
|
@@ -684719,9 +684735,13 @@ async function handleERC20TokenTransaction(account3, subAccount, transaction) {
|
|
|
684719
684735
|
})
|
|
684720
684736
|
]);
|
|
684721
684737
|
const recipientError = validateRecipient3(account3, transaction.recipient);
|
|
684738
|
+
const memoError = validateMemo(transaction.memo);
|
|
684722
684739
|
if (recipientError) {
|
|
684723
684740
|
errors2.recipient = recipientError;
|
|
684724
684741
|
}
|
|
684742
|
+
if (memoError) {
|
|
684743
|
+
errors2.memo = memoError;
|
|
684744
|
+
}
|
|
684725
684745
|
if (transaction.amount.eq(0)) {
|
|
684726
684746
|
errors2.amount = new AmountRequired();
|
|
684727
684747
|
}
|
|
@@ -684750,9 +684770,13 @@ async function handleCoinTransaction(account3, transaction) {
|
|
|
684750
684770
|
})
|
|
684751
684771
|
]);
|
|
684752
684772
|
const recipientError = validateRecipient3(account3, transaction.recipient);
|
|
684773
|
+
const memoError = validateMemo(transaction.memo);
|
|
684753
684774
|
if (recipientError) {
|
|
684754
684775
|
errors2.recipient = recipientError;
|
|
684755
684776
|
}
|
|
684777
|
+
if (memoError) {
|
|
684778
|
+
errors2.memo = memoError;
|
|
684779
|
+
}
|
|
684756
684780
|
if (transaction.amount.eq(0) && !transaction.useAllAmount) {
|
|
684757
684781
|
errors2.amount = new AmountRequired();
|
|
684758
684782
|
}
|
|
@@ -684778,6 +684802,10 @@ async function handleStakingTransaction(account3, transaction) {
|
|
|
684778
684802
|
});
|
|
684779
684803
|
const amount = (0, import_bignumber195.default)(0);
|
|
684780
684804
|
const totalSpent = amount.plus(estimatedFees.tinybars);
|
|
684805
|
+
const memoError = validateMemo(transaction.memo);
|
|
684806
|
+
if (memoError) {
|
|
684807
|
+
errors2.memo = memoError;
|
|
684808
|
+
}
|
|
684781
684809
|
if (transaction.mode === HEDERA_TRANSACTION_MODES.Delegate || transaction.mode === HEDERA_TRANSACTION_MODES.Redelegate) {
|
|
684782
684810
|
if (typeof transaction.properties?.stakingNodeId === "number") {
|
|
684783
684811
|
const isValid3 = validators5.some((validator2) => {
|
|
@@ -789008,7 +789036,7 @@ function handleStxTransaction(amount, useAllAmount, estimatedFees, spendableBala
|
|
|
789008
789036
|
}
|
|
789009
789037
|
return { amount, totalSpent };
|
|
789010
789038
|
}
|
|
789011
|
-
function
|
|
789039
|
+
function validateMemo3(memo3, errors2) {
|
|
789012
789040
|
const memoBytesLength = Buffer.from(memo3 ?? "", "utf-8").byteLength;
|
|
789013
789041
|
if (memoBytesLength > STACKS_MAX_MEMO_SIZE) {
|
|
789014
789042
|
errors2.transaction = new StacksMemoTooLong();
|
|
@@ -789035,7 +789063,7 @@ var getTransactionStatus18 = async (account3, transaction) => {
|
|
|
789035
789063
|
amount = result2.amount;
|
|
789036
789064
|
totalSpent = result2.totalSpent;
|
|
789037
789065
|
}
|
|
789038
|
-
|
|
789066
|
+
validateMemo3(memo3, errors2);
|
|
789039
789067
|
return {
|
|
789040
789068
|
errors: errors2,
|
|
789041
789069
|
warnings: warnings3,
|
|
@@ -878843,14 +878871,21 @@ var accountNames_default = manager2;
|
|
|
878843
878871
|
function toDistantState(addressesByCurrency) {
|
|
878844
878872
|
const state = {};
|
|
878845
878873
|
Object.keys(addressesByCurrency).forEach((key2) => {
|
|
878846
|
-
state[key2] = addressesByCurrency[key2].map((
|
|
878874
|
+
state[key2] = addressesByCurrency[key2].map((entry, index) => ({
|
|
878875
|
+
address: entry.address,
|
|
878876
|
+
index,
|
|
878877
|
+
lastUsed: entry.lastUsed
|
|
878878
|
+
}));
|
|
878847
878879
|
});
|
|
878848
878880
|
return state;
|
|
878849
878881
|
}
|
|
878850
878882
|
function toState(addressesByCurrency) {
|
|
878851
878883
|
const state = {};
|
|
878852
878884
|
Object.keys(addressesByCurrency).forEach((key2) => {
|
|
878853
|
-
state[key2] = addressesByCurrency[key2].sort((current2, other) => current2.index - other.index).map((data6) =>
|
|
878885
|
+
state[key2] = addressesByCurrency[key2].sort((current2, other) => current2.index - other.index).map((data6) => ({
|
|
878886
|
+
address: data6.address,
|
|
878887
|
+
lastUsed: data6.lastUsed ?? Date.now()
|
|
878888
|
+
}));
|
|
878854
878889
|
});
|
|
878855
878890
|
return state;
|
|
878856
878891
|
}
|
|
@@ -878858,12 +878893,17 @@ function sameDistantState2(localData, distantState) {
|
|
|
878858
878893
|
const localDataKeys = Object.keys(localData);
|
|
878859
878894
|
const distantStateKeys = Object.keys(distantState);
|
|
878860
878895
|
return localDataKeys.length === distantStateKeys.length && distantStateKeys.every((key2) => {
|
|
878861
|
-
return localData[key2] && localData[key2].length === distantState[key2].length && !distantState[key2].some((data6) =>
|
|
878896
|
+
return localData[key2] && localData[key2].length === distantState[key2].length && !distantState[key2].some((data6) => {
|
|
878897
|
+
if (data6.index < 0 || data6.index >= localData[key2].length)
|
|
878898
|
+
return true;
|
|
878899
|
+
return localData[key2][data6.index].address !== data6.address;
|
|
878900
|
+
});
|
|
878862
878901
|
});
|
|
878863
878902
|
}
|
|
878864
878903
|
var recentAddressesSchema = z5.object({
|
|
878865
878904
|
address: z5.string(),
|
|
878866
|
-
index: z5.number()
|
|
878905
|
+
index: z5.number(),
|
|
878906
|
+
lastUsed: z5.number().optional()
|
|
878867
878907
|
});
|
|
878868
878908
|
var schema3 = z5.record(z5.string(), z5.array(recentAddressesSchema));
|
|
878869
878909
|
var manager3 = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/live-cli",
|
|
3
|
-
"version": "24.30.0-nightly.
|
|
3
|
+
"version": "24.30.0-nightly.20251223024125",
|
|
4
4
|
"description": "ledger-live CLI version",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"ts-node": "10.9.2",
|
|
59
59
|
"tsup": "7.3.0",
|
|
60
60
|
"yaml": "2.8.1",
|
|
61
|
-
"@ledgerhq/types-cryptoassets": "^7.31.0-nightly.
|
|
62
|
-
"@ledgerhq/types-live": "^6.91.0-nightly.
|
|
61
|
+
"@ledgerhq/types-cryptoassets": "^7.31.0-nightly.20251223024125",
|
|
62
|
+
"@ledgerhq/types-live": "^6.91.0-nightly.20251223024125"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"directory": "dist"
|