@merkl/api 1.0.47 → 1.0.49

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 (69) hide show
  1. package/dist/src/eden/index.d.ts +4 -604
  2. package/dist/src/engine/implementations/Ajna/metadata.d.ts +1 -1
  3. package/dist/src/engine/implementations/Ambient/metadata.d.ts +1 -1
  4. package/dist/src/engine/implementations/Badger/metadata.d.ts +1 -1
  5. package/dist/src/engine/implementations/Clamm/metadata.d.ts +1 -1
  6. package/dist/src/engine/implementations/Compound/metadata.d.ts +1 -1
  7. package/dist/src/engine/implementations/CompoundV3/metadata.d.ts +1 -1
  8. package/dist/src/engine/implementations/Default/metadata.d.ts +1 -1
  9. package/dist/src/engine/implementations/Dolomite/metadata.d.ts +1 -1
  10. package/dist/src/engine/implementations/EigenLayer/metadata.d.ts +1 -1
  11. package/dist/src/engine/implementations/Encompassing/metadata.d.ts +1 -1
  12. package/dist/src/engine/implementations/Erc20/metadata.d.ts +1 -1
  13. package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.d.ts +1 -1
  14. package/dist/src/engine/implementations/Erc20/subTypes/implementations/bunni/metadata.d.ts +18 -0
  15. package/dist/src/engine/implementations/Erc20/subTypes/implementations/bunni/tvl.d.ts +6 -0
  16. package/dist/src/engine/implementations/Erc20/subTypes/implementations/euler/metadata.d.ts +1 -1
  17. package/dist/src/engine/implementations/Erc20/subTypes/implementations/gamma/metadata.d.ts +1 -1
  18. package/dist/src/engine/implementations/Erc20/subTypes/implementations/gearbox/metadata.d.ts +1 -1
  19. package/dist/src/engine/implementations/Erc20/subTypes/implementations/hypurrfiIsolatedMarket/metadata.d.ts +1 -1
  20. package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.d.ts +1 -1
  21. package/dist/src/engine/implementations/Erc20/subTypes/implementations/metamorpho/metadata.d.ts +1 -1
  22. package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.d.ts +1 -1
  23. package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmax/metadata.d.ts +1 -1
  24. package/dist/src/engine/implementations/Erc20/subTypes/implementations/termmaxVault/metadata.d.ts +1 -1
  25. package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.d.ts +1 -1
  26. package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/mimswap/metadata.d.ts +1 -1
  27. package/dist/src/engine/implementations/Erc20Snapshot/metadata.d.ts +1 -1
  28. package/dist/src/engine/implementations/Erc721/metadata.d.ts +1 -1
  29. package/dist/src/engine/implementations/ErcMultiToken/metadata.d.ts +1 -1
  30. package/dist/src/engine/implementations/EventBased/metadata.d.ts +1 -1
  31. package/dist/src/engine/implementations/FraxLend/metadataBorrow.d.ts +2 -2
  32. package/dist/src/engine/implementations/FraxLend/metadataCollateral.d.ts +1 -1
  33. package/dist/src/engine/implementations/Hyperdrive/metadata.d.ts +1 -1
  34. package/dist/src/engine/implementations/Ion/metadata.d.ts +1 -1
  35. package/dist/src/engine/implementations/JsonAirdrop/metadata.d.ts +1 -1
  36. package/dist/src/engine/implementations/Locker/metadata.d.ts +1 -1
  37. package/dist/src/engine/implementations/Morpho/metadata.d.ts +1 -1
  38. package/dist/src/engine/implementations/MultiLog/metadata.d.ts +1 -1
  39. package/dist/src/engine/implementations/Radiant/metadata.d.ts +1 -1
  40. package/dist/src/engine/implementations/Silo/metadata.d.ts +1 -1
  41. package/dist/src/engine/implementations/UniswapV4/metadata.d.ts +1 -1
  42. package/dist/src/engine/implementations/Vest/metadata.d.ts +1 -1
  43. package/dist/src/engine/implementations/morphoBorrow/metadata.d.ts +1 -1
  44. package/dist/src/engine/implementations/morphoCollateral/metadata.d.ts +1 -1
  45. package/dist/src/engine/implementations/morphoSupply/metadata.d.ts +1 -1
  46. package/dist/src/index.d.ts +2 -307
  47. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -55
  48. package/dist/src/modules/v4/campaign/campaign.convertor.d.ts +6 -0
  49. package/dist/src/modules/v4/campaign/campaign.formatter.d.ts +6 -0
  50. package/dist/src/modules/v4/campaign/campaign.model.d.ts +11 -9
  51. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +32 -31
  52. package/dist/src/modules/v4/campaign/campaign.service.d.ts +18 -702
  53. package/dist/src/modules/v4/creator/creator.controller.d.ts +2 -162
  54. package/dist/src/modules/v4/creator/creator.service.d.ts +2 -162
  55. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +0 -90
  56. package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +2 -6
  57. package/dist/src/modules/v4/opportunity/opportunity.formatter.d.ts +174 -0
  58. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +15 -5
  59. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +2 -4
  60. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +14 -460
  61. package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +125 -1
  62. package/dist/src/modules/v4/reward/reward.service.d.ts +8 -88
  63. package/dist/src/modules/v4/router.d.ts +2 -307
  64. package/dist/src/modules/v4/status/status.model.d.ts +0 -1
  65. package/dist/src/modules/v4/status/status.service.d.ts +2 -2
  66. package/dist/src/utils/prices/services/coinGeckoService.d.ts +1 -1
  67. package/dist/src/utils/prices/services/defillamaService.d.ts +1 -1
  68. package/dist/tsconfig.tsbuildinfo +1 -1
  69. package/package.json +1 -1
@@ -13,9 +13,21 @@ import type { OpportunityRepository } from "./opportunity.repository";
13
13
  * @description Target description of rewards campaigns
14
14
  * @see {@link Resource}
15
15
  */
16
- export type Opportunity = Resource<"Opportunity", "mainProtocolId" | "manualOverrides", {
16
+ export type OpportunityLight = Resource<"Opportunity", "manualOverrides" | "mainProtocolId", {
17
17
  depositUrl?: string;
18
18
  explorerAddress?: string;
19
+ lastCampaignCreatedAt: string;
20
+ mainProtocolId?: string;
21
+ }>;
22
+ /**
23
+ * Opportunity
24
+ * @description Target description of rewards campaigns
25
+ * @see {@link Resource}
26
+ */
27
+ export type Opportunity = Resource<"Opportunity", "manualOverrides" | "mainProtocolId", {
28
+ depositUrl?: string;
29
+ explorerAddress?: string;
30
+ mainProtocolId?: string;
19
31
  chain: Chain["model"];
20
32
  tokens: Token["model"][];
21
33
  lastCampaignCreatedAt: string;
@@ -25,7 +37,8 @@ export type Opportunity = Resource<"Opportunity", "mainProtocolId" | "manualOver
25
37
  rewardsRecord?: DailyRewardsRecord["model"];
26
38
  campaigns?: Omit<Campaign["model"], "manualOverrides">[];
27
39
  }>;
28
- export type LightOpportunityFromDB = Omit<Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>, "AprRecords" | "TvlRecords" | "DailyRewardsRecords" | "Campaigns">;
40
+ export type OpportunityWithoutRecords = Omit<Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>, "AprRecords" | "TvlRecords" | "DailyRewardsRecords" | "Campaigns">;
41
+ export type OpportunityWithoutRecordsAndRelation = Omit<Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>, "AprRecords" | "TvlRecords" | "DailyRewardsRecords" | "Campaigns" | "Chain" | "Tokens" | "Protocols" | "MainProtocol">;
29
42
  export type OpportunityUnique = {
30
43
  chainId: ChainId;
31
44
  type: string;
@@ -291,9 +304,7 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
291
304
  campaignId: import("@sinclair/typebox").TString;
292
305
  type: import("@sinclair/typebox").TString;
293
306
  subType: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>;
294
- rewardTokenId: import("@sinclair/typebox").TString;
295
307
  amount: import("@sinclair/typebox").TString;
296
- opportunityId: import("@sinclair/typebox").TString;
297
308
  startTimestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
298
309
  endTimestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
299
310
  creatorAddress: import("@sinclair/typebox").TString;
@@ -353,7 +364,6 @@ export declare const OpportunityWithCampaignsResourceDto: import("@sinclair/type
353
364
  readonly FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT: "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT";
354
365
  }>>;
355
366
  campaignStatus: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
356
- campaignId: import("@sinclair/typebox").TString;
357
367
  computedUntil: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
358
368
  processingStarted: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>;
359
369
  status: import("@sinclair/typebox").TString;
@@ -368,9 +368,7 @@ export declare abstract class OpportunityRepository {
368
368
  lastCampaignCreatedAt: Date;
369
369
  }>;
370
370
  /**
371
- * Gets opportunities and campaigns for which filtered on campaigns
372
- * @param filters
373
- * @returns
371
+ * Gets opportunities and campaigns based on a campaign filter
374
372
  */
375
373
  static findManyByCampaigns(where: Campaign["action"]["findMany"]["args"]["where"]): Promise<({
376
374
  Campaigns: ({
@@ -729,6 +727,7 @@ export declare abstract class OpportunityRepository {
729
727
  tags: string[];
730
728
  lastCampaignCreatedAt: Date;
731
729
  })[]>;
730
+ static countMany(query: GetOpportunitiesQueryModel): Promise<number>;
732
731
  /**
733
732
  * @dev Live campaigns here can be:
734
733
  * 1. Opportunities with status LIVE
@@ -938,7 +937,6 @@ export declare abstract class OpportunityRepository {
938
937
  tags: string[];
939
938
  lastCampaignCreatedAt: Date;
940
939
  })[]>;
941
- static countMany(query: GetOpportunitiesQueryModel): Promise<number>;
942
940
  /**
943
941
  * Updates Apr, Tvl and DailyRewards records
944
942
  * @param opportunityId
@@ -1,12 +1,10 @@
1
1
  import { type MerklChainId } from "@angleprotocol/sdk/ts";
2
2
  import { type OpportunityAction, type OpportunityManualOverride, type Prisma } from "@package/databases/api";
3
- import type { CampaignWithParams, GetCampaignQueryModel } from "../../../modules/v4/campaign/campaign.model";
3
+ import type { CampaignWithParams, FindCampaignModel } from "../../../modules/v4/campaign/campaign.model";
4
4
  import type { Protocol } from "../protocol/protocol.model";
5
5
  import type { Token } from "../token/token.model";
6
- import type { CreateOpportunityModel, FindOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, Opportunity, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique } from "./opportunity.model";
7
- import { OpportunityRepository } from "./opportunity.repository";
6
+ import type { FindOpportunityModel, GetOpportunitiesQueryModel, Opportunity, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique } from "./opportunity.model";
8
7
  export declare abstract class OpportunityService {
9
- #private;
10
8
  static hashId(opportunity: OpportunityUnique): string;
11
9
  static getAprBins(query: GetOpportunitiesQueryModel): Promise<{
12
10
  min: number;
@@ -118,62 +116,12 @@ export declare abstract class OpportunityService {
118
116
  tags: string[];
119
117
  lastCampaignCreatedAt: Date;
120
118
  })>;
121
- /**
122
- * create an opportunity without campaigns
123
- * @param newOpp the new opportunity to create
124
- * @returns {Promise<Opportunity|undefined>}
125
- */
126
- static create(newOpp: CreateOpportunityModel): Promise<{
127
- Tokens: {
128
- symbol: string;
129
- name: string | null;
130
- decimals: number;
131
- price: number | null;
132
- address: string;
133
- id: string;
134
- chainId: number;
135
- icon: string;
136
- isNative: boolean;
137
- isPoint: boolean;
138
- isPreTGE: boolean;
139
- isTest: boolean;
140
- verified: boolean;
141
- displaySymbol: string;
142
- }[];
143
- Protocols: {
144
- name: string;
145
- description: string;
146
- id: string;
147
- url: string;
148
- icon: string;
149
- tags: string[];
150
- }[];
151
- } & {
152
- name: string;
153
- apr: number;
154
- tvl: number;
155
- description: string;
156
- id: string;
157
- status: import("@package/databases").Status;
158
- chainId: number;
159
- action: import("@package/databases").OpportunityAction;
160
- type: string;
161
- depositUrl: string | null;
162
- explorerAddress: string | null;
163
- howToSteps: string[];
164
- mainProtocolId: string | null;
165
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
166
- identifier: string;
167
- dailyRewards: number;
168
- tags: string[];
169
- lastCampaignCreatedAt: Date;
170
- }>;
171
119
  /**
172
120
  * @param upsert whether to update the opportunity if it already exists in database
173
121
  * @param dryRun whether to skip the opportunity table interaction and just return the computed opportunity
174
122
  * @returns the opportunity entity computed
175
123
  */
176
- static createFromCampaign(campaign: Omit<CampaignWithParams, "manualOverrides">, opportunityIdentifier: string, upsert?: boolean, dryRun?: boolean): Promise<{
124
+ static createFromCampaign(campaign: Omit<CampaignWithParams, "manualOverrides" | "opportunityId">, opportunityIdentifier: string, upsert?: boolean, dryRun?: boolean): Promise<{
177
125
  id: string;
178
126
  chainId: number;
179
127
  type: string;
@@ -251,7 +199,8 @@ export declare abstract class OpportunityService {
251
199
  lastCampaignCreatedAt: Date;
252
200
  })>;
253
201
  /**
254
- * deletes and recreates an opportunity with fresh data
202
+ * @notice Find the first campaign of an opportunity and then upserts the opportunity
203
+ * based on this
255
204
  */
256
205
  static recreate(opportunityId: string, campaignId?: string): Promise<{
257
206
  id: string;
@@ -336,7 +285,7 @@ export declare abstract class OpportunityService {
336
285
  * @param where
337
286
  * @returns opportunities
338
287
  */
339
- static findManyByCampaigns(query: GetCampaignQueryModel): Promise<{
288
+ static findManyByCampaigns(query: FindCampaignModel): Promise<{
340
289
  protocol?: {
341
290
  dailyRewards?: number | undefined;
342
291
  numberOfLiveCampaigns?: number | undefined;
@@ -430,7 +379,6 @@ export declare abstract class OpportunityService {
430
379
  campaignStatus?: {
431
380
  error?: string | undefined;
432
381
  details?: any;
433
- campaignId: string;
434
382
  status: string;
435
383
  computedUntil: string | number;
436
384
  processingStarted: string | number;
@@ -469,10 +417,8 @@ export declare abstract class OpportunityService {
469
417
  computeChainId: number;
470
418
  distributionChainId: number;
471
419
  endTimestamp: string | number;
472
- opportunityId: string;
473
420
  creatorAddress: string;
474
421
  subType: number | null;
475
- rewardTokenId: string;
476
422
  createdAt: string;
477
423
  chain: {
478
424
  explorers?: {
@@ -510,7 +456,6 @@ export declare abstract class OpportunityService {
510
456
  * @returns A list of opportunities
511
457
  */
512
458
  static findMany(query: GetOpportunitiesQueryModel): Promise<{
513
- apr: number;
514
459
  aprRecord: {
515
460
  cumulated: number;
516
461
  timestamp: bigint;
@@ -564,91 +509,7 @@ export declare abstract class OpportunityService {
564
509
  distributionType: import("@package/databases").DistributionType;
565
510
  }[];
566
511
  };
567
- campaigns: {
568
- params: any;
569
- chain: {
570
- name: string;
571
- id: number;
572
- icon: string;
573
- };
574
- endTimestamp: number;
575
- startTimestamp: number;
576
- rewardToken: {
577
- symbol: string;
578
- name: string | null;
579
- decimals: number;
580
- address: string;
581
- id: string;
582
- chainId: number;
583
- icon: string;
584
- isNative: boolean;
585
- isPoint: boolean;
586
- isPreTGE: boolean;
587
- isTest: boolean;
588
- verified: boolean;
589
- } & {
590
- price?: number | null | undefined;
591
- isTokenWrapper?: boolean | undefined;
592
- tokenWrapperAddress?: string | undefined;
593
- };
594
- distributionChain: {
595
- name: string;
596
- id: number;
597
- icon: string;
598
- } | undefined;
599
- campaignStatus: {
600
- computedUntil: number;
601
- processingStarted: number;
602
- campaignId: string;
603
- error: string;
604
- status: import("@package/databases").RunStatus;
605
- details: import("@prisma/client/runtime/library").JsonValue;
606
- } | undefined;
607
- creatorAddress: string;
608
- creator: {
609
- address: string;
610
- tags: string[];
611
- creatorId: string | null;
612
- };
613
- createdAt: string;
614
- description: string | undefined;
615
- parentCampaignId: string | undefined;
616
- rootCampaignId: string | undefined;
617
- Opportunity: {
618
- name: string;
619
- apr: number;
620
- tvl: number;
621
- description: string;
622
- id: string;
623
- status: import("@package/databases").Status;
624
- chainId: number;
625
- action: import("@package/databases").OpportunityAction;
626
- type: string;
627
- depositUrl: string | null;
628
- explorerAddress: string | null;
629
- howToSteps: string[];
630
- mainProtocolId: string | null;
631
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
632
- identifier: string;
633
- dailyRewards: number;
634
- tags: string[];
635
- lastCampaignCreatedAt: Date;
636
- };
637
- campaignId: string;
638
- id: string;
639
- amount: string;
640
- type: string;
641
- computeChainId: number;
642
- distributionChainId: number;
643
- opportunityId: string;
644
- distributionType: import("@package/databases").DistributionType;
645
- subType: number | null;
646
- rewardTokenId: string;
647
- }[] | undefined;
648
- id: string;
649
- depositUrl: string | undefined;
650
- explorerAddress: string | undefined;
651
- lastCampaignCreatedAt: string;
512
+ campaigns: Omit<CampaignWithParams, "manualOverrides">[] | undefined;
652
513
  tokens: ({
653
514
  symbol: string;
654
515
  name: string | null;
@@ -680,7 +541,12 @@ export declare abstract class OpportunityService {
680
541
  icon: string;
681
542
  tags: string[];
682
543
  } | undefined;
544
+ id: string;
545
+ depositUrl: string | undefined;
546
+ explorerAddress: string | undefined;
547
+ lastCampaignCreatedAt: string;
683
548
  name: string;
549
+ apr: number;
684
550
  tvl: number;
685
551
  description: string;
686
552
  status: import("@package/databases").Status;
@@ -700,190 +566,6 @@ export declare abstract class OpportunityService {
700
566
  */
701
567
  static countMany(query: GetOpportunitiesQueryModel): Promise<number>;
702
568
  static findLiveWithCampaigns(chainId: MerklChainId, take?: number): Promise<{
703
- apr: number;
704
- aprRecord: {
705
- cumulated: number;
706
- timestamp: bigint;
707
- breakdowns: ({
708
- value: number;
709
- distributionType: import("@package/databases").DistributionType;
710
- identifier: string;
711
- type: "CAMPAIGN";
712
- } | {
713
- value: number;
714
- identifier: string;
715
- type: import("@package/databases").AprType;
716
- })[];
717
- };
718
- tvlRecord: {
719
- id: string;
720
- total: number;
721
- timestamp: bigint;
722
- breakdowns: {
723
- value: number;
724
- type: import("@package/databases").TvlType;
725
- identifier: string;
726
- }[];
727
- };
728
- rewardsRecord: {
729
- id: string;
730
- total: number;
731
- timestamp: bigint;
732
- breakdowns: {
733
- campaignId: string;
734
- id: string;
735
- dailyRewardsRecordId: string;
736
- token: {
737
- symbol: string;
738
- name: string | null;
739
- decimals: number;
740
- price: number | null;
741
- address: string;
742
- id: string;
743
- chainId: number;
744
- icon: string;
745
- isNative: boolean;
746
- isPoint: boolean;
747
- isPreTGE: boolean;
748
- isTest: boolean;
749
- verified: boolean;
750
- displaySymbol: string;
751
- };
752
- amount: bigint;
753
- value: number;
754
- distributionType: import("@package/databases").DistributionType;
755
- }[];
756
- };
757
- campaigns: {
758
- params: any;
759
- chain: {
760
- name: string;
761
- id: number;
762
- icon: string;
763
- };
764
- endTimestamp: number;
765
- startTimestamp: number;
766
- rewardToken: {
767
- symbol: string;
768
- name: string | null;
769
- decimals: number;
770
- address: string;
771
- id: string;
772
- chainId: number;
773
- icon: string;
774
- isNative: boolean;
775
- isPoint: boolean;
776
- isPreTGE: boolean;
777
- isTest: boolean;
778
- verified: boolean;
779
- } & {
780
- price?: number | null | undefined;
781
- isTokenWrapper?: boolean | undefined;
782
- tokenWrapperAddress?: string | undefined;
783
- };
784
- distributionChain: {
785
- name: string;
786
- id: number;
787
- icon: string;
788
- } | undefined;
789
- campaignStatus: {
790
- computedUntil: number;
791
- processingStarted: number;
792
- campaignId: string;
793
- error: string;
794
- status: import("@package/databases").RunStatus;
795
- details: import("@prisma/client/runtime/library").JsonValue;
796
- } | undefined;
797
- creatorAddress: string;
798
- creator: {
799
- address: string;
800
- tags: string[];
801
- creatorId: string | null;
802
- };
803
- createdAt: string;
804
- description: string | undefined;
805
- parentCampaignId: string | undefined;
806
- rootCampaignId: string | undefined;
807
- Opportunity: {
808
- name: string;
809
- apr: number;
810
- tvl: number;
811
- description: string;
812
- id: string;
813
- status: import("@package/databases").Status;
814
- chainId: number;
815
- action: import("@package/databases").OpportunityAction;
816
- type: string;
817
- depositUrl: string | null;
818
- explorerAddress: string | null;
819
- howToSteps: string[];
820
- mainProtocolId: string | null;
821
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
822
- identifier: string;
823
- dailyRewards: number;
824
- tags: string[];
825
- lastCampaignCreatedAt: Date;
826
- };
827
- campaignId: string;
828
- id: string;
829
- amount: string;
830
- type: string;
831
- computeChainId: number;
832
- distributionChainId: number;
833
- opportunityId: string;
834
- distributionType: import("@package/databases").DistributionType;
835
- subType: number | null;
836
- rewardTokenId: string;
837
- }[] | undefined;
838
- id: string;
839
- depositUrl: string | undefined;
840
- explorerAddress: string | undefined;
841
- lastCampaignCreatedAt: string;
842
- tokens: ({
843
- symbol: string;
844
- name: string | null;
845
- decimals: number;
846
- address: string;
847
- id: string;
848
- chainId: number;
849
- icon: string;
850
- isNative: boolean;
851
- isPoint: boolean;
852
- isPreTGE: boolean;
853
- isTest: boolean;
854
- verified: boolean;
855
- } & {
856
- price?: number | null | undefined;
857
- isTokenWrapper?: boolean | undefined;
858
- tokenWrapperAddress?: string | undefined;
859
- })[];
860
- chain: {
861
- name: string;
862
- id: number;
863
- icon: string;
864
- };
865
- protocol: {
866
- name: string;
867
- description: string;
868
- id: string;
869
- url: string;
870
- icon: string;
871
- tags: string[];
872
- } | undefined;
873
- name: string;
874
- tvl: number;
875
- description: string;
876
- status: import("@package/databases").Status;
877
- chainId: number;
878
- action: import("@package/databases").OpportunityAction;
879
- type: string;
880
- howToSteps: string[];
881
- identifier: string;
882
- dailyRewards: number;
883
- tags: string[];
884
- }[]>;
885
- static formatResponse(opportunity: Awaited<ReturnType<typeof OpportunityRepository.findUniqueOrThrow>>): {
886
- apr: number;
887
569
  aprRecord: {
888
570
  cumulated: number;
889
571
  timestamp: bigint;
@@ -937,91 +619,7 @@ export declare abstract class OpportunityService {
937
619
  distributionType: import("@package/databases").DistributionType;
938
620
  }[];
939
621
  };
940
- campaigns: {
941
- params: any;
942
- chain: {
943
- name: string;
944
- id: number;
945
- icon: string;
946
- };
947
- endTimestamp: number;
948
- startTimestamp: number;
949
- rewardToken: {
950
- symbol: string;
951
- name: string | null;
952
- decimals: number;
953
- address: string;
954
- id: string;
955
- chainId: number;
956
- icon: string;
957
- isNative: boolean;
958
- isPoint: boolean;
959
- isPreTGE: boolean;
960
- isTest: boolean;
961
- verified: boolean;
962
- } & {
963
- price?: number | null | undefined;
964
- isTokenWrapper?: boolean | undefined;
965
- tokenWrapperAddress?: string | undefined;
966
- };
967
- distributionChain: {
968
- name: string;
969
- id: number;
970
- icon: string;
971
- } | undefined;
972
- campaignStatus: {
973
- computedUntil: number;
974
- processingStarted: number;
975
- campaignId: string;
976
- error: string;
977
- status: import("@package/databases").RunStatus;
978
- details: import("@prisma/client/runtime/library").JsonValue;
979
- } | undefined;
980
- creatorAddress: string;
981
- creator: {
982
- address: string;
983
- tags: string[];
984
- creatorId: string | null;
985
- };
986
- createdAt: string;
987
- description: string | undefined;
988
- parentCampaignId: string | undefined;
989
- rootCampaignId: string | undefined;
990
- Opportunity: {
991
- name: string;
992
- apr: number;
993
- tvl: number;
994
- description: string;
995
- id: string;
996
- status: import("@package/databases").Status;
997
- chainId: number;
998
- action: import("@package/databases").OpportunityAction;
999
- type: string;
1000
- depositUrl: string | null;
1001
- explorerAddress: string | null;
1002
- howToSteps: string[];
1003
- mainProtocolId: string | null;
1004
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
1005
- identifier: string;
1006
- dailyRewards: number;
1007
- tags: string[];
1008
- lastCampaignCreatedAt: Date;
1009
- };
1010
- campaignId: string;
1011
- id: string;
1012
- amount: string;
1013
- type: string;
1014
- computeChainId: number;
1015
- distributionChainId: number;
1016
- opportunityId: string;
1017
- distributionType: import("@package/databases").DistributionType;
1018
- subType: number | null;
1019
- rewardTokenId: string;
1020
- }[] | undefined;
1021
- id: string;
1022
- depositUrl: string | undefined;
1023
- explorerAddress: string | undefined;
1024
- lastCampaignCreatedAt: string;
622
+ campaigns: Omit<CampaignWithParams, "manualOverrides">[] | undefined;
1025
623
  tokens: ({
1026
624
  symbol: string;
1027
625
  name: string | null;
@@ -1053,54 +651,10 @@ export declare abstract class OpportunityService {
1053
651
  icon: string;
1054
652
  tags: string[];
1055
653
  } | undefined;
1056
- name: string;
1057
- tvl: number;
1058
- description: string;
1059
- status: import("@package/databases").Status;
1060
- chainId: number;
1061
- action: import("@package/databases").OpportunityAction;
1062
- type: string;
1063
- howToSteps: string[];
1064
- identifier: string;
1065
- dailyRewards: number;
1066
- tags: string[];
1067
- };
1068
- static formatResponseBase(opportunity: LightOpportunityFromDB): {
1069
654
  id: string;
1070
655
  depositUrl: string | undefined;
1071
656
  explorerAddress: string | undefined;
1072
657
  lastCampaignCreatedAt: string;
1073
- tokens: ({
1074
- symbol: string;
1075
- name: string | null;
1076
- decimals: number;
1077
- address: string;
1078
- id: string;
1079
- chainId: number;
1080
- icon: string;
1081
- isNative: boolean;
1082
- isPoint: boolean;
1083
- isPreTGE: boolean;
1084
- isTest: boolean;
1085
- verified: boolean;
1086
- } & {
1087
- price?: number | null | undefined;
1088
- isTokenWrapper?: boolean | undefined;
1089
- tokenWrapperAddress?: string | undefined;
1090
- })[];
1091
- chain: {
1092
- name: string;
1093
- id: number;
1094
- icon: string;
1095
- };
1096
- protocol: {
1097
- name: string;
1098
- description: string;
1099
- id: string;
1100
- url: string;
1101
- icon: string;
1102
- tags: string[];
1103
- } | undefined;
1104
658
  name: string;
1105
659
  apr: number;
1106
660
  tvl: number;
@@ -1113,7 +667,7 @@ export declare abstract class OpportunityService {
1113
667
  identifier: string;
1114
668
  dailyRewards: number;
1115
669
  tags: string[];
1116
- };
670
+ }[]>;
1117
671
  static aggregate(query: GetOpportunitiesQueryModel, field: keyof Prisma.OpportunitySumAggregateInputType): Promise<{
1118
672
  sum: string;
1119
673
  }>;