@merkl/api 1.8.38 → 1.9.1
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.
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eden/index.d.ts +2000 -750
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.d.ts +0 -364
- package/dist/src/engine/deprecated/dynamicData/implementations/Erc20.js.map +1 -1
- package/dist/src/engine/deprecated/dynamicData/utils/getFixedApr.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/index.js.map +1 -1
- package/dist/src/engine/implementations/ErcMultiToken/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/FraxLend/metadataBorrow.d.ts +2 -2
- package/dist/src/engine/implementations/FraxLend/metadataCollateral.d.ts +1 -1
- package/dist/src/engine/implementations/FraxLend/tvlBorrow.d.ts +2 -2
- package/dist/src/engine/implementations/FraxLend/tvlCollateral.d.ts +2 -2
- package/dist/src/engine/implementations/StabullStaking/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/morphoBorrow/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/morphoBorrow/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/morphoCollateral/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/morphoCollateral/tvl.d.ts +2 -2
- package/dist/src/engine/implementations/morphoSupply/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/morphoSupply/tvl.d.ts +2 -2
- package/dist/src/engine/metadata/factory.js.map +1 -1
- package/dist/src/engine/tvl/factory.js.map +1 -1
- package/dist/src/index.d.ts +2063 -813
- package/dist/src/jobs/update-dynamic-data.js.map +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +448 -84
- package/dist/src/modules/v4/campaign/campaign.convertor.js.map +1 -1
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +10 -9
- package/dist/src/modules/v4/campaign/campaign.model.js.map +1 -1
- package/dist/src/modules/v4/campaign/campaign.query-transformer.d.ts +15 -15
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +36 -0
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +36 -0
- package/dist/src/modules/v4/campaign/campaign.service.js.map +1 -1
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +16 -0
- package/dist/src/modules/v4/campaignStatus/campaignStatus.model.d.ts +2 -1
- package/dist/src/modules/v4/campaignStatus/campaignStatus.model.js.map +1 -1
- package/dist/src/modules/v4/carousel/carousel.controller.d.ts +106 -84
- package/dist/src/modules/v4/carousel/carousel.repository.d.ts +24 -0
- package/dist/src/modules/v4/carousel/carousel.service.d.ts +84 -56
- package/dist/src/modules/v4/carousel/carousel.service.js.map +1 -1
- package/dist/src/modules/v4/config/config.controller.d.ts +4 -0
- package/dist/src/modules/v4/config/config.service.d.ts +4 -0
- package/dist/src/modules/v4/creator/creator.controller.d.ts +132 -16
- package/dist/src/modules/v4/creator/creator.model.d.ts +192 -19
- package/dist/src/modules/v4/creator/creator.service.d.ts +4 -0
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1183 -483
- package/dist/src/modules/v4/opportunity/opportunity.converter.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.formatter.d.ts +16 -0
- package/dist/src/modules/v4/opportunity/opportunity.formatter.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +483 -128
- package/dist/src/modules/v4/opportunity/opportunity.model.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.query-transformer.d.ts +4 -0
- package/dist/src/modules/v4/opportunity/opportunity.query-transformer.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +57 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js.map +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +687 -279
- package/dist/src/modules/v4/opportunity/opportunity.service.js.map +1 -1
- package/dist/src/modules/v4/payload/payload.controller.d.ts +12 -0
- package/dist/src/modules/v4/payload/payload.service.d.ts +16 -0
- package/dist/src/modules/v4/program/program.controller.d.ts +60 -56
- package/dist/src/modules/v4/program/program.repository.d.ts +16 -0
- package/dist/src/modules/v4/program/program.service.d.ts +60 -56
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +72 -27
- package/dist/src/modules/v4/programPayload/programPayload.repository.js.map +1 -1
- package/dist/src/modules/v4/programPayload/subPayloads/hypurrFi.js.map +1 -1
- package/dist/src/modules/v4/programPayload/subPayloads/nibiru.js.map +1 -1
- package/dist/src/modules/v4/reward/reward.repository.d.ts +12 -0
- package/dist/src/modules/v4/reward/reward.service.d.ts +67 -14
- package/dist/src/modules/v4/router.d.ts +2063 -813
- package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +30 -28
- package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +15 -14
- package/dist/src/modules/v4/user/user.controller.d.ts +25 -15
- package/dist/src/modules/v4/user/user.model.d.ts +2 -1
- package/dist/src/scripts/importOpportunities.js.map +1 -1
- package/dist/src/scripts/seed.js.map +1 -1
- package/dist/src/utils/getAPR.d.ts +78 -680
- package/dist/src/utils/parseDistributionType.d.ts +8 -610
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,11 @@ import type { OpportunityUpdateArgs } from "@package/databases";
|
|
|
2
2
|
import type { Prisma } from "@package/databases/api";
|
|
3
3
|
import { CampaignType, type ChainId, DistributionType, OpportunityAction, type OpportunityManualOverride, TokenType } from "@package/resources/enums";
|
|
4
4
|
import type { Protocol, Token } from "@package/resources/schemas";
|
|
5
|
+
import type { AprRecord } from "../../../modules/v4/apr/apr.model";
|
|
5
6
|
import type { AuthenticationOptions } from "../../../modules/v4/authentication/authentication.model";
|
|
6
7
|
import type { CampaignWithParams, FindCampaignModel } from "../../../modules/v4/campaign/campaign.model";
|
|
8
|
+
import type { DailyRewardsRecord } from "../../../modules/v4/reward/reward.model";
|
|
9
|
+
import type { TvlRecord } from "../../../modules/v4/tvl/tvl.model";
|
|
7
10
|
import type { UpdateTagsModel } from "../user/user.model";
|
|
8
11
|
import type { FindManyOpportunityModel, FindOpportunityOptionsModel, OpportunityOverrideModel, OpportunityResourceModel, OpportunityUnique, OpportunityWithCampaignsResourceModel } from "./opportunity.model";
|
|
9
12
|
export declare abstract class OpportunityService {
|
|
@@ -77,6 +80,10 @@ export declare abstract class OpportunityService {
|
|
|
77
80
|
lastCampaignCreatedAt: Date;
|
|
78
81
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
79
82
|
liveCampaigns: number;
|
|
83
|
+
earliestCampaignStart: bigint | null;
|
|
84
|
+
latestCampaignStart: bigint | null;
|
|
85
|
+
earliestCampaignEnd: bigint | null;
|
|
86
|
+
latestCampaignEnd: bigint | null;
|
|
80
87
|
hidden: boolean;
|
|
81
88
|
}>;
|
|
82
89
|
static deleteOverrides(id: string, overridesToDelete: OpportunityManualOverride[]): Promise<({
|
|
@@ -303,6 +310,10 @@ export declare abstract class OpportunityService {
|
|
|
303
310
|
lastCampaignCreatedAt: Date;
|
|
304
311
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
305
312
|
liveCampaigns: number;
|
|
313
|
+
earliestCampaignStart: bigint | null;
|
|
314
|
+
latestCampaignStart: bigint | null;
|
|
315
|
+
earliestCampaignEnd: bigint | null;
|
|
316
|
+
latestCampaignEnd: bigint | null;
|
|
306
317
|
hidden: boolean;
|
|
307
318
|
})>;
|
|
308
319
|
/**
|
|
@@ -534,6 +545,10 @@ export declare abstract class OpportunityService {
|
|
|
534
545
|
lastCampaignCreatedAt: Date;
|
|
535
546
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
536
547
|
liveCampaigns: number;
|
|
548
|
+
earliestCampaignStart: bigint | null;
|
|
549
|
+
latestCampaignStart: bigint | null;
|
|
550
|
+
earliestCampaignEnd: bigint | null;
|
|
551
|
+
latestCampaignEnd: bigint | null;
|
|
537
552
|
hidden: boolean;
|
|
538
553
|
})>;
|
|
539
554
|
/**
|
|
@@ -764,6 +779,10 @@ export declare abstract class OpportunityService {
|
|
|
764
779
|
lastCampaignCreatedAt: Date;
|
|
765
780
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
766
781
|
liveCampaigns: number;
|
|
782
|
+
earliestCampaignStart: bigint | null;
|
|
783
|
+
latestCampaignStart: bigint | null;
|
|
784
|
+
earliestCampaignEnd: bigint | null;
|
|
785
|
+
latestCampaignEnd: bigint | null;
|
|
767
786
|
hidden: boolean;
|
|
768
787
|
})>;
|
|
769
788
|
/**
|
|
@@ -788,166 +807,6 @@ export declare abstract class OpportunityService {
|
|
|
788
807
|
* @returns opportunities
|
|
789
808
|
*/
|
|
790
809
|
static findManyByCampaigns(query: FindCampaignModel, authOptions?: AuthenticationOptions): Promise<{
|
|
791
|
-
campaigns: CampaignWithParams[];
|
|
792
|
-
action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
|
|
793
|
-
activePrograms: {
|
|
794
|
-
id: string;
|
|
795
|
-
name: string;
|
|
796
|
-
slug?: string | null | undefined;
|
|
797
|
-
description?: string | undefined;
|
|
798
|
-
icon?: string | undefined;
|
|
799
|
-
}[];
|
|
800
|
-
apr: number;
|
|
801
|
-
aprRecord?: {
|
|
802
|
-
id?: string | undefined;
|
|
803
|
-
timestamp: string | bigint;
|
|
804
|
-
cumulated: number;
|
|
805
|
-
opportunityId?: string | undefined;
|
|
806
|
-
breakdowns: {
|
|
807
|
-
identifier: string;
|
|
808
|
-
type: string;
|
|
809
|
-
value: number;
|
|
810
|
-
timestamp: string | bigint;
|
|
811
|
-
distributionType?: string | undefined;
|
|
812
|
-
}[];
|
|
813
|
-
} | undefined;
|
|
814
|
-
chain: {
|
|
815
|
-
id: number;
|
|
816
|
-
name: string;
|
|
817
|
-
icon: string;
|
|
818
|
-
liveCampaigns: number;
|
|
819
|
-
endOfDisputePeriod: number;
|
|
820
|
-
explorers?: {
|
|
821
|
-
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
822
|
-
url: string;
|
|
823
|
-
chainId: number;
|
|
824
|
-
}[] | undefined;
|
|
825
|
-
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
826
|
-
};
|
|
827
|
-
chainId: number;
|
|
828
|
-
dailyRewards: number;
|
|
829
|
-
depositUrl?: string | undefined;
|
|
830
|
-
description: string;
|
|
831
|
-
distributionType?: string | undefined;
|
|
832
|
-
explorerAddress?: string | undefined;
|
|
833
|
-
hidden?: boolean | undefined;
|
|
834
|
-
howToSteps: string[];
|
|
835
|
-
id: string;
|
|
836
|
-
identifier: string;
|
|
837
|
-
lastCampaignCreatedAt: number;
|
|
838
|
-
liveCampaigns: number;
|
|
839
|
-
liveCampaignsForCreator?: number | undefined;
|
|
840
|
-
mainProtocol?: string | undefined;
|
|
841
|
-
maxApr?: number | null | undefined;
|
|
842
|
-
name: string;
|
|
843
|
-
nativeApr?: number | undefined;
|
|
844
|
-
nativeAprRecord?: {
|
|
845
|
-
id?: string | undefined;
|
|
846
|
-
title: string;
|
|
847
|
-
description?: string | undefined;
|
|
848
|
-
timestamp: string | number | bigint;
|
|
849
|
-
value: number;
|
|
850
|
-
amount?: string | number | bigint | undefined;
|
|
851
|
-
rewardTokenId?: string | undefined;
|
|
852
|
-
opportunityId?: string | undefined;
|
|
853
|
-
rewardToken?: {
|
|
854
|
-
id: string;
|
|
855
|
-
name: string | null;
|
|
856
|
-
chainId: number;
|
|
857
|
-
address: string;
|
|
858
|
-
decimals: number;
|
|
859
|
-
symbol: string;
|
|
860
|
-
icon: string;
|
|
861
|
-
verified: boolean;
|
|
862
|
-
isNative: boolean;
|
|
863
|
-
isTest: boolean;
|
|
864
|
-
type: "POINT" | "PRETGE" | "TOKEN";
|
|
865
|
-
price?: number | null | undefined;
|
|
866
|
-
updatedAt?: number | null | undefined;
|
|
867
|
-
priceSource?: string | null | undefined;
|
|
868
|
-
displaySymbol?: string | undefined;
|
|
869
|
-
} | undefined;
|
|
870
|
-
} | undefined;
|
|
871
|
-
protocol?: {
|
|
872
|
-
id: string;
|
|
873
|
-
name: string;
|
|
874
|
-
icon: string;
|
|
875
|
-
tags: string[];
|
|
876
|
-
description: string;
|
|
877
|
-
url: string;
|
|
878
|
-
dailyRewards?: number | undefined;
|
|
879
|
-
numberOfLiveCampaigns?: number | undefined;
|
|
880
|
-
opportunityLiveTags?: string[] | undefined;
|
|
881
|
-
banner: string | null;
|
|
882
|
-
opportunityBannerLight: string | null;
|
|
883
|
-
opportunityBannerDark: string | null;
|
|
884
|
-
} | null | undefined;
|
|
885
|
-
protocols?: string[] | undefined;
|
|
886
|
-
rewardsRecord?: {
|
|
887
|
-
total: number;
|
|
888
|
-
timestamp: string | bigint;
|
|
889
|
-
breakdowns: {
|
|
890
|
-
campaignId: string;
|
|
891
|
-
value: number;
|
|
892
|
-
timestamp: string | bigint;
|
|
893
|
-
token: {
|
|
894
|
-
id: string;
|
|
895
|
-
name: string | null;
|
|
896
|
-
chainId: number;
|
|
897
|
-
address: string;
|
|
898
|
-
decimals: number;
|
|
899
|
-
symbol: string;
|
|
900
|
-
icon: string;
|
|
901
|
-
verified: boolean;
|
|
902
|
-
isNative: boolean;
|
|
903
|
-
isTest: boolean;
|
|
904
|
-
type: "POINT" | "PRETGE" | "TOKEN";
|
|
905
|
-
price?: number | null | undefined;
|
|
906
|
-
updatedAt?: number | null | undefined;
|
|
907
|
-
priceSource?: string | null | undefined;
|
|
908
|
-
displaySymbol?: string | undefined;
|
|
909
|
-
};
|
|
910
|
-
amount: string | bigint;
|
|
911
|
-
distributionType?: string | undefined;
|
|
912
|
-
onChainCampaignId?: string | undefined;
|
|
913
|
-
}[];
|
|
914
|
-
} | undefined;
|
|
915
|
-
status: "LIVE" | "NONE" | "PAST" | "SOON";
|
|
916
|
-
tags: string[];
|
|
917
|
-
tokens: {
|
|
918
|
-
id: string;
|
|
919
|
-
name: string | null;
|
|
920
|
-
chainId: number;
|
|
921
|
-
address: string;
|
|
922
|
-
decimals: number;
|
|
923
|
-
symbol: string;
|
|
924
|
-
icon: string;
|
|
925
|
-
verified: boolean;
|
|
926
|
-
isNative: boolean;
|
|
927
|
-
isTest: boolean;
|
|
928
|
-
type: "POINT" | "PRETGE" | "TOKEN";
|
|
929
|
-
price?: number | null | undefined;
|
|
930
|
-
updatedAt?: number | null | undefined;
|
|
931
|
-
priceSource?: string | null | undefined;
|
|
932
|
-
displaySymbol?: string | undefined;
|
|
933
|
-
}[];
|
|
934
|
-
tvl: number;
|
|
935
|
-
tvlRecord?: {
|
|
936
|
-
id?: string | undefined;
|
|
937
|
-
timestamp: string | number | bigint;
|
|
938
|
-
total: number;
|
|
939
|
-
opportunityId?: string | undefined;
|
|
940
|
-
breakdowns?: any[] | undefined;
|
|
941
|
-
} | undefined;
|
|
942
|
-
type: string;
|
|
943
|
-
}[]>;
|
|
944
|
-
static findUniqueOrThrow(opportunityId: string | OpportunityUnique, options: FindOpportunityOptionsModel, authOptions?: AuthenticationOptions): Promise<OpportunityResourceModel | OpportunityWithCampaignsResourceModel>;
|
|
945
|
-
/**
|
|
946
|
-
* Get the list of opportunities satisfying the query
|
|
947
|
-
* @param query
|
|
948
|
-
* @returns A list of opportunities
|
|
949
|
-
*/
|
|
950
|
-
static findMany(query: FindManyOpportunityModel, authOptions?: AuthenticationOptions): Promise<{
|
|
951
810
|
id: string;
|
|
952
811
|
type: string;
|
|
953
812
|
identifier: string;
|
|
@@ -968,6 +827,10 @@ export declare abstract class OpportunityService {
|
|
|
968
827
|
dailyRewards: number;
|
|
969
828
|
liveCampaigns: number;
|
|
970
829
|
lastCampaignCreatedAt: number;
|
|
830
|
+
earliestCampaignStart?: string | bigint | undefined;
|
|
831
|
+
latestCampaignStart?: string | bigint | undefined;
|
|
832
|
+
earliestCampaignEnd?: string | bigint | undefined;
|
|
833
|
+
latestCampaignEnd?: string | bigint | undefined;
|
|
971
834
|
nativeApr?: number | undefined;
|
|
972
835
|
maxApr?: number | null | undefined;
|
|
973
836
|
liveCampaignsForCreator?: number | undefined;
|
|
@@ -1024,27 +887,22 @@ export declare abstract class OpportunityService {
|
|
|
1024
887
|
opportunityBannerDark: string | null;
|
|
1025
888
|
} | null | undefined;
|
|
1026
889
|
aprRecord?: {
|
|
1027
|
-
id?: string | undefined;
|
|
1028
|
-
timestamp: string | bigint;
|
|
1029
890
|
cumulated: number;
|
|
1030
|
-
|
|
891
|
+
timestamp: string | bigint;
|
|
1031
892
|
breakdowns: {
|
|
1032
893
|
identifier: string;
|
|
1033
|
-
type:
|
|
894
|
+
type: "CAMPAIGN" | "PROTOCOL" | "TOKEN";
|
|
1034
895
|
value: number;
|
|
1035
896
|
timestamp: string | bigint;
|
|
1036
|
-
distributionType?:
|
|
897
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1037
898
|
}[];
|
|
1038
899
|
} | undefined;
|
|
1039
900
|
nativeAprRecord?: {
|
|
1040
|
-
id?: string | undefined;
|
|
1041
901
|
title: string;
|
|
1042
902
|
description?: string | undefined;
|
|
1043
|
-
timestamp: string | number | bigint;
|
|
1044
903
|
value: number;
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
opportunityId?: string | undefined;
|
|
904
|
+
timestamp: string | bigint;
|
|
905
|
+
amount?: bigint | undefined;
|
|
1048
906
|
rewardToken?: {
|
|
1049
907
|
id: string;
|
|
1050
908
|
name: string | null;
|
|
@@ -1064,11 +922,13 @@ export declare abstract class OpportunityService {
|
|
|
1064
922
|
} | undefined;
|
|
1065
923
|
} | undefined;
|
|
1066
924
|
tvlRecord?: {
|
|
1067
|
-
id?: string | undefined;
|
|
1068
|
-
timestamp: string | number | bigint;
|
|
1069
925
|
total: number;
|
|
1070
|
-
|
|
1071
|
-
breakdowns
|
|
926
|
+
timestamp: string | bigint;
|
|
927
|
+
breakdowns: {
|
|
928
|
+
identifier: string;
|
|
929
|
+
type: "PROTOCOL" | "TOKEN";
|
|
930
|
+
value: number;
|
|
931
|
+
}[];
|
|
1072
932
|
} | undefined;
|
|
1073
933
|
rewardsRecord?: {
|
|
1074
934
|
total: number;
|
|
@@ -1095,12 +955,129 @@ export declare abstract class OpportunityService {
|
|
|
1095
955
|
displaySymbol?: string | undefined;
|
|
1096
956
|
};
|
|
1097
957
|
amount: string | bigint;
|
|
1098
|
-
distributionType?:
|
|
958
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1099
959
|
onChainCampaignId?: string | undefined;
|
|
1100
960
|
}[];
|
|
1101
961
|
} | undefined;
|
|
1102
|
-
campaigns
|
|
1103
|
-
|
|
962
|
+
campaigns: {
|
|
963
|
+
id: string;
|
|
964
|
+
computeChainId: number;
|
|
965
|
+
distributionChainId: number;
|
|
966
|
+
campaignId: string;
|
|
967
|
+
type: string;
|
|
968
|
+
subType?: number | null | undefined;
|
|
969
|
+
amount: string;
|
|
970
|
+
startTimestamp: string | number | bigint;
|
|
971
|
+
endTimestamp: string | number | bigint;
|
|
972
|
+
creatorAddress: string;
|
|
973
|
+
apr?: number | undefined;
|
|
974
|
+
dailyRewards?: number | undefined;
|
|
975
|
+
creator?: {
|
|
976
|
+
address: string;
|
|
977
|
+
tags?: string[] | undefined;
|
|
978
|
+
creatorId?: string | null | undefined;
|
|
979
|
+
} | undefined;
|
|
980
|
+
params: unknown;
|
|
981
|
+
description?: string | undefined;
|
|
982
|
+
chain: {
|
|
983
|
+
id: number;
|
|
984
|
+
name: string;
|
|
985
|
+
icon: string;
|
|
986
|
+
liveCampaigns: number;
|
|
987
|
+
endOfDisputePeriod: number;
|
|
988
|
+
explorers?: {
|
|
989
|
+
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
990
|
+
url: string;
|
|
991
|
+
chainId: number;
|
|
992
|
+
}[] | undefined;
|
|
993
|
+
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
994
|
+
};
|
|
995
|
+
rewardTokenId?: string | undefined;
|
|
996
|
+
rewardToken: {
|
|
997
|
+
id: string;
|
|
998
|
+
name: string | null;
|
|
999
|
+
chainId: number;
|
|
1000
|
+
address: string;
|
|
1001
|
+
decimals: number;
|
|
1002
|
+
symbol: string;
|
|
1003
|
+
icon: string;
|
|
1004
|
+
verified: boolean;
|
|
1005
|
+
isNative: boolean;
|
|
1006
|
+
isTest: boolean;
|
|
1007
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1008
|
+
price?: number | null | undefined;
|
|
1009
|
+
updatedAt?: number | null | undefined;
|
|
1010
|
+
priceSource?: string | null | undefined;
|
|
1011
|
+
displaySymbol?: string | undefined;
|
|
1012
|
+
};
|
|
1013
|
+
opportunityId?: string | undefined;
|
|
1014
|
+
distributionChain?: {
|
|
1015
|
+
id: number;
|
|
1016
|
+
name: string;
|
|
1017
|
+
icon: string;
|
|
1018
|
+
liveCampaigns: number;
|
|
1019
|
+
endOfDisputePeriod: number;
|
|
1020
|
+
explorers?: {
|
|
1021
|
+
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
1022
|
+
url: string;
|
|
1023
|
+
chainId: number;
|
|
1024
|
+
}[] | undefined;
|
|
1025
|
+
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
1026
|
+
} | undefined;
|
|
1027
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1028
|
+
campaignStatus: {
|
|
1029
|
+
campaignId: string;
|
|
1030
|
+
computedUntil: string | number;
|
|
1031
|
+
processingStarted: string | number;
|
|
1032
|
+
status: string;
|
|
1033
|
+
preComputeProcessingStarted: string | number;
|
|
1034
|
+
preComputeStatus: string;
|
|
1035
|
+
delay?: number | undefined;
|
|
1036
|
+
error?: string | undefined;
|
|
1037
|
+
details?: unknown;
|
|
1038
|
+
};
|
|
1039
|
+
createdAt: string;
|
|
1040
|
+
rootCampaignId?: string | null | undefined;
|
|
1041
|
+
parentCampaignId?: string | null | undefined;
|
|
1042
|
+
childCampaignIds?: string[] | undefined;
|
|
1043
|
+
dailyRewardsBreakdown?: {
|
|
1044
|
+
campaignId: string;
|
|
1045
|
+
value: number;
|
|
1046
|
+
timestamp: string | bigint;
|
|
1047
|
+
token: {
|
|
1048
|
+
id: string;
|
|
1049
|
+
name: string | null;
|
|
1050
|
+
chainId: number;
|
|
1051
|
+
address: string;
|
|
1052
|
+
decimals: number;
|
|
1053
|
+
symbol: string;
|
|
1054
|
+
icon: string;
|
|
1055
|
+
verified: boolean;
|
|
1056
|
+
isNative: boolean;
|
|
1057
|
+
isTest: boolean;
|
|
1058
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1059
|
+
price?: number | null | undefined;
|
|
1060
|
+
updatedAt?: number | null | undefined;
|
|
1061
|
+
priceSource?: string | null | undefined;
|
|
1062
|
+
displaySymbol?: string | undefined;
|
|
1063
|
+
};
|
|
1064
|
+
amount: string | bigint;
|
|
1065
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1066
|
+
onChainCampaignId?: string | undefined;
|
|
1067
|
+
}[] | undefined;
|
|
1068
|
+
pauseCompute?: string | null | undefined;
|
|
1069
|
+
hasOverrides?: boolean | undefined;
|
|
1070
|
+
isPrivate: boolean;
|
|
1071
|
+
campaignEncodingHash?: string | undefined;
|
|
1072
|
+
}[];
|
|
1073
|
+
}[]>;
|
|
1074
|
+
static findUniqueOrThrow(opportunityId: string | OpportunityUnique, options: FindOpportunityOptionsModel, authOptions?: AuthenticationOptions): Promise<OpportunityResourceModel | OpportunityWithCampaignsResourceModel>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Get the list of opportunities satisfying the query
|
|
1077
|
+
* @param query
|
|
1078
|
+
* @returns A list of opportunities
|
|
1079
|
+
*/
|
|
1080
|
+
static findMany(query: FindManyOpportunityModel, authOptions?: AuthenticationOptions): Promise<{
|
|
1104
1081
|
chainId: number;
|
|
1105
1082
|
type: string;
|
|
1106
1083
|
identifier: string;
|
|
@@ -1274,6 +1251,10 @@ export declare abstract class OpportunityService {
|
|
|
1274
1251
|
depositUrl: string | undefined;
|
|
1275
1252
|
explorerAddress: string | undefined;
|
|
1276
1253
|
lastCampaignCreatedAt: number;
|
|
1254
|
+
earliestCampaignStart: bigint | undefined;
|
|
1255
|
+
latestCampaignStart: bigint | undefined;
|
|
1256
|
+
earliestCampaignEnd: bigint | undefined;
|
|
1257
|
+
latestCampaignEnd: bigint | undefined;
|
|
1277
1258
|
};
|
|
1278
1259
|
})[] | undefined;
|
|
1279
1260
|
liveCampaignsForCreator?: any;
|
|
@@ -1330,44 +1311,108 @@ export declare abstract class OpportunityService {
|
|
|
1330
1311
|
depositUrl: string | undefined;
|
|
1331
1312
|
explorerAddress: string | undefined;
|
|
1332
1313
|
lastCampaignCreatedAt: number;
|
|
1333
|
-
|
|
1334
|
-
|
|
1314
|
+
earliestCampaignStart: bigint | undefined;
|
|
1315
|
+
latestCampaignStart: bigint | undefined;
|
|
1316
|
+
earliestCampaignEnd: bigint | undefined;
|
|
1317
|
+
latestCampaignEnd: bigint | undefined;
|
|
1318
|
+
}[] | ({
|
|
1319
|
+
id: string;
|
|
1335
1320
|
type: string;
|
|
1336
1321
|
identifier: string;
|
|
1322
|
+
chainId: number;
|
|
1337
1323
|
name: string;
|
|
1338
1324
|
description: string;
|
|
1339
1325
|
howToSteps: string[];
|
|
1340
|
-
status:
|
|
1341
|
-
action:
|
|
1342
|
-
tvl: number;
|
|
1343
|
-
apr: number;
|
|
1344
|
-
maxApr: number | null;
|
|
1345
|
-
dailyRewards: number;
|
|
1326
|
+
status: "LIVE" | "NONE" | "PAST" | "SOON";
|
|
1327
|
+
action: "BORROW" | "DROP" | "HOLD" | "INVALID" | "LEND" | "LONG" | "POOL" | "SHORT" | "STAKE" | "SWAP";
|
|
1346
1328
|
tags: string[];
|
|
1347
|
-
|
|
1348
|
-
|
|
1329
|
+
protocols?: string[] | undefined;
|
|
1330
|
+
mainProtocol?: string | undefined;
|
|
1331
|
+
depositUrl?: string | undefined;
|
|
1332
|
+
explorerAddress?: string | undefined;
|
|
1333
|
+
hidden?: boolean | undefined;
|
|
1334
|
+
tvl: number;
|
|
1335
|
+
apr: number;
|
|
1336
|
+
dailyRewards: number;
|
|
1337
|
+
liveCampaigns: number;
|
|
1338
|
+
lastCampaignCreatedAt: number;
|
|
1339
|
+
earliestCampaignStart?: string | bigint | undefined;
|
|
1340
|
+
latestCampaignStart?: string | bigint | undefined;
|
|
1341
|
+
earliestCampaignEnd?: string | bigint | undefined;
|
|
1342
|
+
latestCampaignEnd?: string | bigint | undefined;
|
|
1343
|
+
nativeApr?: number | undefined;
|
|
1344
|
+
maxApr?: number | null | undefined;
|
|
1345
|
+
liveCampaignsForCreator?: number | undefined;
|
|
1346
|
+
distributionType?: string | undefined;
|
|
1347
|
+
tokens: {
|
|
1348
|
+
id: string;
|
|
1349
|
+
name: string | null;
|
|
1350
|
+
chainId: number;
|
|
1351
|
+
address: string;
|
|
1352
|
+
decimals: number;
|
|
1353
|
+
symbol: string;
|
|
1354
|
+
icon: string;
|
|
1355
|
+
verified: boolean;
|
|
1356
|
+
isNative: boolean;
|
|
1357
|
+
isTest: boolean;
|
|
1358
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1359
|
+
price?: number | null | undefined;
|
|
1360
|
+
updatedAt?: number | null | undefined;
|
|
1361
|
+
priceSource?: string | null | undefined;
|
|
1362
|
+
displaySymbol?: string | undefined;
|
|
1363
|
+
}[];
|
|
1364
|
+
chain: {
|
|
1365
|
+
id: number;
|
|
1366
|
+
name: string;
|
|
1367
|
+
icon: string;
|
|
1368
|
+
liveCampaigns: number;
|
|
1369
|
+
endOfDisputePeriod: number;
|
|
1370
|
+
explorers?: {
|
|
1371
|
+
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
1372
|
+
url: string;
|
|
1373
|
+
chainId: number;
|
|
1374
|
+
}[] | undefined;
|
|
1375
|
+
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
1376
|
+
};
|
|
1377
|
+
activePrograms: {
|
|
1378
|
+
id: string;
|
|
1379
|
+
name: string;
|
|
1380
|
+
slug?: string | null | undefined;
|
|
1381
|
+
description?: string | undefined;
|
|
1382
|
+
icon?: string | undefined;
|
|
1383
|
+
}[];
|
|
1384
|
+
protocol?: {
|
|
1385
|
+
id: string;
|
|
1386
|
+
name: string;
|
|
1387
|
+
icon: string;
|
|
1388
|
+
tags: string[];
|
|
1389
|
+
description: string;
|
|
1390
|
+
url: string;
|
|
1391
|
+
dailyRewards?: number | undefined;
|
|
1392
|
+
numberOfLiveCampaigns?: number | undefined;
|
|
1393
|
+
opportunityLiveTags?: string[] | undefined;
|
|
1394
|
+
banner: string | null;
|
|
1395
|
+
opportunityBannerLight: string | null;
|
|
1396
|
+
opportunityBannerDark: string | null;
|
|
1397
|
+
} | null | undefined;
|
|
1398
|
+
aprRecord?: {
|
|
1349
1399
|
cumulated: number;
|
|
1350
|
-
timestamp: bigint;
|
|
1351
|
-
breakdowns:
|
|
1352
|
-
distributionType: import("@package/databases").DistributionType;
|
|
1353
|
-
identifier: string;
|
|
1354
|
-
type: "CAMPAIGN";
|
|
1355
|
-
timestamp: bigint;
|
|
1356
|
-
value: number;
|
|
1357
|
-
} | {
|
|
1400
|
+
timestamp: string | bigint;
|
|
1401
|
+
breakdowns: {
|
|
1358
1402
|
identifier: string;
|
|
1359
|
-
type:
|
|
1360
|
-
timestamp: bigint;
|
|
1403
|
+
type: "CAMPAIGN" | "PROTOCOL" | "TOKEN";
|
|
1361
1404
|
value: number;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1405
|
+
timestamp: string | bigint;
|
|
1406
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1407
|
+
}[];
|
|
1408
|
+
} | undefined;
|
|
1409
|
+
nativeAprRecord?: {
|
|
1365
1410
|
title: string;
|
|
1366
|
-
description
|
|
1411
|
+
description?: string | undefined;
|
|
1367
1412
|
value: number;
|
|
1368
|
-
timestamp: bigint;
|
|
1369
|
-
amount
|
|
1370
|
-
rewardToken
|
|
1413
|
+
timestamp: string | bigint;
|
|
1414
|
+
amount?: bigint | undefined;
|
|
1415
|
+
rewardToken?: {
|
|
1371
1416
|
id: string;
|
|
1372
1417
|
name: string | null;
|
|
1373
1418
|
chainId: number;
|
|
@@ -1384,26 +1429,23 @@ export declare abstract class OpportunityService {
|
|
|
1384
1429
|
priceSource?: string | null | undefined;
|
|
1385
1430
|
displaySymbol?: string | undefined;
|
|
1386
1431
|
} | undefined;
|
|
1387
|
-
};
|
|
1388
|
-
tvlRecord
|
|
1389
|
-
id: string;
|
|
1432
|
+
} | undefined;
|
|
1433
|
+
tvlRecord?: {
|
|
1390
1434
|
total: number;
|
|
1391
|
-
timestamp: bigint;
|
|
1435
|
+
timestamp: string | bigint;
|
|
1392
1436
|
breakdowns: {
|
|
1393
1437
|
identifier: string;
|
|
1394
|
-
type:
|
|
1438
|
+
type: "PROTOCOL" | "TOKEN";
|
|
1395
1439
|
value: number;
|
|
1396
1440
|
}[];
|
|
1397
|
-
};
|
|
1398
|
-
rewardsRecord
|
|
1399
|
-
id: string;
|
|
1441
|
+
} | undefined;
|
|
1442
|
+
rewardsRecord?: {
|
|
1400
1443
|
total: number;
|
|
1401
|
-
timestamp: bigint;
|
|
1444
|
+
timestamp: string | bigint;
|
|
1402
1445
|
breakdowns: {
|
|
1403
|
-
id: string;
|
|
1404
|
-
timestamp: bigint;
|
|
1405
1446
|
campaignId: string;
|
|
1406
|
-
|
|
1447
|
+
value: number;
|
|
1448
|
+
timestamp: string | bigint;
|
|
1407
1449
|
token: {
|
|
1408
1450
|
id: string;
|
|
1409
1451
|
name: string | null;
|
|
@@ -1411,77 +1453,133 @@ export declare abstract class OpportunityService {
|
|
|
1411
1453
|
address: string;
|
|
1412
1454
|
decimals: number;
|
|
1413
1455
|
symbol: string;
|
|
1414
|
-
displaySymbol: string;
|
|
1415
1456
|
icon: string;
|
|
1416
1457
|
verified: boolean;
|
|
1417
|
-
isTest: boolean;
|
|
1418
|
-
type: import("@package/databases").TokenType;
|
|
1419
1458
|
isNative: boolean;
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1459
|
+
isTest: boolean;
|
|
1460
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1461
|
+
price?: number | null | undefined;
|
|
1462
|
+
updatedAt?: number | null | undefined;
|
|
1463
|
+
priceSource?: string | null | undefined;
|
|
1464
|
+
displaySymbol?: string | undefined;
|
|
1423
1465
|
};
|
|
1424
|
-
amount: bigint;
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
onChainCampaignId: string;
|
|
1466
|
+
amount: string | bigint;
|
|
1467
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1468
|
+
onChainCampaignId?: string | undefined;
|
|
1428
1469
|
}[];
|
|
1429
|
-
};
|
|
1430
|
-
|
|
1431
|
-
|
|
1470
|
+
} | undefined;
|
|
1471
|
+
} & {
|
|
1472
|
+
campaigns?: {
|
|
1432
1473
|
id: string;
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1474
|
+
computeChainId: number;
|
|
1475
|
+
distributionChainId: number;
|
|
1476
|
+
campaignId: string;
|
|
1477
|
+
type: string;
|
|
1478
|
+
subType?: number | null | undefined;
|
|
1479
|
+
amount: string;
|
|
1480
|
+
startTimestamp: string | number | bigint;
|
|
1481
|
+
endTimestamp: string | number | bigint;
|
|
1482
|
+
creatorAddress: string;
|
|
1483
|
+
apr?: number | undefined;
|
|
1484
|
+
dailyRewards?: number | undefined;
|
|
1485
|
+
creator?: {
|
|
1486
|
+
address: string;
|
|
1487
|
+
tags?: string[] | undefined;
|
|
1488
|
+
creatorId?: string | null | undefined;
|
|
1489
|
+
} | undefined;
|
|
1490
|
+
params: unknown;
|
|
1491
|
+
description?: string | undefined;
|
|
1492
|
+
chain: {
|
|
1493
|
+
id: number;
|
|
1494
|
+
name: string;
|
|
1495
|
+
icon: string;
|
|
1496
|
+
liveCampaigns: number;
|
|
1497
|
+
endOfDisputePeriod: number;
|
|
1498
|
+
explorers?: {
|
|
1499
|
+
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
1500
|
+
url: string;
|
|
1501
|
+
chainId: number;
|
|
1502
|
+
}[] | undefined;
|
|
1503
|
+
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
1504
|
+
};
|
|
1505
|
+
rewardTokenId?: string | undefined;
|
|
1506
|
+
rewardToken: {
|
|
1507
|
+
id: string;
|
|
1508
|
+
name: string | null;
|
|
1457
1509
|
chainId: number;
|
|
1510
|
+
address: string;
|
|
1511
|
+
decimals: number;
|
|
1512
|
+
symbol: string;
|
|
1513
|
+
icon: string;
|
|
1514
|
+
verified: boolean;
|
|
1515
|
+
isNative: boolean;
|
|
1516
|
+
isTest: boolean;
|
|
1517
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1518
|
+
price?: number | null | undefined;
|
|
1519
|
+
updatedAt?: number | null | undefined;
|
|
1520
|
+
priceSource?: string | null | undefined;
|
|
1521
|
+
displaySymbol?: string | undefined;
|
|
1522
|
+
};
|
|
1523
|
+
opportunityId?: string | undefined;
|
|
1524
|
+
distributionChain?: {
|
|
1525
|
+
id: number;
|
|
1526
|
+
name: string;
|
|
1527
|
+
icon: string;
|
|
1528
|
+
liveCampaigns: number;
|
|
1529
|
+
endOfDisputePeriod: number;
|
|
1530
|
+
explorers?: {
|
|
1531
|
+
type: "BLOCKSCOUT" | "ETHERSCAN";
|
|
1532
|
+
url: string;
|
|
1533
|
+
chainId: number;
|
|
1534
|
+
}[] | undefined;
|
|
1535
|
+
lastClaimsOnchainFetchTimestamp?: string | null | undefined;
|
|
1536
|
+
} | undefined;
|
|
1537
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1538
|
+
campaignStatus: {
|
|
1539
|
+
campaignId: string;
|
|
1540
|
+
computedUntil: string | number;
|
|
1541
|
+
processingStarted: string | number;
|
|
1542
|
+
status: string;
|
|
1543
|
+
preComputeProcessingStarted: string | number;
|
|
1544
|
+
preComputeStatus: string;
|
|
1545
|
+
delay?: number | undefined;
|
|
1546
|
+
error?: string | undefined;
|
|
1547
|
+
details?: unknown;
|
|
1548
|
+
};
|
|
1549
|
+
createdAt: string;
|
|
1550
|
+
rootCampaignId?: string | null | undefined;
|
|
1551
|
+
parentCampaignId?: string | null | undefined;
|
|
1552
|
+
childCampaignIds?: string[] | undefined;
|
|
1553
|
+
dailyRewardsBreakdown?: {
|
|
1554
|
+
campaignId: string;
|
|
1555
|
+
value: number;
|
|
1556
|
+
timestamp: string | bigint;
|
|
1557
|
+
token: {
|
|
1558
|
+
id: string;
|
|
1559
|
+
name: string | null;
|
|
1560
|
+
chainId: number;
|
|
1561
|
+
address: string;
|
|
1562
|
+
decimals: number;
|
|
1563
|
+
symbol: string;
|
|
1564
|
+
icon: string;
|
|
1565
|
+
verified: boolean;
|
|
1566
|
+
isNative: boolean;
|
|
1567
|
+
isTest: boolean;
|
|
1568
|
+
type: "POINT" | "PRETGE" | "TOKEN";
|
|
1569
|
+
price?: number | null | undefined;
|
|
1570
|
+
updatedAt?: number | null | undefined;
|
|
1571
|
+
priceSource?: string | null | undefined;
|
|
1572
|
+
displaySymbol?: string | undefined;
|
|
1573
|
+
};
|
|
1574
|
+
amount: string | bigint;
|
|
1575
|
+
distributionType?: "DUTCH_AUCTION" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "FIX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "FIX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_AMOUNT_PER_LIQUIDITY_VALUE" | "MAX_REWARD_VALUE_PER_LIQUIDITY_AMOUNT" | "MAX_REWARD_VALUE_PER_LIQUIDITY_VALUE" | undefined;
|
|
1576
|
+
onChainCampaignId?: string | undefined;
|
|
1458
1577
|
}[] | undefined;
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
name: string;
|
|
1465
|
-
description: string;
|
|
1466
|
-
url: string;
|
|
1467
|
-
icon: string;
|
|
1468
|
-
banner: string | null;
|
|
1469
|
-
opportunityBannerLight: string | null;
|
|
1470
|
-
opportunityBannerDark: string | null;
|
|
1471
|
-
} | undefined;
|
|
1472
|
-
activePrograms: {
|
|
1473
|
-
icon: string;
|
|
1474
|
-
id: string;
|
|
1475
|
-
name: string;
|
|
1476
|
-
slug: string | null;
|
|
1477
|
-
}[];
|
|
1478
|
-
id: string;
|
|
1479
|
-
hidden: true | undefined;
|
|
1480
|
-
nativeApr: number | undefined;
|
|
1481
|
-
depositUrl: string | undefined;
|
|
1482
|
-
explorerAddress: string | undefined;
|
|
1483
|
-
lastCampaignCreatedAt: number;
|
|
1484
|
-
campaigns: any[];
|
|
1578
|
+
pauseCompute?: string | null | undefined;
|
|
1579
|
+
hasOverrides?: boolean | undefined;
|
|
1580
|
+
isPrivate: boolean;
|
|
1581
|
+
campaignEncodingHash?: string | undefined;
|
|
1582
|
+
}[] | undefined;
|
|
1485
1583
|
})[]>;
|
|
1486
1584
|
static findManyWithoutRecords(query: FindManyOpportunityModel): Promise<{
|
|
1487
1585
|
id: string;
|
|
@@ -1505,6 +1603,10 @@ export declare abstract class OpportunityService {
|
|
|
1505
1603
|
lastCampaignCreatedAt: Date;
|
|
1506
1604
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
1507
1605
|
liveCampaigns: number;
|
|
1606
|
+
earliestCampaignStart: bigint | null;
|
|
1607
|
+
latestCampaignStart: bigint | null;
|
|
1608
|
+
earliestCampaignEnd: bigint | null;
|
|
1609
|
+
latestCampaignEnd: bigint | null;
|
|
1508
1610
|
hidden: boolean;
|
|
1509
1611
|
}[]>;
|
|
1510
1612
|
/**
|
|
@@ -1688,6 +1790,10 @@ export declare abstract class OpportunityService {
|
|
|
1688
1790
|
depositUrl: string | undefined;
|
|
1689
1791
|
explorerAddress: string | undefined;
|
|
1690
1792
|
lastCampaignCreatedAt: number;
|
|
1793
|
+
earliestCampaignStart: bigint | undefined;
|
|
1794
|
+
latestCampaignStart: bigint | undefined;
|
|
1795
|
+
earliestCampaignEnd: bigint | undefined;
|
|
1796
|
+
latestCampaignEnd: bigint | undefined;
|
|
1691
1797
|
};
|
|
1692
1798
|
})[] | undefined;
|
|
1693
1799
|
liveCampaignsForCreator?: any;
|
|
@@ -1744,6 +1850,10 @@ export declare abstract class OpportunityService {
|
|
|
1744
1850
|
depositUrl: string | undefined;
|
|
1745
1851
|
explorerAddress: string | undefined;
|
|
1746
1852
|
lastCampaignCreatedAt: number;
|
|
1853
|
+
earliestCampaignStart: bigint | undefined;
|
|
1854
|
+
latestCampaignStart: bigint | undefined;
|
|
1855
|
+
earliestCampaignEnd: bigint | undefined;
|
|
1856
|
+
latestCampaignEnd: bigint | undefined;
|
|
1747
1857
|
}[]>;
|
|
1748
1858
|
static aggregate(query: FindManyOpportunityModel, field: keyof Prisma.OpportunitySumAggregateInputType): Promise<{
|
|
1749
1859
|
sum: string;
|
|
@@ -1776,6 +1886,10 @@ export declare abstract class OpportunityService {
|
|
|
1776
1886
|
lastCampaignCreatedAt: Date;
|
|
1777
1887
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
1778
1888
|
liveCampaigns: number;
|
|
1889
|
+
earliestCampaignStart: bigint | null;
|
|
1890
|
+
latestCampaignStart: bigint | null;
|
|
1891
|
+
earliestCampaignEnd: bigint | null;
|
|
1892
|
+
latestCampaignEnd: bigint | null;
|
|
1779
1893
|
hidden: boolean;
|
|
1780
1894
|
}>;
|
|
1781
1895
|
static updateTags(id: string, tagUpdates: UpdateTagsModel): Promise<{
|
|
@@ -1800,9 +1914,299 @@ export declare abstract class OpportunityService {
|
|
|
1800
1914
|
lastCampaignCreatedAt: Date;
|
|
1801
1915
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
1802
1916
|
liveCampaigns: number;
|
|
1917
|
+
earliestCampaignStart: bigint | null;
|
|
1918
|
+
latestCampaignStart: bigint | null;
|
|
1919
|
+
earliestCampaignEnd: bigint | null;
|
|
1920
|
+
latestCampaignEnd: bigint | null;
|
|
1803
1921
|
hidden: boolean;
|
|
1804
1922
|
}>;
|
|
1805
1923
|
static updateMany(ids: string[], data: Partial<OpportunityUpdateArgs["data"]>): Promise<import("@prisma/client/runtime/client").GetBatchResult>;
|
|
1924
|
+
/**
|
|
1925
|
+
* Recalculates and updates campaign timestamp aggregates for an opportunity.
|
|
1926
|
+
* This includes earliestCampaignStart, latestCampaignStart, earliestCampaignEnd, and latestCampaignEnd.
|
|
1927
|
+
* @param opportunityId - The opportunity ID to update
|
|
1928
|
+
*/
|
|
1929
|
+
static updateCampaignTimestamps(opportunityId: string): Promise<void>;
|
|
1930
|
+
/**
|
|
1931
|
+
* Finds a single opportunity by ID with all related records and relations.
|
|
1932
|
+
* @param id - The opportunity ID
|
|
1933
|
+
* @param options - Options including forcePrimary flag
|
|
1934
|
+
* @returns The opportunity with all records or null if not found
|
|
1935
|
+
*/
|
|
1936
|
+
static findUnique(id: string, options?: {
|
|
1937
|
+
forcePrimary?: boolean;
|
|
1938
|
+
}): Promise<({
|
|
1939
|
+
ActivePrograms: {
|
|
1940
|
+
icon: string;
|
|
1941
|
+
id: string;
|
|
1942
|
+
name: string;
|
|
1943
|
+
slug: string | null;
|
|
1944
|
+
}[];
|
|
1945
|
+
AprRecords: ({
|
|
1946
|
+
AprBreakdown: {
|
|
1947
|
+
identifier: string;
|
|
1948
|
+
timestamp: bigint;
|
|
1949
|
+
type: import("@package/databases").AprType;
|
|
1950
|
+
value: number;
|
|
1951
|
+
}[];
|
|
1952
|
+
} & {
|
|
1953
|
+
id: string;
|
|
1954
|
+
timestamp: bigint;
|
|
1955
|
+
cumulated: number;
|
|
1956
|
+
opportunityId: string;
|
|
1957
|
+
})[];
|
|
1958
|
+
Campaigns: ({
|
|
1959
|
+
RewardToken: {
|
|
1960
|
+
id: string;
|
|
1961
|
+
name: string | null;
|
|
1962
|
+
chainId: number;
|
|
1963
|
+
address: string;
|
|
1964
|
+
decimals: number;
|
|
1965
|
+
symbol: string;
|
|
1966
|
+
displaySymbol: string;
|
|
1967
|
+
icon: string;
|
|
1968
|
+
verified: boolean;
|
|
1969
|
+
isTest: boolean;
|
|
1970
|
+
type: import("@package/databases").TokenType;
|
|
1971
|
+
isNative: boolean;
|
|
1972
|
+
price: number | null;
|
|
1973
|
+
updatedAt: number | null;
|
|
1974
|
+
priceSource: string | null;
|
|
1975
|
+
};
|
|
1976
|
+
} & {
|
|
1977
|
+
id: string;
|
|
1978
|
+
computeChainId: number;
|
|
1979
|
+
distributionChainId: number;
|
|
1980
|
+
campaignId: string;
|
|
1981
|
+
type: string;
|
|
1982
|
+
distributionType: import("@package/databases").DistributionType;
|
|
1983
|
+
subType: number | null;
|
|
1984
|
+
rewardTokenId: string;
|
|
1985
|
+
amount: string;
|
|
1986
|
+
opportunityId: string;
|
|
1987
|
+
startTimestamp: bigint;
|
|
1988
|
+
endTimestamp: bigint;
|
|
1989
|
+
params: import("@prisma/client/runtime/client").JsonValue;
|
|
1990
|
+
description: string | null;
|
|
1991
|
+
pauseCompute: string | null;
|
|
1992
|
+
dailyRewards: number;
|
|
1993
|
+
apr: number;
|
|
1994
|
+
creatorAddress: string;
|
|
1995
|
+
manualOverrides: import("@package/databases").CampaignManualOverride[];
|
|
1996
|
+
createdAt: Date;
|
|
1997
|
+
rootCampaignId: string | null;
|
|
1998
|
+
parentCampaignId: string | null;
|
|
1999
|
+
isPrivate: boolean;
|
|
2000
|
+
campaignEncodingHash: string | null;
|
|
2001
|
+
})[];
|
|
2002
|
+
Chain: {
|
|
2003
|
+
id: number;
|
|
2004
|
+
name: string;
|
|
2005
|
+
icon: string;
|
|
2006
|
+
liveCampaigns: number;
|
|
2007
|
+
endOfDisputePeriod: number;
|
|
2008
|
+
lastClaimsOnchainFetchTimestamp: string | null;
|
|
2009
|
+
};
|
|
2010
|
+
DailyRewardsRecords: ({
|
|
2011
|
+
DailyRewardsBreakdown: ({
|
|
2012
|
+
Campaign: {
|
|
2013
|
+
CampaignStatus: {
|
|
2014
|
+
campaignId: string;
|
|
2015
|
+
computedUntil: bigint;
|
|
2016
|
+
processingStarted: bigint;
|
|
2017
|
+
status: import("@package/databases").RunStatus;
|
|
2018
|
+
preComputeStatus: import("@package/databases").RunStatus;
|
|
2019
|
+
preComputeProcessingStarted: bigint;
|
|
2020
|
+
error: string;
|
|
2021
|
+
details: import("@prisma/client/runtime/client").JsonValue;
|
|
2022
|
+
}[];
|
|
2023
|
+
RewardToken: {
|
|
2024
|
+
id: string;
|
|
2025
|
+
name: string | null;
|
|
2026
|
+
chainId: number;
|
|
2027
|
+
address: string;
|
|
2028
|
+
decimals: number;
|
|
2029
|
+
symbol: string;
|
|
2030
|
+
displaySymbol: string;
|
|
2031
|
+
icon: string;
|
|
2032
|
+
verified: boolean;
|
|
2033
|
+
isTest: boolean;
|
|
2034
|
+
type: import("@package/databases").TokenType;
|
|
2035
|
+
isNative: boolean;
|
|
2036
|
+
price: number | null;
|
|
2037
|
+
updatedAt: number | null;
|
|
2038
|
+
priceSource: string | null;
|
|
2039
|
+
};
|
|
2040
|
+
amount: string;
|
|
2041
|
+
campaignId: string;
|
|
2042
|
+
distributionType: import("@package/databases").DistributionType;
|
|
2043
|
+
endTimestamp: bigint;
|
|
2044
|
+
startTimestamp: bigint;
|
|
2045
|
+
};
|
|
2046
|
+
} & {
|
|
2047
|
+
id: string;
|
|
2048
|
+
value: number;
|
|
2049
|
+
timestamp: bigint;
|
|
2050
|
+
campaignId: string;
|
|
2051
|
+
dailyRewardsRecordId: string;
|
|
2052
|
+
})[];
|
|
2053
|
+
} & {
|
|
2054
|
+
id: string;
|
|
2055
|
+
timestamp: bigint;
|
|
2056
|
+
total: number;
|
|
2057
|
+
opportunityId: string;
|
|
2058
|
+
})[];
|
|
2059
|
+
MainProtocol: {
|
|
2060
|
+
id: string;
|
|
2061
|
+
tags: string[];
|
|
2062
|
+
name: string;
|
|
2063
|
+
description: string;
|
|
2064
|
+
url: string;
|
|
2065
|
+
icon: string;
|
|
2066
|
+
banner: string | null;
|
|
2067
|
+
opportunityBannerLight: string | null;
|
|
2068
|
+
opportunityBannerDark: string | null;
|
|
2069
|
+
} | null;
|
|
2070
|
+
NativeAprRecords: ({
|
|
2071
|
+
RewardToken: {
|
|
2072
|
+
id: string;
|
|
2073
|
+
name: string | null;
|
|
2074
|
+
chainId: number;
|
|
2075
|
+
address: string;
|
|
2076
|
+
decimals: number;
|
|
2077
|
+
symbol: string;
|
|
2078
|
+
displaySymbol: string;
|
|
2079
|
+
icon: string;
|
|
2080
|
+
verified: boolean;
|
|
2081
|
+
isTest: boolean;
|
|
2082
|
+
type: import("@package/databases").TokenType;
|
|
2083
|
+
isNative: boolean;
|
|
2084
|
+
price: number | null;
|
|
2085
|
+
updatedAt: number | null;
|
|
2086
|
+
priceSource: string | null;
|
|
2087
|
+
} | null;
|
|
2088
|
+
} & {
|
|
2089
|
+
id: string;
|
|
2090
|
+
title: string;
|
|
2091
|
+
description: string | null;
|
|
2092
|
+
timestamp: bigint;
|
|
2093
|
+
value: number;
|
|
2094
|
+
amount: bigint | null;
|
|
2095
|
+
rewardTokenId: string | null;
|
|
2096
|
+
opportunityId: string;
|
|
2097
|
+
})[];
|
|
2098
|
+
Protocols: {
|
|
2099
|
+
id: string;
|
|
2100
|
+
tags: string[];
|
|
2101
|
+
name: string;
|
|
2102
|
+
description: string;
|
|
2103
|
+
url: string;
|
|
2104
|
+
icon: string;
|
|
2105
|
+
banner: string | null;
|
|
2106
|
+
opportunityBannerLight: string | null;
|
|
2107
|
+
opportunityBannerDark: string | null;
|
|
2108
|
+
}[];
|
|
2109
|
+
Tokens: {
|
|
2110
|
+
id: string;
|
|
2111
|
+
name: string | null;
|
|
2112
|
+
chainId: number;
|
|
2113
|
+
address: string;
|
|
2114
|
+
decimals: number;
|
|
2115
|
+
symbol: string;
|
|
2116
|
+
displaySymbol: string;
|
|
2117
|
+
icon: string;
|
|
2118
|
+
verified: boolean;
|
|
2119
|
+
isTest: boolean;
|
|
2120
|
+
type: import("@package/databases").TokenType;
|
|
2121
|
+
isNative: boolean;
|
|
2122
|
+
price: number | null;
|
|
2123
|
+
updatedAt: number | null;
|
|
2124
|
+
priceSource: string | null;
|
|
2125
|
+
}[];
|
|
2126
|
+
TvlRecords: ({
|
|
2127
|
+
TvlBreakdown: {
|
|
2128
|
+
identifier: string;
|
|
2129
|
+
type: import("@package/databases").TvlType;
|
|
2130
|
+
value: number;
|
|
2131
|
+
}[];
|
|
2132
|
+
} & {
|
|
2133
|
+
id: string;
|
|
2134
|
+
timestamp: bigint;
|
|
2135
|
+
total: number;
|
|
2136
|
+
opportunityId: string;
|
|
2137
|
+
})[];
|
|
2138
|
+
} & {
|
|
2139
|
+
id: string;
|
|
2140
|
+
chainId: number;
|
|
2141
|
+
type: string;
|
|
2142
|
+
identifier: string;
|
|
2143
|
+
name: string;
|
|
2144
|
+
description: string;
|
|
2145
|
+
howToSteps: string[];
|
|
2146
|
+
depositUrl: string | null;
|
|
2147
|
+
explorerAddress: string | null;
|
|
2148
|
+
status: import("@package/databases").Status;
|
|
2149
|
+
action: import("@package/databases").OpportunityAction;
|
|
2150
|
+
mainProtocolId: string | null;
|
|
2151
|
+
tvl: number;
|
|
2152
|
+
apr: number;
|
|
2153
|
+
nativeApr: number | null;
|
|
2154
|
+
maxApr: number | null;
|
|
2155
|
+
dailyRewards: number;
|
|
2156
|
+
tags: string[];
|
|
2157
|
+
lastCampaignCreatedAt: Date;
|
|
2158
|
+
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
2159
|
+
liveCampaigns: number;
|
|
2160
|
+
earliestCampaignStart: bigint | null;
|
|
2161
|
+
latestCampaignStart: bigint | null;
|
|
2162
|
+
earliestCampaignEnd: bigint | null;
|
|
2163
|
+
latestCampaignEnd: bigint | null;
|
|
2164
|
+
hidden: boolean;
|
|
2165
|
+
}) | null>;
|
|
2166
|
+
/**
|
|
2167
|
+
* Updates APR, TVL, and Daily Rewards records for an opportunity.
|
|
2168
|
+
* @param opportunityId - The opportunity ID
|
|
2169
|
+
* @param apr - APR record data
|
|
2170
|
+
* @param tvl - TVL record data
|
|
2171
|
+
* @param dailyRewards - Daily rewards record data
|
|
2172
|
+
*/
|
|
2173
|
+
static updateDynamicData(opportunityId: string, apr: AprRecord["model"], tvl: TvlRecord["model"], dailyRewards: DailyRewardsRecord["model"]): Promise<{
|
|
2174
|
+
aprRecord: {
|
|
2175
|
+
id: string;
|
|
2176
|
+
timestamp: bigint;
|
|
2177
|
+
cumulated: number;
|
|
2178
|
+
opportunityId: string;
|
|
2179
|
+
};
|
|
2180
|
+
tvlRecord: {
|
|
2181
|
+
TvlBreakdown: {
|
|
2182
|
+
id: string;
|
|
2183
|
+
identifier: string;
|
|
2184
|
+
type: import("@package/databases").TvlType;
|
|
2185
|
+
value: number;
|
|
2186
|
+
tvlRecordId: string;
|
|
2187
|
+
}[];
|
|
2188
|
+
} & {
|
|
2189
|
+
id: string;
|
|
2190
|
+
timestamp: bigint;
|
|
2191
|
+
total: number;
|
|
2192
|
+
opportunityId: string;
|
|
2193
|
+
};
|
|
2194
|
+
dailyRewardsRecord: {
|
|
2195
|
+
DailyRewardsBreakdown: {
|
|
2196
|
+
id: string;
|
|
2197
|
+
value: number;
|
|
2198
|
+
timestamp: bigint;
|
|
2199
|
+
campaignId: string;
|
|
2200
|
+
dailyRewardsRecordId: string;
|
|
2201
|
+
}[];
|
|
2202
|
+
} & {
|
|
2203
|
+
id: string;
|
|
2204
|
+
timestamp: bigint;
|
|
2205
|
+
total: number;
|
|
2206
|
+
opportunityId: string;
|
|
2207
|
+
};
|
|
2208
|
+
opportunity: import("@prisma/client/runtime/client").GetBatchResult;
|
|
2209
|
+
}>;
|
|
1806
2210
|
static description(action: OpportunityAction, tokens: Token[], protocol: Protocol | null, chainId: number): Promise<string>;
|
|
1807
2211
|
static howToSteps(action: OpportunityAction, tokens: Token[], protocol: Protocol | null): string[];
|
|
1808
2212
|
static countLiveCampaignsForCreator(opportunity: OpportunityWithCampaignsResourceModel, creator: string | null): number;
|
|
@@ -2028,6 +2432,10 @@ export declare abstract class OpportunityService {
|
|
|
2028
2432
|
lastCampaignCreatedAt: Date;
|
|
2029
2433
|
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
|
2030
2434
|
liveCampaigns: number;
|
|
2435
|
+
earliestCampaignStart: bigint | null;
|
|
2436
|
+
latestCampaignStart: bigint | null;
|
|
2437
|
+
earliestCampaignEnd: bigint | null;
|
|
2438
|
+
latestCampaignEnd: bigint | null;
|
|
2031
2439
|
hidden: boolean;
|
|
2032
2440
|
}>;
|
|
2033
2441
|
}
|