@magmaprotocol/magma-clmm-sdk 0.5.28 → 0.5.29

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.mjs CHANGED
@@ -7306,23 +7306,27 @@ var LockModule = class {
7306
7306
  }
7307
7307
  });
7308
7308
  for (const item of ownerRes.data) {
7309
- const { fields } = item.data.content;
7310
- const aLockSummary = await this.aLockSummary(fields.id.id);
7311
- const lockInfo = {
7312
- lock_id: fields.id.id,
7313
- amount: fields.amount,
7314
- start: fields.start,
7315
- end: fields.end,
7316
- permanent: fields.permanent,
7317
- rebase_amount: {
7318
- kind: "rebaseCoin" /* RebaseCoin */,
7319
- token_addr: magma_token,
7320
- amount: aLockSummary.reward_distributor_claimable
7321
- },
7322
- voting_power: aLockSummary.voting_power,
7323
- voting_rewards: /* @__PURE__ */ new Map()
7324
- };
7325
- locksInfo.lockInfo.push(lockInfo);
7309
+ try {
7310
+ const { fields } = item.data.content;
7311
+ const aLockSummary = await this.aLockSummary(fields.id.id);
7312
+ const lockInfo = {
7313
+ lock_id: fields.id.id,
7314
+ amount: fields.amount,
7315
+ start: fields.start,
7316
+ end: fields.end,
7317
+ permanent: fields.permanent,
7318
+ rebase_amount: {
7319
+ kind: "rebaseCoin" /* RebaseCoin */,
7320
+ token_addr: magma_token,
7321
+ amount: aLockSummary.reward_distributor_claimable
7322
+ },
7323
+ voting_power: aLockSummary.voting_power,
7324
+ voting_rewards: /* @__PURE__ */ new Map()
7325
+ };
7326
+ locksInfo.lockInfo.push(lockInfo);
7327
+ } catch (error) {
7328
+ throw Error("fastLocksOfUser error");
7329
+ }
7326
7330
  }
7327
7331
  return locksInfo;
7328
7332
  }
@@ -7337,61 +7341,65 @@ var LockModule = class {
7337
7341
  }
7338
7342
  });
7339
7343
  for (const item of ownerRes.data) {
7340
- const { fields } = item.data.content;
7341
- const aLockSummary = await this.aLockSummary(fields.id.id);
7342
- const poolIncentiveTokens = await this.getVotingBribeRewardTokens(fields.id.id);
7343
- const poolFeeTokens = await this.getVotingFeeRewardTokens(fields.id.id);
7344
- const incentiveTokens = [];
7345
- poolIncentiveTokens.forEach((value, key) => {
7346
- incentiveTokens.push(...value);
7347
- });
7348
- const feeTokens = [];
7349
- poolFeeTokens.forEach((value, key) => {
7350
- feeTokens.push(...value);
7351
- });
7352
- const poolIncentiveRewards = await this.getPoolIncentiveRewards(fields.id.id, incentiveTokens);
7353
- const votingRewards = /* @__PURE__ */ new Map();
7354
- poolIncentiveRewards.forEach((value, coin) => {
7355
- value.forEach((amount, pool) => {
7356
- if (!votingRewards.has(pool)) {
7357
- votingRewards.set(pool, []);
7358
- }
7359
- votingRewards.get(pool)?.push({
7360
- kind: "incentiveCoin" /* Incentive */,
7361
- token_addr: coin,
7362
- amount: amount.toString()
7344
+ try {
7345
+ const { fields } = item.data.content;
7346
+ const aLockSummary = await this.aLockSummary(fields.id.id);
7347
+ const poolIncentiveTokens = await this.getVotingBribeRewardTokens(fields.id.id);
7348
+ const poolFeeTokens = await this.getVotingFeeRewardTokens(fields.id.id);
7349
+ const incentiveTokens = [];
7350
+ poolIncentiveTokens.forEach((value, key) => {
7351
+ incentiveTokens.push(...value);
7352
+ });
7353
+ const feeTokens = [];
7354
+ poolFeeTokens.forEach((value, key) => {
7355
+ feeTokens.push(...value);
7356
+ });
7357
+ const poolIncentiveRewards = await this.getPoolIncentiveRewards(fields.id.id, incentiveTokens);
7358
+ const votingRewards = /* @__PURE__ */ new Map();
7359
+ poolIncentiveRewards.forEach((value, coin) => {
7360
+ value.forEach((amount, pool) => {
7361
+ if (!votingRewards.has(pool)) {
7362
+ votingRewards.set(pool, []);
7363
+ }
7364
+ votingRewards.get(pool)?.push({
7365
+ kind: "incentiveCoin" /* Incentive */,
7366
+ token_addr: coin,
7367
+ amount: amount.toString()
7368
+ });
7363
7369
  });
7364
7370
  });
7365
- });
7366
- const poolFeeRewards = await this.getPoolFeeRewards(fields.id.id, feeTokens);
7367
- poolFeeRewards.forEach((value, coin) => {
7368
- value.forEach((amount, pool) => {
7369
- if (!votingRewards.has(pool)) {
7370
- votingRewards.set(pool, []);
7371
- }
7372
- votingRewards.get(pool)?.push({
7373
- kind: "fee" /* Fee */,
7374
- token_addr: coin,
7375
- amount: amount.toString()
7371
+ const poolFeeRewards = await this.getPoolFeeRewards(fields.id.id, feeTokens);
7372
+ poolFeeRewards.forEach((value, coin) => {
7373
+ value.forEach((amount, pool) => {
7374
+ if (!votingRewards.has(pool)) {
7375
+ votingRewards.set(pool, []);
7376
+ }
7377
+ votingRewards.get(pool)?.push({
7378
+ kind: "fee" /* Fee */,
7379
+ token_addr: coin,
7380
+ amount: amount.toString()
7381
+ });
7376
7382
  });
7377
7383
  });
7378
- });
7379
- const lockInfo = {
7380
- lock_id: fields.id.id,
7381
- amount: fields.amount,
7382
- start: fields.start,
7383
- end: fields.end,
7384
- permanent: fields.permanent,
7385
- rebase_amount: {
7386
- kind: "rebaseCoin" /* RebaseCoin */,
7387
- token_addr: magma_token,
7388
- amount: aLockSummary.reward_distributor_claimable
7389
- },
7390
- voting_power: aLockSummary.voting_power,
7391
- // pool => incentive/fee => amount
7392
- voting_rewards: votingRewards
7393
- };
7394
- locksInfo.lockInfo.push(lockInfo);
7384
+ const lockInfo = {
7385
+ lock_id: fields.id.id,
7386
+ amount: fields.amount,
7387
+ start: fields.start,
7388
+ end: fields.end,
7389
+ permanent: fields.permanent,
7390
+ rebase_amount: {
7391
+ kind: "rebaseCoin" /* RebaseCoin */,
7392
+ token_addr: magma_token,
7393
+ amount: aLockSummary.reward_distributor_claimable
7394
+ },
7395
+ voting_power: aLockSummary.voting_power,
7396
+ // pool => incentive/fee => amount
7397
+ voting_rewards: votingRewards
7398
+ };
7399
+ locksInfo.lockInfo.push(lockInfo);
7400
+ } catch (error) {
7401
+ throw Error("locksOfUser error");
7402
+ }
7395
7403
  }
7396
7404
  return locksInfo;
7397
7405
  }