@ledgerhq/live-cli 24.19.4-nightly.4 → 24.19.4-nightly.6

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 +29 -16
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -516671,7 +516671,7 @@ var require_package8 = __commonJS({
516671
516671
  module2.exports = {
516672
516672
  name: "@ledgerhq/live-common",
516673
516673
  description: "Common ground for the Ledger Live apps",
516674
- version: "34.41.0-nightly.4",
516674
+ version: "34.41.0-nightly.6",
516675
516675
  repository: {
516676
516676
  type: "git",
516677
516677
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -523472,7 +523472,7 @@ var require_package9 = __commonJS({
523472
523472
  "package.json"(exports2, module2) {
523473
523473
  module2.exports = {
523474
523474
  name: "@ledgerhq/live-cli",
523475
- version: "24.19.4-nightly.4",
523475
+ version: "24.19.4-nightly.6",
523476
523476
  description: "ledger-live CLI version",
523477
523477
  repository: {
523478
523478
  type: "git",
@@ -534309,6 +534309,7 @@ var findExchangeCurrencyConfig = (id5) => configs[id5];
534309
534309
  // ../../libs/ledgerjs/packages/cryptoassets/lib-es/abandonseed.js
534310
534310
  var import_invariant = __toESM(require("invariant"));
534311
534311
  var EVM_DEAD_ADDRESS = "0x000000000000000000000000000000000000dEaD";
534312
+ var EVM_RAND_ADDRESS = "0x123000000000000000000000000000000000dEaD";
534312
534313
  var abandonSeedAddresses = {
534313
534314
  algorand: "PSHLIWQKDEETIIBQEOTLGCT5IF7BTTOKCUULONOGVGF2HYDT2IHW3H4CCI",
534314
534315
  // https://snowtrace.io/address/0x000000000000000000000000000000000000dead/tokens
@@ -534413,8 +534414,8 @@ var abandonSeedAddresses = {
534413
534414
  scroll: EVM_DEAD_ADDRESS,
534414
534415
  scroll_sepolia: EVM_DEAD_ADDRESS,
534415
534416
  etherlink: EVM_DEAD_ADDRESS,
534416
- zksync: EVM_DEAD_ADDRESS,
534417
- zksync_sepolia: EVM_DEAD_ADDRESS,
534417
+ zksync: EVM_RAND_ADDRESS,
534418
+ zksync_sepolia: EVM_RAND_ADDRESS,
534418
534419
  mantra: "mantra12jypwtxm7npfszx5x9780fhz0j3ken696fdp33",
534419
534420
  xion: "xion19rl4cm2hmr8afy4kldpxz3fka4jguq0a5xyz123",
534420
534421
  sui: "0x33444cf803c690db96527cec67e3c9ab512596f4ba2d4eace43f0b4f716e0164",
@@ -807217,8 +807218,10 @@ var FALLBACK_GAS_BUDGET = {
807217
807218
  var paymentInfo3 = async (sender, fakeTransaction) => withApi2(async (api7) => {
807218
807219
  const tx = new Transaction6();
807219
807220
  tx.setSender(ensureAddressFormat(sender));
807220
- const coinObjectId = await getCoinObjectId(sender, fakeTransaction);
807221
- const [coin] = tx.splitCoins(coinObjectId ?? tx.gas, [fakeTransaction.amount.toNumber()]);
807221
+ const coinObjects = await getCoinObjectIds(sender, fakeTransaction);
807222
+ const [coin] = tx.splitCoins(Array.isArray(coinObjects) ? coinObjects[0] : tx.gas, [
807223
+ fakeTransaction.amount.toNumber()
807224
+ ]);
807222
807225
  tx.transferObjects([coin], fakeTransaction.recipient);
807223
807226
  try {
807224
807227
  const txb = await tx.build({ client: api7 });
@@ -807232,29 +807235,38 @@ var paymentInfo3 = async (sender, fakeTransaction) => withApi2(async (api7) => {
807232
807235
  } catch (error) {
807233
807236
  console.warn("Fee estimation failed:", error);
807234
807237
  return {
807235
- gasBudget: coinObjectId ? FALLBACK_GAS_BUDGET.TOKEN_TRANSFER : FALLBACK_GAS_BUDGET.SUI_TRANSFER,
807238
+ gasBudget: Array.isArray(coinObjects) ? FALLBACK_GAS_BUDGET.TOKEN_TRANSFER : FALLBACK_GAS_BUDGET.SUI_TRANSFER,
807236
807239
  totalGasUsed: BigInt(1e6),
807237
807240
  fees: BigInt(1e6)
807238
807241
  };
807239
807242
  }
807240
807243
  });
807241
- var getCoinObjectId = async (address4, transaction) => withApi2(async (api7) => {
807242
- let coinObjectId = null;
807244
+ var getCoinObjectIds = async (address4, transaction) => withApi2(async (api7) => {
807245
+ const coinObjectId = null;
807243
807246
  if (transaction.coinType !== DEFAULT_COIN_TYPE) {
807244
807247
  const tokenInfo = await api7.getCoins({
807245
807248
  owner: address4,
807246
807249
  coinType: transaction.coinType
807247
807250
  });
807248
- coinObjectId = tokenInfo.data[0].coinObjectId;
807251
+ return tokenInfo.data.map((coin) => coin.coinObjectId);
807249
807252
  }
807250
807253
  return coinObjectId;
807251
807254
  });
807252
807255
  var createTransaction24 = async (address4, transaction) => withApi2(async (api7) => {
807253
807256
  const tx = new Transaction6();
807254
807257
  tx.setSender(ensureAddressFormat(address4));
807255
- const coinObjectId = await getCoinObjectId(address4, transaction);
807256
- const [coin] = tx.splitCoins(coinObjectId ?? tx.gas, [transaction.amount.toNumber()]);
807257
- tx.transferObjects([coin], transaction.recipient);
807258
+ const coinObjects = await getCoinObjectIds(address4, transaction);
807259
+ if (Array.isArray(coinObjects) && transaction.coinType !== DEFAULT_COIN_TYPE) {
807260
+ const coins = coinObjects.map((coinId) => tx.object(coinId));
807261
+ if (coins.length > 1) {
807262
+ tx.mergeCoins(coins[0], coins.slice(1));
807263
+ }
807264
+ const [coin] = tx.splitCoins(coins[0], [transaction.amount.toNumber()]);
807265
+ tx.transferObjects([coin], transaction.recipient);
807266
+ } else {
807267
+ const [coin] = tx.splitCoins(tx.gas, [transaction.amount.toNumber()]);
807268
+ tx.transferObjects([coin], transaction.recipient);
807269
+ }
807258
807270
  return tx.build({ client: api7 });
807259
807271
  });
807260
807272
  var executeTransactionBlock = async (params) => withApi2(async (api7) => {
@@ -807318,11 +807330,11 @@ var network_default3 = {
807318
807330
  };
807319
807331
 
807320
807332
  // ../../libs/coin-modules/coin-sui/lib-es/logic/craftTransaction.js
807321
- async function craftTransaction4({ sender, amount, recipient, type: type4 }) {
807333
+ async function craftTransaction4({ sender, amount, recipient, coinType, type: type4 }) {
807322
807334
  const unsigned2 = await network_default3.createTransaction(sender, {
807323
807335
  amount: (0, import_bignumber307.default)(amount.toString()),
807324
807336
  recipient,
807325
- coinType: DEFAULT_COIN_TYPE,
807337
+ coinType: coinType ?? DEFAULT_COIN_TYPE,
807326
807338
  mode: type4
807327
807339
  });
807328
807340
  return { unsigned: unsigned2 };
@@ -810284,11 +810296,12 @@ function optimisticOpcommons2(commandDescriptor) {
810284
810296
 
810285
810297
  // ../../libs/coin-modules/coin-sui/lib-es/bridge/buildTransaction.js
810286
810298
  var import_pick = __toESM(require("lodash/pick"));
810287
- var buildTransaction10 = async ({ freshAddress }, { recipient, mode, amount }) => {
810299
+ var buildTransaction10 = async ({ freshAddress }, { recipient, mode, amount, coinType }) => {
810288
810300
  return craftTransaction4({
810289
810301
  sender: freshAddress,
810290
810302
  recipient,
810291
810303
  type: mode,
810304
+ coinType,
810292
810305
  amount: BigInt(amount.toString()),
810293
810306
  asset: { type: "native" }
810294
810307
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.19.4-nightly.4",
3
+ "version": "24.19.4-nightly.6",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",