@magmaprotocol/magma-clmm-sdk 0.5.28 → 0.5.30

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/dist/index.js CHANGED
@@ -7511,23 +7511,27 @@ var LockModule = class {
7511
7511
  }
7512
7512
  });
7513
7513
  for (const item of ownerRes.data) {
7514
- const { fields } = item.data.content;
7515
- const aLockSummary = await this.aLockSummary(fields.id.id);
7516
- const lockInfo = {
7517
- lock_id: fields.id.id,
7518
- amount: fields.amount,
7519
- start: fields.start,
7520
- end: fields.end,
7521
- permanent: fields.permanent,
7522
- rebase_amount: {
7523
- kind: "rebaseCoin" /* RebaseCoin */,
7524
- token_addr: magma_token,
7525
- amount: aLockSummary.reward_distributor_claimable
7526
- },
7527
- voting_power: aLockSummary.voting_power,
7528
- voting_rewards: /* @__PURE__ */ new Map()
7529
- };
7530
- locksInfo.lockInfo.push(lockInfo);
7514
+ try {
7515
+ const { fields } = item.data.content;
7516
+ const aLockSummary = await this.aLockSummary(fields.id.id);
7517
+ const lockInfo = {
7518
+ lock_id: fields.id.id,
7519
+ amount: fields.amount,
7520
+ start: fields.start,
7521
+ end: fields.end,
7522
+ permanent: fields.permanent,
7523
+ rebase_amount: {
7524
+ kind: "rebaseCoin" /* RebaseCoin */,
7525
+ token_addr: magma_token,
7526
+ amount: aLockSummary.reward_distributor_claimable
7527
+ },
7528
+ voting_power: aLockSummary.voting_power,
7529
+ voting_rewards: /* @__PURE__ */ new Map()
7530
+ };
7531
+ locksInfo.lockInfo.push(lockInfo);
7532
+ } catch (error) {
7533
+ console.error("fastLocksOfUser error", error);
7534
+ }
7531
7535
  }
7532
7536
  return locksInfo;
7533
7537
  }
@@ -7542,61 +7546,65 @@ var LockModule = class {
7542
7546
  }
7543
7547
  });
7544
7548
  for (const item of ownerRes.data) {
7545
- const { fields } = item.data.content;
7546
- const aLockSummary = await this.aLockSummary(fields.id.id);
7547
- const poolIncentiveTokens = await this.getVotingBribeRewardTokens(fields.id.id);
7548
- const poolFeeTokens = await this.getVotingFeeRewardTokens(fields.id.id);
7549
- const incentiveTokens = [];
7550
- poolIncentiveTokens.forEach((value, key) => {
7551
- incentiveTokens.push(...value);
7552
- });
7553
- const feeTokens = [];
7554
- poolFeeTokens.forEach((value, key) => {
7555
- feeTokens.push(...value);
7556
- });
7557
- const poolIncentiveRewards = await this.getPoolIncentiveRewards(fields.id.id, incentiveTokens);
7558
- const votingRewards = /* @__PURE__ */ new Map();
7559
- poolIncentiveRewards.forEach((value, coin) => {
7560
- value.forEach((amount, pool) => {
7561
- if (!votingRewards.has(pool)) {
7562
- votingRewards.set(pool, []);
7563
- }
7564
- votingRewards.get(pool)?.push({
7565
- kind: "incentiveCoin" /* Incentive */,
7566
- token_addr: coin,
7567
- amount: amount.toString()
7549
+ try {
7550
+ const { fields } = item.data.content;
7551
+ const aLockSummary = await this.aLockSummary(fields.id.id);
7552
+ const poolIncentiveTokens = await this.getVotingBribeRewardTokens(fields.id.id);
7553
+ const poolFeeTokens = await this.getVotingFeeRewardTokens(fields.id.id);
7554
+ const incentiveTokens = [];
7555
+ poolIncentiveTokens.forEach((value, key) => {
7556
+ incentiveTokens.push(...value);
7557
+ });
7558
+ const feeTokens = [];
7559
+ poolFeeTokens.forEach((value, key) => {
7560
+ feeTokens.push(...value);
7561
+ });
7562
+ const poolIncentiveRewards = await this.getPoolIncentiveRewards(fields.id.id, incentiveTokens);
7563
+ const votingRewards = /* @__PURE__ */ new Map();
7564
+ poolIncentiveRewards.forEach((value, coin) => {
7565
+ value.forEach((amount, pool) => {
7566
+ if (!votingRewards.has(pool)) {
7567
+ votingRewards.set(pool, []);
7568
+ }
7569
+ votingRewards.get(pool)?.push({
7570
+ kind: "incentiveCoin" /* Incentive */,
7571
+ token_addr: coin,
7572
+ amount: amount.toString()
7573
+ });
7568
7574
  });
7569
7575
  });
7570
- });
7571
- const poolFeeRewards = await this.getPoolFeeRewards(fields.id.id, feeTokens);
7572
- poolFeeRewards.forEach((value, coin) => {
7573
- value.forEach((amount, pool) => {
7574
- if (!votingRewards.has(pool)) {
7575
- votingRewards.set(pool, []);
7576
- }
7577
- votingRewards.get(pool)?.push({
7578
- kind: "fee" /* Fee */,
7579
- token_addr: coin,
7580
- amount: amount.toString()
7576
+ const poolFeeRewards = await this.getPoolFeeRewards(fields.id.id, feeTokens);
7577
+ poolFeeRewards.forEach((value, coin) => {
7578
+ value.forEach((amount, pool) => {
7579
+ if (!votingRewards.has(pool)) {
7580
+ votingRewards.set(pool, []);
7581
+ }
7582
+ votingRewards.get(pool)?.push({
7583
+ kind: "fee" /* Fee */,
7584
+ token_addr: coin,
7585
+ amount: amount.toString()
7586
+ });
7581
7587
  });
7582
7588
  });
7583
- });
7584
- const lockInfo = {
7585
- lock_id: fields.id.id,
7586
- amount: fields.amount,
7587
- start: fields.start,
7588
- end: fields.end,
7589
- permanent: fields.permanent,
7590
- rebase_amount: {
7591
- kind: "rebaseCoin" /* RebaseCoin */,
7592
- token_addr: magma_token,
7593
- amount: aLockSummary.reward_distributor_claimable
7594
- },
7595
- voting_power: aLockSummary.voting_power,
7596
- // pool => incentive/fee => amount
7597
- voting_rewards: votingRewards
7598
- };
7599
- locksInfo.lockInfo.push(lockInfo);
7589
+ const lockInfo = {
7590
+ lock_id: fields.id.id,
7591
+ amount: fields.amount,
7592
+ start: fields.start,
7593
+ end: fields.end,
7594
+ permanent: fields.permanent,
7595
+ rebase_amount: {
7596
+ kind: "rebaseCoin" /* RebaseCoin */,
7597
+ token_addr: magma_token,
7598
+ amount: aLockSummary.reward_distributor_claimable
7599
+ },
7600
+ voting_power: aLockSummary.voting_power,
7601
+ // pool => incentive/fee => amount
7602
+ voting_rewards: votingRewards
7603
+ };
7604
+ locksInfo.lockInfo.push(lockInfo);
7605
+ } catch (error) {
7606
+ console.error("locksOfUser error", error);
7607
+ }
7600
7608
  }
7601
7609
  return locksInfo;
7602
7610
  }