@ledgerhq/live-cli 24.27.0-nightly.20251105023815 → 24.27.0-nightly.20251106023835

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 +96 -112
  2. package/package.json +3 -3
package/lib/cli.js CHANGED
@@ -520289,7 +520289,7 @@ var require_package7 = __commonJS({
520289
520289
  module2.exports = {
520290
520290
  name: "@ledgerhq/live-common",
520291
520291
  description: "Common ground for the Ledger Live apps",
520292
- version: "34.52.0-nightly.20251105023815",
520292
+ version: "34.52.0-nightly.20251106023835",
520293
520293
  repository: {
520294
520294
  type: "git",
520295
520295
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -520624,7 +520624,7 @@ var require_package8 = __commonJS({
520624
520624
  "package.json"(exports2, module2) {
520625
520625
  module2.exports = {
520626
520626
  name: "@ledgerhq/live-cli",
520627
- version: "24.27.0-nightly.20251105023815",
520627
+ version: "24.27.0-nightly.20251106023835",
520628
520628
  description: "ledger-live CLI version",
520629
520629
  repository: {
520630
520630
  type: "git",
@@ -565919,6 +565919,7 @@ var STAKING_EVENTS = ADD_STAKE_EVENTS.concat(REACTIVATE_STAKE_EVENTS, UNLOCK_STA
565919
565919
  var APTOS_ASSET_ID = "0x1::aptos_coin::AptosCoin";
565920
565920
  var APTOS_COIN_CHANGE = `0x1::coin::CoinStore<${APTOS_ASSET_ID}>`;
565921
565921
  var APTOS_FUNGIBLE_STORE = "0x1::fungible_asset::FungibleStore";
565922
+ var APTOS_ASSET_FUNGIBLE_ID = "0xa";
565922
565923
  var APTOS_OBJECT_CORE = "0x1::object::ObjectCore";
565923
565924
  var OP_TYPE;
565924
565925
  (function(OP_TYPE2) {
@@ -566253,7 +566254,7 @@ var txsToOps = async (info6, id5, txs) => {
566253
566254
  ops.push(op);
566254
566255
  opsStaking.push(op);
566255
566256
  } else if (op.type !== OP_TYPE.UNKNOWN && coin_id !== null) {
566256
- if (coin_id === APTOS_ASSET_ID) {
566257
+ if (coin_id === APTOS_ASSET_ID || coin_id === APTOS_ASSET_FUNGIBLE_ID) {
566257
566258
  ops.push(op);
566258
566259
  } else {
566259
566260
  const token = await getCryptoAssetsStore().findTokenByAddressInCurrency(coin_id.toLowerCase(), "aptos");
@@ -579083,18 +579084,23 @@ var import_isUndefined = __toESM(require("lodash/isUndefined"));
579083
579084
 
579084
579085
  // ../../libs/coin-modules/coin-aptos/lib-es/network/graphql/queries.js
579085
579086
  var GetAccountTransactionsData = gql`
579086
- query GetAccountTransactionsData($address: String, $limit: Int) {
579087
- account_transactions(where: { account_address: { _eq: $address } }, limit: $limit) {
579087
+ query GetAccountTransactionsData($address: String, $limit: Int, $offset: Int) {
579088
+ account_transactions(
579089
+ where: { account_address: { _eq: $address } }
579090
+ limit: $limit
579091
+ offset: $offset
579092
+ ) {
579088
579093
  transaction_version
579089
579094
  __typename
579090
579095
  }
579091
579096
  }
579092
579097
  `;
579093
579098
  var GetAccountTransactionsDataGt = gql`
579094
- query GetAccountTransactionsDataGt($address: String, $limit: Int, $gt: bigint) {
579099
+ query GetAccountTransactionsDataGt($address: String, $limit: Int, $gt: bigint, $offset: Int) {
579095
579100
  account_transactions(
579096
579101
  where: { account_address: { _eq: $address }, transaction_version: { _gt: $gt } }
579097
579102
  limit: $limit
579103
+ offset: $offset
579098
579104
  ) {
579099
579105
  transaction_version
579100
579106
  __typename
@@ -579316,24 +579322,43 @@ var AptosAPI = class {
579316
579322
  const newOperations = transactionsToOperations(address3, transactions3.transactions);
579317
579323
  return [newOperations, ""];
579318
579324
  }
579319
- async fetchTransactions(address3, gt3) {
579320
- if (!address3) {
579321
- return [];
579322
- }
579325
+ async getAllTransactions(address3, gt3) {
579326
+ let allTransactions = [];
579327
+ let offset2 = 0;
579323
579328
  let query2 = GetAccountTransactionsData;
579324
579329
  if (gt3) {
579325
579330
  query2 = GetAccountTransactionsDataGt;
579326
579331
  }
579327
- const queryResponse = await this.apolloClient.query({
579328
- query: query2,
579329
- variables: {
579330
- address: address3,
579331
- limit: 1e3,
579332
- gt: gt3
579333
- },
579334
- fetchPolicy: "network-only"
579335
- });
579336
- return Promise.all(queryResponse.data.account_transactions.slice().sort((a68, b19) => b19.transaction_version - a68.transaction_version).map(({ transaction_version }) => {
579332
+ const condition = true;
579333
+ while (condition) {
579334
+ try {
579335
+ const queryResponse = await this.apolloClient.query({
579336
+ query: query2,
579337
+ variables: {
579338
+ address: address3,
579339
+ limit: 100,
579340
+ gt: gt3,
579341
+ offset: offset2
579342
+ },
579343
+ fetchPolicy: "network-only"
579344
+ });
579345
+ offset2 += 100;
579346
+ allTransactions = allTransactions.concat(queryResponse.data.account_transactions);
579347
+ if (queryResponse.data.account_transactions.length < 100) {
579348
+ break;
579349
+ }
579350
+ } catch (error) {
579351
+ throw new Error(error);
579352
+ }
579353
+ }
579354
+ return allTransactions;
579355
+ }
579356
+ async fetchTransactions(address3, gt3) {
579357
+ if (!address3) {
579358
+ return [];
579359
+ }
579360
+ const transactions3 = await this.getAllTransactions(address3, gt3);
579361
+ return Promise.all(transactions3.slice().sort((a68, b19) => b19.transaction_version - a68.transaction_version).map(({ transaction_version }) => {
579337
579362
  return this.richItemByVersion(transaction_version);
579338
579363
  }));
579339
579364
  }
@@ -696788,24 +696813,18 @@ var getCoinConfig5 = () => {
696788
696813
  };
696789
696814
 
696790
696815
  // ../../libs/coin-modules/coin-near/lib-es/api/indexer.js
696791
- var DEFAULT_TRANSACTIONS_LIMIT2 = 100;
696792
- var getIndexerUrl = (route) => {
696816
+ var fetchTransactions2 = async (address3) => {
696793
696817
  const currencyConfig = getCoinConfig5();
696794
- return `${currencyConfig.infra.API_NEAR_INDEXER}${route || ""}`;
696795
- };
696796
- var fetchTransactions2 = async (address3, limit = DEFAULT_TRANSACTIONS_LIMIT2) => {
696797
- const route = `/transactions?limit=${limit}&account=${address3}&date=${(/* @__PURE__ */ new Date()).getTime()}`;
696798
- const { data: data6 } = await network_default({
696799
- method: "GET",
696800
- url: getIndexerUrl(route)
696818
+ const response = await lib_es_default({
696819
+ url: `${currencyConfig.infra.API_NEARBLOCKS_INDEXER}/v1/account/${address3}/txns-only`
696801
696820
  });
696802
- return data6?.records || [];
696821
+ return response.data.txns || [];
696803
696822
  };
696804
696823
  function isSender3(transaction, address3) {
696805
- return transaction.sender === address3;
696824
+ return transaction.signer_account_id === address3;
696806
696825
  }
696807
696826
  function getOperationType6(transaction, address3) {
696808
- switch (transaction.actions[0]?.data?.method_name) {
696827
+ switch (transaction.actions[0]?.method) {
696809
696828
  case "deposit_and_stake":
696810
696829
  return "STAKE";
696811
696830
  case "unstake":
@@ -696819,28 +696838,28 @@ function getOperationType6(transaction, address3) {
696819
696838
  }
696820
696839
  }
696821
696840
  function getOperationValue2(transaction, type4) {
696822
- const amount = transaction.actions[0]?.data?.deposit || 0;
696841
+ const amount = transaction.actions[0]?.deposit || 0;
696823
696842
  if (type4 === "OUT") {
696824
- return new import_bignumber233.BigNumber(amount).plus(transaction.fee);
696843
+ return new import_bignumber233.BigNumber(amount).plus(transaction.outcomes_agg.transaction_fee);
696825
696844
  }
696826
696845
  return new import_bignumber233.BigNumber(amount);
696827
696846
  }
696828
696847
  async function transactionToOperation2(accountId2, address3, transaction) {
696829
696848
  const type4 = getOperationType6(transaction, address3);
696830
696849
  return {
696831
- id: encodeOperationId(accountId2, transaction.hash, type4),
696850
+ id: encodeOperationId(accountId2, transaction.transaction_hash, type4),
696832
696851
  accountId: accountId2,
696833
- fee: new import_bignumber233.BigNumber(transaction.fee || 0),
696852
+ fee: new import_bignumber233.BigNumber(transaction.outcomes_agg.transaction_fee || 0),
696834
696853
  value: getOperationValue2(transaction, type4),
696835
696854
  type: type4,
696836
- hash: transaction.hash,
696837
- blockHash: transaction.block_hash,
696838
- blockHeight: transaction.height,
696839
- date: new Date(transaction.time),
696855
+ hash: transaction.transaction_hash,
696856
+ blockHash: transaction.included_in_block_hash,
696857
+ blockHeight: transaction.block.block_height,
696858
+ date: new Date(parseFloat(transaction.block_timestamp) / 1e6),
696840
696859
  extra: {},
696841
- senders: transaction.sender ? [transaction.sender] : [],
696842
- recipients: transaction.receiver ? [transaction.receiver] : [],
696843
- hasFailed: !transaction.success
696860
+ senders: transaction.signer_account_id ? [transaction.signer_account_id] : [],
696861
+ recipients: transaction.receiver_account_id ? [transaction.receiver_account_id] : [],
696862
+ hasFailed: !transaction.outcomes.status
696844
696863
  };
696845
696864
  }
696846
696865
  var getOperations3 = async (accountId2, address3) => {
@@ -696954,7 +696973,7 @@ var getStakingFees = (t45, gasPrice) => {
696954
696973
  // ../../libs/coin-modules/coin-near/lib-es/api/node.js
696955
696974
  var fetchAccountDetails2 = async (address3) => {
696956
696975
  const currencyConfig = getCoinConfig5();
696957
- const { data: data6 } = await lib_es_default({
696976
+ const { data: data6 } = await network_default({
696958
696977
  method: "POST",
696959
696978
  url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
696960
696979
  data: {
@@ -697004,7 +697023,7 @@ var getAccount6 = async (address3) => {
697004
697023
  };
697005
697024
  var getProtocolConfig = async () => {
697006
697025
  const currencyConfig = getCoinConfig5();
697007
- const { data: data6 } = await lib_es_default({
697026
+ const { data: data6 } = await network_default({
697008
697027
  method: "POST",
697009
697028
  url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697010
697029
  data: {
@@ -697020,21 +697039,14 @@ var getProtocolConfig = async () => {
697020
697039
  };
697021
697040
  var getGasPrice = async () => {
697022
697041
  const currencyConfig = getCoinConfig5();
697023
- const { data: data6 } = await lib_es_default({
697024
- method: "POST",
697025
- url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697026
- data: {
697027
- jsonrpc: "2.0",
697028
- id: "id",
697029
- method: "gas_price",
697030
- params: [null]
697031
- }
697042
+ const response = await lib_es_default({
697043
+ url: `${currencyConfig.infra.API_NEARBLOCKS_INDEXER}/v1/stats`
697032
697044
  });
697033
- return data6?.result?.gas_price;
697045
+ return response.data.stats[0].gas_price;
697034
697046
  };
697035
697047
  var getAccessKey = async ({ address: address3, publicKey: publicKey3 }) => {
697036
697048
  const currencyConfig = getCoinConfig5();
697037
- const { data: data6 } = await lib_es_default({
697049
+ const { data: data6 } = await network_default({
697038
697050
  method: "POST",
697039
697051
  url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697040
697052
  data: {
@@ -697053,7 +697065,7 @@ var getAccessKey = async ({ address: address3, publicKey: publicKey3 }) => {
697053
697065
  };
697054
697066
  var broadcastTransaction7 = async (transaction, retries = 6) => {
697055
697067
  const currencyConfig = getCoinConfig5();
697056
- const { data: data6 } = await lib_es_default({
697068
+ const { data: data6 } = await network_default({
697057
697069
  method: "POST",
697058
697070
  url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697059
697071
  data: {
@@ -697102,8 +697114,11 @@ var getStakingPositions = async (address3) => {
697102
697114
  let totalStaked = new import_bignumber236.BigNumber(0);
697103
697115
  let totalAvailable = new import_bignumber236.BigNumber(0);
697104
697116
  let totalPending = new import_bignumber236.BigNumber(0);
697105
- const activeDelegatedStakeBalance = await account3.getActiveDelegatedStakeBalance();
697106
- const stakingPositions = await Promise.all(activeDelegatedStakeBalance.stakedValidators.map(async ({ validatorId }) => {
697117
+ const stakingThreshold = getYoctoThreshold();
697118
+ const delegatedValidators = await lib_es_default({
697119
+ url: `${currencyConfig.infra.API_NEARBLOCKS_INDEXER}/v1/kitwallet/staking-deposits/${address3}`
697120
+ });
697121
+ const stakingPositions = await Promise.all(delegatedValidators.data.map(async ({ validator_id: validatorId }) => {
697107
697122
  const contract = new nearAPI.Contract(account3, validatorId, {
697108
697123
  viewMethods: [
697109
697124
  "get_account_staked_balance",
@@ -697134,7 +697149,6 @@ var getStakingPositions = async (address3) => {
697134
697149
  const staked = new import_bignumber236.BigNumber(rawStaked);
697135
697150
  available = new import_bignumber236.BigNumber(available);
697136
697151
  pending = new import_bignumber236.BigNumber(pending);
697137
- const stakingThreshold = getYoctoThreshold();
697138
697152
  if (staked.gte(stakingThreshold)) {
697139
697153
  totalStaked = totalStaked.plus(staked);
697140
697154
  }
@@ -697158,45 +697172,19 @@ var getStakingPositions = async (address3) => {
697158
697172
  totalPending
697159
697173
  };
697160
697174
  };
697161
- var getValidators3 = makeLRUCache(async () => {
697162
- const currencyConfig = getCoinConfig5();
697163
- const { data: data6 } = await lib_es_default({
697164
- method: "POST",
697165
- url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697166
- data: {
697167
- jsonrpc: "2.0",
697168
- id: "id",
697169
- method: "validators",
697170
- params: [null]
697171
- }
697172
- });
697173
- return data6?.result?.current_validators || [];
697174
- }, () => "", { ttl: 30 * 60 * 1e3 });
697175
- var getCommission = makeLRUCache(async (validatorAddress) => {
697175
+ async function fetchValidators({ per_page, page }) {
697176
697176
  const currencyConfig = getCoinConfig5();
697177
- const { data: data6 } = await lib_es_default({
697178
- method: "POST",
697179
- url: currencyConfig.infra.API_NEAR_PRIVATE_NODE,
697180
- data: {
697181
- jsonrpc: "2.0",
697182
- id: "id",
697183
- method: "query",
697184
- params: {
697185
- request_type: "call_function",
697186
- account_id: validatorAddress,
697187
- method_name: "get_reward_fee_fraction",
697188
- args_base64: "e30=",
697189
- finality: "optimistic"
697190
- }
697191
- }
697177
+ const delegatedValidators = await lib_es_default({
697178
+ url: `${currencyConfig.infra.API_NEARBLOCKS_INDEXER}/v1/validators?per_page=${per_page}&page=${page}`
697192
697179
  });
697193
- const result2 = data6?.result?.result;
697194
- if (Array.isArray(result2) && result2.length) {
697195
- const parsedResult = JSON.parse(Buffer.from(result2).toString());
697196
- return Math.round(parsedResult.numerator / parsedResult.denominator * 100);
697197
- }
697198
- return null;
697199
- }, (validatorAddress) => validatorAddress, { ttl: 30 * 60 * 1e3 });
697180
+ const validators7 = delegatedValidators.data.validatorFullData.map(({ accountId: accountId2, currentEpoch, poolInfo }) => ({
697181
+ account_id: accountId2,
697182
+ stake: currentEpoch.stake,
697183
+ commission: Math.round(poolInfo.fee.numerator / poolInfo.fee.denominator * 100)
697184
+ }));
697185
+ return validators7 || [];
697186
+ }
697187
+ var getValidators3 = makeLRUCache(fetchValidators, () => "", { ttl: 30 * 60 * 1e3 });
697200
697188
 
697201
697189
  // ../../libs/coin-modules/coin-near/lib-es/errors.js
697202
697190
  init_lib_es();
@@ -697281,16 +697269,11 @@ var preload5 = async () => {
697281
697269
  log2("near/preload", "preloading near data...");
697282
697270
  const [protocolConfig, rawValidators, gasPrice] = await Promise.all([
697283
697271
  getProtocolConfig(),
697284
- getValidators3(),
697272
+ getValidators3({ per_page: 200, page: 1 }),
697273
+ // get first 200 validators
697285
697274
  getGasPrice()
697286
697275
  ]);
697287
- const defautCommission = 10;
697288
- const validators7 = await Promise.all(rawValidators.map(async ({ account_id: validatorAddress, stake }) => {
697289
- let commission = defautCommission;
697290
- try {
697291
- commission = await getCommission(validatorAddress) || defautCommission;
697292
- } catch (error) {
697293
- }
697276
+ const validators7 = await Promise.all(rawValidators.map(async ({ account_id: validatorAddress, stake, commission }) => {
697294
697277
  return {
697295
697278
  validatorAddress,
697296
697279
  tokens: stake,
@@ -743044,7 +743027,7 @@ var fetchStakingInfo = async (addr, currency24) => {
743044
743027
  };
743045
743028
 
743046
743029
  // ../../libs/coin-modules/coin-polkadot/lib-es/network/node/validators.js
743047
- var fetchValidators = async (status = "all", addresses, currency24) => {
743030
+ var fetchValidators2 = async (status = "all", addresses, currency24) => {
743048
743031
  const api7 = await apiPromise_default(currency24);
743049
743032
  const [activeOpt, allStashes, elected] = await Promise.all([
743050
743033
  api7.query.staking.activeEra(),
@@ -743186,7 +743169,7 @@ var fetchNominations = async (address3) => {
743186
743169
  var node_default3 = {
743187
743170
  fetchConstants,
743188
743171
  fetchStakingInfo,
743189
- fetchValidators,
743172
+ fetchValidators: fetchValidators2,
743190
743173
  fetchNominations
743191
743174
  };
743192
743175
 
@@ -743242,7 +743225,7 @@ var getMinimumBondBalance = async (currency24) => {
743242
743225
  const { data: data6 } = await callSidecar(`/pallets/staking/storage/minNominatorBond`, currency24);
743243
743226
  return data6.value && new import_bignumber244.BigNumber(data6.value) || new import_bignumber244.BigNumber(0);
743244
743227
  };
743245
- var fetchValidators2 = async (status = "all", currency24, addresses) => {
743228
+ var fetchValidators3 = async (status = "all", currency24, addresses) => {
743246
743229
  return await node_default3.fetchValidators(status, addresses, currency24);
743247
743230
  };
743248
743231
  var fetchStakingProgress = async (currency24) => {
@@ -743271,7 +743254,7 @@ var isControllerAddress = async (addr, currency24) => {
743271
743254
  return !!stash;
743272
743255
  };
743273
743256
  var verifyValidatorAddresses = async (validators7, currency24) => {
743274
- const existingValidators = await fetchValidators2("all", currency24, validators7);
743257
+ const existingValidators = await fetchValidators3("all", currency24, validators7);
743275
743258
  const existingIds = existingValidators.map((v34) => v34.accountId);
743276
743259
  return validators7.filter((v34) => !existingIds.includes(v34));
743277
743260
  };
@@ -743384,9 +743367,9 @@ var paymentInfo = async (extrinsic, currency24) => {
743384
743367
  var getValidators4 = async (stashes2 = "elected", currency24) => {
743385
743368
  let validators7;
743386
743369
  if (Array.isArray(stashes2)) {
743387
- validators7 = await fetchValidators2("all", currency24, stashes2);
743370
+ validators7 = await fetchValidators3("all", currency24, stashes2);
743388
743371
  } else {
743389
- validators7 = await fetchValidators2(stashes2, currency24);
743372
+ validators7 = await fetchValidators3(stashes2, currency24);
743390
743373
  }
743391
743374
  return validators7.map((v34) => ({
743392
743375
  address: v34.accountId,
@@ -824237,7 +824220,8 @@ var nearConfig = {
824237
824220
  infra: {
824238
824221
  API_NEAR_PRIVATE_NODE: "https://near.coin.ledger.com/node",
824239
824222
  API_NEAR_PUBLIC_NODE: "https://rpc.mainnet.near.org",
824240
- API_NEAR_INDEXER: "https://near.coin.ledger.com/indexer"
824223
+ API_NEAR_INDEXER: "https://near.coin.ledger.com/indexer",
824224
+ API_NEARBLOCKS_INDEXER: "https://near-indexer.coin.ledger.com"
824241
824225
  }
824242
824226
  }
824243
824227
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-cli",
3
- "version": "24.27.0-nightly.20251105023815",
3
+ "version": "24.27.0-nightly.20251106023835",
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.30.0-nightly.20251105023815",
62
- "@ledgerhq/types-live": "^6.88.0-nightly.20251105023815"
61
+ "@ledgerhq/types-live": "^6.88.0-nightly.20251106023835",
62
+ "@ledgerhq/types-cryptoassets": "^7.30.0-nightly.20251106023835"
63
63
  },
64
64
  "publishConfig": {
65
65
  "directory": "dist"