@ledgerhq/live-cli 24.22.1-nightly.0 → 24.22.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.
Files changed (2) hide show
  1. package/lib/cli.js +45 -34
  2. package/package.json +3 -3
package/lib/cli.js CHANGED
@@ -512911,7 +512911,7 @@ var require_package7 = __commonJS({
512911
512911
  module2.exports = {
512912
512912
  name: "@ledgerhq/live-common",
512913
512913
  description: "Common ground for the Ledger Live apps",
512914
- version: "34.48.0-nightly.0",
512914
+ version: "34.48.0-nightly.1",
512915
512915
  repository: {
512916
512916
  type: "git",
512917
512917
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -514177,7 +514177,7 @@ var require_package8 = __commonJS({
514177
514177
  "package.json"(exports2, module2) {
514178
514178
  module2.exports = {
514179
514179
  name: "@ledgerhq/live-cli",
514180
- version: "24.22.1-nightly.0",
514180
+ version: "24.22.1-nightly.1",
514181
514181
  description: "ledger-live CLI version",
514182
514182
  repository: {
514183
514183
  type: "git",
@@ -518819,6 +518819,11 @@ var envDefinitions = {
518819
518819
  parser: stringParser,
518820
518820
  desc: "Node endpoint for celo"
518821
518821
  },
518822
+ ENABLE_CELO_TOKENS: {
518823
+ def: false,
518824
+ parser: boolParser,
518825
+ desc: "Enable token send and receive for Celo"
518826
+ },
518822
518827
  COSMOS_GAS_AMPLIFIER: {
518823
518828
  def: 1.3,
518824
518829
  // Same as Keplr
@@ -520630,8 +520635,8 @@ var cryptocurrenciesById = {
520630
520635
  ],
520631
520636
  explorerViews: [
520632
520637
  {
520633
- tx: "https://explorer-to-define.io/transaction/$hash",
520634
- address: "https://explorer-to-define.io/address/$address"
520638
+ tx: "https://www.cantonscan.com/update/$hash",
520639
+ address: "https://www.cantonscan.com/party/$address"
520635
520640
  }
520636
520641
  ],
520637
520642
  keywords: ["canton_network"]
@@ -520694,8 +520699,8 @@ var cryptocurrenciesById = {
520694
520699
  ],
520695
520700
  explorerViews: [
520696
520701
  {
520697
- tx: "https://explorer-to-define.io/transaction/$hash",
520698
- address: "https://explorer-to-define.io/address/$address"
520702
+ tx: "https://devnet.explorer.canton.nodefortress.io/transactions/$hash",
520703
+ address: "https://devnet.explorer.canton.nodefortress.io/parties/$address"
520699
520704
  }
520700
520705
  ],
520701
520706
  keywords: ["canton_network_devnet"]
@@ -584167,8 +584172,8 @@ var transactionToOperation = (accountId2, transaction) => {
584167
584172
  hasFailed,
584168
584173
  blockHash: null,
584169
584174
  extra: {
584170
- celoOperationValue: new import_bignumber123.BigNumber(transaction.amount),
584171
584175
  ...["ACTIVATE", "VOTE", "REVOKE"].includes(type4) ? {
584176
+ celoOperationValue: new import_bignumber123.BigNumber(transaction.amount),
584172
584177
  celoSourceValidator: recipient ? recipient : ""
584173
584178
  } : {}
584174
584179
  }
@@ -584760,24 +584765,26 @@ function assignFromAccountRaw5(accountRaw, account3) {
584760
584765
  account3.celoResources = fromCeloResourcesRaw(celoResourcesRaw);
584761
584766
  }
584762
584767
  function fromOperationExtraRaw2(extraRaw) {
584768
+ const extra = {};
584763
584769
  if (!isCeloOperationExtraRaw(extraRaw)) {
584764
- throw new Error("Unsupported OperationExtra");
584770
+ return extra;
584771
+ }
584772
+ if (extraRaw.celoOperationValue) {
584773
+ extra.celoOperationValue = (0, import_bignumber131.BigNumber)(extraRaw.celoOperationValue);
584765
584774
  }
584766
- const extra = {
584767
- celoOperationValue: new import_bignumber131.BigNumber(extraRaw.celoOperationValue)
584768
- };
584769
584775
  if (extraRaw.celoSourceValidator) {
584770
584776
  extra.celoSourceValidator = extraRaw.celoSourceValidator;
584771
584777
  }
584772
584778
  return extra;
584773
584779
  }
584774
584780
  function toOperationExtraRaw2(extra) {
584781
+ const extraRaw = {};
584775
584782
  if (!isCeloOperationExtra(extra)) {
584776
- throw new Error("Unsupported OperationExtra");
584783
+ return extraRaw;
584784
+ }
584785
+ if (extra.celoOperationValue) {
584786
+ extraRaw.celoOperationValue = extra.celoOperationValue.toString();
584777
584787
  }
584778
- const extraRaw = {
584779
- celoOperationValue: extra.celoOperationValue.toString()
584780
- };
584781
584788
  if (extra.celoSourceValidator) {
584782
584789
  extraRaw.celoSourceValidator = extra.celoSourceValidator;
584783
584790
  }
@@ -612194,7 +612201,7 @@ var getAccountShape6 = async (info6, config4) => {
612194
612201
  blockHeight,
612195
612202
  operationsCount: operations3.length,
612196
612203
  spendableBalance,
612197
- subAccounts: fromEvm.subAccounts || [],
612204
+ subAccounts: getEnv("ENABLE_CELO_TOKENS") === false ? [] : fromEvm.subAccounts || [],
612198
612205
  syncHash: fromEvm.syncHash,
612199
612206
  celoResources: {
612200
612207
  registrationStatus: accountRegistrationStatus,
@@ -612248,8 +612255,8 @@ var buildOptimisticOperation4 = (account3, transaction, fee) => {
612248
612255
  accountId: isTokenTransaction ? tokenAccount.id : account3.id,
612249
612256
  date: /* @__PURE__ */ new Date(),
612250
612257
  extra: {
612251
- celoOperationValue: new import_bignumber142.default(transaction.amount),
612252
612258
  ...["ACTIVATE", "VOTE", "REVOKE"].includes(type4) ? {
612259
+ celoOperationValue: new import_bignumber142.default(transaction.amount),
612253
612260
  celoSourceValidator: transaction.recipient
612254
612261
  } : {}
612255
612262
  }
@@ -798013,12 +798020,12 @@ async function craftTransaction4(transactionIntent, customFees) {
798013
798020
  throw new Error("Memo cannot be used with smart contract transactions");
798014
798021
  }
798015
798022
  const { raw_data_hex: rawDataHex } = await craftTrc20Transaction(asset.assetReference, recipientAddress, senderAddress, new import_bignumber283.default(amount.toString()), feesToNumber(fees2), expiration);
798016
- return rawDataHex;
798023
+ return { transaction: rawDataHex };
798017
798024
  } else {
798018
798025
  const isTransferAsset = asset.type === "trc10";
798019
798026
  const tokenId = asset.type === "trc10" ? asset.assetReference : void 0;
798020
798027
  const { raw_data_hex: rawDataHex } = await craftStandardTransaction(tokenId, recipientAddress, senderAddress, new import_bignumber283.default(amount.toString()), isTransferAsset, memo3, expiration);
798021
- return rawDataHex;
798028
+ return { transaction: rawDataHex };
798022
798029
  }
798023
798030
  }
798024
798031
 
@@ -809625,8 +809632,7 @@ var calculateMaxSend3 = (account3, transaction) => {
809625
809632
  return amount.lt(0) ? new import_bignumber305.BigNumber(0) : amount;
809626
809633
  };
809627
809634
  var calculateMaxDelegate = (account3, transaction) => {
809628
- const ONE_SUI2 = new import_bignumber305.BigNumber("1000000000");
809629
- const gasReserve = ONE_SUI2.div(10);
809635
+ const gasReserve = (0, import_bignumber305.BigNumber)(ONE_SUI).div(10);
809630
809636
  const amount = account3.spendableBalance.minus(transaction.fees || 0).minus(gasReserve);
809631
809637
  return amount.lt(0) ? new import_bignumber305.BigNumber(0) : amount;
809632
809638
  };
@@ -809705,13 +809711,15 @@ var estimateMaxSpendable22 = async ({ account: account3, parentAccount, transact
809705
809711
  useAllAmount: true
809706
809712
  };
809707
809713
  let spendableBalance = account3.spendableBalance;
809708
- if (account3.type === "Account") {
809709
- const fees2 = await getEstimatedFees12({
809710
- account: mainAccount,
809711
- transaction: estimatedTransaction
809712
- });
809713
- if (fees2) {
809714
- spendableBalance = spendableBalance.minus(fees2);
809714
+ if (transaction?.mode !== "delegate") {
809715
+ if (account3.type === "Account") {
809716
+ const fees2 = await getEstimatedFees12({
809717
+ account: mainAccount,
809718
+ transaction: estimatedTransaction
809719
+ });
809720
+ if (fees2) {
809721
+ spendableBalance = spendableBalance.minus(fees2);
809722
+ }
809715
809723
  }
809716
809724
  }
809717
809725
  if (transaction?.mode === "delegate") {
@@ -809744,7 +809752,10 @@ var getTransactionStatus22 = async (account3, transaction) => {
809744
809752
  const errors = {};
809745
809753
  const warnings3 = {};
809746
809754
  const amount = new import_bignumber308.BigNumber(transaction?.amount || 0);
809747
- const estimatedFees = new import_bignumber308.BigNumber(transaction?.fees || 0);
809755
+ let estimatedFees = new import_bignumber308.BigNumber(transaction?.fees || 0);
809756
+ if (estimatedFees.eq(0) && transaction.mode === "delegate") {
809757
+ estimatedFees = (0, import_bignumber308.BigNumber)(ONE_SUI).div(10);
809758
+ }
809748
809759
  const totalSpent = transaction.subAccountId ? amount : amount.plus(estimatedFees);
809749
809760
  let accountBalance = account3.balance;
809750
809761
  if (transaction.subAccountId) {
@@ -818009,7 +818020,7 @@ async function craft(transactionIntent, customFees) {
818009
818020
  // NOTE: double check before/after here
818010
818021
  memos: memoEntries
818011
818022
  }, transactionIntent.senderPublicKey);
818012
- return tx.serializedTransaction;
818023
+ return { transaction: tx.serializedTransaction };
818013
818024
  }
818014
818025
  async function estimate() {
818015
818026
  const estimation = await estimateFees6();
@@ -818952,7 +818963,7 @@ async function craft2(transactionIntent, customFees) {
818952
818963
  memoType: memo3?.type,
818953
818964
  ...hasMemoValue ? { memoValue: memo3.value } : {}
818954
818965
  });
818955
- return tx.signatureBase;
818966
+ return { transaction: tx.signatureBase };
818956
818967
  }
818957
818968
  function compose(tx, signature4, pubkey) {
818958
818969
  if (!pubkey) {
@@ -819054,7 +819065,7 @@ async function craft3(transactionIntent) {
819054
819065
  recipient: transactionIntent.recipient,
819055
819066
  amount: new import_bignumber348.default(transactionIntent.amount.toString())
819056
819067
  });
819057
- return tx.serializedTransaction;
819068
+ return { transaction: tx.serializedTransaction };
819058
819069
  }
819059
819070
  async function estimate3(transactionIntent) {
819060
819071
  const { serializedTransaction } = await craftTransaction({ address: transactionIntent.sender }, {
@@ -819213,7 +819224,7 @@ var buildCraftTransaction = (networkFamily) => async function craftTransaction8(
819213
819224
  }
819214
819225
  }
819215
819226
  });
819216
- return data9.rawTransaction;
819227
+ return data9;
819217
819228
  };
819218
819229
  var getNetworkAlpacaApi = (networkFamily) => ({
819219
819230
  broadcast: buildBroadcast(networkFamily),
@@ -819791,7 +819802,7 @@ var genericSignOperation = (network, kind) => (signerContext4) => ({ account: ac
819791
819802
  transactionIntent = enrichTransactionIntent(transactionIntent, transaction, publicKey3);
819792
819803
  const sequenceNumber = await getAlpacaApi(network, kind).getSequence(transactionIntent.sender);
819793
819804
  transactionIntent.sequence = sequenceNumber;
819794
- const unsigned2 = await getAlpacaApi(network, kind).craftTransaction(transactionIntent, { value: fees2 });
819805
+ const { transaction: unsigned2 } = await getAlpacaApi(network, kind).craftTransaction(transactionIntent, { value: fees2 });
819795
819806
  o40.next({ type: "device-signature-requested" });
819796
819807
  const txnSig = await signer2.signTransaction(derivationPath, unsigned2);
819797
819808
  return { unsigned: unsigned2, txnSig, publicKey: publicKey3, sequence: transactionIntent.sequence };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.22.1-nightly.0",
3
+ "version": "24.22.1-nightly.1",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,8 +56,8 @@
56
56
  "@types/ws": "8.5.10",
57
57
  "ts-node": "10.9.2",
58
58
  "tsup": "7.3.0",
59
- "@ledgerhq/types-live": "^6.83.0",
60
- "@ledgerhq/types-cryptoassets": "^7.26.0"
59
+ "@ledgerhq/types-cryptoassets": "^7.26.0",
60
+ "@ledgerhq/types-live": "^6.83.0"
61
61
  },
62
62
  "publishConfig": {
63
63
  "directory": "dist"