@ledgerhq/live-cli 24.30.0-nightly.20251212024049 → 24.30.0-nightly.20251213023821
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 +134 -91
- 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.20251213023821",
|
|
543748
543748
|
repository: {
|
|
543749
543749
|
type: "git",
|
|
543750
543750
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -544081,7 +544081,7 @@ var require_package9 = __commonJS({
|
|
|
544081
544081
|
"package.json"(exports2, module2) {
|
|
544082
544082
|
module2.exports = {
|
|
544083
544083
|
name: "@ledgerhq/live-cli",
|
|
544084
|
-
version: "24.30.0-nightly.
|
|
544084
|
+
version: "24.30.0-nightly.20251213023821",
|
|
544085
544085
|
description: "ledger-live CLI version",
|
|
544086
544086
|
repository: {
|
|
544087
544087
|
type: "git",
|
|
@@ -567331,7 +567331,7 @@ function formatError(e95, longform = false) {
|
|
|
567331
567331
|
} else {
|
|
567332
567332
|
try {
|
|
567333
567333
|
out = "raw object: " + JSON.stringify(e95);
|
|
567334
|
-
} catch
|
|
567334
|
+
} catch {
|
|
567335
567335
|
out = String(e95);
|
|
567336
567336
|
}
|
|
567337
567337
|
}
|
|
@@ -682886,6 +682886,11 @@ var HEDERA_TRANSACTION_MODES;
|
|
|
682886
682886
|
HEDERA_TRANSACTION_MODES2["Redelegate"] = "redelegate";
|
|
682887
682887
|
HEDERA_TRANSACTION_MODES2["ClaimRewards"] = "claim-rewards";
|
|
682888
682888
|
})(HEDERA_TRANSACTION_MODES || (HEDERA_TRANSACTION_MODES = {}));
|
|
682889
|
+
var HEDERA_TRANSACTION_NAMES;
|
|
682890
|
+
(function(HEDERA_TRANSACTION_NAMES2) {
|
|
682891
|
+
HEDERA_TRANSACTION_NAMES2["ContractCall"] = "CONTRACTCALL";
|
|
682892
|
+
HEDERA_TRANSACTION_NAMES2["UpdateAccount"] = "CRYPTOUPDATEACCOUNT";
|
|
682893
|
+
})(HEDERA_TRANSACTION_NAMES || (HEDERA_TRANSACTION_NAMES = {}));
|
|
682889
682894
|
var HEDERA_OPERATION_TYPES;
|
|
682890
682895
|
(function(HEDERA_OPERATION_TYPES2) {
|
|
682891
682896
|
HEDERA_OPERATION_TYPES2["CryptoUpdate"] = "CryptoUpdate";
|
|
@@ -682945,6 +682950,17 @@ var MAP_STAKING_MODE_TO_MEMO = {
|
|
|
682945
682950
|
[HEDERA_TRANSACTION_MODES.Undelegate]: "Unstake",
|
|
682946
682951
|
[HEDERA_TRANSACTION_MODES.Redelegate]: "Restake"
|
|
682947
682952
|
};
|
|
682953
|
+
var MAP_STAKING_MODE_TO_OPERATION_TYPE = {
|
|
682954
|
+
[HEDERA_TRANSACTION_MODES.Delegate]: "DELEGATE",
|
|
682955
|
+
[HEDERA_TRANSACTION_MODES.Undelegate]: "UNDELEGATE",
|
|
682956
|
+
[HEDERA_TRANSACTION_MODES.Redelegate]: "REDELEGATE"
|
|
682957
|
+
};
|
|
682958
|
+
var MAP_STAKING_MODE_TO_METHOD = {
|
|
682959
|
+
[HEDERA_TRANSACTION_MODES.Delegate]: "Delegate",
|
|
682960
|
+
[HEDERA_TRANSACTION_MODES.Undelegate]: "Undelegate",
|
|
682961
|
+
[HEDERA_TRANSACTION_MODES.Redelegate]: "Redelegate",
|
|
682962
|
+
[HEDERA_TRANSACTION_MODES.ClaimRewards]: "Claim Rewards"
|
|
682963
|
+
};
|
|
682948
682964
|
|
|
682949
682965
|
// ../../libs/coin-modules/coin-hedera/lib-es/network/api.js
|
|
682950
682966
|
var import_bignumber188 = __toESM(require("bignumber.js"));
|
|
@@ -683355,11 +683371,15 @@ async function getAccountsForPublicKey(publicKey4) {
|
|
|
683355
683371
|
const accounts2 = res.data.accounts;
|
|
683356
683372
|
return accounts2;
|
|
683357
683373
|
}
|
|
683358
|
-
async function getAccount3(address3) {
|
|
683374
|
+
async function getAccount3(address3, timestamp) {
|
|
683359
683375
|
try {
|
|
683376
|
+
const params = new URLSearchParams({
|
|
683377
|
+
transactions: "false",
|
|
683378
|
+
...timestamp && { timestamp }
|
|
683379
|
+
});
|
|
683360
683380
|
const res = await lib_es_default({
|
|
683361
683381
|
method: "GET",
|
|
683362
|
-
url: `${API_URL}/api/v1/accounts/${address3}`
|
|
683382
|
+
url: `${API_URL}/api/v1/accounts/${address3}?${params.toString()}`
|
|
683363
683383
|
});
|
|
683364
683384
|
const account3 = res.data;
|
|
683365
683385
|
return account3;
|
|
@@ -683370,6 +683390,11 @@ async function getAccount3(address3) {
|
|
|
683370
683390
|
throw error;
|
|
683371
683391
|
}
|
|
683372
683392
|
}
|
|
683393
|
+
var getPaginationDirection = (fetchAllPages, order) => {
|
|
683394
|
+
if (fetchAllPages)
|
|
683395
|
+
return "gt";
|
|
683396
|
+
return order === "asc" ? "gt" : "lt";
|
|
683397
|
+
};
|
|
683373
683398
|
async function getAccountTransactions2({ address: address3, pagingToken, limit = 100, order = "desc", fetchAllPages }) {
|
|
683374
683399
|
const transactions3 = [];
|
|
683375
683400
|
const params = new URLSearchParams({
|
|
@@ -683377,13 +683402,8 @@ async function getAccountTransactions2({ address: address3, pagingToken, limit =
|
|
|
683377
683402
|
limit: limit.toString(),
|
|
683378
683403
|
order
|
|
683379
683404
|
});
|
|
683380
|
-
const getTimestampDirection = () => {
|
|
683381
|
-
if (fetchAllPages)
|
|
683382
|
-
return "gt";
|
|
683383
|
-
return order === "asc" ? "gt" : "lt";
|
|
683384
|
-
};
|
|
683385
683405
|
if (pagingToken) {
|
|
683386
|
-
params.append("timestamp", `${
|
|
683406
|
+
params.append("timestamp", `${getPaginationDirection(fetchAllPages, order)}:${pagingToken}`);
|
|
683387
683407
|
}
|
|
683388
683408
|
let nextCursor = null;
|
|
683389
683409
|
let nextPath = `/api/v1/transactions?${params.toString()}`;
|
|
@@ -683460,7 +683480,8 @@ async function findTransactionByContractCall(timestamp, contractId) {
|
|
|
683460
683480
|
url: `${API_URL}/api/v1/transactions?timestamp=${timestamp}`
|
|
683461
683481
|
});
|
|
683462
683482
|
const transactions3 = res.data.transactions;
|
|
683463
|
-
|
|
683483
|
+
const relatedTx = transactions3.find((el) => el.name === HEDERA_TRANSACTION_NAMES.ContractCall && el.entity_id === contractId);
|
|
683484
|
+
return relatedTx ?? null;
|
|
683464
683485
|
}
|
|
683465
683486
|
async function getERC20Balance(accountEvmAddress, contractEvmAddress) {
|
|
683466
683487
|
const res = await lib_es_default({
|
|
@@ -683516,12 +683537,16 @@ async function getTransactionsByTimestampRange(startTimestamp, endTimestamp) {
|
|
|
683516
683537
|
}
|
|
683517
683538
|
return transactions3;
|
|
683518
683539
|
}
|
|
683519
|
-
async function getNodes() {
|
|
683540
|
+
async function getNodes({ cursor, limit = 100, order = "desc", fetchAllPages }) {
|
|
683520
683541
|
const nodes = [];
|
|
683521
683542
|
const params = new URLSearchParams({
|
|
683522
|
-
order
|
|
683523
|
-
limit:
|
|
683543
|
+
order,
|
|
683544
|
+
limit: limit.toString()
|
|
683524
683545
|
});
|
|
683546
|
+
if (cursor) {
|
|
683547
|
+
params.append("node.id", `${getPaginationDirection(fetchAllPages, order)}:${cursor}`);
|
|
683548
|
+
}
|
|
683549
|
+
let nextCursor = null;
|
|
683525
683550
|
let nextPath = `/api/v1/network/nodes?${params.toString()}`;
|
|
683526
683551
|
while (nextPath) {
|
|
683527
683552
|
const res = await lib_es_default({
|
|
@@ -683531,8 +683556,18 @@ async function getNodes() {
|
|
|
683531
683556
|
const newNodes = res.data.nodes;
|
|
683532
683557
|
nodes.push(...newNodes);
|
|
683533
683558
|
nextPath = res.data.links.next;
|
|
683559
|
+
if (!fetchAllPages && nodes.length >= limit) {
|
|
683560
|
+
break;
|
|
683561
|
+
}
|
|
683562
|
+
}
|
|
683563
|
+
if (!fetchAllPages && nodes.length > limit) {
|
|
683564
|
+
nodes.splice(limit);
|
|
683534
683565
|
}
|
|
683535
|
-
|
|
683566
|
+
if (!fetchAllPages && nextPath) {
|
|
683567
|
+
const lastNode = nodes.at(-1);
|
|
683568
|
+
nextCursor = lastNode?.node_id?.toString() ?? null;
|
|
683569
|
+
}
|
|
683570
|
+
return { nodes, nextCursor };
|
|
683536
683571
|
}
|
|
683537
683572
|
var apiClient = {
|
|
683538
683573
|
getAccountsForPublicKey,
|
|
@@ -683746,6 +683781,32 @@ var isStakingTransaction = (tx) => {
|
|
|
683746
683781
|
var hasSpecificIntentData = (txIntent, expectedType) => {
|
|
683747
683782
|
return "data" in txIntent && txIntent.data.type === expectedType;
|
|
683748
683783
|
};
|
|
683784
|
+
var analyzeStakingOperation = async (address3, mirrorTx) => {
|
|
683785
|
+
const [accountBefore, accountAfter] = await Promise.all([
|
|
683786
|
+
apiClient.getAccount(address3, `lt:${mirrorTx.consensus_timestamp}`),
|
|
683787
|
+
apiClient.getAccount(address3, `eq:${mirrorTx.consensus_timestamp}`)
|
|
683788
|
+
]);
|
|
683789
|
+
let operationType = null;
|
|
683790
|
+
const previousStakingNodeId = accountBefore.staked_node_id;
|
|
683791
|
+
const targetStakingNodeId = accountAfter.staked_node_id;
|
|
683792
|
+
if (previousStakingNodeId === null && targetStakingNodeId !== null) {
|
|
683793
|
+
operationType = "DELEGATE";
|
|
683794
|
+
} else if (previousStakingNodeId !== null && targetStakingNodeId === null) {
|
|
683795
|
+
operationType = "UNDELEGATE";
|
|
683796
|
+
} else if (previousStakingNodeId !== null && targetStakingNodeId !== null && previousStakingNodeId !== targetStakingNodeId) {
|
|
683797
|
+
operationType = "REDELEGATE";
|
|
683798
|
+
}
|
|
683799
|
+
if (!operationType) {
|
|
683800
|
+
return null;
|
|
683801
|
+
}
|
|
683802
|
+
return {
|
|
683803
|
+
operationType,
|
|
683804
|
+
previousStakingNodeId,
|
|
683805
|
+
targetStakingNodeId,
|
|
683806
|
+
stakedAmount: BigInt(accountAfter.balance.balance)
|
|
683807
|
+
// always entire balance on Hedera (fully liquid)
|
|
683808
|
+
};
|
|
683809
|
+
};
|
|
683749
683810
|
|
|
683750
683811
|
// ../../libs/coin-modules/coin-hedera/lib-es/logic/broadcast.js
|
|
683751
683812
|
var broadcast12 = async (txWithSignature) => {
|
|
@@ -684650,8 +684711,8 @@ var getPreloadStrategy3 = () => ({
|
|
|
684650
684711
|
});
|
|
684651
684712
|
async function preload3(currency24) {
|
|
684652
684713
|
log2("hedera/preload", "preloading hedera data...");
|
|
684653
|
-
const
|
|
684654
|
-
const validators9 = nodes.map((mirrorNode) => {
|
|
684714
|
+
const result2 = await apiClient.getNodes({ fetchAllPages: true });
|
|
684715
|
+
const validators9 = result2.nodes.map((mirrorNode) => {
|
|
684655
684716
|
const minStake = new import_bignumber197.default(mirrorNode.min_stake);
|
|
684656
684717
|
const maxStake = new import_bignumber197.default(mirrorNode.max_stake);
|
|
684657
684718
|
const activeStake = new import_bignumber197.default(mirrorNode.stake_rewarded);
|
|
@@ -684713,17 +684774,14 @@ var import_bignumber198 = __toESM(require("bignumber.js"));
|
|
|
684713
684774
|
var import_invariant31 = __toESM(require("invariant"));
|
|
684714
684775
|
var buildOptimisticTokenAssociateOperation = async ({ account: account3, transaction }) => {
|
|
684715
684776
|
(0, import_invariant31.default)(isTokenAssociateTransaction(transaction), "invalid transaction properties");
|
|
684716
|
-
const
|
|
684717
|
-
currency: account3.currency,
|
|
684718
|
-
operationType: HEDERA_OPERATION_TYPES.TokenAssociate
|
|
684719
|
-
});
|
|
684777
|
+
const fee = transaction.maxFee ?? new import_bignumber198.default(0);
|
|
684720
684778
|
const type4 = "ASSOCIATE_TOKEN";
|
|
684721
684779
|
const operation = {
|
|
684722
684780
|
id: encodeOperationId(account3.id, "", type4),
|
|
684723
684781
|
hash: "",
|
|
684724
684782
|
type: type4,
|
|
684725
|
-
value:
|
|
684726
|
-
fee
|
|
684783
|
+
value: fee,
|
|
684784
|
+
fee,
|
|
684727
684785
|
blockHash: null,
|
|
684728
684786
|
blockHeight: null,
|
|
684729
684787
|
senders: [account3.freshAddress.toString()],
|
|
@@ -684737,10 +684795,7 @@ var buildOptimisticTokenAssociateOperation = async ({ account: account3, transac
|
|
|
684737
684795
|
return operation;
|
|
684738
684796
|
};
|
|
684739
684797
|
var buildOptimisticCoinOperation = async ({ account: account3, transaction, transactionType }) => {
|
|
684740
|
-
const
|
|
684741
|
-
currency: account3.currency,
|
|
684742
|
-
operationType: HEDERA_OPERATION_TYPES.CryptoTransfer
|
|
684743
|
-
});
|
|
684798
|
+
const fee = transactionType === "FEES" ? transaction.amount : transaction.maxFee ?? new import_bignumber198.default(0);
|
|
684744
684799
|
const value2 = transaction.amount;
|
|
684745
684800
|
const type4 = transactionType ?? "OUT";
|
|
684746
684801
|
const [_24, recipientAddress] = safeParseAccountId(transaction.recipient);
|
|
@@ -684751,7 +684806,7 @@ var buildOptimisticCoinOperation = async ({ account: account3, transaction, tran
|
|
|
684751
684806
|
hash: "",
|
|
684752
684807
|
type: type4,
|
|
684753
684808
|
value: value2,
|
|
684754
|
-
fee
|
|
684809
|
+
fee,
|
|
684755
684810
|
blockHash: null,
|
|
684756
684811
|
blockHeight: null,
|
|
684757
684812
|
senders: [account3.freshAddress.toString()],
|
|
@@ -684765,10 +684820,7 @@ var buildOptimisticCoinOperation = async ({ account: account3, transaction, tran
|
|
|
684765
684820
|
return operation;
|
|
684766
684821
|
};
|
|
684767
684822
|
var buildOptimisticHTSTokenOperation = async ({ account: account3, tokenAccount, transaction }) => {
|
|
684768
|
-
const
|
|
684769
|
-
currency: account3.currency,
|
|
684770
|
-
operationType: HEDERA_OPERATION_TYPES.TokenTransfer
|
|
684771
|
-
});
|
|
684823
|
+
const fee = transaction.maxFee ?? new import_bignumber198.default(0);
|
|
684772
684824
|
const value2 = transaction.amount;
|
|
684773
684825
|
const type4 = "OUT";
|
|
684774
684826
|
const [_24, recipientAddress] = safeParseAccountId(transaction.recipient);
|
|
@@ -684778,7 +684830,7 @@ var buildOptimisticHTSTokenOperation = async ({ account: account3, tokenAccount,
|
|
|
684778
684830
|
account: account3,
|
|
684779
684831
|
transaction: {
|
|
684780
684832
|
...transaction,
|
|
684781
|
-
amount:
|
|
684833
|
+
amount: fee
|
|
684782
684834
|
},
|
|
684783
684835
|
transactionType: "FEES"
|
|
684784
684836
|
});
|
|
@@ -684790,7 +684842,7 @@ var buildOptimisticHTSTokenOperation = async ({ account: account3, tokenAccount,
|
|
|
684790
684842
|
hash: "",
|
|
684791
684843
|
type: type4,
|
|
684792
684844
|
value: value2,
|
|
684793
|
-
fee
|
|
684845
|
+
fee,
|
|
684794
684846
|
blockHash: null,
|
|
684795
684847
|
blockHeight: null,
|
|
684796
684848
|
senders: [account3.freshAddress.toString()],
|
|
@@ -684806,21 +684858,7 @@ var buildOptimisticHTSTokenOperation = async ({ account: account3, tokenAccount,
|
|
|
684806
684858
|
return operation;
|
|
684807
684859
|
};
|
|
684808
684860
|
var buildOptimisticERC20TokenOperation = async ({ account: account3, tokenAccount, transaction }) => {
|
|
684809
|
-
const
|
|
684810
|
-
operationType: HEDERA_OPERATION_TYPES.ContractCall,
|
|
684811
|
-
txIntent: {
|
|
684812
|
-
intentType: "transaction",
|
|
684813
|
-
type: HEDERA_TRANSACTION_MODES.Send,
|
|
684814
|
-
asset: {
|
|
684815
|
-
type: "erc20",
|
|
684816
|
-
assetReference: tokenAccount.token.contractAddress,
|
|
684817
|
-
assetOwner: account3.freshAddress
|
|
684818
|
-
},
|
|
684819
|
-
amount: BigInt(transaction.amount.toString()),
|
|
684820
|
-
sender: account3.freshAddress,
|
|
684821
|
-
recipient: transaction.recipient
|
|
684822
|
-
}
|
|
684823
|
-
});
|
|
684861
|
+
const fee = transaction.maxFee ?? new import_bignumber198.default(0);
|
|
684824
684862
|
const value2 = transaction.amount;
|
|
684825
684863
|
const type4 = "OUT";
|
|
684826
684864
|
const memo3 = transaction.memo;
|
|
@@ -684828,7 +684866,7 @@ var buildOptimisticERC20TokenOperation = async ({ account: account3, tokenAccoun
|
|
|
684828
684866
|
account: account3,
|
|
684829
684867
|
transaction: {
|
|
684830
684868
|
...transaction,
|
|
684831
|
-
amount:
|
|
684869
|
+
amount: fee
|
|
684832
684870
|
},
|
|
684833
684871
|
transactionType: "FEES"
|
|
684834
684872
|
});
|
|
@@ -684840,7 +684878,7 @@ var buildOptimisticERC20TokenOperation = async ({ account: account3, tokenAccoun
|
|
|
684840
684878
|
hash: "",
|
|
684841
684879
|
type: type4,
|
|
684842
684880
|
value: value2,
|
|
684843
|
-
fee
|
|
684881
|
+
fee,
|
|
684844
684882
|
blockHash: null,
|
|
684845
684883
|
blockHeight: null,
|
|
684846
684884
|
senders: [account3.freshAddress.toString()],
|
|
@@ -684857,18 +684895,15 @@ var buildOptimisticERC20TokenOperation = async ({ account: account3, tokenAccoun
|
|
|
684857
684895
|
};
|
|
684858
684896
|
var buildOptimisticUpdateAccountOperation = async ({ account: account3, transaction }) => {
|
|
684859
684897
|
(0, import_invariant31.default)(isStakingTransaction(transaction), "invalid transaction properties");
|
|
684860
|
-
const
|
|
684861
|
-
operationType: HEDERA_OPERATION_TYPES.CryptoUpdate,
|
|
684862
|
-
currency: account3.currency
|
|
684863
|
-
});
|
|
684898
|
+
const fee = transaction.maxFee ?? new import_bignumber198.default(0);
|
|
684864
684899
|
const value2 = transaction.amount;
|
|
684865
|
-
const type4 =
|
|
684900
|
+
const type4 = MAP_STAKING_MODE_TO_OPERATION_TYPE[transaction.mode];
|
|
684866
684901
|
const operation = {
|
|
684867
684902
|
id: encodeOperationId(account3.id, "", type4),
|
|
684868
684903
|
hash: "",
|
|
684869
684904
|
type: type4,
|
|
684870
684905
|
value: value2,
|
|
684871
|
-
fee
|
|
684906
|
+
fee,
|
|
684872
684907
|
blockHash: null,
|
|
684873
684908
|
blockHeight: null,
|
|
684874
684909
|
senders: [account3.freshAddress.toString()],
|
|
@@ -685222,7 +685257,7 @@ async function processTokenTransfers({ rawTx, address: address3, currency: curre
|
|
|
685222
685257
|
tokenOperation
|
|
685223
685258
|
};
|
|
685224
685259
|
}
|
|
685225
|
-
function processTransfers({ rawTx, address: address3, ledgerAccountId, commonData, mirrorTokens }) {
|
|
685260
|
+
function processTransfers({ rawTx, address: address3, ledgerAccountId, commonData, mirrorTokens, stakingAnalysis }) {
|
|
685226
685261
|
const coinOperations = [];
|
|
685227
685262
|
const transfers = rawTx.transfers ?? [];
|
|
685228
685263
|
if (transfers.length === 0) {
|
|
@@ -685231,7 +685266,13 @@ function processTransfers({ rawTx, address: address3, ledgerAccountId, commonDat
|
|
|
685231
685266
|
const { type: type4, value: value2, senders, recipients } = parseTransfers(transfers, address3);
|
|
685232
685267
|
const { hash: hash9, fee, timestamp, blockHeight, blockHash, hasFailed } = commonData;
|
|
685233
685268
|
const extra = { ...commonData.extra };
|
|
685234
|
-
|
|
685269
|
+
let operationType = txNameToCustomOperationType[rawTx.name] ?? type4;
|
|
685270
|
+
if (stakingAnalysis) {
|
|
685271
|
+
operationType = stakingAnalysis.operationType;
|
|
685272
|
+
extra.previousStakingNodeId = stakingAnalysis.previousStakingNodeId;
|
|
685273
|
+
extra.targetStakingNodeId = stakingAnalysis.targetStakingNodeId;
|
|
685274
|
+
extra.stakedAmount = new import_bignumber200.default(stakingAnalysis.stakedAmount.toString());
|
|
685275
|
+
}
|
|
685235
685276
|
const stakingReward = rawTx.staking_reward_transfers.reduce((acc, transfer) => {
|
|
685236
685277
|
const transferAmount = new import_bignumber200.default(transfer.amount);
|
|
685237
685278
|
if (transfer.account === address3) {
|
|
@@ -685302,6 +685343,7 @@ async function listOperations3({ currency: currency24, address: address3, mirror
|
|
|
685302
685343
|
});
|
|
685303
685344
|
for (const rawTx of mirrorResult.transactions) {
|
|
685304
685345
|
const commonData = getCommonOperationData(rawTx, useEncodedHash, useSyntheticBlocks);
|
|
685346
|
+
const stakingAnalysis = rawTx.name === HEDERA_TRANSACTION_NAMES.UpdateAccount ? await analyzeStakingOperation(address3, rawTx) : null;
|
|
685305
685347
|
const tokenResult = await processTokenTransfers({
|
|
685306
685348
|
rawTx,
|
|
685307
685349
|
address: address3,
|
|
@@ -685320,7 +685362,8 @@ async function listOperations3({ currency: currency24, address: address3, mirror
|
|
|
685320
685362
|
address: address3,
|
|
685321
685363
|
ledgerAccountId,
|
|
685322
685364
|
commonData,
|
|
685323
|
-
mirrorTokens
|
|
685365
|
+
mirrorTokens,
|
|
685366
|
+
stakingAnalysis
|
|
685324
685367
|
});
|
|
685325
685368
|
coinOperations.push(...newCoinOperations);
|
|
685326
685369
|
}
|
|
@@ -694560,7 +694603,7 @@ init_lib_es();
|
|
|
694560
694603
|
var getAddress7 = (a127) => ({ address: a127.freshAddress, derivationPath: a127.freshAddressPath });
|
|
694561
694604
|
|
|
694562
694605
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/getTransactionStatus.js
|
|
694563
|
-
var
|
|
694606
|
+
var import_utils237 = require("@zondax/ledger-live-icp/utils");
|
|
694564
694607
|
|
|
694565
694608
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/errors.js
|
|
694566
694609
|
init_lib_es();
|
|
@@ -694576,19 +694619,19 @@ var getTransactionStatus11 = async (account3, transaction) => {
|
|
|
694576
694619
|
let { amount } = transaction;
|
|
694577
694620
|
if (!recipient) {
|
|
694578
694621
|
errors2.recipient = new RecipientRequired();
|
|
694579
|
-
} else if (!(await (0,
|
|
694622
|
+
} else if (!(await (0, import_utils237.validateAddress)(recipient)).isValid) {
|
|
694580
694623
|
errors2.recipient = new InvalidAddress("", {
|
|
694581
694624
|
currencyName: account3.currency.name
|
|
694582
694625
|
});
|
|
694583
694626
|
} else if (recipient.toLowerCase() === address3.toLowerCase()) {
|
|
694584
694627
|
errors2.recipient = new InvalidAddressBecauseDestinationIsAlsoSource();
|
|
694585
694628
|
}
|
|
694586
|
-
if (!(await (0,
|
|
694629
|
+
if (!(await (0, import_utils237.validateAddress)(address3)).isValid) {
|
|
694587
694630
|
errors2.sender = new InvalidAddress("", {
|
|
694588
694631
|
currencyName: account3.currency.name
|
|
694589
694632
|
});
|
|
694590
694633
|
}
|
|
694591
|
-
if (!(0,
|
|
694634
|
+
if (!(0, import_utils237.validateMemo)(transaction.memo).isValid) {
|
|
694592
694635
|
errors2.transaction = new InvalidMemoICP();
|
|
694593
694636
|
}
|
|
694594
694637
|
const estimatedFees = transaction.fees;
|
|
@@ -694677,7 +694720,7 @@ var createTransaction13 = () => {
|
|
|
694677
694720
|
init_lib_es2();
|
|
694678
694721
|
var import_ledger_live_icp2 = require("@zondax/ledger-live-icp");
|
|
694679
694722
|
var import_bignumber214 = __toESM(require("bignumber.js"));
|
|
694680
|
-
var
|
|
694723
|
+
var import_utils238 = require("@zondax/ledger-live-icp/utils");
|
|
694681
694724
|
var import_agent = require("@zondax/ledger-live-icp/agent");
|
|
694682
694725
|
var import_invariant38 = __toESM(require("invariant"));
|
|
694683
694726
|
var fetchBlockHeight3 = async () => {
|
|
@@ -694695,7 +694738,7 @@ var fetchBlockHeight3 = async () => {
|
|
|
694695
694738
|
});
|
|
694696
694739
|
(0, import_invariant38.default)(blockHeightRes.status === "replied", "[ICP](fetchBlockHeight) Query failed");
|
|
694697
694740
|
const decodedIdl = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(queryBlocksIdlFunc, blockHeightRes.reply.arg);
|
|
694698
|
-
const decoded = (0,
|
|
694741
|
+
const decoded = (0, import_utils238.fromNullable)(decodedIdl);
|
|
694699
694742
|
(0, import_invariant38.default)(decoded, "[ICP](fetchBlockHeight) Decoding failed");
|
|
694700
694743
|
return (0, import_bignumber214.default)(decoded.chain_length.toString());
|
|
694701
694744
|
};
|
|
@@ -694727,7 +694770,7 @@ var fetchBalance2 = async (address3) => {
|
|
|
694727
694770
|
return (0, import_bignumber214.default)(0);
|
|
694728
694771
|
}
|
|
694729
694772
|
const decodedBalance = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(getBalanceIdlFunc, balanceRes.reply.arg);
|
|
694730
|
-
const balance2 = (0,
|
|
694773
|
+
const balance2 = (0, import_utils238.fromNullable)(decodedBalance);
|
|
694731
694774
|
if (!balance2) {
|
|
694732
694775
|
return (0, import_bignumber214.default)(0);
|
|
694733
694776
|
}
|
|
@@ -694754,7 +694797,7 @@ var fetchTxns = async (address3, startBlockHeight, stopBlockHeight = BigInt(0))
|
|
|
694754
694797
|
});
|
|
694755
694798
|
(0, import_invariant38.default)(transactionsRes.status === "replied", "[ICP](fetchTxns) Query failed");
|
|
694756
694799
|
const decodedTransactions = (0, import_ledger_live_icp2.decodeCanisterIdlFunc)(getTransactionsIdlFunc, transactionsRes.reply.arg);
|
|
694757
|
-
const response = (0,
|
|
694800
|
+
const response = (0, import_utils238.fromNullable)(decodedTransactions);
|
|
694758
694801
|
(0, import_invariant38.default)(response, "[ICP](fetchTxns) Decoding failed");
|
|
694759
694802
|
if (response.Ok.transactions.length === 0) {
|
|
694760
694803
|
return [];
|
|
@@ -694920,7 +694963,7 @@ var mapTxToOps3 = (accountId2, address3, fee = ICP_FEES) => {
|
|
|
694920
694963
|
|
|
694921
694964
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/signOperation.js
|
|
694922
694965
|
var import_rxjs28 = require("rxjs");
|
|
694923
|
-
var
|
|
694966
|
+
var import_utils241 = require("@zondax/ledger-live-icp/utils");
|
|
694924
694967
|
var import_agent2 = require("@zondax/ledger-live-icp/agent");
|
|
694925
694968
|
|
|
694926
694969
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/buildOptimisticOperation.js
|
|
@@ -694959,7 +695002,7 @@ var signICPTransaction = async (unsignedTxn, derivationPath, signerContext4, acc
|
|
|
694959
695002
|
signature: Buffer.from(signatures.signatureRS).toString("hex"),
|
|
694960
695003
|
callBody: {
|
|
694961
695004
|
content: unsignedTxn,
|
|
694962
|
-
sender_pubkey: (0,
|
|
695005
|
+
sender_pubkey: (0, import_utils241.pubkeyToDer)(account3.xpub),
|
|
694963
695006
|
sender_sig: signatures.signatureRS
|
|
694964
695007
|
}
|
|
694965
695008
|
};
|
|
@@ -694971,7 +695014,7 @@ var buildSignOperation11 = (signerContext4) => ({ account: account3, transaction
|
|
|
694971
695014
|
const { xpub } = account3;
|
|
694972
695015
|
(0, import_invariant40.default)(xpub, "[ICP](signOperation) Account xpub is required");
|
|
694973
695016
|
const { derivationPath } = getAddress7(account3);
|
|
694974
|
-
const { unsignedTransaction, transferRawRequest } = (0,
|
|
695017
|
+
const { unsignedTransaction, transferRawRequest } = (0, import_utils241.createUnsignedSendTransaction)(transaction, xpub);
|
|
694975
695018
|
o93.next({
|
|
694976
695019
|
type: "device-signature-requested"
|
|
694977
695020
|
});
|
|
@@ -694984,7 +695027,7 @@ var buildSignOperation11 = (signerContext4) => ({ account: account3, transaction
|
|
|
694984
695027
|
o93.next({
|
|
694985
695028
|
type: "device-signature-granted"
|
|
694986
695029
|
});
|
|
694987
|
-
const hash9 = (0,
|
|
695030
|
+
const hash9 = (0, import_utils241.hashTransaction)({
|
|
694988
695031
|
from: account3.freshAddress,
|
|
694989
695032
|
to: transaction.recipient,
|
|
694990
695033
|
amount: transferRawRequest.amount.e8s,
|
|
@@ -695022,9 +695065,9 @@ var broadcast15 = async ({ signedOperation: { operation, rawData } }) => {
|
|
|
695022
695065
|
};
|
|
695023
695066
|
|
|
695024
695067
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/validateAddress.js
|
|
695025
|
-
var
|
|
695068
|
+
var import_utils242 = require("@zondax/ledger-live-icp/utils");
|
|
695026
695069
|
async function validateAddress15(address3, _parameters) {
|
|
695027
|
-
const result2 = await (0,
|
|
695070
|
+
const result2 = await (0, import_utils242.validateAddress)(address3);
|
|
695028
695071
|
return result2.isValid;
|
|
695029
695072
|
}
|
|
695030
695073
|
|
|
@@ -695403,7 +695446,7 @@ var getEstimatedFees6 = async ({ account: account3, transaction }) => {
|
|
|
695403
695446
|
transaction.stepLimit = stepLimit;
|
|
695404
695447
|
const stepPrice = await getStepPrice(account3);
|
|
695405
695448
|
return stepLimit.multipliedBy(stepPrice);
|
|
695406
|
-
} catch
|
|
695449
|
+
} catch {
|
|
695407
695450
|
return FEES_SAFETY_BUFFER2;
|
|
695408
695451
|
}
|
|
695409
695452
|
};
|
|
@@ -699550,7 +699593,7 @@ async function fetchValidators({ per_page, page }) {
|
|
|
699550
699593
|
}));
|
|
699551
699594
|
return validators9 || [];
|
|
699552
699595
|
}
|
|
699553
|
-
var
|
|
699596
|
+
var getValidators4 = makeLRUCache(fetchValidators, () => "", { ttl: 30 * 60 * 1e3 });
|
|
699554
699597
|
|
|
699555
699598
|
// ../../libs/coin-modules/coin-near/lib-es/errors.js
|
|
699556
699599
|
init_lib_es();
|
|
@@ -699635,7 +699678,7 @@ var preload5 = async () => {
|
|
|
699635
699678
|
log2("near/preload", "preloading near data...");
|
|
699636
699679
|
const [protocolConfig, rawValidators, gasPrice] = await Promise.all([
|
|
699637
699680
|
getProtocolConfig(),
|
|
699638
|
-
|
|
699681
|
+
getValidators4({ per_page: 200, page: 1 }),
|
|
699639
699682
|
// get first 200 validators
|
|
699640
699683
|
getGasPrice()
|
|
699641
699684
|
]);
|
|
@@ -700082,7 +700125,7 @@ function makeCliTools14() {
|
|
|
700082
700125
|
}
|
|
700083
700126
|
|
|
700084
700127
|
// ../../libs/ledgerjs/packages/hw-app-near/lib-es/Near.js
|
|
700085
|
-
var
|
|
700128
|
+
var import_utils245 = __toESM(require_utils38());
|
|
700086
700129
|
var import_key_pair = __toESM(require_key_pair2());
|
|
700087
700130
|
|
|
700088
700131
|
// ../../libs/ledgerjs/packages/hw-app-near/lib-es/utils.js
|
|
@@ -700118,7 +700161,7 @@ var Near = class {
|
|
|
700118
700161
|
await client.getAddress(path4);
|
|
700119
700162
|
}
|
|
700120
700163
|
const rawPublicKey = await client.getPublicKey(path4, false);
|
|
700121
|
-
const publicKey4 = new
|
|
700164
|
+
const publicKey4 = new import_utils245.PublicKey({
|
|
700122
700165
|
keyType: import_key_pair.KeyType.ED25519,
|
|
700123
700166
|
data: rawPublicKey
|
|
700124
700167
|
});
|
|
@@ -745743,7 +745786,7 @@ var paymentInfo = async (extrinsic, currency24) => {
|
|
|
745743
745786
|
});
|
|
745744
745787
|
return data6;
|
|
745745
745788
|
};
|
|
745746
|
-
var
|
|
745789
|
+
var getValidators5 = async (stashes2 = "elected", currency24) => {
|
|
745747
745790
|
let validators9;
|
|
745748
745791
|
if (Array.isArray(stashes2)) {
|
|
745749
745792
|
validators9 = await fetchValidators3("all", currency24, stashes2);
|
|
@@ -745854,7 +745897,7 @@ var network_default2 = {
|
|
|
745854
745897
|
getMinimumBondBalance: getMinimumBondBalance2,
|
|
745855
745898
|
getRegistry: getRegistry2,
|
|
745856
745899
|
getStakingProgress,
|
|
745857
|
-
getValidators:
|
|
745900
|
+
getValidators: getValidators5,
|
|
745858
745901
|
getTransactionParams: async (currency24, { force } = { force: false }) => {
|
|
745859
745902
|
return force ? getTransactionParamsFn.force(currency24) : getTransactionParamsFn(currency24);
|
|
745860
745903
|
},
|
|
@@ -759945,7 +759988,7 @@ var MAX_MEMO_LENGTH = 500;
|
|
|
759945
759988
|
var isValidBase58Address = (address3) => {
|
|
759946
759989
|
try {
|
|
759947
759990
|
return Boolean(new PublicKey7(address3));
|
|
759948
|
-
} catch
|
|
759991
|
+
} catch {
|
|
759949
759992
|
return false;
|
|
759950
759993
|
}
|
|
759951
759994
|
};
|
|
@@ -761182,7 +761225,7 @@ async function fetchFigmentApy(cluster) {
|
|
|
761182
761225
|
}
|
|
761183
761226
|
return {};
|
|
761184
761227
|
}
|
|
761185
|
-
async function
|
|
761228
|
+
async function getValidators6(cluster) {
|
|
761186
761229
|
const [validatorsResponse, apyMap] = await Promise.all([
|
|
761187
761230
|
lib_es_default({ method: "GET", url: URLS.validatorList(cluster) }),
|
|
761188
761231
|
fetchFigmentApy(cluster)
|
|
@@ -761210,7 +761253,7 @@ async function getValidators5(cluster) {
|
|
|
761210
761253
|
var PRELOAD_MAX_AGE6 = 15 * 60 * 1e3;
|
|
761211
761254
|
async function preloadWithAPI(currency24, api7) {
|
|
761212
761255
|
const cluster = clusterByCurrencyId(currency24.id);
|
|
761213
|
-
const validators9 = cluster === "devnet" ? await loadDevnetValidators(api7) : await
|
|
761256
|
+
const validators9 = cluster === "devnet" ? await loadDevnetValidators(api7) : await getValidators6(cluster);
|
|
761214
761257
|
const data6 = {
|
|
761215
761258
|
version: "1",
|
|
761216
761259
|
validatorsWithMeta: [],
|
|
@@ -761955,7 +761998,7 @@ var parse12 = (ix) => {
|
|
|
761955
761998
|
var parseQuiet = (ix) => {
|
|
761956
761999
|
try {
|
|
761957
762000
|
return parse12(ix);
|
|
761958
|
-
} catch
|
|
762001
|
+
} catch {
|
|
761959
762002
|
return unknown4();
|
|
761960
762003
|
}
|
|
761961
762004
|
};
|
|
@@ -814960,7 +815003,7 @@ var getPreloadStrategy8 = () => ({
|
|
|
814960
815003
|
preloadMaxAge: PRELOAD_MAX_AGE7
|
|
814961
815004
|
});
|
|
814962
815005
|
var preload8 = async () => {
|
|
814963
|
-
const validators9 = await
|
|
815006
|
+
const validators9 = await getValidators7();
|
|
814964
815007
|
return { validators: validators9, tokens: [] };
|
|
814965
815008
|
};
|
|
814966
815009
|
var hydrate9 = (data6) => {
|
|
@@ -815994,7 +816037,7 @@ var toStakeAmounts = (stake) => {
|
|
|
815994
816037
|
return { deposited: BigInt(stake.principal), rewarded: 0n };
|
|
815995
816038
|
}
|
|
815996
816039
|
};
|
|
815997
|
-
var
|
|
816040
|
+
var getValidators7 = () => withApi2(async (api7) => {
|
|
815998
816041
|
const [{ activeValidators }, { apys }] = await Promise.all([
|
|
815999
816042
|
api7.getLatestSuiSystemState(),
|
|
816000
816043
|
api7.getValidatorsApy()
|
|
@@ -816018,7 +816061,7 @@ var network_default3 = {
|
|
|
816018
816061
|
createTransaction: createTransaction25,
|
|
816019
816062
|
executeTransactionBlock,
|
|
816020
816063
|
getStakes: getStakes2,
|
|
816021
|
-
getValidators:
|
|
816064
|
+
getValidators: getValidators7
|
|
816022
816065
|
};
|
|
816023
816066
|
|
|
816024
816067
|
// ../../libs/coin-modules/coin-sui/lib-es/logic/craftTransaction.js
|
|
@@ -849340,7 +849383,7 @@ var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddre
|
|
|
849340
849383
|
var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
|
|
849341
849384
|
|
|
849342
849385
|
// ../../libs/coin-modules/coin-tezos/lib-es/utils.js
|
|
849343
|
-
var
|
|
849386
|
+
var import_utils418 = __toESM(require_utils47());
|
|
849344
849387
|
var DUST_MARGIN_MUTEZ = 500;
|
|
849345
849388
|
var MIN_SUGGESTED_FEE_SMALL_TRANSFER = 489;
|
|
849346
849389
|
var OP_SIZE_XTZ_TRANSFER = 154;
|
|
@@ -849385,7 +849428,7 @@ function normalizePublicKeyForAddress(maybeKey, address3) {
|
|
|
849385
849428
|
}
|
|
849386
849429
|
const compressedPubKeyLength = 33;
|
|
849387
849430
|
if (keyBuf.length > compressedPubKeyLength) {
|
|
849388
|
-
return b58Encode((0,
|
|
849431
|
+
return b58Encode((0, import_utils418.compressPublicKey)(keyBuf, derivationType), prefix3);
|
|
849389
849432
|
} else {
|
|
849390
849433
|
return b58Encode(keyBuf, prefix3);
|
|
849391
849434
|
}
|
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.20251213023821",
|
|
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.20251213023821",
|
|
62
|
+
"@ledgerhq/types-live": "^6.91.0-nightly.20251213023821"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"directory": "dist"
|