@merkl/api 0.17.19 → 0.17.21

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.
@@ -54,10 +54,10 @@ export const opportunityUpdater = (app) => {
54
54
  await Redis.safeSet("OpportunitiesWithTest", opportunitiesWithTest);
55
55
  log.info("✅ opportunity cache updated successfully");
56
56
  await OpportunityConvertorService.logKeyAndTTLV3Opportunities(true, false, undefined, undefined);
57
- await OpportunityConvertorService.setV3Opportunities(true, false, undefined, undefined);
57
+ await OpportunityConvertorService.setV3Opportunities(false, false, undefined, undefined);
58
58
  log.info("✅ opportunity v3 cache updated successfully");
59
59
  await OpportunityConvertorService.logKeyAndTTLV3Opportunities(true, true, undefined, undefined);
60
- await OpportunityConvertorService.setV3Opportunities(true, true, undefined, undefined);
60
+ await OpportunityConvertorService.setV3Opportunities(false, true, undefined, undefined);
61
61
  log.info("✅ opportunity v3 test cache updated successfully");
62
62
  return new Response(JSON.stringify({
63
63
  status: "success",
@@ -47,9 +47,9 @@ const main = async () => {
47
47
  }
48
48
  // 3. Update the status of the opportunities associated to future campaigns
49
49
  const futureOpportunityIds = (await CampaignService.getFutureCampaigns({ computeChainId: chainId })).map(c => c.Opportunity.id);
50
- await OpportunityService.updateMany(futureOpportunityIds, { status: "SOON" });
51
- // 4. Update the status of the opportunities associated to live campaigns
52
50
  const liveOpportunityIds = (await CampaignService.getLiveCampaigns({ computeChainId: chainId })).map(c => c.Opportunity.id);
51
+ await OpportunityService.updateMany(futureOpportunityIds?.filter(opportunityId => !liveOpportunityIds.includes(opportunityId)), { status: "SOON" });
52
+ // 4. Update the status of the opportunities associated to live campaigns
53
53
  await OpportunityService.updateMany(liveOpportunityIds, { status: "LIVE" });
54
54
  };
55
55
  try {
@@ -2,9 +2,9 @@ import { NotFoundError } from "../../../errors";
2
2
  import { BackOfficeGuard } from "../../../guards/BackOffice.guard";
3
3
  import { AuthorizationHeadersDto, EngineGuard } from "../../../guards/Engine.guard";
4
4
  import { ChainUniqueDto } from "../chain/chain.model";
5
+ import { Campaign } from "@sdk";
5
6
  import Elysia, { t } from "elysia";
6
7
  import { throwOnUnsupportedChainId } from "src/utils/throw";
7
- import { Campaign } from "@sdk";
8
8
  import { DynamicDataService } from "../dynamicData/dynamicData.service";
9
9
  import { CampaignResourceDto, CreateCampaignDto, GetCampaignQueryDto, UpdateCampaignDto, UpdateMetaDataCampaignDto, } from "./campaign.model";
10
10
  import { CampaignService } from "./campaign.service";
@@ -30,7 +30,7 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
30
30
  detail: { hide: true },
31
31
  })
32
32
  .put("/:campaignId/dynamic-data", async ({ params }) => {
33
- const id = (await CampaignService.findMany({ campaignId: params.campaignId }))[0].id;
33
+ const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))[0].id;
34
34
  if (!id)
35
35
  throw new NotFoundError();
36
36
  const campaign = await CampaignService.findUniqueOrThrow(id, true);
@@ -108,6 +108,7 @@ export class OpportunityConvertorService {
108
108
  : undefined,
109
109
  tags: opportunity.tags,
110
110
  rewardTokenIcons: opportunity.campaigns
111
+ ?.filter(campaign => campaign.rewardToken.icon?.length > 0) // Do not return tokens without icons
111
112
  ?.map(campaign => campaign.rewardToken.symbol)
112
113
  .reduce((acc, curr) => {
113
114
  if (!acc.includes(curr))