@ledgerhq/live-cli 24.21.3-nightly.2 → 24.21.3-nightly.4

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 -15
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -527196,7 +527196,7 @@ var require_package7 = __commonJS({
527196
527196
  module2.exports = {
527197
527197
  name: "@ledgerhq/live-common",
527198
527198
  description: "Common ground for the Ledger Live apps",
527199
- version: "34.47.0-nightly.2",
527199
+ version: "34.47.0-nightly.4",
527200
527200
  repository: {
527201
527201
  type: "git",
527202
527202
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -527276,7 +527276,7 @@ var require_package7 = __commonJS({
527276
527276
  "test-bridge-update": "UPDATE_BACKEND_MOCKS=1 env-cmd -f .ci.integration.env pnpm jest --ci --updateSnapshot --passWithNoTests",
527277
527277
  "test-account-migration": "tsx src/__tests__/migration/account-migration.ts",
527278
527278
  unimported: "unimported",
527279
- coverage: "env-cmd -f .ci.unit.env pnpm jest --coverage --ci --updateSnapshot"
527279
+ coverage: "env-cmd -f .ci.unit.env pnpm jest --coverage --ci"
527280
527280
  },
527281
527281
  files: [
527282
527282
  "lib",
@@ -527942,7 +527942,7 @@ var require_package8 = __commonJS({
527942
527942
  "package.json"(exports2, module2) {
527943
527943
  module2.exports = {
527944
527944
  name: "@ledgerhq/live-cli",
527945
- version: "24.21.3-nightly.2",
527945
+ version: "24.21.3-nightly.4",
527946
527946
  description: "ledger-live CLI version",
527947
527947
  repository: {
527948
527948
  type: "git",
@@ -765759,6 +765759,10 @@ async function getValidators4(cluster) {
765759
765759
  }
765760
765760
 
765761
765761
  // ../../libs/coin-modules/coin-solana/lib-es/preload.js
765762
+ var shouldSkipTokenLoading2 = false;
765763
+ function setShouldSkipTokenLoading2(skip2) {
765764
+ shouldSkipTokenLoading2 = skip2;
765765
+ }
765762
765766
  var PRELOAD_MAX_AGE6 = 15 * 60 * 1e3;
765763
765767
  var fetchSPLTokens = async (currency24) => {
765764
765768
  const latestCALHash = getCALHash2(currency24);
@@ -765775,14 +765779,18 @@ var fetchSPLTokens = async (currency24) => {
765775
765779
  ]);
765776
765780
  setCALHash2(currency24, hash10 || "");
765777
765781
  log2("solana/preload", "preload " + splTokens.length + " tokens");
765778
- addTokens(splTokens.map(convertSplTokens));
765782
+ if (!shouldSkipTokenLoading2) {
765783
+ addTokens(splTokens.map(convertSplTokens));
765784
+ }
765779
765785
  return splTokens;
765780
765786
  } catch (e36) {
765781
765787
  if (e36 instanceof AxiosError2 && e36.response?.status === 304) {
765782
765788
  log2("solana/preload", `loading existing fallback tokens for solana with hash ${latestCALHash || spl_hash_default}`);
765783
765789
  if (!latestCALHash) {
765784
765790
  setCALHash2(currency24, spl_hash_default);
765785
- addTokens(spl_default2.map(convertSplTokens));
765791
+ if (!shouldSkipTokenLoading2) {
765792
+ addTokens(spl_default2.map(convertSplTokens));
765793
+ }
765786
765794
  return spl_default2;
765787
765795
  }
765788
765796
  return null;
@@ -765834,12 +765842,16 @@ function hydrate8(data6, currency24) {
765834
765842
  }
765835
765843
  function hydrateV1(data6, currency24) {
765836
765844
  if (Array.isArray(data6.splTokens)) {
765837
- addTokens(data6.splTokens.map(convertSplTokens));
765845
+ if (!shouldSkipTokenLoading2) {
765846
+ addTokens(data6.splTokens.map(convertSplTokens));
765847
+ }
765838
765848
  log2("solana/preload", `hydrate ${data6.splTokens.length} tokens`);
765839
765849
  setSolanaPreloadData(data6, currency24);
765840
765850
  return;
765841
765851
  }
765842
- addTokens(spl_default2.map(convertSplTokens));
765852
+ if (!shouldSkipTokenLoading2) {
765853
+ addTokens(spl_default2.map(convertSplTokens));
765854
+ }
765843
765855
  log2("solana/preload", `hydrate fallback ${spl_default2.length} embedded tokens`);
765844
765856
  setSolanaPreloadData(data6, currency24);
765845
765857
  }
@@ -769087,6 +769099,12 @@ var createSigner17 = (transport) => new LegacySignerSolana(transport);
769087
769099
  var getCurrencyConfig8 = () => {
769088
769100
  return getCurrencyConfiguration(getCryptoCurrencyById("solana"));
769089
769101
  };
769102
+ try {
769103
+ const isCALLazyLoadingEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
769104
+ setShouldSkipTokenLoading2(Boolean(isCALLazyLoadingEnabled));
769105
+ } catch (error) {
769106
+ setShouldSkipTokenLoading2(false);
769107
+ }
769090
769108
  var bridge18 = createBridges17(executeWithSigner(createSigner17), getCurrencyConfig8, getCryptoAssetsStore3);
769091
769109
  var messageSigner6 = {
769092
769110
  signMessage: createMessageSigner(createSigner17, signMessage7)
@@ -816053,13 +816071,8 @@ async function listOperations5(address4, { limit, minHeight, token, order }) {
816053
816071
  var convertToCoreOperation = (address4) => (operation) => {
816054
816072
  const { ledger_hash, hash: hash10, close_time_iso, meta: { delivered_amount }, tx_json: { TransactionType: TransactionType3, Fee: Fee2, date, Account: Account2, Destination, DestinationTag, Memos, ledger_index, Sequence, SigningPubKey } } = operation;
816055
816073
  const type4 = Account2 === address4 ? "OUT" : "IN";
816056
- let value5 = delivered_amount && typeof delivered_amount === "string" ? BigInt(delivered_amount) : BigInt(0);
816074
+ const value5 = delivered_amount && typeof delivered_amount === "string" ? BigInt(delivered_amount) : BigInt(0);
816057
816075
  const fees2 = BigInt(Fee2);
816058
- if (type4 === "OUT") {
816059
- if (!Number.isNaN(fees2)) {
816060
- value5 = value5 + fees2;
816061
- }
816062
- }
816063
816076
  const toEpochDate = (RIPPLE_EPOCH + date) * 1e3;
816064
816077
  let details = {};
816065
816078
  if (DestinationTag) {
@@ -817437,13 +817450,14 @@ function adaptCoreOperationToLiveOperation(accountId2, op) {
817437
817450
  if (op.details?.memo) {
817438
817451
  extra.memo = op.details.memo;
817439
817452
  }
817453
+ const bnFees = new import_bignumber359.default(op.tx.fees.toString());
817440
817454
  const res = {
817441
817455
  id: extra.ledgerOpType ? encodeOperationId(accountId2, op.tx.hash, extra.ledgerOpType) : encodeOperationId(accountId2, op.tx.hash, op.type),
817442
817456
  hash: op.tx.hash,
817443
817457
  accountId: accountId2,
817444
817458
  type: opType,
817445
- value: new import_bignumber359.default(op.value.toString()),
817446
- fee: new import_bignumber359.default(op.tx.fees.toString()),
817459
+ value: ["OUT", "FEES"].includes(opType) ? new import_bignumber359.default(op.value.toString()).plus(bnFees) : new import_bignumber359.default(op.value.toString()),
817460
+ fee: bnFees,
817447
817461
  blockHash: op.tx.block.hash,
817448
817462
  blockHeight: op.tx.block.height,
817449
817463
  senders: op.senders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.21.3-nightly.2",
3
+ "version": "24.21.3-nightly.4",
4
4
  "description": "ledger-live CLI version",
5
5
  "repository": {
6
6
  "type": "git",