@merkl/api 0.17.22 → 0.17.24

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 (36) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +46 -0
  2. package/dist/database/api/.generated/drizzle/schema.js +5 -1
  3. package/dist/database/api/.generated/drizzle/schema.ts +8 -1
  4. package/dist/database/api/.generated/edge.js +26 -4
  5. package/dist/database/api/.generated/index-browser.js +7 -1
  6. package/dist/database/api/.generated/index.d.ts +149 -2
  7. package/dist/database/api/.generated/index.js +26 -4
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +29 -8
  10. package/dist/database/api/.generated/wasm.js +7 -1
  11. package/dist/src/eden/index.d.ts +190 -8
  12. package/dist/src/index.d.ts +44 -2
  13. package/dist/src/libs/campaigns/utils/getDolomiteMarkets.d.ts +3 -2
  14. package/dist/src/libs/campaigns/utils/getDolomiteMarkets.js +10 -7
  15. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +40 -1
  16. package/dist/src/modules/v4/campaign/campaign.controller.js +16 -1
  17. package/dist/src/modules/v4/campaign/campaign.model.d.ts +14 -1
  18. package/dist/src/modules/v4/campaign/campaign.model.js +11 -1
  19. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +64 -32
  20. package/dist/src/modules/v4/campaign/campaign.repository.js +84 -122
  21. package/dist/src/modules/v4/campaign/campaign.service.d.ts +61 -19
  22. package/dist/src/modules/v4/campaign/campaign.service.js +51 -63
  23. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -0
  24. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +5 -0
  25. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +3 -0
  26. package/dist/src/modules/v4/programPayload/programPayload.repository.js +6 -6
  27. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -0
  28. package/dist/src/modules/v4/router.d.ts +41 -1
  29. package/dist/src/modules/v4/status/status.service.js +1 -1
  30. package/dist/src/routes/v3/dolomite.d.ts +6 -1
  31. package/dist/src/routes/v3/dolomite.js +6 -3
  32. package/dist/src/routes/v3/router.d.ts +3 -1
  33. package/dist/src/utils/error.d.ts +6 -0
  34. package/dist/src/utils/error.js +12 -0
  35. package/dist/tsconfig.package.tsbuildinfo +1 -1
  36. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import type { CampaignUnique, CampaignWithParams, CreateCampaignModel, GetCampaignQueryModel, UpdateCampaignModel, UpdateMetaDataCampaignModel } from "./";
1
+ import type { CampaignUnique, CampaignWithParams, CreateCampaignModel, GetCampaignQueryModel, UpdateCampaignCreatorModel, UpdateCampaignModel, UpdateMetaDataCampaignModel } from "./";
2
+ import type { CampaignManualOverride } from "../../../../database/api/.generated";
2
3
  import { Campaign as CampaignEnum, type CampaignParameters, type ChainId } from "@sdk";
3
4
  import { CampaignRepository } from "./campaign.repository";
4
5
  export declare abstract class CampaignService {
@@ -37,6 +38,7 @@ export declare abstract class CampaignService {
37
38
  amount: string;
38
39
  opportunityId: string;
39
40
  creatorAddress: string;
41
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
40
42
  })[]>;
41
43
  static getFutureCampaigns(query?: {
42
44
  computeChainId?: number;
@@ -71,8 +73,10 @@ export declare abstract class CampaignService {
71
73
  amount: string;
72
74
  opportunityId: string;
73
75
  creatorAddress: string;
76
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
74
77
  })[]>;
75
78
  static getLiveCampaigns(query?: {
79
+ distributionChainId?: number;
76
80
  computeChainId?: number;
77
81
  type?: string;
78
82
  }): Promise<({
@@ -105,7 +109,13 @@ export declare abstract class CampaignService {
105
109
  amount: string;
106
110
  opportunityId: string;
107
111
  creatorAddress: string;
112
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
108
113
  })[]>;
114
+ static countLives(query?: {
115
+ distributionChainId?: number;
116
+ computeChainId?: number;
117
+ type?: string;
118
+ }): Promise<number>;
109
119
  static create(campaign: Omit<CreateCampaignModel, "id">): Promise<{
110
120
  type: string;
111
121
  id: string;
@@ -120,11 +130,8 @@ export declare abstract class CampaignService {
120
130
  amount: string;
121
131
  opportunityId: string;
122
132
  creatorAddress: string;
133
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
123
134
  } | undefined>;
124
- static createMany(campaigns: Omit<CreateCampaignModel, "id">[], upsert?: boolean): Promise<{
125
- success: number;
126
- fail: number;
127
- }>;
128
135
  /**
129
136
  * @dev back-office function
130
137
  * @dev deprecated should be replaced with a manual override
@@ -143,7 +150,12 @@ export declare abstract class CampaignService {
143
150
  amount: string;
144
151
  opportunityId: string;
145
152
  creatorAddress: string;
153
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
146
154
  }>;
155
+ /**
156
+ * @dev back-office function for manual overrides
157
+ */
158
+ static updateCreator(campaign: UpdateCampaignCreatorModel): Promise<void>;
147
159
  /**
148
160
  * @dev back-office function
149
161
  */
@@ -203,6 +215,7 @@ export declare abstract class CampaignService {
203
215
  rewardTokenId: string;
204
216
  amount: string;
205
217
  opportunityId: string;
218
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
206
219
  }[]>;
207
220
  /**
208
221
  * Counts the number of campaigns that complies to query
@@ -211,9 +224,45 @@ export declare abstract class CampaignService {
211
224
  * @returns the number of campaigns
212
225
  */
213
226
  static countMany(query: GetCampaignQueryModel): Promise<number>;
214
- static countLives(chainId: number): Promise<number>;
215
227
  static checkIfExist(campaign: CampaignUnique | string): Promise<boolean>;
216
- static findUnique(campaign: CampaignUnique | string): Promise<{
228
+ static findUnique(campaign: CampaignUnique | string): Promise<({
229
+ ComputeChain: {
230
+ name: string;
231
+ id: number;
232
+ icon: string;
233
+ };
234
+ DistributionChain: {
235
+ name: string;
236
+ id: number;
237
+ icon: string;
238
+ };
239
+ RewardToken: {
240
+ symbol: string;
241
+ name: string | null;
242
+ id: string;
243
+ icon: string;
244
+ chainId: number;
245
+ address: string;
246
+ decimals: number;
247
+ displaySymbol: string;
248
+ verified: boolean;
249
+ isTest: boolean;
250
+ price: number | null;
251
+ };
252
+ Creator: {
253
+ tags: string[];
254
+ address: string;
255
+ creatorId: string | null;
256
+ };
257
+ CampaignStatus: {
258
+ error: string;
259
+ details: import("database/api/.generated/runtime/library").JsonValue;
260
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
261
+ campaignId: string;
262
+ computedUntil: bigint;
263
+ processingStarted: bigint;
264
+ }[];
265
+ } & {
217
266
  type: string;
218
267
  id: string;
219
268
  params: import("database/api/.generated/runtime/library").JsonValue;
@@ -227,7 +276,8 @@ export declare abstract class CampaignService {
227
276
  amount: string;
228
277
  opportunityId: string;
229
278
  creatorAddress: string;
230
- } | null>;
279
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
280
+ }) | null>;
231
281
  static findUniqueOrThrow(campaign: CampaignUnique | string, withOpportunity?: boolean): Promise<{
232
282
  ComputeChain: {
233
283
  name: string;
@@ -294,7 +344,9 @@ export declare abstract class CampaignService {
294
344
  amount: string;
295
345
  opportunityId: string;
296
346
  creatorAddress: string;
347
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
297
348
  }>;
349
+ static removeManualOverride(campaign: CampaignUnique | string, field: CampaignManualOverride): Promise<void>;
298
350
  static findCampaignsToProcess(distributionChainId: ChainId): Promise<{
299
351
  endTimestamp: bigint;
300
352
  campaignId: string;
@@ -314,10 +366,6 @@ export declare abstract class CampaignService {
314
366
  success: number;
315
367
  fail: number;
316
368
  }>;
317
- static fetchMissingCampaigns(chainId: ChainId, campaignIds: CampaignUnique[]): Promise<{
318
- success: number;
319
- fail: number;
320
- }>;
321
369
  static findChains(): Promise<Record<string, ChainId>>;
322
370
  /**
323
371
  * Returns the campaign data
@@ -339,13 +387,6 @@ export declare abstract class CampaignService {
339
387
  live: C[];
340
388
  soon: C[];
341
389
  };
342
- /**
343
- * Returns the campaign data
344
- * @param chainId to fetch campaigns for
345
- * @param timestamp from which campaigns endTimestamp are filtered
346
- * @returns
347
- */
348
- static getFromEngineDb(chainId: number, timestamp: number): Promise<CampaignParameters<CampaignV3>[]>;
349
390
  /**
350
391
  * Convert raw
351
392
  * @param query
@@ -402,6 +443,7 @@ export declare abstract class CampaignService {
402
443
  rewardTokenId: string;
403
444
  amount: string;
404
445
  opportunityId: string;
446
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
405
447
  };
406
448
  static formatAsCampaignParameters<C extends CampaignEnum>(campaign: CampaignWithParams): CampaignParameters<C>;
407
449
  /**
@@ -4,7 +4,7 @@ import { OpportunityService } from "../opportunity";
4
4
  import { StatusService } from "../status/status.service";
5
5
  import { TokenRepository } from "../token/token.repository";
6
6
  import { TokenService } from "../token/token.service";
7
- import { InvalidParameter } from "../../../utils/error";
7
+ import { CannotParseOpportunity, InvalidParameter } from "../../../utils/error";
8
8
  import { executeSimple } from "../../../utils/execute";
9
9
  import { log } from "../../../utils/logger";
10
10
  import { Campaign as CampaignEnum, NETWORK_LABELS, } from "@sdk";
@@ -30,32 +30,19 @@ export class CampaignService {
30
30
  static async getLiveCampaigns(query) {
31
31
  return await CampaignRepository.getLiveCampaigns(query);
32
32
  }
33
+ static async countLives(query) {
34
+ return await CampaignRepository.countLives(query);
35
+ }
33
36
  static async create(campaign) {
34
37
  const id = CampaignService.hashId({ distributionChain: campaign.chainId, campaignId: campaign.campaignId });
35
- await OpportunityService.createFromCampaign(campaign);
38
+ try {
39
+ await OpportunityService.createFromCampaign(campaign);
40
+ }
41
+ catch {
42
+ throw new CannotParseOpportunity(campaign.campaignId, campaign.chainId, campaign.type);
43
+ }
36
44
  return await CampaignRepository.upsert({ id, ...campaign });
37
45
  }
38
- static async createMany(campaigns, upsert = false) {
39
- const failedToFetchMetadata = [];
40
- const campaignsToInsert = [];
41
- await Promise.all(campaigns.map(async (campaign) => {
42
- const id = CampaignService.hashId({ distributionChain: campaign.chainId, campaignId: campaign.campaignId });
43
- campaign.computeChainId = campaign.computeChainId === 0 ? campaign.chainId : campaign.computeChainId;
44
- try {
45
- if (upsert || !(await CampaignService.checkIfExist(id))) {
46
- await OpportunityService.createFromCampaign(campaign);
47
- campaignsToInsert.push({ id, ...campaign });
48
- }
49
- }
50
- catch (err) {
51
- log.error(`Cannot get Opportunity metadata for campaign ${campaign.campaignId} of type ${campaign.type}`, err);
52
- failedToFetchMetadata.push(campaign);
53
- }
54
- }));
55
- let { success, fail } = await CampaignRepository.upsertMany(campaignsToInsert);
56
- fail += failedToFetchMetadata.length;
57
- return { success, fail };
58
- }
59
46
  /**
60
47
  * @dev back-office function
61
48
  * @dev deprecated should be replaced with a manual override
@@ -73,6 +60,16 @@ export class CampaignService {
73
60
  const updatedParams = JSON.stringify(params);
74
61
  return await CampaignRepository.updateMetaData(id, updatedParams);
75
62
  }
63
+ /**
64
+ * @dev back-office function for manual overrides
65
+ */
66
+ static async updateCreator(campaign) {
67
+ const id = CampaignService.hashId({
68
+ distributionChain: campaign.distributionChain,
69
+ campaignId: campaign.campaignId,
70
+ });
71
+ return await CampaignRepository.updateCreator(id, campaign.creatorAddress);
72
+ }
76
73
  /**
77
74
  * @dev back-office function
78
75
  */
@@ -117,10 +114,6 @@ export class CampaignService {
117
114
  await OpportunityService.createFromCampaign(updatedCampaign, upsert);
118
115
  // Move campaign to new opportunity
119
116
  await CampaignRepository.updateOpportunity(id, { id, ...updatedCampaignData });
120
- // Update new opportunity with campaign
121
- // await OpportunityService.recreate(opportunityId);
122
- // Remov (update) campaign from old opportunity
123
- await OpportunityService.recreate(existingCampaign.opportunityId);
124
117
  // Return new opportunityId
125
118
  return (await CampaignService.findUniqueOrThrow(campaign)).opportunityId;
126
119
  }
@@ -148,12 +141,9 @@ export class CampaignService {
148
141
  }
149
142
  return await CampaignRepository.countMany(query);
150
143
  }
151
- static async countLives(chainId) {
152
- return await CampaignRepository.countLives(chainId);
153
- }
154
144
  static async checkIfExist(campaign) {
155
145
  const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
156
- return await CampaignRepository.checkIfExist(id);
146
+ return !!(await CampaignRepository.findUnique(id));
157
147
  }
158
148
  static async findUnique(campaign) {
159
149
  const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
@@ -163,6 +153,10 @@ export class CampaignService {
163
153
  const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
164
154
  return await CampaignRepository.findUniqueOrThrow(id, withOpportunity);
165
155
  }
156
+ static async removeManualOverride(campaign, field) {
157
+ const id = typeof campaign === "string" ? campaign : CampaignService.hashId(campaign);
158
+ return await CampaignRepository.removeManualOverride(id, field);
159
+ }
166
160
  static async findCampaignsToProcess(distributionChainId) {
167
161
  return (await CampaignRepository.findCampaignsToProcess(distributionChainId))
168
162
  .filter(campaign => campaign.endTimestamp > (campaign?.CampaignStatus?.[0]?.computedUntil ?? 0n))
@@ -193,29 +187,32 @@ export class CampaignService {
193
187
  log.warn(`Campaign ${campaign.campaignId} on ${NETWORK_LABELS[campaign.distributionChain]} not found in engine db`);
194
188
  }
195
189
  }
196
- return await CampaignService.createMany(campaignsFromEngine.map(campaign => {
197
- return {
198
- amount: campaign.amount,
199
- chainId: campaign.chainId,
200
- computeChainId: campaign.computeChainId,
201
- creator: campaign.creator,
202
- endTimestamp: campaign.endTimestamp.toString(),
203
- campaignId: campaign.campaignId,
204
- opportunityIdentifier: campaign.mainParameter,
205
- params: JSON.stringify(campaign.campaignParameters),
206
- rewardTokenAddress: campaign.rewardToken,
207
- startTimestamp: campaign.startTimestamp.toString(),
208
- type: campaign.campaignType,
209
- subType: campaign.campaignSubType,
210
- };
211
- }));
212
- }
213
- static async fetchMissingCampaigns(chainId, campaignIds) {
214
- const foundCampaignIds = (await CampaignRepository.findManyCampaignId(chainId)).reduce((acc, { campaignId }) => acc.add(CampaignService.hashId({ distributionChain: chainId, campaignId })), new Set());
215
- const missingCampaigns = campaignIds.filter(campaignId => !foundCampaignIds.has(CampaignService.hashId(campaignId)));
216
- if (!missingCampaigns.length)
217
- return { success: 0, fail: 0 };
218
- return await CampaignService.fill(missingCampaigns);
190
+ let success = 0;
191
+ let fail = 0;
192
+ for (const engineCampaign of campaignsFromEngine) {
193
+ try {
194
+ await CampaignService.create({
195
+ amount: engineCampaign.amount,
196
+ chainId: engineCampaign.chainId,
197
+ computeChainId: engineCampaign.computeChainId,
198
+ creator: engineCampaign.creator,
199
+ endTimestamp: engineCampaign.endTimestamp.toString(),
200
+ campaignId: engineCampaign.campaignId,
201
+ opportunityIdentifier: engineCampaign.mainParameter,
202
+ params: JSON.stringify(engineCampaign.campaignParameters),
203
+ rewardTokenAddress: engineCampaign.rewardToken,
204
+ startTimestamp: engineCampaign.startTimestamp.toString(),
205
+ type: engineCampaign.campaignType,
206
+ subType: engineCampaign.campaignSubType,
207
+ });
208
+ success++;
209
+ }
210
+ catch {
211
+ log.warn(`Failed to create campaign ${engineCampaign.campaignId} on ${NETWORK_LABELS[engineCampaign.chainId]}`);
212
+ fail++;
213
+ }
214
+ }
215
+ return { success, fail };
219
216
  }
220
217
  static async findChains() {
221
218
  return await CampaignRepository.findChains();
@@ -240,15 +237,6 @@ export class CampaignService {
240
237
  const soon = campaigns.filter(({ startTimestamp: start }) => start > timestamp);
241
238
  return { past, live, soon };
242
239
  }
243
- /**
244
- * Returns the campaign data
245
- * @param chainId to fetch campaigns for
246
- * @param timestamp from which campaigns endTimestamp are filtered
247
- * @returns
248
- */
249
- static async getFromEngineDb(chainId, timestamp) {
250
- return CampaignRepository.getFromEngineDb(chainId, timestamp);
251
- }
252
240
  /**
253
241
  * Convert raw
254
242
  * @param query
@@ -226,6 +226,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
226
226
  rewardTokenId: string;
227
227
  amount: string;
228
228
  opportunityId: string;
229
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
229
230
  }[] | undefined;
230
231
  id: string;
231
232
  depositUrl: string | undefined;
@@ -56,6 +56,7 @@ export declare abstract class OpportunityRepository {
56
56
  amount: string;
57
57
  opportunityId: string;
58
58
  creatorAddress: string;
59
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
59
60
  })[];
60
61
  Tokens: {
61
62
  symbol: string;
@@ -189,6 +190,7 @@ export declare abstract class OpportunityRepository {
189
190
  amount: string;
190
191
  opportunityId: string;
191
192
  creatorAddress: string;
193
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
192
194
  }[];
193
195
  Tokens: {
194
196
  symbol: string;
@@ -378,6 +380,7 @@ export declare abstract class OpportunityRepository {
378
380
  amount: string;
379
381
  opportunityId: string;
380
382
  creatorAddress: string;
383
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
381
384
  })[];
382
385
  Tokens: {
383
386
  symbol: string;
@@ -511,6 +514,7 @@ export declare abstract class OpportunityRepository {
511
514
  amount: string;
512
515
  opportunityId: string;
513
516
  creatorAddress: string;
517
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
514
518
  }[];
515
519
  Tokens: {
516
520
  symbol: string;
@@ -688,6 +692,7 @@ export declare abstract class OpportunityRepository {
688
692
  amount: string;
689
693
  opportunityId: string;
690
694
  creatorAddress: string;
695
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
691
696
  })[];
692
697
  Tokens: {
693
698
  symbol: string;
@@ -513,6 +513,7 @@ export declare abstract class OpportunityService {
513
513
  rewardTokenId: string;
514
514
  amount: string;
515
515
  opportunityId: string;
516
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
516
517
  }[] | undefined;
517
518
  id: string;
518
519
  depositUrl: string | undefined;
@@ -659,6 +660,7 @@ export declare abstract class OpportunityService {
659
660
  rewardTokenId: string;
660
661
  amount: string;
661
662
  opportunityId: string;
663
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
662
664
  }[] | undefined;
663
665
  id: string;
664
666
  depositUrl: string | undefined;
@@ -801,6 +803,7 @@ export declare abstract class OpportunityService {
801
803
  rewardTokenId: string;
802
804
  amount: string;
803
805
  opportunityId: string;
806
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
804
807
  }[] | undefined;
805
808
  id: string;
806
809
  depositUrl: string | undefined;
@@ -818,7 +818,7 @@ const SwapxInterfaceCampaigns = {
818
818
  hooks: [],
819
819
  poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
820
820
  whitelist: ["0x640429B0633851F487639BcDd8Ed523DDf1Bbff8"],
821
- blacklist: [],
821
+ blacklist: ["0x646ab1E6D0939672f810781449650A8058BB3C18", "0x45D341eE986532E09266c4ff182f610FaE249b5D"],
822
822
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
823
823
  forwarders: [],
824
824
  isOutOfRangeIncentivized: false,
@@ -832,7 +832,7 @@ const SwapxInterfaceCampaigns = {
832
832
  hooks: [],
833
833
  poolAddress: "0xDd35c88B1754879EF86BBF3A24F81fCCA5Eb6B5D",
834
834
  whitelist: ["0x4604782BcD6F749B271Fc9d14BFd583be6e5a6cf"],
835
- blacklist: [],
835
+ blacklist: ["0x09AcA88Fc65Ea9BC94C9DDB2C48FC4265e2ba41A", "0xBd58346C2c19CA392f473d1C048c09A6353A2B50"],
836
836
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
837
837
  forwarders: [],
838
838
  isOutOfRangeIncentivized: false,
@@ -860,7 +860,7 @@ const SwapxInterfaceCampaigns = {
860
860
  hooks: [],
861
861
  poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
862
862
  whitelist: ["0x2f9e2852de03c42c13d3dCdD2C57c0b3cF0382c1"],
863
- blacklist: [],
863
+ blacklist: ["0x90513c7e25330A208CCEfCd975C6F6E8237541d0", "0x8dd81BA99883491Db2070F8E3aD6AAA563D71457"],
864
864
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
865
865
  forwarders: [],
866
866
  isOutOfRangeIncentivized: false,
@@ -874,7 +874,7 @@ const SwapxInterfaceCampaigns = {
874
874
  hooks: [],
875
875
  poolAddress: "0xD760791B29e7894FB827A94Ca433254bb5aFB653",
876
876
  whitelist: ["0xC693c6fc1d2b44DfB5C5aa05Ca2b02A91DB97528"],
877
- blacklist: [],
877
+ blacklist: ["0x7D2EF0fa1b7b2d237079F3e680aaFa54aA63be91", "0xd1Cb5d8D24Df956eC6C74647730ED4b1507000da"],
878
878
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
879
879
  forwarders: [],
880
880
  isOutOfRangeIncentivized: false,
@@ -1028,7 +1028,7 @@ const SwapxInterfaceCampaigns = {
1028
1028
  hooks: [],
1029
1029
  poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
1030
1030
  whitelist: ["0x29985EE262a4C9D878AA6A9B9dC43f2FC87a81c6"],
1031
- blacklist: [],
1031
+ blacklist: ["0xA49883f4123c2a10bbdBf095950E7F64292E29bF", "0x0b900e9fd1A345c643E995c6Fea4a3Ce9FaDFcdf"],
1032
1032
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
1033
1033
  forwarders: [],
1034
1034
  isOutOfRangeIncentivized: false,
@@ -1042,7 +1042,7 @@ const SwapxInterfaceCampaigns = {
1042
1042
  hooks: [],
1043
1043
  poolAddress: "0x0d13400CC7c46D77a43957fE614ba58C827dfde6",
1044
1044
  whitelist: ["0x30Df881606c719916b99a0b5bc89e5eB338a226C"],
1045
- blacklist: [],
1045
+ blacklist: ["0xf9a6Bc526c39925485946FfD93923Ca0906ab8f2", "0xE5B85B2D6A765b64d23089039bB76198Cd65e0E1"],
1046
1046
  url: "https://swapx.fi/earn?ownerType=pools&filter=conc-liquidity",
1047
1047
  forwarders: [],
1048
1048
  isOutOfRangeIncentivized: false,
@@ -41,6 +41,7 @@ export declare abstract class ProtocolRepository {
41
41
  amount: string;
42
42
  opportunityId: string;
43
43
  creatorAddress: string;
44
+ manualOverrides: import("../../../../database/api/.generated").$Enums.CampaignManualOverride[];
44
45
  }[];
45
46
  } & {
46
47
  name: string;
@@ -241,6 +241,7 @@ export declare const v4: Elysia<"/v4", false, {
241
241
  rewardTokenId: string;
242
242
  amount: string;
243
243
  opportunityId: string;
244
+ manualOverrides: import("../../../database/api/.generated").$Enums.CampaignManualOverride[];
244
245
  }[] | undefined;
245
246
  id: string;
246
247
  depositUrl: string | undefined;
@@ -960,6 +961,7 @@ export declare const v4: Elysia<"/v4", false, {
960
961
  amount: string;
961
962
  opportunityId: string;
962
963
  creatorAddress: string;
964
+ manualOverrides: import("../../../database/api/.generated").$Enums.CampaignManualOverride[];
963
965
  } | undefined;
964
966
  };
965
967
  };
@@ -968,7 +970,6 @@ export declare const v4: Elysia<"/v4", false, {
968
970
  opportunity: {
969
971
  patch: {
970
972
  body: {
971
- tags?: string[] | undefined;
972
973
  opportunityIdentifier?: string | undefined;
973
974
  campaignId: string;
974
975
  distributionChain: number;
@@ -983,6 +984,42 @@ export declare const v4: Elysia<"/v4", false, {
983
984
  };
984
985
  };
985
986
  };
987
+ } & {
988
+ creator: {
989
+ patch: {
990
+ body: {
991
+ campaignId: string;
992
+ creatorAddress: string;
993
+ distributionChain: number;
994
+ };
995
+ params: {};
996
+ query: unknown;
997
+ headers: {
998
+ authorization: string;
999
+ };
1000
+ response: {
1001
+ 200: void;
1002
+ };
1003
+ };
1004
+ };
1005
+ } & {
1006
+ "remove-override": {
1007
+ patch: {
1008
+ body: {
1009
+ campaignId: string;
1010
+ field: "opportunityId" | "creatorAddress";
1011
+ distributionChain: number;
1012
+ };
1013
+ params: {};
1014
+ query: unknown;
1015
+ headers: {
1016
+ authorization: string;
1017
+ };
1018
+ response: {
1019
+ 200: void;
1020
+ };
1021
+ };
1022
+ };
986
1023
  } & {
987
1024
  metadata: {
988
1025
  patch: {
@@ -1011,6 +1048,7 @@ export declare const v4: Elysia<"/v4", false, {
1011
1048
  amount: string;
1012
1049
  opportunityId: string;
1013
1050
  creatorAddress: string;
1051
+ manualOverrides: import("../../../database/api/.generated").$Enums.CampaignManualOverride[];
1014
1052
  };
1015
1053
  };
1016
1054
  };
@@ -1108,6 +1146,7 @@ export declare const v4: Elysia<"/v4", false, {
1108
1146
  rewardTokenId: string;
1109
1147
  amount: string;
1110
1148
  opportunityId: string;
1149
+ manualOverrides: import("../../../database/api/.generated").$Enums.CampaignManualOverride[];
1111
1150
  }[];
1112
1151
  };
1113
1152
  };
@@ -1172,6 +1211,7 @@ export declare const v4: Elysia<"/v4", false, {
1172
1211
  rewardTokenId: string;
1173
1212
  amount: string;
1174
1213
  opportunityId: string;
1214
+ manualOverrides: import("../../../database/api/.generated").$Enums.CampaignManualOverride[];
1175
1215
  };
1176
1216
  };
1177
1217
  };
@@ -78,7 +78,7 @@ export class StatusService {
78
78
  static async findUpdatesAndDelays() {
79
79
  const merklRoots = await MerklRootService.fetchAll();
80
80
  const delayedCampaignPromises = Promise.allSettled(Object.keys(merklRoots).map(chainId => StatusService.findManyDelay({ chainId: Number.parseInt(chainId), delayLowerBound: 9 * HOUR })));
81
- const liveCampaignPromises = await Promise.allSettled(Object.keys(merklRoots).map(chainId => CampaignService.countLives(Number.parseInt(chainId))));
81
+ const liveCampaignPromises = await Promise.allSettled(Object.keys(merklRoots).map(chainId => CampaignService.countLives({ distributionChainId: Number.parseInt(chainId) })));
82
82
  const delayedCampaignArray = await delayedCampaignPromises;
83
83
  const liveCampaignArray = await liveCampaignPromises;
84
84
  const res = {};
@@ -1,4 +1,7 @@
1
1
  import type Elysia from "elysia";
2
+ export declare const query: import("@sinclair/typebox").TObject<{
3
+ chainId: import("@sinclair/typebox").TNumber;
4
+ }>;
2
5
  export declare const response: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
3
6
  index: import("@sinclair/typebox").TNumber;
4
7
  token: import("@sinclair/typebox").TString;
@@ -21,7 +24,9 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
21
24
  get: {
22
25
  body: unknown;
23
26
  params: {};
24
- query: {};
27
+ query: {
28
+ chainId: number;
29
+ };
25
30
  headers: unknown;
26
31
  response: {
27
32
  [x: string]: any;
@@ -1,9 +1,12 @@
1
1
  import { t } from "elysia";
2
2
  import { getDolomiteMarketWithCache } from "../../libs/campaigns/utils/getDolomiteMarkets";
3
+ export const query = t.Object({
4
+ chainId: t.Numeric(),
5
+ });
3
6
  export const response = t.Array(t.Object({ index: t.Number(), token: t.String(), symbol: t.String() }));
4
- export default (app) => app.get("/dolomite", async () => {
5
- return await getDolomiteMarketWithCache();
7
+ export default (app) => app.get("/dolomite", async ({ query }) => {
8
+ return await getDolomiteMarketWithCache(query.chainId);
6
9
  }, {
7
- query: t.Object({}),
10
+ query: query,
8
11
  tags: ["Protocols"],
9
12
  });
@@ -219,7 +219,9 @@ export declare const v3: Elysia<"/v3", false, {
219
219
  get: {
220
220
  body: unknown;
221
221
  params: {};
222
- query: {};
222
+ query: {
223
+ chainId: number;
224
+ };
223
225
  headers: unknown;
224
226
  response: {
225
227
  [x: string]: any;
@@ -15,6 +15,12 @@ export declare class OpportunityNotFound extends Error {
15
15
  chainId: ChainId;
16
16
  constructor(mainParameter: string, chainId: ChainId);
17
17
  }
18
+ export declare class CannotParseOpportunity extends Error {
19
+ campaignId: string;
20
+ chainId: ChainId;
21
+ type: number;
22
+ constructor(campaignId: string, chainId: ChainId, type: number);
23
+ }
18
24
  export declare class MerkleRootNotFound extends Error {
19
25
  chainId: ChainId;
20
26
  constructor(chainId: ChainId);
@@ -27,6 +27,18 @@ export class OpportunityNotFound extends Error {
27
27
  this.name = "OPPORTUNITY_NOT_FOUND";
28
28
  }
29
29
  }
30
+ export class CannotParseOpportunity extends Error {
31
+ campaignId;
32
+ chainId;
33
+ type;
34
+ constructor(campaignId, chainId, type) {
35
+ super(`Cannot parse opportunity from campaign ${campaignId} of type ${type} on chain ${NETWORK_LABELS[chainId]}`);
36
+ this.campaignId = campaignId;
37
+ this.chainId = chainId;
38
+ this.type = type;
39
+ this.name = "OPPORTUNITY_CANNOT_BE_PARSED";
40
+ }
41
+ }
30
42
  export class MerkleRootNotFound extends Error {
31
43
  chainId;
32
44
  constructor(chainId) {