@merkl/api 0.20.171 → 0.20.173

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 (37) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +57 -0
  2. package/dist/database/api/.generated/drizzle/schema.js +52 -4
  3. package/dist/database/api/.generated/drizzle/schema.ts +52 -4
  4. package/dist/database/api/.generated/edge.js +13 -7
  5. package/dist/database/api/.generated/index-browser.js +10 -4
  6. package/dist/database/api/.generated/index.d.ts +1624 -39
  7. package/dist/database/api/.generated/index.js +13 -7
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +23 -13
  10. package/dist/database/api/.generated/wasm.js +10 -4
  11. package/dist/src/eden/index.d.ts +430 -315
  12. package/dist/src/engine/deprecated/dynamicData/factory.js +0 -1
  13. package/dist/src/engine/metadata/factory.js +0 -1
  14. package/dist/src/index.d.ts +146 -105
  15. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +133 -105
  16. package/dist/src/modules/v4/campaign/campaign.controller.js +7 -3
  17. package/dist/src/modules/v4/campaign/campaign.model.d.ts +8 -0
  18. package/dist/src/modules/v4/campaign/campaign.model.js +10 -0
  19. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +48 -0
  20. package/dist/src/modules/v4/campaign/campaign.repository.js +3 -1
  21. package/dist/src/modules/v4/campaign/campaign.service.d.ts +24 -0
  22. package/dist/src/modules/v4/campaign/campaign.service.js +5 -1
  23. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +4 -0
  24. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +8 -0
  25. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -0
  26. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +10 -0
  27. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +10 -0
  28. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +2 -0
  29. package/dist/src/modules/v4/reward/reward.controller.js +5 -9
  30. package/dist/src/modules/v4/reward/reward.model.d.ts +3 -1
  31. package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -0
  32. package/dist/src/modules/v4/reward/reward.service.d.ts +9 -0
  33. package/dist/src/modules/v4/reward/reward.service.js +2 -1
  34. package/dist/src/modules/v4/router.d.ts +146 -105
  35. package/dist/src/modules/v4/user/user.controller.d.ts +3 -0
  36. package/dist/tsconfig.package.tsbuildinfo +1 -1
  37. package/package.json +1 -1
@@ -14,121 +14,127 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
14
14
  }, {
15
15
  campaigns: {
16
16
  engine: {
17
- post: {
18
- body: {
19
- tags?: string[] | undefined;
20
- identifier?: string | undefined;
21
- subType?: number | undefined;
22
- type: number;
23
- params: string;
24
- creator: string;
25
- computeChainId: number;
26
- campaignId: string;
27
- amount: string;
28
- startTimestamp: string;
29
- endTimestamp: string;
30
- chainId: number;
31
- rewardTokenAddress: string;
32
- opportunityIdentifier: string;
33
- };
34
- params: {};
35
- query: unknown;
36
- headers: {
37
- authorization: string;
38
- };
39
- response: {
40
- 200: {
41
- type: string;
42
- description: string | null;
43
- id: string;
44
- params: import("database/api/.generated/runtime/library").JsonValue;
45
- subType: number | null;
17
+ index: {
18
+ post: {
19
+ body: {
20
+ tags?: string[] | undefined;
21
+ identifier?: string | undefined;
22
+ subType?: number | undefined;
23
+ rootCampaignId?: string | undefined;
24
+ parentCampaignId?: string | undefined;
25
+ type: number;
26
+ params: string;
27
+ creator: string;
46
28
  computeChainId: number;
47
- distributionChainId: number;
48
29
  campaignId: string;
49
- distributionType: import("@db/api").$Enums.DistributionType;
50
- rewardTokenId: string;
51
30
  amount: string;
52
- opportunityId: string;
53
- startTimestamp: bigint;
54
- endTimestamp: bigint;
55
- creatorAddress: string;
56
- manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
57
- createdAt: Date;
58
- } | {
59
- Tokens: {
60
- symbol: string;
61
- name: string | null;
31
+ startTimestamp: string;
32
+ endTimestamp: string;
33
+ chainId: number;
34
+ rewardTokenAddress: string;
35
+ opportunityIdentifier: string;
36
+ };
37
+ params: {};
38
+ query: unknown;
39
+ headers: {
40
+ authorization: string;
41
+ };
42
+ response: {
43
+ 200: {
44
+ type: string;
45
+ description: string | null;
62
46
  id: string;
63
- icon: string;
64
- address: string;
65
- chainId: number;
66
- decimals: number;
67
- displaySymbol: string;
68
- verified: boolean;
69
- isTest: boolean;
70
- isPoint: boolean;
71
- isPreTGE: boolean;
72
- isNative: boolean;
73
- price: number | null;
74
- }[];
75
- Protocols: {
76
- url: string;
47
+ params: import("database/api/.generated/runtime/library").JsonValue;
48
+ subType: number | null;
49
+ computeChainId: number;
50
+ distributionChainId: number;
51
+ campaignId: string;
52
+ distributionType: import("@db/api").$Enums.DistributionType;
53
+ rewardTokenId: string;
54
+ amount: string;
55
+ opportunityId: string;
56
+ startTimestamp: bigint;
57
+ endTimestamp: bigint;
58
+ creatorAddress: string;
59
+ manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
60
+ createdAt: Date;
61
+ rootCampaignId: string | null;
62
+ parentCampaignId: string | null;
63
+ } | {
64
+ Tokens: {
65
+ symbol: string;
66
+ name: string | null;
67
+ id: string;
68
+ icon: string;
69
+ address: string;
70
+ chainId: number;
71
+ decimals: number;
72
+ displaySymbol: string;
73
+ verified: boolean;
74
+ isTest: boolean;
75
+ isPoint: boolean;
76
+ isPreTGE: boolean;
77
+ isNative: boolean;
78
+ price: number | null;
79
+ }[];
80
+ Protocols: {
81
+ url: string;
82
+ name: string;
83
+ description: string;
84
+ id: string;
85
+ tags: string[];
86
+ icon: string;
87
+ }[];
88
+ status: import("@db/api").$Enums.Status;
89
+ type: string;
77
90
  name: string;
78
91
  description: string;
79
92
  id: string;
80
93
  tags: string[];
81
- icon: string;
82
- }[];
83
- status: import("@db/api").$Enums.Status;
84
- type: string;
85
- name: string;
86
- description: string;
87
- id: string;
88
- tags: string[];
89
- identifier: string;
90
- action: import("@db/api").$Enums.OpportunityAction;
91
- manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
92
- chainId: number;
93
- howToSteps: string[];
94
- depositUrl: string | null;
95
- explorerAddress: string | null;
96
- mainProtocolId: string | null;
97
- tvl: number;
98
- apr: number;
99
- dailyRewards: number;
100
- lastCampaignCreatedAt: Date;
101
- } | {
102
- id: string;
103
- chainId: number;
104
- type: string;
105
- identifier: string;
106
- name: string;
107
- status: "PAST" | "LIVE" | "SOON";
108
- action: any;
109
- tokens: ({
110
- symbol: string;
111
- name: string | null;
94
+ identifier: string;
95
+ action: import("@db/api").$Enums.OpportunityAction;
96
+ manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
97
+ chainId: number;
98
+ howToSteps: string[];
99
+ depositUrl: string | null;
100
+ explorerAddress: string | null;
101
+ mainProtocolId: string | null;
102
+ tvl: number;
103
+ apr: number;
104
+ dailyRewards: number;
105
+ lastCampaignCreatedAt: Date;
106
+ } | {
112
107
  id: string;
113
- icon: string;
114
- address: string;
115
108
  chainId: number;
116
- decimals: number;
117
- verified: boolean;
118
- isTest: boolean;
119
- isPoint: boolean;
120
- isPreTGE: boolean;
121
- isNative: boolean;
122
- } & {
123
- price?: number | null | undefined;
124
- })[];
125
- mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "stability" | "termmax" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | "puffer" | undefined;
126
- description: string;
127
- howToSteps: string[];
128
- depositUrl: string | undefined;
129
- explorerAddress: string | undefined;
130
- tags: string[];
131
- } | undefined;
109
+ type: string;
110
+ identifier: string;
111
+ name: string;
112
+ status: "PAST" | "LIVE" | "SOON";
113
+ action: any;
114
+ tokens: ({
115
+ symbol: string;
116
+ name: string | null;
117
+ id: string;
118
+ icon: string;
119
+ address: string;
120
+ chainId: number;
121
+ decimals: number;
122
+ verified: boolean;
123
+ isTest: boolean;
124
+ isPoint: boolean;
125
+ isPreTGE: boolean;
126
+ isNative: boolean;
127
+ } & {
128
+ price?: number | null | undefined;
129
+ })[];
130
+ mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "aura" | "poolside" | "gearbox" | "filament" | "fluid" | "compound" | "ionic" | "layerbank" | "moonwell" | "fraxlend" | "fenix" | "ra" | "syncswap" | "beefy" | "aerodrome" | "velodrome" | "curve" | "toros" | "akron" | "enzyme" | "dragonswap" | "koi" | "rfx" | "woofi" | "pendle" | "zkSwapThreePool" | "maha" | "tempest" | "holdstation" | "venus" | "reactor_fusion" | "vicuna" | "curveNPool" | "satlayer" | "veda" | "cian" | "concrete" | "hourglass" | "katana" | "gamma" | "stability" | "termmax" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "balancer" | "cross_curve" | "neptune" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "ironclad" | "sturdy" | "frax" | "silo" | "dolomite" | "badger" | "ajna" | "ion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "hyperdrive" | "oku" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "angles" | "bunni" | "beratrax" | "yei" | "gammaswap" | "uranium" | "puffer" | undefined;
131
+ description: string;
132
+ howToSteps: string[];
133
+ depositUrl: string | undefined;
134
+ explorerAddress: string | undefined;
135
+ tags: string[];
136
+ } | undefined;
137
+ };
132
138
  };
133
139
  };
134
140
  };
@@ -218,6 +224,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
218
224
  creatorAddress: string;
219
225
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
220
226
  createdAt: Date;
227
+ rootCampaignId: string | null;
228
+ parentCampaignId: string | null;
221
229
  };
222
230
  };
223
231
  };
@@ -257,6 +265,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
257
265
  startTimestamp?: string | undefined;
258
266
  endTimestamp?: string | undefined;
259
267
  creatorAddress?: string | undefined;
268
+ rootCampaignId?: string | undefined;
269
+ parentCampaignId?: string | undefined;
260
270
  chainId?: number | undefined;
261
271
  creatorId?: string | undefined;
262
272
  mainParameter?: string | undefined;
@@ -317,6 +327,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
317
327
  };
318
328
  createdAt: string;
319
329
  description: string | undefined;
330
+ parentCampaignId: string | undefined;
331
+ rootCampaignId: string | undefined;
320
332
  Opportunity: {
321
333
  status: import("@db/api").$Enums.Status;
322
334
  type: string;
@@ -407,6 +419,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
407
419
  };
408
420
  createdAt: string;
409
421
  description: string | undefined;
422
+ parentCampaignId: string | undefined;
423
+ rootCampaignId: string | undefined;
410
424
  Opportunity: {
411
425
  status: import("@db/api").$Enums.Status;
412
426
  type: string;
@@ -563,6 +577,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
563
577
  startTimestamp?: string | undefined;
564
578
  endTimestamp?: string | undefined;
565
579
  creatorAddress?: string | undefined;
580
+ rootCampaignId?: string | undefined;
581
+ parentCampaignId?: string | undefined;
566
582
  chainId?: number | undefined;
567
583
  creatorId?: string | undefined;
568
584
  mainParameter?: string | undefined;
@@ -623,6 +639,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
623
639
  };
624
640
  createdAt: string;
625
641
  description: string | undefined;
642
+ parentCampaignId: string | undefined;
643
+ rootCampaignId: string | undefined;
626
644
  Opportunity: {
627
645
  status: import("@db/api").$Enums.Status;
628
646
  type: string;
@@ -676,6 +694,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
676
694
  startTimestamp?: string | undefined;
677
695
  endTimestamp?: string | undefined;
678
696
  creatorAddress?: string | undefined;
697
+ rootCampaignId?: string | undefined;
698
+ parentCampaignId?: string | undefined;
679
699
  chainId?: number | undefined;
680
700
  creatorId?: string | undefined;
681
701
  mainParameter?: string | undefined;
@@ -713,6 +733,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
713
733
  startTimestamp?: string | undefined;
714
734
  endTimestamp?: string | undefined;
715
735
  creatorAddress?: string | undefined;
736
+ rootCampaignId?: string | undefined;
737
+ parentCampaignId?: string | undefined;
716
738
  chainId?: number | undefined;
717
739
  creatorId?: string | undefined;
718
740
  mainParameter?: string | undefined;
@@ -755,6 +777,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
755
777
  startTimestamp?: string | undefined;
756
778
  endTimestamp?: string | undefined;
757
779
  creatorAddress?: string | undefined;
780
+ rootCampaignId?: string | undefined;
781
+ parentCampaignId?: string | undefined;
758
782
  chainId?: number | undefined;
759
783
  creatorId?: string | undefined;
760
784
  mainParameter?: string | undefined;
@@ -798,6 +822,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
798
822
  startTimestamp?: string | undefined;
799
823
  endTimestamp?: string | undefined;
800
824
  creatorAddress?: string | undefined;
825
+ rootCampaignId?: string | undefined;
826
+ parentCampaignId?: string | undefined;
801
827
  chainId?: number | undefined;
802
828
  creatorId?: string | undefined;
803
829
  mainParameter?: string | undefined;
@@ -846,6 +872,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
846
872
  startTimestamp?: string | undefined;
847
873
  endTimestamp?: string | undefined;
848
874
  creatorAddress?: string | undefined;
875
+ rootCampaignId?: string | undefined;
876
+ parentCampaignId?: string | undefined;
849
877
  chainId?: number | undefined;
850
878
  creatorId?: string | undefined;
851
879
  mainParameter?: string | undefined;
@@ -15,12 +15,16 @@ import { CampaignService } from "./campaign.service";
15
15
  // ─── Campaigns Controller ────────────────────────────────────────────────────
16
16
  export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { tags: ["Campaigns"] } })
17
17
  // ─── Create A Campaign ───────────────────────────────────────────────
18
- .post("/engine", async ({ body }) => await CampaignService.create(body), {
19
- beforeHandle: EngineGuard,
18
+ .group("/engine", {
20
19
  headers: AuthorizationHeadersDto,
21
- body: CreateCampaignDto,
20
+ beforeHandle: EngineGuard,
22
21
  detail: { hide: true },
22
+ }, app => {
23
+ return app.post("/", async ({ body }) => await CampaignService.create(body), {
24
+ body: CreateCampaignDto,
25
+ });
23
26
  })
27
+ // ─── Backoffice Routes ─────────────────────────────────────────────────────
24
28
  .patch("/opportunity", async ({ body }) => await CampaignService.moveToOpportunity(body), {
25
29
  beforeHandle: BackOfficeGuard,
26
30
  headers: AuthorizationHeadersDto,
@@ -22,6 +22,8 @@ export type Campaign = Resource<"Campaign", "opportunityId" | "rewardTokenId", {
22
22
  endTimestamp: number;
23
23
  startTimestamp: number;
24
24
  createdAt: string;
25
+ rootCampaignId?: string;
26
+ parentCampaignId?: string;
25
27
  }>;
26
28
  export type CampaignWithParams<C extends CampaignType = CampaignType> = Campaign["model"] & {
27
29
  params: CampaignParameters<C>["campaignParameters"];
@@ -84,6 +86,8 @@ export declare const CampaignResourceDto: import("@sinclair/typebox").TObject<{
84
86
  details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TAny>;
85
87
  }>>;
86
88
  createdAt: import("@sinclair/typebox").TString;
89
+ rootCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
90
+ parentCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
87
91
  }>;
88
92
  export declare const CampaignConfigMinimal: import("@sinclair/typebox").TObject<{
89
93
  computeChainId: import("@sinclair/typebox").TNumber;
@@ -103,6 +107,8 @@ export declare const CreateCampaignDto: import("@sinclair/typebox").TObject<{
103
107
  computeChainId: import("@sinclair/typebox").TNumber;
104
108
  chainId: import("@sinclair/typebox").TNumber;
105
109
  campaignId: import("@sinclair/typebox").TString;
110
+ rootCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
111
+ parentCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
106
112
  identifier: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
107
113
  creator: import("@sinclair/typebox").TString;
108
114
  type: import("@sinclair/typebox").TNumber;
@@ -164,6 +170,8 @@ export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
164
170
  endTimestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
165
171
  withOpportunity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
166
172
  createdAfter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TDate, import("@sinclair/typebox").TNull]>>;
173
+ rootCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
174
+ parentCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
167
175
  page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
168
176
  items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
169
177
  }>;
@@ -34,6 +34,8 @@ export const CampaignResourceDto = t.Object({
34
34
  distributionChain: t.Optional(ChainResourceDto),
35
35
  campaignStatus: t.Optional(CampaignStatusResourceDto),
36
36
  createdAt: t.String({ format: "date" }),
37
+ rootCampaignId: t.Optional(t.String()),
38
+ parentCampaignId: t.Optional(t.String()),
37
39
  });
38
40
  export const CampaignConfigMinimal = t.Object({
39
41
  computeChainId: t.Number(),
@@ -53,6 +55,8 @@ export const CreateCampaignDto = t.Object({
53
55
  computeChainId: t.Number(),
54
56
  chainId: t.Number(),
55
57
  campaignId: t.String(),
58
+ rootCampaignId: t.Optional(t.String()),
59
+ parentCampaignId: t.Optional(t.String()),
56
60
  identifier: t.Optional(t.String()),
57
61
  creator: t.String(),
58
62
  type: t.Numeric(),
@@ -124,6 +128,12 @@ export const GetCampaignQueryDto = t.Object({
124
128
  description: "Include opportunity data. Will slow down the request. Default: false",
125
129
  })),
126
130
  createdAfter: t.Optional(t.Union([t.Date({ description: "Return campaigns created after the given date. Format: YYYY-MM-DD" }), t.Null()])),
131
+ rootCampaignId: t.Optional(t.String({
132
+ description: "Filter campaigns by rootCampaignId. This only return subcampaigns.",
133
+ })),
134
+ parentCampaignId: t.Optional(t.String({
135
+ description: "Filter campaigns by parentCampaignId. This only return subcampaigns.",
136
+ })),
127
137
  page: t.Optional(t.Numeric({ description: "0-indexed page number", default: 0 })),
128
138
  items: t.Optional(t.Numeric({ description: "Number of items returned by page", default: 20 })), // items per page
129
139
  });
@@ -7,6 +7,14 @@ export declare abstract class CampaignRepository {
7
7
  createdAt: {
8
8
  gte: Date;
9
9
  } | undefined;
10
+ rootCampaignId: {
11
+ equals: string;
12
+ mode: "insensitive";
13
+ } | undefined;
14
+ parentCampaignId: {
15
+ equals: string;
16
+ mode: "insensitive";
17
+ } | undefined;
10
18
  endTimestamp: {
11
19
  gte: number;
12
20
  lt?: undefined;
@@ -80,6 +88,14 @@ export declare abstract class CampaignRepository {
80
88
  createdAt: {
81
89
  gte: Date;
82
90
  } | undefined;
91
+ rootCampaignId: {
92
+ equals: string;
93
+ mode: "insensitive";
94
+ } | undefined;
95
+ parentCampaignId: {
96
+ equals: string;
97
+ mode: "insensitive";
98
+ } | undefined;
83
99
  endTimestamp: {
84
100
  lt: number;
85
101
  gte?: undefined;
@@ -149,6 +165,14 @@ export declare abstract class CampaignRepository {
149
165
  createdAt: {
150
166
  gte: Date;
151
167
  } | undefined;
168
+ rootCampaignId: {
169
+ equals: string;
170
+ mode: "insensitive";
171
+ } | undefined;
172
+ parentCampaignId: {
173
+ equals: string;
174
+ mode: "insensitive";
175
+ } | undefined;
152
176
  startTimestamp: {
153
177
  gt: number;
154
178
  lte?: undefined;
@@ -219,6 +243,14 @@ export declare abstract class CampaignRepository {
219
243
  createdAt: {
220
244
  gte: Date;
221
245
  } | undefined;
246
+ rootCampaignId: {
247
+ equals: string;
248
+ mode: "insensitive";
249
+ } | undefined;
250
+ parentCampaignId: {
251
+ equals: string;
252
+ mode: "insensitive";
253
+ } | undefined;
222
254
  endTimestamp: {
223
255
  gte: number;
224
256
  lt?: undefined;
@@ -340,6 +372,8 @@ export declare abstract class CampaignRepository {
340
372
  creatorAddress: string;
341
373
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
342
374
  createdAt: Date;
375
+ rootCampaignId: string | null;
376
+ parentCampaignId: string | null;
343
377
  })[]>;
344
378
  /**
345
379
  * Retrieves all past campaigns from the database.
@@ -391,6 +425,8 @@ export declare abstract class CampaignRepository {
391
425
  creatorAddress: string;
392
426
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
393
427
  createdAt: Date;
428
+ rootCampaignId: string | null;
429
+ parentCampaignId: string | null;
394
430
  })[]>;
395
431
  /**
396
432
  * Retrieves all live campaigns from the database.
@@ -459,6 +495,8 @@ export declare abstract class CampaignRepository {
459
495
  creatorAddress: string;
460
496
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
461
497
  createdAt: Date;
498
+ rootCampaignId: string | null;
499
+ parentCampaignId: string | null;
462
500
  })[]>;
463
501
  static countLives(query?: {
464
502
  distributionChainId?: number;
@@ -502,6 +540,8 @@ export declare abstract class CampaignRepository {
502
540
  creatorAddress: string;
503
541
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
504
542
  createdAt: Date;
543
+ rootCampaignId: string | null;
544
+ parentCampaignId: string | null;
505
545
  } | undefined>;
506
546
  /**
507
547
  * Retrieves a campaign from the engine database by its chain and campaign id.
@@ -582,6 +622,8 @@ export declare abstract class CampaignRepository {
582
622
  creatorAddress: string;
583
623
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
584
624
  createdAt: Date;
625
+ rootCampaignId: string | null;
626
+ parentCampaignId: string | null;
585
627
  }) | null>;
586
628
  static findUniqueOrThrow(id: string, withOpportunity: boolean): Promise<{
587
629
  ComputeChain: {
@@ -661,6 +703,8 @@ export declare abstract class CampaignRepository {
661
703
  creatorAddress: string;
662
704
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
663
705
  createdAt: Date;
706
+ rootCampaignId: string | null;
707
+ parentCampaignId: string | null;
664
708
  }>;
665
709
  static findCampaignsToProcess(distributionChainId: ChainId): Promise<{
666
710
  campaignId: string;
@@ -749,6 +793,8 @@ export declare abstract class CampaignRepository {
749
793
  creatorAddress: string;
750
794
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
751
795
  createdAt: Date;
796
+ rootCampaignId: string | null;
797
+ parentCampaignId: string | null;
752
798
  })[]>;
753
799
  static countMany(query: GetCampaignQueryModel): Promise<number>;
754
800
  static findChains(): Promise<Record<string, ChainId>>;
@@ -774,6 +820,8 @@ export declare abstract class CampaignRepository {
774
820
  creatorAddress: string;
775
821
  manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
776
822
  createdAt: Date;
823
+ rootCampaignId: string | null;
824
+ parentCampaignId: string | null;
777
825
  }>;
778
826
  static getTvlRecords(campaign: {
779
827
  opportunityId: string;
@@ -7,7 +7,7 @@ import { MAX_COMPUTE_JOB_TIME } from "@sdk";
7
7
  import moment from "moment";
8
8
  export class CampaignRepository {
9
9
  static transformQueryToPrismaFilters(query) {
10
- const { creatorTag, creatorId, creatorAddress, chainId, distributionChainIds, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, status, subType, type, types, tokenAddress, tokenSymbol, test, createdAfter, point, } = query;
10
+ const { creatorTag, creatorId, creatorAddress, chainId, distributionChainIds, endTimestamp, opportunityId, mainParameter, campaignId, startTimestamp, status, subType, type, types, tokenAddress, tokenSymbol, test, createdAfter, point, rootCampaignId, parentCampaignId, } = query;
11
11
  const getTagFilter = () => {
12
12
  if (creatorTag && creatorId)
13
13
  return {
@@ -67,6 +67,8 @@ export class CampaignRepository {
67
67
  Creator: getTagFilter(),
68
68
  ...timeFilter,
69
69
  createdAt: createdAfter ? { gte: createdAfter } : undefined,
70
+ rootCampaignId: rootCampaignId ? { equals: rootCampaignId, mode: "insensitive" } : undefined,
71
+ parentCampaignId: parentCampaignId ? { equals: parentCampaignId, mode: "insensitive" } : undefined,
70
72
  },
71
73
  };
72
74
  }