@merkl/api 0.20.154 → 0.20.156

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 (35) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +84 -7
  2. package/dist/database/api/.generated/drizzle/schema.js +4 -1
  3. package/dist/database/api/.generated/drizzle/schema.ts +4 -1
  4. package/dist/database/api/.generated/edge.js +12 -4
  5. package/dist/database/api/.generated/index-browser.js +9 -1
  6. package/dist/database/api/.generated/index.d.ts +303 -79
  7. package/dist/database/api/.generated/index.js +12 -4
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +5 -0
  10. package/dist/database/api/.generated/wasm.js +9 -1
  11. package/dist/src/eden/index.d.ts +171 -3
  12. package/dist/src/index.d.ts +59 -1
  13. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +15 -0
  14. package/dist/src/modules/v4/campaign/campaign.model.d.ts +2 -0
  15. package/dist/src/modules/v4/campaign/campaign.model.js +1 -0
  16. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +18 -0
  17. package/dist/src/modules/v4/campaign/campaign.service.d.ts +34 -0
  18. package/dist/src/modules/v4/campaign/campaign.service.js +2 -1
  19. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +10 -0
  20. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +30 -1
  21. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +11 -0
  22. package/dist/src/modules/v4/opportunity/opportunity.model.js +6 -0
  23. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +23 -0
  24. package/dist/src/modules/v4/opportunity/opportunity.repository.js +4 -0
  25. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +46 -1
  26. package/dist/src/modules/v4/opportunity/opportunity.service.js +44 -0
  27. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +3 -0
  28. package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -0
  29. package/dist/src/modules/v4/reward/reward.service.d.ts +17 -0
  30. package/dist/src/modules/v4/router.d.ts +59 -1
  31. package/dist/src/modules/v4/user/user.controller.d.ts +4 -0
  32. package/dist/src/scripts/fill-descriptions.d.ts +1 -0
  33. package/dist/src/scripts/fill-descriptions.js +101 -0
  34. package/dist/tsconfig.package.tsbuildinfo +1 -1
  35. package/package.json +1 -1
@@ -39,11 +39,13 @@ export declare abstract class OpportunityRepository {
39
39
  name: string;
40
40
  type: string;
41
41
  status: import("@db/api").$Enums.Status;
42
+ description: string;
42
43
  tags: string[];
43
44
  identifier: string;
44
45
  action: import("@db/api").$Enums.OpportunityAction;
45
46
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
46
47
  chainId: number;
48
+ howToSteps: string[];
47
49
  depositUrl: string | null;
48
50
  explorerAddress: string | null;
49
51
  mainProtocolId: string | null;
@@ -78,6 +80,7 @@ export declare abstract class OpportunityRepository {
78
80
  } & {
79
81
  id: string;
80
82
  type: string;
83
+ description: string | null;
81
84
  params: Prisma.JsonValue;
82
85
  subType: number | null;
83
86
  computeChainId: number;
@@ -203,11 +206,13 @@ export declare abstract class OpportunityRepository {
203
206
  name: string;
204
207
  type: string;
205
208
  status: import("@db/api").$Enums.Status;
209
+ description: string;
206
210
  tags: string[];
207
211
  identifier: string;
208
212
  action: import("@db/api").$Enums.OpportunityAction;
209
213
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
210
214
  chainId: number;
215
+ howToSteps: string[];
211
216
  depositUrl: string | null;
212
217
  explorerAddress: string | null;
213
218
  mainProtocolId: string | null;
@@ -225,6 +230,7 @@ export declare abstract class OpportunityRepository {
225
230
  Campaigns: {
226
231
  id: string;
227
232
  type: string;
233
+ description: string | null;
228
234
  params: Prisma.JsonValue;
229
235
  subType: number | null;
230
236
  computeChainId: number;
@@ -350,11 +356,13 @@ export declare abstract class OpportunityRepository {
350
356
  name: string;
351
357
  type: string;
352
358
  status: import("@db/api").$Enums.Status;
359
+ description: string;
353
360
  tags: string[];
354
361
  identifier: string;
355
362
  action: import("@db/api").$Enums.OpportunityAction;
356
363
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
357
364
  chainId: number;
365
+ howToSteps: string[];
358
366
  depositUrl: string | null;
359
367
  explorerAddress: string | null;
360
368
  mainProtocolId: string | null;
@@ -431,6 +439,7 @@ export declare abstract class OpportunityRepository {
431
439
  } & {
432
440
  id: string;
433
441
  type: string;
442
+ description: string | null;
434
443
  params: Prisma.JsonValue;
435
444
  subType: number | null;
436
445
  computeChainId: number;
@@ -556,11 +565,13 @@ export declare abstract class OpportunityRepository {
556
565
  name: string;
557
566
  type: string;
558
567
  status: import("@db/api").$Enums.Status;
568
+ description: string;
559
569
  tags: string[];
560
570
  identifier: string;
561
571
  action: import("@db/api").$Enums.OpportunityAction;
562
572
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
563
573
  chainId: number;
574
+ howToSteps: string[];
564
575
  depositUrl: string | null;
565
576
  explorerAddress: string | null;
566
577
  mainProtocolId: string | null;
@@ -585,6 +596,7 @@ export declare abstract class OpportunityRepository {
585
596
  Campaigns: {
586
597
  id: string;
587
598
  type: string;
599
+ description: string | null;
588
600
  params: Prisma.JsonValue;
589
601
  subType: number | null;
590
602
  computeChainId: number;
@@ -710,11 +722,13 @@ export declare abstract class OpportunityRepository {
710
722
  name: string;
711
723
  type: string;
712
724
  status: import("@db/api").$Enums.Status;
725
+ description: string;
713
726
  tags: string[];
714
727
  identifier: string;
715
728
  action: import("@db/api").$Enums.OpportunityAction;
716
729
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
717
730
  chainId: number;
731
+ howToSteps: string[];
718
732
  depositUrl: string | null;
719
733
  explorerAddress: string | null;
720
734
  mainProtocolId: string | null;
@@ -793,6 +807,7 @@ export declare abstract class OpportunityRepository {
793
807
  } & {
794
808
  id: string;
795
809
  type: string;
810
+ description: string | null;
796
811
  params: Prisma.JsonValue;
797
812
  subType: number | null;
798
813
  computeChainId: number;
@@ -918,11 +933,13 @@ export declare abstract class OpportunityRepository {
918
933
  name: string;
919
934
  type: string;
920
935
  status: import("@db/api").$Enums.Status;
936
+ description: string;
921
937
  tags: string[];
922
938
  identifier: string;
923
939
  action: import("@db/api").$Enums.OpportunityAction;
924
940
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
925
941
  chainId: number;
942
+ howToSteps: string[];
926
943
  depositUrl: string | null;
927
944
  explorerAddress: string | null;
928
945
  mainProtocolId: string | null;
@@ -978,11 +995,13 @@ export declare abstract class OpportunityRepository {
978
995
  name: string;
979
996
  type: string;
980
997
  status: import("@db/api").$Enums.Status;
998
+ description: string;
981
999
  tags: string[];
982
1000
  identifier: string;
983
1001
  action: import("@db/api").$Enums.OpportunityAction;
984
1002
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
985
1003
  chainId: number;
1004
+ howToSteps: string[];
986
1005
  depositUrl: string | null;
987
1006
  explorerAddress: string | null;
988
1007
  mainProtocolId: string | null;
@@ -997,11 +1016,13 @@ export declare abstract class OpportunityRepository {
997
1016
  name: string;
998
1017
  type: string;
999
1018
  status: import("@db/api").$Enums.Status;
1019
+ description: string;
1000
1020
  tags: string[];
1001
1021
  identifier: string;
1002
1022
  action: import("@db/api").$Enums.OpportunityAction;
1003
1023
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1004
1024
  chainId: number;
1025
+ howToSteps: string[];
1005
1026
  depositUrl: string | null;
1006
1027
  explorerAddress: string | null;
1007
1028
  mainProtocolId: string | null;
@@ -1015,11 +1036,13 @@ export declare abstract class OpportunityRepository {
1015
1036
  name: string;
1016
1037
  type: string;
1017
1038
  status: import("@db/api").$Enums.Status;
1039
+ description: string;
1018
1040
  tags: string[];
1019
1041
  identifier: string;
1020
1042
  action: import("@db/api").$Enums.OpportunityAction;
1021
1043
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1022
1044
  chainId: number;
1045
+ howToSteps: string[];
1023
1046
  depositUrl: string | null;
1024
1047
  explorerAddress: string | null;
1025
1048
  mainProtocolId: string | null;
@@ -204,6 +204,8 @@ export class OpportunityRepository {
204
204
  status: newOpp.status,
205
205
  type: newOpp.type,
206
206
  tags: newOpp.tags,
207
+ description: newOpp.description,
208
+ howToSteps: newOpp.howToSteps,
207
209
  depositUrl: !previousOpportunity?.manualOverrides.includes("depositUrl")
208
210
  ? newOpp.depositUrl
209
211
  : previousOpportunity.depositUrl,
@@ -231,6 +233,8 @@ export class OpportunityRepository {
231
233
  status: newOpp.status,
232
234
  type: newOpp.type,
233
235
  tags: newOpp.tags,
236
+ description: newOpp.description,
237
+ howToSteps: newOpp.howToSteps,
234
238
  depositUrl: !previousOpportunity?.manualOverrides.includes("depositUrl") ? newOpp.depositUrl : undefined,
235
239
  explorerAddress: !previousOpportunity?.manualOverrides.includes("explorerAddress")
236
240
  ? newOpp.explorerAddress
@@ -1,6 +1,8 @@
1
1
  import type { CampaignWithParams, GetCampaignQueryModel } from "@/modules/v4/campaign/campaign.model";
2
- import { type OpportunityManualOverride, type Prisma } from "@db/api";
2
+ import { type OpportunityAction, type OpportunityManualOverride, type Prisma } from "@db/api";
3
3
  import { type MerklChainId } from "@sdk";
4
+ import type { Protocol } from "../protocol/protocol.model";
5
+ import type { Token } from "../token/token.model";
4
6
  import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, Opportunity, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique } from "./opportunity.model";
5
7
  import { OpportunityRepository } from "./opportunity.repository";
6
8
  export declare abstract class OpportunityService {
@@ -11,11 +13,13 @@ export declare abstract class OpportunityService {
11
13
  name: string;
12
14
  type: string;
13
15
  status: import("@db/api").$Enums.Status;
16
+ description: string;
14
17
  tags: string[];
15
18
  identifier: string;
16
19
  action: import("@db/api").$Enums.OpportunityAction;
17
20
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
18
21
  chainId: number;
22
+ howToSteps: string[];
19
23
  depositUrl: string | null;
20
24
  explorerAddress: string | null;
21
25
  mainProtocolId: string | null;
@@ -54,11 +58,13 @@ export declare abstract class OpportunityService {
54
58
  name: string;
55
59
  type: string;
56
60
  status: import("@db/api").$Enums.Status;
61
+ description: string;
57
62
  tags: string[];
58
63
  identifier: string;
59
64
  action: import("@db/api").$Enums.OpportunityAction;
60
65
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
61
66
  chainId: number;
67
+ howToSteps: string[];
62
68
  depositUrl: string | null;
63
69
  explorerAddress: string | null;
64
70
  mainProtocolId: string | null;
@@ -91,6 +97,8 @@ export declare abstract class OpportunityService {
91
97
  price?: number | null | undefined;
92
98
  })[];
93
99
  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" | "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" | undefined;
100
+ description: string;
101
+ howToSteps: string[];
94
102
  depositUrl: string | undefined;
95
103
  explorerAddress: string | undefined;
96
104
  tags: string[];
@@ -130,11 +138,13 @@ export declare abstract class OpportunityService {
130
138
  name: string;
131
139
  type: string;
132
140
  status: import("@db/api").$Enums.Status;
141
+ description: string;
133
142
  tags: string[];
134
143
  identifier: string;
135
144
  action: import("@db/api").$Enums.OpportunityAction;
136
145
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
137
146
  chainId: number;
147
+ howToSteps: string[];
138
148
  depositUrl: string | null;
139
149
  explorerAddress: string | null;
140
150
  mainProtocolId: string | null;
@@ -178,11 +188,13 @@ export declare abstract class OpportunityService {
178
188
  name: string;
179
189
  type: string;
180
190
  status: import("@db/api").$Enums.Status;
191
+ description: string;
181
192
  tags: string[];
182
193
  identifier: string;
183
194
  action: import("@db/api").$Enums.OpportunityAction;
184
195
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
185
196
  chainId: number;
197
+ howToSteps: string[];
186
198
  depositUrl: string | null;
187
199
  explorerAddress: string | null;
188
200
  mainProtocolId: string | null;
@@ -215,6 +227,8 @@ export declare abstract class OpportunityService {
215
227
  price?: number | null | undefined;
216
228
  })[];
217
229
  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" | "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" | undefined;
230
+ description: string;
231
+ howToSteps: string[];
218
232
  depositUrl: string | undefined;
219
233
  explorerAddress: string | undefined;
220
234
  tags: string[];
@@ -252,11 +266,13 @@ export declare abstract class OpportunityService {
252
266
  name: string;
253
267
  type: string;
254
268
  status: import("@db/api").$Enums.Status;
269
+ description: string;
255
270
  tags: string[];
256
271
  identifier: string;
257
272
  action: import("@db/api").$Enums.OpportunityAction;
258
273
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
259
274
  chainId: number;
275
+ howToSteps: string[];
260
276
  depositUrl: string | null;
261
277
  explorerAddress: string | null;
262
278
  mainProtocolId: string | null;
@@ -289,6 +305,8 @@ export declare abstract class OpportunityService {
289
305
  price?: number | null | undefined;
290
306
  })[];
291
307
  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" | "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" | undefined;
308
+ description: string;
309
+ howToSteps: string[];
292
310
  depositUrl: string | undefined;
293
311
  explorerAddress: string | undefined;
294
312
  tags: string[];
@@ -377,6 +395,7 @@ export declare abstract class OpportunityService {
377
395
  isPoint: boolean;
378
396
  isPreTGE: boolean;
379
397
  }[];
398
+ description: string;
380
399
  tags: string[];
381
400
  identifier: string;
382
401
  chain: {
@@ -386,11 +405,13 @@ export declare abstract class OpportunityService {
386
405
  };
387
406
  action: string;
388
407
  chainId: number;
408
+ howToSteps: string[];
389
409
  tvl: number;
390
410
  apr: number;
391
411
  dailyRewards: number;
392
412
  lastCampaignCreatedAt: string;
393
413
  campaigns: {
414
+ description?: string | undefined;
394
415
  creator?: {
395
416
  tags?: string[] | undefined;
396
417
  creatorId?: string | null | undefined;
@@ -522,6 +543,7 @@ export declare abstract class OpportunityService {
522
543
  isPoint: boolean;
523
544
  isPreTGE: boolean;
524
545
  }[];
546
+ description: string;
525
547
  tags: string[];
526
548
  identifier: string;
527
549
  chain: {
@@ -531,11 +553,13 @@ export declare abstract class OpportunityService {
531
553
  };
532
554
  action: string;
533
555
  chainId: number;
556
+ howToSteps: string[];
534
557
  tvl: number;
535
558
  apr: number;
536
559
  dailyRewards: number;
537
560
  lastCampaignCreatedAt: string;
538
561
  campaigns: {
562
+ description?: string | undefined;
539
563
  creator?: {
540
564
  tags?: string[] | undefined;
541
565
  creatorId?: string | null | undefined;
@@ -701,16 +725,19 @@ export declare abstract class OpportunityService {
701
725
  creatorId: string | null;
702
726
  };
703
727
  createdAt: string;
728
+ description: string | undefined;
704
729
  Opportunity: {
705
730
  id: string;
706
731
  name: string;
707
732
  type: string;
708
733
  status: import("@db/api").$Enums.Status;
734
+ description: string;
709
735
  tags: string[];
710
736
  identifier: string;
711
737
  action: import("@db/api").$Enums.OpportunityAction;
712
738
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
713
739
  chainId: number;
740
+ howToSteps: string[];
714
741
  depositUrl: string | null;
715
742
  explorerAddress: string | null;
716
743
  mainProtocolId: string | null;
@@ -766,10 +793,12 @@ export declare abstract class OpportunityService {
766
793
  name: string;
767
794
  type: string;
768
795
  status: import("@db/api").$Enums.Status;
796
+ description: string;
769
797
  tags: string[];
770
798
  identifier: string;
771
799
  action: import("@db/api").$Enums.OpportunityAction;
772
800
  chainId: number;
801
+ howToSteps: string[];
773
802
  tvl: number;
774
803
  dailyRewards: number;
775
804
  }[]>;
@@ -886,16 +915,19 @@ export declare abstract class OpportunityService {
886
915
  creatorId: string | null;
887
916
  };
888
917
  createdAt: string;
918
+ description: string | undefined;
889
919
  Opportunity: {
890
920
  id: string;
891
921
  name: string;
892
922
  type: string;
893
923
  status: import("@db/api").$Enums.Status;
924
+ description: string;
894
925
  tags: string[];
895
926
  identifier: string;
896
927
  action: import("@db/api").$Enums.OpportunityAction;
897
928
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
898
929
  chainId: number;
930
+ howToSteps: string[];
899
931
  depositUrl: string | null;
900
932
  explorerAddress: string | null;
901
933
  mainProtocolId: string | null;
@@ -951,10 +983,12 @@ export declare abstract class OpportunityService {
951
983
  name: string;
952
984
  type: string;
953
985
  status: import("@db/api").$Enums.Status;
986
+ description: string;
954
987
  tags: string[];
955
988
  identifier: string;
956
989
  action: import("@db/api").$Enums.OpportunityAction;
957
990
  chainId: number;
991
+ howToSteps: string[];
958
992
  tvl: number;
959
993
  dailyRewards: number;
960
994
  }[]>;
@@ -1064,16 +1098,19 @@ export declare abstract class OpportunityService {
1064
1098
  creatorId: string | null;
1065
1099
  };
1066
1100
  createdAt: string;
1101
+ description: string | undefined;
1067
1102
  Opportunity: {
1068
1103
  id: string;
1069
1104
  name: string;
1070
1105
  type: string;
1071
1106
  status: import("@db/api").$Enums.Status;
1107
+ description: string;
1072
1108
  tags: string[];
1073
1109
  identifier: string;
1074
1110
  action: import("@db/api").$Enums.OpportunityAction;
1075
1111
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1076
1112
  chainId: number;
1113
+ howToSteps: string[];
1077
1114
  depositUrl: string | null;
1078
1115
  explorerAddress: string | null;
1079
1116
  mainProtocolId: string | null;
@@ -1129,10 +1166,12 @@ export declare abstract class OpportunityService {
1129
1166
  name: string;
1130
1167
  type: string;
1131
1168
  status: import("@db/api").$Enums.Status;
1169
+ description: string;
1132
1170
  tags: string[];
1133
1171
  identifier: string;
1134
1172
  action: import("@db/api").$Enums.OpportunityAction;
1135
1173
  chainId: number;
1174
+ howToSteps: string[];
1136
1175
  tvl: number;
1137
1176
  dailyRewards: number;
1138
1177
  };
@@ -1173,10 +1212,12 @@ export declare abstract class OpportunityService {
1173
1212
  name: string;
1174
1213
  type: string;
1175
1214
  status: import("@db/api").$Enums.Status;
1215
+ description: string;
1176
1216
  tags: string[];
1177
1217
  identifier: string;
1178
1218
  action: import("@db/api").$Enums.OpportunityAction;
1179
1219
  chainId: number;
1220
+ howToSteps: string[];
1180
1221
  tvl: number;
1181
1222
  apr: number;
1182
1223
  dailyRewards: number;
@@ -1195,11 +1236,13 @@ export declare abstract class OpportunityService {
1195
1236
  name: string;
1196
1237
  type: string;
1197
1238
  status: import("@db/api").$Enums.Status;
1239
+ description: string;
1198
1240
  tags: string[];
1199
1241
  identifier: string;
1200
1242
  action: import("@db/api").$Enums.OpportunityAction;
1201
1243
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
1202
1244
  chainId: number;
1245
+ howToSteps: string[];
1203
1246
  depositUrl: string | null;
1204
1247
  explorerAddress: string | null;
1205
1248
  mainProtocolId: string | null;
@@ -1209,4 +1252,6 @@ export declare abstract class OpportunityService {
1209
1252
  lastCampaignCreatedAt: Date;
1210
1253
  }>;
1211
1254
  static updateMany(ids: string[], data: Partial<Opportunity["raw"]>): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
1255
+ static description(action: OpportunityAction, tokens: Token["model"][], protocol: Protocol["model"], chainId: number): Promise<string>;
1256
+ static howToSteps(action: OpportunityAction, tokens: Token["model"][], protocol: Protocol["model"]): string[];
1212
1257
  }
@@ -10,6 +10,7 @@ import { AprType, Status } from "@db/api";
10
10
  import { Campaign as CampaignType } from "@sdk";
11
11
  import moment from "moment";
12
12
  import { metadataBuilderFactory } from "../../../engine/metadata/factory";
13
+ import { ChainService } from "../chain/chain.service";
13
14
  import { ProtocolService } from "../protocol/protocol.service";
14
15
  import { OpportunityRepository } from "./opportunity.repository";
15
16
  export class OpportunityService {
@@ -79,6 +80,8 @@ export class OpportunityService {
79
80
  action: metadata.action,
80
81
  tokens,
81
82
  mainProtocol: metadata.mainProtocol,
83
+ description: await OpportunityService.description(metadata.action, tokens, protocol, campaign.computeChainId),
84
+ howToSteps: OpportunityService.howToSteps(metadata.action, tokens, protocol),
82
85
  // If creator has specified a deposit URL, use it
83
86
  // Else if we have the specific logic to handle the deposit URL, use it
84
87
  // Else if the protocol has a deposit URL, use it
@@ -271,4 +274,45 @@ export class OpportunityService {
271
274
  static async updateMany(ids, data) {
272
275
  return await OpportunityRepository.updateMany(ids, data);
273
276
  }
277
+ static async description(action, tokens, protocol, chainId) {
278
+ const chain = await ChainService.findUniqueOrThrow(chainId);
279
+ const symbols = tokens?.map(t => t.symbol).join("-");
280
+ if (action === "POOL")
281
+ return `Earn rewards by providing liquidity to the ${protocol?.name} ${symbols} pool on ${chain.name}, or through a liquidity manager supported by Merkl`;
282
+ if (action === "HOLD")
283
+ return `Earn rewards by holding ${symbols} or by staking it in a supported contract`;
284
+ if (action === "LEND")
285
+ return `Earn rewards by lending ${symbols} to ${protocol?.name} on ${chain.name}`;
286
+ if (action === "BORROW")
287
+ return `Earn rewards by taking a long position on ${protocol?.name} ${symbols} on ${chain.name}`;
288
+ if (action === "DROP")
289
+ return `Visit your dashboard to check if you've earned rewards from this airdrop`;
290
+ if (action === "LONG")
291
+ return `Borrow ${symbols} on ${protocol?.name} on ${chain.name}`;
292
+ if (action === "SHORT")
293
+ return `Earn rewards by taking a short position on ${protocol?.name} ${symbols} on ${chain.name}`;
294
+ if (action === "SWAP")
295
+ return `Earn rewards by trading ${symbols} on ${chain.name}`;
296
+ return "";
297
+ }
298
+ static howToSteps(action, tokens, protocol) {
299
+ const symbols = tokens?.map(t => t.symbol).join("-");
300
+ if (action === "POOL")
301
+ return [`Provide liquidity on ${protocol?.name}.`, "Earn rewards based on your liquidity position."];
302
+ if (action === "HOLD")
303
+ return [`Hold ${symbols}.`, "Rewards accumulate automatically."];
304
+ if (action === "LEND")
305
+ return [`Lend assets on ${protocol?.name}.`, "Rewards accumulate automatically."];
306
+ if (action === "BORROW")
307
+ return [`Borrow assets on ${protocol?.name}.`, "Rewards accumulate automatically."];
308
+ if (action === "DROP")
309
+ return ["Check your eligibility on Merkl."];
310
+ if (action === "LONG")
311
+ return [`Open a long position on ${protocol?.name}.`, "Rewards accumulate automatically."];
312
+ if (action === "SHORT")
313
+ return [`Open a short position on ${protocol?.name}.`, "Rewards accumulate automatically."];
314
+ if (action === "SWAP")
315
+ return [`Swap on ${protocol?.name}.`, "Rewards accumulate automatically."];
316
+ return [];
317
+ }
274
318
  }
@@ -31,6 +31,7 @@ export declare abstract class ProtocolRepository {
31
31
  Campaigns: {
32
32
  id: string;
33
33
  type: string;
34
+ description: string | null;
34
35
  params: import("database/api/.generated/runtime/library").JsonValue;
35
36
  subType: number | null;
36
37
  computeChainId: number;
@@ -51,11 +52,13 @@ export declare abstract class ProtocolRepository {
51
52
  name: string;
52
53
  type: string;
53
54
  status: import("@db/api").$Enums.Status;
55
+ description: string;
54
56
  tags: string[];
55
57
  identifier: string;
56
58
  action: import("@db/api").$Enums.OpportunityAction;
57
59
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
58
60
  chainId: number;
61
+ howToSteps: string[];
59
62
  depositUrl: string | null;
60
63
  explorerAddress: string | null;
61
64
  mainProtocolId: string | null;
@@ -66,11 +66,13 @@ export declare abstract class RewardRepository {
66
66
  name: string;
67
67
  type: string;
68
68
  status: import("@db/api").$Enums.Status;
69
+ description: string;
69
70
  tags: string[];
70
71
  identifier: string;
71
72
  action: import("@db/api").$Enums.OpportunityAction;
72
73
  manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
73
74
  chainId: number;
75
+ howToSteps: string[];
74
76
  depositUrl: string | null;
75
77
  explorerAddress: string | null;
76
78
  mainProtocolId: string | null;