@merkl/api 0.10.276 → 0.10.277

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.
@@ -191,10 +191,9 @@ export const extractOpportunities = {
191
191
  };
192
192
  return opportunity;
193
193
  },
194
- [Campaign.ERC20]: (campaign, campaigns, prices) => {
194
+ [Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR]: (campaign, campaigns, prices) => {
195
195
  const { chainId, tvl, campaignParameters: params, typeInfo, computeChainId, mainParameter } = campaign;
196
196
  const { active, all } = campaigns;
197
- // DEPRECATED!!!!
198
197
  const map = {
199
198
  actions: {
200
199
  pool: [
@@ -385,8 +385,6 @@ campaign //FIXME
385
385
  return prepareCompoundFetch(previous, campaign);
386
386
  case Campaign.EIGENLAYER:
387
387
  return prepareEigenLayerFetch(previous, campaign);
388
- case Campaign.VEST:
389
- return prepareEigenLayerFetch(previous, campaign);
390
388
  default:
391
389
  return previous;
392
390
  }
@@ -22,7 +22,7 @@ import { getJsonAirdropMetadata } from "./subservices/getJsonAirDropMetadata.ser
22
22
  import { getMorphoMetadata } from "./subservices/getMorphoMetadata.service";
23
23
  import { getRadiantMetadata } from "./subservices/getRadiantMetadata.service";
24
24
  import { getSiloMetadata } from "./subservices/getSiloMetadata.service";
25
- import { getVestMetaData } from "./subservices/getVestMetaData";
25
+ import { getVestMetaData } from "./subservices/getVestMetaData.service";
26
26
  export class OpportunityService {
27
27
  static hashId(opportunity) {
28
28
  return Bun.hash(`${opportunity.chainId}${opportunity.type}${opportunity.identifier}`).toString();
@@ -225,6 +225,7 @@ export type UserRewardV3Model = typeof UserRewardV3Dto.static;
225
225
  export type RewardV3Model = typeof RewardV3Dto.static;
226
226
  export type BreakdownForCampaignsRaw = {
227
227
  amount: string;
228
+ pending: string;
228
229
  claimed: string;
229
230
  recipient: string;
230
231
  campaignId: string;
@@ -208,6 +208,7 @@ export class RewardRepository {
208
208
  rb."amount",
209
209
  rb."reason",
210
210
  rb."claimed",
211
+ rb."pending",
211
212
  r."recipient",
212
213
  t."address" as "rewardTokenAddress"
213
214
  FROM
@@ -219,7 +220,7 @@ export class RewardRepository {
219
220
  WHERE
220
221
  r."root" = $1 AND rb."campaignId" = $2
221
222
  ORDER BY
222
- rb."amount"::numeric DESC
223
+ (rb."amount"::numeric + rb."pending"::numeric) DESC
223
224
  LIMIT $3
224
225
  OFFSET $4
225
226
  `, root, id, items, items * page);
@@ -235,11 +236,12 @@ export class RewardRepository {
235
236
  },
236
237
  select: {
237
238
  amount: true,
239
+ pending: true,
238
240
  campaignId: true,
239
241
  },
240
242
  });
241
- const reducedData = totalAmount.reduce((acc, { amount }) => {
242
- acc.amount += BigInt(amount);
243
+ const reducedData = totalAmount.reduce((acc, { amount, pending }) => {
244
+ acc.amount += BigInt(amount) + BigInt(pending ?? 0);
243
245
  return acc;
244
246
  }, { campaignId, amount: 0n });
245
247
  return reducedData;