@merkl/api 1.6.0 → 1.6.2

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 (71) hide show
  1. package/dist/src/eden/index.d.ts +777 -427
  2. package/dist/src/engine/implementations/clamm/tvl.abstract.d.ts +1 -1
  3. package/dist/src/index.d.ts +767 -425
  4. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +12 -0
  5. package/dist/src/modules/v4/campaign/campaign.controller.js.map +1 -1
  6. package/dist/src/modules/v4/campaign/campaign.formatter.js.map +1 -1
  7. package/dist/src/modules/v4/campaign/campaign.model.d.ts +3 -0
  8. package/dist/src/modules/v4/campaign/campaign.model.js.map +1 -1
  9. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +22 -2
  10. package/dist/src/modules/v4/campaign/campaign.repository.js.map +1 -1
  11. package/dist/src/modules/v4/campaign/campaign.service.d.ts +18 -6
  12. package/dist/src/modules/v4/campaign/campaign.service.js.map +1 -1
  13. package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +8 -0
  14. package/dist/src/modules/v4/campaignBatch/campaignBatch.controller.d.ts +2 -0
  15. package/dist/src/modules/v4/campaignBatch/campaignBatch.repository.d.ts +2 -0
  16. package/dist/src/modules/v4/campaignBatch/campaignBatch.service.d.ts +2 -0
  17. package/dist/src/modules/v4/campaignGroup/campaignGroup.repository.d.ts +4 -0
  18. package/dist/src/modules/v4/campaignGroup/campaignGroup.service.d.ts +4 -0
  19. package/dist/src/modules/v4/campaignStatus/campaignStatus.repository.d.ts +1 -0
  20. package/dist/src/modules/v4/carousel/carousel.controller.d.ts +4 -0
  21. package/dist/src/modules/v4/carousel/carousel.repository.d.ts +6 -0
  22. package/dist/src/modules/v4/carousel/carousel.service.d.ts +6 -0
  23. package/dist/src/modules/v4/clamm/clamm.controller.d.ts +63 -1
  24. package/dist/src/modules/v4/clamm/clamm.controller.js.map +1 -1
  25. package/dist/src/modules/v4/clamm/clamm.service.d.ts +5 -2
  26. package/dist/src/modules/v4/clamm/clamm.service.js.map +1 -1
  27. package/dist/src/modules/v4/config/config.controller.d.ts +2 -0
  28. package/dist/src/modules/v4/config/config.service.d.ts +2 -0
  29. package/dist/src/modules/v4/creator/creator.controller.d.ts +3 -0
  30. package/dist/src/modules/v4/creator/creator.model.d.ts +1 -0
  31. package/dist/src/modules/v4/creator/creator.repository.d.ts +2 -0
  32. package/dist/src/modules/v4/creator/creator.service.d.ts +2 -0
  33. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +118 -0
  34. package/dist/src/modules/v4/opportunity/opportunity.controller.js.map +1 -1
  35. package/dist/src/modules/v4/opportunity/opportunity.formatter.d.ts +4 -0
  36. package/dist/src/modules/v4/opportunity/opportunity.formatter.js.map +1 -1
  37. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +9 -0
  38. package/dist/src/modules/v4/opportunity/opportunity.model.js.map +1 -1
  39. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +16 -0
  40. package/dist/src/modules/v4/opportunity/opportunity.repository.js.map +1 -1
  41. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +16 -0
  42. package/dist/src/modules/v4/override/override.controller.d.ts +126 -3
  43. package/dist/src/modules/v4/override/override.controller.js.map +1 -1
  44. package/dist/src/modules/v4/override/override.model.d.ts +48 -3
  45. package/dist/src/modules/v4/override/override.model.js.map +1 -1
  46. package/dist/src/modules/v4/override/override.repository.d.ts +19 -0
  47. package/dist/src/modules/v4/override/override.repository.js.map +1 -1
  48. package/dist/src/modules/v4/override/override.service.d.ts +72 -5
  49. package/dist/src/modules/v4/override/override.service.js.map +1 -1
  50. package/dist/src/modules/v4/payload/payload.controller.d.ts +418 -421
  51. package/dist/src/modules/v4/payload/payload.controller.js.map +1 -1
  52. package/dist/src/modules/v4/payload/payload.service.d.ts +425 -426
  53. package/dist/src/modules/v4/payload/payload.service.js.map +1 -1
  54. package/dist/src/modules/v4/program/program.repository.d.ts +4 -0
  55. package/dist/src/modules/v4/protocol/protocol.repository.d.ts +2 -0
  56. package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -0
  57. package/dist/src/modules/v4/reward/reward.service.d.ts +19 -0
  58. package/dist/src/modules/v4/router.d.ts +767 -425
  59. package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +6 -0
  60. package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +3 -0
  61. package/dist/src/modules/v4/user/user.controller.d.ts +5 -0
  62. package/dist/src/scripts/compare-engine-campaigns/campaign-loader.js.map +1 -1
  63. package/dist/src/scripts/compare-engine-campaigns/constants.d.ts +1 -0
  64. package/dist/src/scripts/compare-engine-campaigns/constants.js.map +1 -1
  65. package/dist/src/scripts/compare-engine-campaigns/diff-reporter.js.map +1 -1
  66. package/dist/src/scripts/compare-engine-campaigns/index.js.map +1 -1
  67. package/dist/src/scripts/compare-engine-campaigns/normalizer.d.ts +1 -1
  68. package/dist/src/scripts/compare-engine-campaigns/normalizer.js.map +1 -1
  69. package/dist/src/scripts/recompute-override.js.map +1 -1
  70. package/dist/src/utils/getAPR.d.ts +24 -24
  71. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { CampaignType, type ChainId } from "@package/resources/enums";
2
2
  import type { CampaignConfig, OnchainCampaign } from "@package/resources/schemas";
3
- import { type ValidCampaign } from "@package/sdk";
3
+ import type { ValidCampaign } from "@package/sdk";
4
4
  import type { TransactionParametersModel } from "../transaction/transaction.model";
5
5
  import type { CampaignPayloadInputModel, SafeFileModel, SinglePayloadInputModel } from "./payload.model";
6
6
  export declare class PayloadService {
@@ -19,7 +19,7 @@ export declare class PayloadService {
19
19
  };
20
20
  payload: string;
21
21
  };
22
- campaign: import("@package/resources/schemas").EngineCampaign<CampaignType> | undefined;
22
+ campaign: import("@package/resources/schemas").EngineCampaign<CampaignType.INVALID> | import("@package/resources/schemas").EngineCampaign<CampaignType>;
23
23
  opportunity: ({
24
24
  chainId: number;
25
25
  type: string;
@@ -75,6 +75,7 @@ export declare class PayloadService {
75
75
  endTimestamp: bigint;
76
76
  params: import("@prisma/client/runtime/client").JsonValue;
77
77
  description: string | null;
78
+ pauseCompute: boolean;
78
79
  dailyRewards: number;
79
80
  apr: number;
80
81
  creatorAddress: string;
@@ -240,8 +241,9 @@ export declare class PayloadService {
240
241
  lastCampaignCreatedAt: Date;
241
242
  manualOverrides: import("@package/databases").OpportunityManualOverride[];
242
243
  liveCampaigns: number;
243
- }) | undefined;
244
- tvl: ({
244
+ hidden: boolean;
245
+ });
246
+ tvl: {
245
247
  breakdowns: ({
246
248
  identifier: string;
247
249
  type: import("@package/databases").TvlType;
@@ -249,21 +251,15 @@ export declare class PayloadService {
249
251
  } & {})[];
250
252
  timestamp: bigint;
251
253
  total: number;
252
- } & {}) | undefined;
254
+ } & {};
253
255
  fee: string;
254
256
  }>;
255
257
  /**
256
258
  * Given onchain campaign creation arguments, tries to build the campaign and return the opportunity.
257
259
  */
258
260
  static analyseOnchainArgs(chainId: number, args: OnchainCampaign): Promise<{
259
- message: string;
260
- name: string;
261
- campaign?: undefined;
262
- opportunity?: undefined;
263
- tvl?: undefined;
264
- } | {
265
- message?: undefined;
266
- campaign: import("@package/resources/schemas").EngineCampaign<CampaignType>;
261
+ config: import("@package/resources/schemas").ExtendedConfig<CampaignType>;
262
+ campaign: import("@package/resources/schemas").EngineCampaign<CampaignType.INVALID> | import("@package/resources/schemas").EngineCampaign<CampaignType>;
267
263
  opportunity: ({
268
264
  chainId: number;
269
265
  type: string;
@@ -319,6 +315,7 @@ export declare class PayloadService {
319
315
  endTimestamp: bigint;
320
316
  params: import("@prisma/client/runtime/client").JsonValue;
321
317
  description: string | null;
318
+ pauseCompute: boolean;
322
319
  dailyRewards: number;
323
320
  apr: number;
324
321
  creatorAddress: string;
@@ -484,6 +481,7 @@ export declare class PayloadService {
484
481
  lastCampaignCreatedAt: Date;
485
482
  manualOverrides: import("@package/databases").OpportunityManualOverride[];
486
483
  liveCampaigns: number;
484
+ hidden: boolean;
487
485
  });
488
486
  tvl: {
489
487
  breakdowns: ({
@@ -494,149 +492,182 @@ export declare class PayloadService {
494
492
  timestamp: bigint;
495
493
  total: number;
496
494
  } & {};
497
- name?: undefined;
498
495
  }>;
499
- static simulateAndAnalyze(body: TransactionParametersModel): Promise<Record<string, {
500
- message: string;
501
- name: string;
502
- campaign?: undefined;
503
- opportunity?: undefined;
504
- tvl?: undefined;
505
- } | {
506
- message?: undefined;
507
- campaign: import("@package/resources/schemas").EngineCampaign<CampaignType>;
508
- opportunity: ({
509
- chainId: number;
510
- type: string;
511
- identifier: string;
512
- name?: string | undefined;
513
- status: "LIVE" | "NONE" | "PAST" | "SOON";
514
- action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
515
- description?: string | undefined;
516
- howToSteps?: string[] | undefined;
517
- tokens: {
518
- address: string;
496
+ static simulateAndAnalyze(body: TransactionParametersModel): Promise<{
497
+ campaigns: Record<string, {
498
+ config: import("@package/resources/schemas").ExtendedConfig<CampaignType>;
499
+ campaign: import("@package/resources/schemas").EngineCampaign<CampaignType.INVALID> | import("@package/resources/schemas").EngineCampaign<CampaignType>;
500
+ opportunity: ({
519
501
  chainId: number;
520
- }[];
521
- protocols?: string[] | undefined;
522
- mainProtocol?: string | undefined;
523
- depositUrl?: string | undefined;
524
- explorerAddress?: string | undefined;
525
- tags?: string[] | undefined;
526
- } & {
527
- id: string;
528
- }) | ({
529
- ActivePrograms: {
530
- icon: string;
531
- id: string;
532
- name: string;
533
- slug: string | null;
534
- }[];
535
- AprRecords: ({
536
- AprBreakdown: {
537
- identifier: string;
538
- timestamp: bigint;
539
- type: import("@package/databases").AprType;
540
- value: number;
502
+ type: string;
503
+ identifier: string;
504
+ name?: string | undefined;
505
+ status: "LIVE" | "NONE" | "PAST" | "SOON";
506
+ action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
507
+ description?: string | undefined;
508
+ howToSteps?: string[] | undefined;
509
+ tokens: {
510
+ address: string;
511
+ chainId: number;
541
512
  }[];
513
+ protocols?: string[] | undefined;
514
+ mainProtocol?: string | undefined;
515
+ depositUrl?: string | undefined;
516
+ explorerAddress?: string | undefined;
517
+ tags?: string[] | undefined;
542
518
  } & {
543
519
  id: string;
544
- timestamp: bigint;
545
- cumulated: number;
546
- opportunityId: string;
547
- })[];
548
- Campaigns: {
549
- id: string;
550
- computeChainId: number;
551
- distributionChainId: number;
552
- campaignId: string;
553
- type: string;
554
- distributionType: import("@package/databases").DistributionType;
555
- subType: number | null;
556
- rewardTokenId: string;
557
- amount: string;
558
- opportunityId: string;
559
- startTimestamp: bigint;
560
- endTimestamp: bigint;
561
- params: import("@prisma/client/runtime/client").JsonValue;
562
- description: string | null;
563
- dailyRewards: number;
564
- apr: number;
565
- creatorAddress: string;
566
- manualOverrides: import("@package/databases").CampaignManualOverride[];
567
- createdAt: Date;
568
- rootCampaignId: string | null;
569
- parentCampaignId: string | null;
570
- }[];
571
- Chain: {
572
- id: number;
573
- name: string;
574
- icon: string;
575
- liveCampaigns: number;
576
- endOfDisputePeriod: number;
577
- };
578
- DailyRewardsRecords: ({
579
- DailyRewardsBreakdown: ({
580
- Campaign: {
581
- CampaignStatus: {
520
+ }) | ({
521
+ ActivePrograms: {
522
+ icon: string;
523
+ id: string;
524
+ name: string;
525
+ slug: string | null;
526
+ }[];
527
+ AprRecords: ({
528
+ AprBreakdown: {
529
+ identifier: string;
530
+ timestamp: bigint;
531
+ type: import("@package/databases").AprType;
532
+ value: number;
533
+ }[];
534
+ } & {
535
+ id: string;
536
+ timestamp: bigint;
537
+ cumulated: number;
538
+ opportunityId: string;
539
+ })[];
540
+ Campaigns: {
541
+ id: string;
542
+ computeChainId: number;
543
+ distributionChainId: number;
544
+ campaignId: string;
545
+ type: string;
546
+ distributionType: import("@package/databases").DistributionType;
547
+ subType: number | null;
548
+ rewardTokenId: string;
549
+ amount: string;
550
+ opportunityId: string;
551
+ startTimestamp: bigint;
552
+ endTimestamp: bigint;
553
+ params: import("@prisma/client/runtime/client").JsonValue;
554
+ description: string | null;
555
+ pauseCompute: boolean;
556
+ dailyRewards: number;
557
+ apr: number;
558
+ creatorAddress: string;
559
+ manualOverrides: import("@package/databases").CampaignManualOverride[];
560
+ createdAt: Date;
561
+ rootCampaignId: string | null;
562
+ parentCampaignId: string | null;
563
+ }[];
564
+ Chain: {
565
+ id: number;
566
+ name: string;
567
+ icon: string;
568
+ liveCampaigns: number;
569
+ endOfDisputePeriod: number;
570
+ };
571
+ DailyRewardsRecords: ({
572
+ DailyRewardsBreakdown: ({
573
+ Campaign: {
574
+ CampaignStatus: {
575
+ campaignId: string;
576
+ computedUntil: bigint;
577
+ processingStarted: bigint;
578
+ status: import("@package/databases").RunStatus;
579
+ preComputeStatus: import("@package/databases").RunStatus;
580
+ preComputeProcessingStarted: bigint;
581
+ error: string;
582
+ details: import("@prisma/client/runtime/client").JsonValue;
583
+ }[];
584
+ RewardToken: {
585
+ id: string;
586
+ name: string | null;
587
+ chainId: number;
588
+ address: string;
589
+ decimals: number;
590
+ symbol: string;
591
+ displaySymbol: string;
592
+ icon: string;
593
+ verified: boolean;
594
+ isTest: boolean;
595
+ type: import("@package/databases").TokenType;
596
+ isNative: boolean;
597
+ price: number | null;
598
+ updatedAt: number | null;
599
+ priceSource: string | null;
600
+ };
601
+ amount: string;
582
602
  campaignId: string;
583
- computedUntil: bigint;
584
- processingStarted: bigint;
585
- status: import("@package/databases").RunStatus;
586
- preComputeStatus: import("@package/databases").RunStatus;
587
- preComputeProcessingStarted: bigint;
588
- error: string;
589
- details: import("@prisma/client/runtime/client").JsonValue;
590
- }[];
591
- RewardToken: {
592
- id: string;
593
- name: string | null;
594
- chainId: number;
595
- address: string;
596
- decimals: number;
597
- symbol: string;
598
- displaySymbol: string;
599
- icon: string;
600
- verified: boolean;
601
- isTest: boolean;
602
- type: import("@package/databases").TokenType;
603
- isNative: boolean;
604
- price: number | null;
605
- updatedAt: number | null;
606
- priceSource: string | null;
603
+ distributionType: import("@package/databases").DistributionType;
604
+ endTimestamp: bigint;
605
+ startTimestamp: bigint;
607
606
  };
608
- amount: string;
607
+ } & {
608
+ id: string;
609
+ value: number;
610
+ timestamp: bigint;
609
611
  campaignId: string;
610
- distributionType: import("@package/databases").DistributionType;
611
- endTimestamp: bigint;
612
- startTimestamp: bigint;
613
- };
612
+ dailyRewardsRecordId: string;
613
+ })[];
614
614
  } & {
615
615
  id: string;
616
- value: number;
617
616
  timestamp: bigint;
618
- campaignId: string;
619
- dailyRewardsRecordId: string;
617
+ total: number;
618
+ opportunityId: string;
620
619
  })[];
621
- } & {
622
- id: string;
623
- timestamp: bigint;
624
- total: number;
625
- opportunityId: string;
626
- })[];
627
- MainProtocol: {
628
- id: string;
629
- tags: string[];
630
- name: string;
631
- description: string;
632
- url: string;
633
- icon: string;
634
- banner: string | null;
635
- opportunityBannerLight: string | null;
636
- opportunityBannerDark: string | null;
637
- } | null;
638
- NativeAprRecords: ({
639
- RewardToken: {
620
+ MainProtocol: {
621
+ id: string;
622
+ tags: string[];
623
+ name: string;
624
+ description: string;
625
+ url: string;
626
+ icon: string;
627
+ banner: string | null;
628
+ opportunityBannerLight: string | null;
629
+ opportunityBannerDark: string | null;
630
+ } | null;
631
+ NativeAprRecords: ({
632
+ RewardToken: {
633
+ id: string;
634
+ name: string | null;
635
+ chainId: number;
636
+ address: string;
637
+ decimals: number;
638
+ symbol: string;
639
+ displaySymbol: string;
640
+ icon: string;
641
+ verified: boolean;
642
+ isTest: boolean;
643
+ type: import("@package/databases").TokenType;
644
+ isNative: boolean;
645
+ price: number | null;
646
+ updatedAt: number | null;
647
+ priceSource: string | null;
648
+ } | null;
649
+ } & {
650
+ id: string;
651
+ title: string;
652
+ description: string | null;
653
+ timestamp: bigint;
654
+ value: number;
655
+ amount: bigint | null;
656
+ rewardTokenId: string | null;
657
+ opportunityId: string;
658
+ })[];
659
+ Protocols: {
660
+ id: string;
661
+ tags: string[];
662
+ name: string;
663
+ description: string;
664
+ url: string;
665
+ icon: string;
666
+ banner: string | null;
667
+ opportunityBannerLight: string | null;
668
+ opportunityBannerDark: string | null;
669
+ }[];
670
+ Tokens: {
640
671
  id: string;
641
672
  name: string | null;
642
673
  chainId: number;
@@ -652,232 +683,233 @@ export declare class PayloadService {
652
683
  price: number | null;
653
684
  updatedAt: number | null;
654
685
  priceSource: string | null;
655
- } | null;
686
+ }[];
687
+ TvlRecords: ({
688
+ TvlBreakdown: {
689
+ identifier: string;
690
+ type: import("@package/databases").TvlType;
691
+ value: number;
692
+ }[];
693
+ } & {
694
+ id: string;
695
+ timestamp: bigint;
696
+ total: number;
697
+ opportunityId: string;
698
+ })[];
656
699
  } & {
657
700
  id: string;
658
- title: string;
659
- description: string | null;
660
- timestamp: bigint;
661
- value: number;
662
- amount: bigint | null;
663
- rewardTokenId: string | null;
664
- opportunityId: string;
665
- })[];
666
- Protocols: {
667
- id: string;
668
- tags: string[];
701
+ chainId: number;
702
+ type: string;
703
+ identifier: string;
669
704
  name: string;
670
705
  description: string;
671
- url: string;
672
- icon: string;
673
- banner: string | null;
674
- opportunityBannerLight: string | null;
675
- opportunityBannerDark: string | null;
676
- }[];
677
- Tokens: {
678
- id: string;
679
- name: string | null;
680
- chainId: number;
681
- address: string;
682
- decimals: number;
683
- symbol: string;
684
- displaySymbol: string;
685
- icon: string;
686
- verified: boolean;
687
- isTest: boolean;
688
- type: import("@package/databases").TokenType;
689
- isNative: boolean;
690
- price: number | null;
691
- updatedAt: number | null;
692
- priceSource: string | null;
693
- }[];
694
- TvlRecords: ({
695
- TvlBreakdown: {
706
+ howToSteps: string[];
707
+ depositUrl: string | null;
708
+ explorerAddress: string | null;
709
+ status: import("@package/databases").Status;
710
+ action: import("@package/databases").OpportunityAction;
711
+ mainProtocolId: string | null;
712
+ tvl: number;
713
+ apr: number;
714
+ nativeApr: number | null;
715
+ maxApr: number | null;
716
+ dailyRewards: number;
717
+ tags: string[];
718
+ lastCampaignCreatedAt: Date;
719
+ manualOverrides: import("@package/databases").OpportunityManualOverride[];
720
+ liveCampaigns: number;
721
+ hidden: boolean;
722
+ });
723
+ tvl: {
724
+ breakdowns: ({
696
725
  identifier: string;
697
726
  type: import("@package/databases").TvlType;
698
727
  value: number;
699
- }[];
700
- } & {
701
- id: string;
728
+ } & {})[];
702
729
  timestamp: bigint;
703
730
  total: number;
704
- opportunityId: string;
705
- })[];
706
- } & {
707
- id: string;
708
- chainId: number;
709
- type: string;
710
- identifier: string;
711
- name: string;
712
- description: string;
713
- howToSteps: string[];
714
- depositUrl: string | null;
715
- explorerAddress: string | null;
716
- status: import("@package/databases").Status;
717
- action: import("@package/databases").OpportunityAction;
718
- mainProtocolId: string | null;
719
- tvl: number;
720
- apr: number;
721
- nativeApr: number | null;
722
- maxApr: number | null;
723
- dailyRewards: number;
724
- tags: string[];
725
- lastCampaignCreatedAt: Date;
726
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
727
- liveCampaigns: number;
728
- });
729
- tvl: {
730
- breakdowns: ({
731
- identifier: string;
732
- type: import("@package/databases").TvlType;
733
- value: number;
734
- } & {})[];
735
- timestamp: bigint;
736
- total: number;
737
- } & {};
738
- name?: undefined;
739
- }>>;
740
- static analyseSafe(body: SafeFileModel): Promise<Record<string, {
741
- message: string;
742
- name: string;
743
- campaign?: undefined;
744
- opportunity?: undefined;
745
- tvl?: undefined;
746
- } | {
747
- message?: undefined;
748
- campaign: import("@package/resources/schemas").EngineCampaign<CampaignType>;
749
- opportunity: ({
750
- chainId: number;
751
- type: string;
752
- identifier: string;
753
- name?: string | undefined;
754
- status: "LIVE" | "NONE" | "PAST" | "SOON";
755
- action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
756
- description?: string | undefined;
757
- howToSteps?: string[] | undefined;
758
- tokens: {
759
- address: string;
731
+ } & {};
732
+ }>;
733
+ errors: {
734
+ campaignId: string;
735
+ error: string;
736
+ }[];
737
+ }>;
738
+ static analyseSafe(body: SafeFileModel): Promise<{
739
+ campaigns: Record<string, {
740
+ config: import("@package/resources/schemas").ExtendedConfig<CampaignType>;
741
+ campaign: import("@package/resources/schemas").EngineCampaign<CampaignType.INVALID> | import("@package/resources/schemas").EngineCampaign<CampaignType>;
742
+ opportunity: ({
760
743
  chainId: number;
761
- }[];
762
- protocols?: string[] | undefined;
763
- mainProtocol?: string | undefined;
764
- depositUrl?: string | undefined;
765
- explorerAddress?: string | undefined;
766
- tags?: string[] | undefined;
767
- } & {
768
- id: string;
769
- }) | ({
770
- ActivePrograms: {
771
- icon: string;
772
- id: string;
773
- name: string;
774
- slug: string | null;
775
- }[];
776
- AprRecords: ({
777
- AprBreakdown: {
778
- identifier: string;
779
- timestamp: bigint;
780
- type: import("@package/databases").AprType;
781
- value: number;
744
+ type: string;
745
+ identifier: string;
746
+ name?: string | undefined;
747
+ status: "LIVE" | "NONE" | "PAST" | "SOON";
748
+ action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
749
+ description?: string | undefined;
750
+ howToSteps?: string[] | undefined;
751
+ tokens: {
752
+ address: string;
753
+ chainId: number;
782
754
  }[];
755
+ protocols?: string[] | undefined;
756
+ mainProtocol?: string | undefined;
757
+ depositUrl?: string | undefined;
758
+ explorerAddress?: string | undefined;
759
+ tags?: string[] | undefined;
783
760
  } & {
784
761
  id: string;
785
- timestamp: bigint;
786
- cumulated: number;
787
- opportunityId: string;
788
- })[];
789
- Campaigns: {
790
- id: string;
791
- computeChainId: number;
792
- distributionChainId: number;
793
- campaignId: string;
794
- type: string;
795
- distributionType: import("@package/databases").DistributionType;
796
- subType: number | null;
797
- rewardTokenId: string;
798
- amount: string;
799
- opportunityId: string;
800
- startTimestamp: bigint;
801
- endTimestamp: bigint;
802
- params: import("@prisma/client/runtime/client").JsonValue;
803
- description: string | null;
804
- dailyRewards: number;
805
- apr: number;
806
- creatorAddress: string;
807
- manualOverrides: import("@package/databases").CampaignManualOverride[];
808
- createdAt: Date;
809
- rootCampaignId: string | null;
810
- parentCampaignId: string | null;
811
- }[];
812
- Chain: {
813
- id: number;
814
- name: string;
815
- icon: string;
816
- liveCampaigns: number;
817
- endOfDisputePeriod: number;
818
- };
819
- DailyRewardsRecords: ({
820
- DailyRewardsBreakdown: ({
821
- Campaign: {
822
- CampaignStatus: {
762
+ }) | ({
763
+ ActivePrograms: {
764
+ icon: string;
765
+ id: string;
766
+ name: string;
767
+ slug: string | null;
768
+ }[];
769
+ AprRecords: ({
770
+ AprBreakdown: {
771
+ identifier: string;
772
+ timestamp: bigint;
773
+ type: import("@package/databases").AprType;
774
+ value: number;
775
+ }[];
776
+ } & {
777
+ id: string;
778
+ timestamp: bigint;
779
+ cumulated: number;
780
+ opportunityId: string;
781
+ })[];
782
+ Campaigns: {
783
+ id: string;
784
+ computeChainId: number;
785
+ distributionChainId: number;
786
+ campaignId: string;
787
+ type: string;
788
+ distributionType: import("@package/databases").DistributionType;
789
+ subType: number | null;
790
+ rewardTokenId: string;
791
+ amount: string;
792
+ opportunityId: string;
793
+ startTimestamp: bigint;
794
+ endTimestamp: bigint;
795
+ params: import("@prisma/client/runtime/client").JsonValue;
796
+ description: string | null;
797
+ pauseCompute: boolean;
798
+ dailyRewards: number;
799
+ apr: number;
800
+ creatorAddress: string;
801
+ manualOverrides: import("@package/databases").CampaignManualOverride[];
802
+ createdAt: Date;
803
+ rootCampaignId: string | null;
804
+ parentCampaignId: string | null;
805
+ }[];
806
+ Chain: {
807
+ id: number;
808
+ name: string;
809
+ icon: string;
810
+ liveCampaigns: number;
811
+ endOfDisputePeriod: number;
812
+ };
813
+ DailyRewardsRecords: ({
814
+ DailyRewardsBreakdown: ({
815
+ Campaign: {
816
+ CampaignStatus: {
817
+ campaignId: string;
818
+ computedUntil: bigint;
819
+ processingStarted: bigint;
820
+ status: import("@package/databases").RunStatus;
821
+ preComputeStatus: import("@package/databases").RunStatus;
822
+ preComputeProcessingStarted: bigint;
823
+ error: string;
824
+ details: import("@prisma/client/runtime/client").JsonValue;
825
+ }[];
826
+ RewardToken: {
827
+ id: string;
828
+ name: string | null;
829
+ chainId: number;
830
+ address: string;
831
+ decimals: number;
832
+ symbol: string;
833
+ displaySymbol: string;
834
+ icon: string;
835
+ verified: boolean;
836
+ isTest: boolean;
837
+ type: import("@package/databases").TokenType;
838
+ isNative: boolean;
839
+ price: number | null;
840
+ updatedAt: number | null;
841
+ priceSource: string | null;
842
+ };
843
+ amount: string;
823
844
  campaignId: string;
824
- computedUntil: bigint;
825
- processingStarted: bigint;
826
- status: import("@package/databases").RunStatus;
827
- preComputeStatus: import("@package/databases").RunStatus;
828
- preComputeProcessingStarted: bigint;
829
- error: string;
830
- details: import("@prisma/client/runtime/client").JsonValue;
831
- }[];
832
- RewardToken: {
833
- id: string;
834
- name: string | null;
835
- chainId: number;
836
- address: string;
837
- decimals: number;
838
- symbol: string;
839
- displaySymbol: string;
840
- icon: string;
841
- verified: boolean;
842
- isTest: boolean;
843
- type: import("@package/databases").TokenType;
844
- isNative: boolean;
845
- price: number | null;
846
- updatedAt: number | null;
847
- priceSource: string | null;
845
+ distributionType: import("@package/databases").DistributionType;
846
+ endTimestamp: bigint;
847
+ startTimestamp: bigint;
848
848
  };
849
- amount: string;
849
+ } & {
850
+ id: string;
851
+ value: number;
852
+ timestamp: bigint;
850
853
  campaignId: string;
851
- distributionType: import("@package/databases").DistributionType;
852
- endTimestamp: bigint;
853
- startTimestamp: bigint;
854
- };
854
+ dailyRewardsRecordId: string;
855
+ })[];
855
856
  } & {
856
857
  id: string;
857
- value: number;
858
858
  timestamp: bigint;
859
- campaignId: string;
860
- dailyRewardsRecordId: string;
859
+ total: number;
860
+ opportunityId: string;
861
861
  })[];
862
- } & {
863
- id: string;
864
- timestamp: bigint;
865
- total: number;
866
- opportunityId: string;
867
- })[];
868
- MainProtocol: {
869
- id: string;
870
- tags: string[];
871
- name: string;
872
- description: string;
873
- url: string;
874
- icon: string;
875
- banner: string | null;
876
- opportunityBannerLight: string | null;
877
- opportunityBannerDark: string | null;
878
- } | null;
879
- NativeAprRecords: ({
880
- RewardToken: {
862
+ MainProtocol: {
863
+ id: string;
864
+ tags: string[];
865
+ name: string;
866
+ description: string;
867
+ url: string;
868
+ icon: string;
869
+ banner: string | null;
870
+ opportunityBannerLight: string | null;
871
+ opportunityBannerDark: string | null;
872
+ } | null;
873
+ NativeAprRecords: ({
874
+ RewardToken: {
875
+ id: string;
876
+ name: string | null;
877
+ chainId: number;
878
+ address: string;
879
+ decimals: number;
880
+ symbol: string;
881
+ displaySymbol: string;
882
+ icon: string;
883
+ verified: boolean;
884
+ isTest: boolean;
885
+ type: import("@package/databases").TokenType;
886
+ isNative: boolean;
887
+ price: number | null;
888
+ updatedAt: number | null;
889
+ priceSource: string | null;
890
+ } | null;
891
+ } & {
892
+ id: string;
893
+ title: string;
894
+ description: string | null;
895
+ timestamp: bigint;
896
+ value: number;
897
+ amount: bigint | null;
898
+ rewardTokenId: string | null;
899
+ opportunityId: string;
900
+ })[];
901
+ Protocols: {
902
+ id: string;
903
+ tags: string[];
904
+ name: string;
905
+ description: string;
906
+ url: string;
907
+ icon: string;
908
+ banner: string | null;
909
+ opportunityBannerLight: string | null;
910
+ opportunityBannerDark: string | null;
911
+ }[];
912
+ Tokens: {
881
913
  id: string;
882
914
  name: string | null;
883
915
  chainId: number;
@@ -893,91 +925,58 @@ export declare class PayloadService {
893
925
  price: number | null;
894
926
  updatedAt: number | null;
895
927
  priceSource: string | null;
896
- } | null;
928
+ }[];
929
+ TvlRecords: ({
930
+ TvlBreakdown: {
931
+ identifier: string;
932
+ type: import("@package/databases").TvlType;
933
+ value: number;
934
+ }[];
935
+ } & {
936
+ id: string;
937
+ timestamp: bigint;
938
+ total: number;
939
+ opportunityId: string;
940
+ })[];
897
941
  } & {
898
942
  id: string;
899
- title: string;
900
- description: string | null;
901
- timestamp: bigint;
902
- value: number;
903
- amount: bigint | null;
904
- rewardTokenId: string | null;
905
- opportunityId: string;
906
- })[];
907
- Protocols: {
908
- id: string;
909
- tags: string[];
943
+ chainId: number;
944
+ type: string;
945
+ identifier: string;
910
946
  name: string;
911
947
  description: string;
912
- url: string;
913
- icon: string;
914
- banner: string | null;
915
- opportunityBannerLight: string | null;
916
- opportunityBannerDark: string | null;
917
- }[];
918
- Tokens: {
919
- id: string;
920
- name: string | null;
921
- chainId: number;
922
- address: string;
923
- decimals: number;
924
- symbol: string;
925
- displaySymbol: string;
926
- icon: string;
927
- verified: boolean;
928
- isTest: boolean;
929
- type: import("@package/databases").TokenType;
930
- isNative: boolean;
931
- price: number | null;
932
- updatedAt: number | null;
933
- priceSource: string | null;
934
- }[];
935
- TvlRecords: ({
936
- TvlBreakdown: {
948
+ howToSteps: string[];
949
+ depositUrl: string | null;
950
+ explorerAddress: string | null;
951
+ status: import("@package/databases").Status;
952
+ action: import("@package/databases").OpportunityAction;
953
+ mainProtocolId: string | null;
954
+ tvl: number;
955
+ apr: number;
956
+ nativeApr: number | null;
957
+ maxApr: number | null;
958
+ dailyRewards: number;
959
+ tags: string[];
960
+ lastCampaignCreatedAt: Date;
961
+ manualOverrides: import("@package/databases").OpportunityManualOverride[];
962
+ liveCampaigns: number;
963
+ hidden: boolean;
964
+ });
965
+ tvl: {
966
+ breakdowns: ({
937
967
  identifier: string;
938
968
  type: import("@package/databases").TvlType;
939
969
  value: number;
940
- }[];
941
- } & {
942
- id: string;
970
+ } & {})[];
943
971
  timestamp: bigint;
944
972
  total: number;
945
- opportunityId: string;
946
- })[];
947
- } & {
948
- id: string;
949
- chainId: number;
950
- type: string;
951
- identifier: string;
952
- name: string;
953
- description: string;
954
- howToSteps: string[];
955
- depositUrl: string | null;
956
- explorerAddress: string | null;
957
- status: import("@package/databases").Status;
958
- action: import("@package/databases").OpportunityAction;
959
- mainProtocolId: string | null;
960
- tvl: number;
961
- apr: number;
962
- nativeApr: number | null;
963
- maxApr: number | null;
964
- dailyRewards: number;
965
- tags: string[];
966
- lastCampaignCreatedAt: Date;
967
- manualOverrides: import("@package/databases").OpportunityManualOverride[];
968
- liveCampaigns: number;
969
- });
970
- tvl: {
971
- breakdowns: ({
972
- identifier: string;
973
- type: import("@package/databases").TvlType;
974
- value: number;
975
- } & {})[];
976
- timestamp: bigint;
977
- total: number;
978
- } & {};
979
- name?: undefined;
980
- }>>;
973
+ } & {};
974
+ }>;
975
+ errors: {
976
+ campaignId: string;
977
+ error: string;
978
+ }[];
979
+ }>;
981
980
  static checkMinimumAmount(rewardToken: string, tokenAmount: bigint, numberOfHours: bigint, distributionChainId: ChainId): Promise<boolean>;
982
981
  static getMinimumAmount(rewardToken: string, distributionChainId: ChainId): Promise<bigint>;
983
982
  }