@ledgerhq/live-cli 24.25.1-nightly.0 → 24.25.1-nightly.1
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 +34 -12
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -513744,7 +513744,7 @@ var require_package7 = __commonJS({
|
|
|
513744
513744
|
module2.exports = {
|
|
513745
513745
|
name: "@ledgerhq/live-common",
|
|
513746
513746
|
description: "Common ground for the Ledger Live apps",
|
|
513747
|
-
version: "34.51.0-nightly.
|
|
513747
|
+
version: "34.51.0-nightly.1",
|
|
513748
513748
|
repository: {
|
|
513749
513749
|
type: "git",
|
|
513750
513750
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -514081,7 +514081,7 @@ var require_package8 = __commonJS({
|
|
|
514081
514081
|
"package.json"(exports2, module2) {
|
|
514082
514082
|
module2.exports = {
|
|
514083
514083
|
name: "@ledgerhq/live-cli",
|
|
514084
|
-
version: "24.25.1-nightly.
|
|
514084
|
+
version: "24.25.1-nightly.1",
|
|
514085
514085
|
description: "ledger-live CLI version",
|
|
514086
514086
|
repository: {
|
|
514087
514087
|
type: "git",
|
|
@@ -815835,6 +815835,9 @@ function transactionToOperation3(accountId2, address3, transaction) {
|
|
|
815835
815835
|
value: getOperationAmount(address3, transaction, coinType)
|
|
815836
815836
|
};
|
|
815837
815837
|
}
|
|
815838
|
+
function absoluteAmount(balanceChange) {
|
|
815839
|
+
return new import_bignumber303.BigNumber(balanceChange?.amount || 0).abs();
|
|
815840
|
+
}
|
|
815838
815841
|
function toBlockInfo(checkpoint) {
|
|
815839
815842
|
const info6 = {
|
|
815840
815843
|
height: Number(checkpoint.sequenceNumber),
|
|
@@ -815855,22 +815858,41 @@ function toBlockTransaction(transaction) {
|
|
|
815855
815858
|
return {
|
|
815856
815859
|
hash: transaction.digest,
|
|
815857
815860
|
failed: transaction.effects?.status.status !== "success",
|
|
815858
|
-
operations: transaction.balanceChanges?.flatMap(toBlockOperation) || [],
|
|
815861
|
+
operations: transaction.balanceChanges?.flatMap((change2) => toBlockOperation(transaction, change2)) || [],
|
|
815859
815862
|
fees: BigInt(getOperationFee(transaction).toString()),
|
|
815860
815863
|
feesPayer: transaction.transaction?.data.sender || ""
|
|
815861
815864
|
};
|
|
815862
815865
|
}
|
|
815863
|
-
function toBlockOperation(change2) {
|
|
815866
|
+
function toBlockOperation(transaction, change2) {
|
|
815864
815867
|
if (typeof change2.owner === "string" || !("AddressOwner" in change2.owner))
|
|
815865
815868
|
return [];
|
|
815866
|
-
|
|
815867
|
-
|
|
815868
|
-
|
|
815869
|
-
|
|
815870
|
-
|
|
815871
|
-
|
|
815872
|
-
|
|
815873
|
-
|
|
815869
|
+
const address3 = change2.owner.AddressOwner;
|
|
815870
|
+
const operationType = getOperationType9(address3, transaction);
|
|
815871
|
+
switch (operationType) {
|
|
815872
|
+
case "IN":
|
|
815873
|
+
case "OUT":
|
|
815874
|
+
return [
|
|
815875
|
+
{
|
|
815876
|
+
type: "transfer",
|
|
815877
|
+
address: change2.owner.AddressOwner,
|
|
815878
|
+
asset: toSuiAsset(change2.coinType),
|
|
815879
|
+
amount: BigInt(change2.amount)
|
|
815880
|
+
}
|
|
815881
|
+
];
|
|
815882
|
+
case "DELEGATE":
|
|
815883
|
+
case "UNDELEGATE":
|
|
815884
|
+
return [
|
|
815885
|
+
{
|
|
815886
|
+
type: "other",
|
|
815887
|
+
operationType,
|
|
815888
|
+
address: change2.owner.AddressOwner,
|
|
815889
|
+
asset: toSuiAsset(change2.coinType),
|
|
815890
|
+
amount: BigInt(absoluteAmount(change2).toString())
|
|
815891
|
+
}
|
|
815892
|
+
];
|
|
815893
|
+
default:
|
|
815894
|
+
return [];
|
|
815895
|
+
}
|
|
815874
815896
|
}
|
|
815875
815897
|
function toSuiAsset(coinType) {
|
|
815876
815898
|
switch (coinType) {
|