@merkl/api 1.0.42 → 1.0.44
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/eden/index.d.ts +1590 -1518
- package/dist/src/index.d.ts +842 -848
- package/dist/src/modules/v4/accounting/accounting.controller.d.ts +2 -2
- package/dist/src/modules/v4/accounting/accounting.model.d.ts +4 -4
- package/dist/src/modules/v4/accounting/accounting.repository.d.ts +1 -1
- package/dist/src/modules/v4/accounting/accounting.service.d.ts +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +303 -315
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +2 -2
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +83 -2
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +90 -7
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +2 -0
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +2 -0
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +2 -0
- package/dist/src/modules/v4/creator/creator.controller.d.ts +2 -2
- package/dist/src/modules/v4/creator/creator.model.d.ts +2 -2
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +6 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +627 -627
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +36 -4
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +4 -4
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.controller.d.ts +18 -18
- package/dist/src/modules/v4/reward/reward.model.d.ts +6 -6
- package/dist/src/modules/v4/router.d.ts +842 -848
- package/dist/src/modules/v4/token/token.controller.d.ts +4 -4
- package/dist/src/modules/v4/token/token.model.d.ts +2 -2
- package/dist/src/modules/v4/token/token.repository.d.ts +16 -0
- package/dist/src/modules/v4/token/token.service.d.ts +1 -1
- package/dist/src/modules/v4/user/user.controller.d.ts +2 -2
- package/dist/src/modules/v4/user/user.model.d.ts +2 -2
- package/dist/src/utils/pagination.d.ts +11 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -203,8 +203,8 @@ export declare const GetCampaignQueryDto: import("@sinclair/typebox").TObject<{
|
|
203
203
|
rootCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
204
204
|
parentCampaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
205
205
|
mainProtocolId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
206
|
-
page: import("@sinclair/typebox").
|
207
|
-
items: import("@sinclair/typebox").
|
206
|
+
page: import("@sinclair/typebox").TNumber;
|
207
|
+
items: import("@sinclair/typebox").TNumber;
|
208
208
|
}>;
|
209
209
|
export type CampaignUnique = typeof CampaignUniqueDto.static;
|
210
210
|
export type CreateCampaignModel = typeof CreateCampaignDto.static & {
|
@@ -2,7 +2,7 @@ import { type ChainId } from "@angleprotocol/sdk/ts";
|
|
2
2
|
import { type CampaignManualOverride } from "@package/databases/api";
|
3
3
|
import type { Campaign, CampaignUnique, CampaignWithParams, GetCampaignQueryModel } from "../../../modules/v4/campaign/campaign.model";
|
4
4
|
export declare abstract class CampaignRepository {
|
5
|
-
static transformQueryToPrismaFilters(query: GetCampaignQueryModel): {
|
5
|
+
static transformQueryToPrismaFilters(query: Omit<GetCampaignQueryModel, "page" | "items">): {
|
6
6
|
where: {
|
7
7
|
createdAt: {
|
8
8
|
gte: Date;
|
@@ -852,7 +852,88 @@ export declare abstract class CampaignRepository {
|
|
852
852
|
rootCampaignId: string | null;
|
853
853
|
parentCampaignId: string | null;
|
854
854
|
})[]>;
|
855
|
-
static
|
855
|
+
static findFirst(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<({
|
856
|
+
ComputeChain: {
|
857
|
+
name: string;
|
858
|
+
id: number;
|
859
|
+
icon: string;
|
860
|
+
};
|
861
|
+
DistributionChain: {
|
862
|
+
name: string;
|
863
|
+
id: number;
|
864
|
+
icon: string;
|
865
|
+
};
|
866
|
+
RewardToken: {
|
867
|
+
symbol: string;
|
868
|
+
name: string | null;
|
869
|
+
decimals: number;
|
870
|
+
price: number | null;
|
871
|
+
address: string;
|
872
|
+
id: string;
|
873
|
+
chainId: number;
|
874
|
+
icon: string;
|
875
|
+
isNative: boolean;
|
876
|
+
isPoint: boolean;
|
877
|
+
isPreTGE: boolean;
|
878
|
+
isTest: boolean;
|
879
|
+
verified: boolean;
|
880
|
+
displaySymbol: string;
|
881
|
+
};
|
882
|
+
Opportunity: {
|
883
|
+
name: string;
|
884
|
+
apr: number;
|
885
|
+
tvl: number;
|
886
|
+
description: string;
|
887
|
+
id: string;
|
888
|
+
status: import("@package/databases").Status;
|
889
|
+
chainId: number;
|
890
|
+
action: import("@package/databases").OpportunityAction;
|
891
|
+
type: string;
|
892
|
+
depositUrl: string | null;
|
893
|
+
explorerAddress: string | null;
|
894
|
+
howToSteps: string[];
|
895
|
+
mainProtocolId: string | null;
|
896
|
+
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
897
|
+
identifier: string;
|
898
|
+
dailyRewards: number;
|
899
|
+
tags: string[];
|
900
|
+
lastCampaignCreatedAt: Date;
|
901
|
+
};
|
902
|
+
Creator: {
|
903
|
+
address: string;
|
904
|
+
tags: string[];
|
905
|
+
creatorId: string | null;
|
906
|
+
};
|
907
|
+
CampaignStatus: {
|
908
|
+
campaignId: string;
|
909
|
+
error: string;
|
910
|
+
status: import("@package/databases").RunStatus;
|
911
|
+
details: import("@prisma/client/runtime/library").JsonValue;
|
912
|
+
computedUntil: bigint;
|
913
|
+
processingStarted: bigint;
|
914
|
+
}[];
|
915
|
+
} & {
|
916
|
+
campaignId: string;
|
917
|
+
description: string | null;
|
918
|
+
id: string;
|
919
|
+
params: import("@prisma/client/runtime/library").JsonValue;
|
920
|
+
amount: string;
|
921
|
+
startTimestamp: bigint;
|
922
|
+
type: string;
|
923
|
+
computeChainId: number;
|
924
|
+
distributionChainId: number;
|
925
|
+
endTimestamp: bigint;
|
926
|
+
opportunityId: string;
|
927
|
+
creatorAddress: string;
|
928
|
+
distributionType: import("@package/databases").DistributionType;
|
929
|
+
subType: number | null;
|
930
|
+
rewardTokenId: string;
|
931
|
+
manualOverrides: import("@package/databases").CampaignManualOverride[];
|
932
|
+
createdAt: Date;
|
933
|
+
rootCampaignId: string | null;
|
934
|
+
parentCampaignId: string | null;
|
935
|
+
}) | null>;
|
936
|
+
static countMany(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<number>;
|
856
937
|
static findChains(): Promise<Record<string, ChainId>>;
|
857
938
|
static addManualOverride(id: string, field: CampaignManualOverride): Promise<void>;
|
858
939
|
static removeManualOverride(id: string, field: CampaignManualOverride): Promise<void>;
|
@@ -405,7 +405,88 @@ export declare abstract class CampaignService {
|
|
405
405
|
subType: number | null;
|
406
406
|
rewardTokenId: string;
|
407
407
|
}[]>;
|
408
|
-
static
|
408
|
+
static findFirst(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<{
|
409
|
+
params: any;
|
410
|
+
chain: {
|
411
|
+
name: string;
|
412
|
+
id: number;
|
413
|
+
icon: string;
|
414
|
+
};
|
415
|
+
endTimestamp: number;
|
416
|
+
startTimestamp: number;
|
417
|
+
rewardToken: {
|
418
|
+
symbol: string;
|
419
|
+
name: string | null;
|
420
|
+
decimals: number;
|
421
|
+
address: string;
|
422
|
+
id: string;
|
423
|
+
chainId: number;
|
424
|
+
icon: string;
|
425
|
+
isNative: boolean;
|
426
|
+
isPoint: boolean;
|
427
|
+
isPreTGE: boolean;
|
428
|
+
isTest: boolean;
|
429
|
+
verified: boolean;
|
430
|
+
} & {
|
431
|
+
price?: number | null | undefined;
|
432
|
+
isTokenWrapper?: boolean | undefined;
|
433
|
+
tokenWrapperAddress?: string | undefined;
|
434
|
+
};
|
435
|
+
distributionChain: {
|
436
|
+
name: string;
|
437
|
+
id: number;
|
438
|
+
icon: string;
|
439
|
+
} | undefined;
|
440
|
+
campaignStatus: {
|
441
|
+
computedUntil: number;
|
442
|
+
processingStarted: number;
|
443
|
+
campaignId: string;
|
444
|
+
error: string;
|
445
|
+
status: import("@package/databases").RunStatus;
|
446
|
+
details: import("@prisma/client/runtime/library").JsonValue;
|
447
|
+
} | undefined;
|
448
|
+
creatorAddress: string;
|
449
|
+
creator: {
|
450
|
+
address: string;
|
451
|
+
tags: string[];
|
452
|
+
creatorId: string | null;
|
453
|
+
};
|
454
|
+
createdAt: string;
|
455
|
+
description: string | undefined;
|
456
|
+
parentCampaignId: string | undefined;
|
457
|
+
rootCampaignId: string | undefined;
|
458
|
+
Opportunity: {
|
459
|
+
name: string;
|
460
|
+
apr: number;
|
461
|
+
tvl: number;
|
462
|
+
description: string;
|
463
|
+
id: string;
|
464
|
+
status: import("@package/databases").Status;
|
465
|
+
chainId: number;
|
466
|
+
action: import("@package/databases").OpportunityAction;
|
467
|
+
type: string;
|
468
|
+
depositUrl: string | null;
|
469
|
+
explorerAddress: string | null;
|
470
|
+
howToSteps: string[];
|
471
|
+
mainProtocolId: string | null;
|
472
|
+
manualOverrides: import("@package/databases").OpportunityManualOverride[];
|
473
|
+
identifier: string;
|
474
|
+
dailyRewards: number;
|
475
|
+
tags: string[];
|
476
|
+
lastCampaignCreatedAt: Date;
|
477
|
+
};
|
478
|
+
campaignId: string;
|
479
|
+
id: string;
|
480
|
+
amount: string;
|
481
|
+
type: string;
|
482
|
+
computeChainId: number;
|
483
|
+
distributionChainId: number;
|
484
|
+
opportunityId: string;
|
485
|
+
distributionType: import("@package/databases").DistributionType;
|
486
|
+
subType: number | null;
|
487
|
+
rewardTokenId: string;
|
488
|
+
} | null>;
|
489
|
+
static findAndGroupByChains(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Map<number, {
|
409
490
|
params: any;
|
410
491
|
chain: {
|
411
492
|
name: string;
|
@@ -486,8 +567,8 @@ export declare abstract class CampaignService {
|
|
486
567
|
subType: number | null;
|
487
568
|
rewardTokenId: string;
|
488
569
|
}[]>>;
|
489
|
-
static countByChains(query: GetCampaignQueryModel): Promise<Record<string, number>>;
|
490
|
-
static findAndGroupByTypes(query: GetCampaignQueryModel): Promise<Map<string, {
|
570
|
+
static countByChains(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Record<string, number>>;
|
571
|
+
static findAndGroupByTypes(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Map<string, {
|
491
572
|
params: any;
|
492
573
|
chain: {
|
493
574
|
name: string;
|
@@ -568,8 +649,8 @@ export declare abstract class CampaignService {
|
|
568
649
|
subType: number | null;
|
569
650
|
rewardTokenId: string;
|
570
651
|
}[]>>;
|
571
|
-
static countByTypes(query: GetCampaignQueryModel): Promise<Record<string, number>>;
|
572
|
-
static findAndGroupByProtocols(query: GetCampaignQueryModel): Promise<Map<string | null, {
|
652
|
+
static countByTypes(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Record<string, number>>;
|
653
|
+
static findAndGroupByProtocols(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Map<string | null, {
|
573
654
|
params: any;
|
574
655
|
chain: {
|
575
656
|
name: string;
|
@@ -650,7 +731,7 @@ export declare abstract class CampaignService {
|
|
650
731
|
subType: number | null;
|
651
732
|
rewardTokenId: string;
|
652
733
|
}[]>>;
|
653
|
-
static countByProtocols(query: GetCampaignQueryModel): Promise<Record<string, number>>;
|
734
|
+
static countByProtocols(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<Record<string, number>>;
|
654
735
|
static countBy<T>(campaignsMap: Map<T, ReturnType<(typeof CampaignService)["format"]>[]>): Record<string, number>;
|
655
736
|
/**
|
656
737
|
* Counts the number of campaigns that complies to query
|
@@ -658,7 +739,7 @@ export declare abstract class CampaignService {
|
|
658
739
|
* @param query
|
659
740
|
* @returns the number of campaigns
|
660
741
|
*/
|
661
|
-
static countMany(query: GetCampaignQueryModel): Promise<number>;
|
742
|
+
static countMany(query: Omit<GetCampaignQueryModel, "page" | "items">): Promise<number>;
|
662
743
|
static checkIfExist(campaign: CampaignUnique | string): Promise<boolean>;
|
663
744
|
static findUnique(campaign: CampaignUnique | string): Promise<({
|
664
745
|
ComputeChain: {
|
@@ -803,6 +884,8 @@ export declare abstract class CampaignService {
|
|
803
884
|
parentCampaignId: string | null;
|
804
885
|
}>;
|
805
886
|
static findCampaignValue(params: GetCampaignComputedValueModel): Promise<{
|
887
|
+
apr: number | null;
|
888
|
+
tvl: number | null;
|
806
889
|
averageBoost: number | null;
|
807
890
|
totalDistributedInUSD: number | null;
|
808
891
|
forfeitingBoost: number | null;
|
@@ -28,6 +28,8 @@ export declare const ComputedValueController: Elysia<"/value", {
|
|
28
28
|
headers: unknown;
|
29
29
|
response: {
|
30
30
|
200: {
|
31
|
+
apr: number | null;
|
32
|
+
tvl: number | null;
|
31
33
|
averageBoost: number | null;
|
32
34
|
totalDistributedInUSD: number | null;
|
33
35
|
forfeitingBoost: number | null;
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import type { GetCampaignComputedValueModel, GetUserComputedValuesModel, UpsertCampaignComputedValueModel, UpsertUserComputedValuesModel } from "./computedValue.model";
|
2
2
|
export declare abstract class ComputedValueRepository {
|
3
3
|
static findCampaignValue(params: GetCampaignComputedValueModel): Promise<{
|
4
|
+
apr: number | null;
|
5
|
+
tvl: number | null;
|
4
6
|
averageBoost: number | null;
|
5
7
|
totalDistributedInUSD: number | null;
|
6
8
|
forfeitingBoost: number | null;
|
@@ -2,6 +2,8 @@ import type { GetCampaignComputedValueModel, GetUserComputedValuesModel, UpsertC
|
|
2
2
|
export declare abstract class ComputedValueService {
|
3
3
|
static hashUserComputedValueId(campaignId: string, address: string, reason: string): string;
|
4
4
|
static findCampaignValue(campaignId: string, field: GetCampaignComputedValueModel["field"]): Promise<{
|
5
|
+
apr: number | null;
|
6
|
+
tvl: number | null;
|
5
7
|
averageBoost: number | null;
|
6
8
|
totalDistributedInUSD: number | null;
|
7
9
|
forfeitingBoost: number | null;
|
@@ -54,8 +54,8 @@ export declare const CreatorController: Elysia<"/creators", {
|
|
54
54
|
query: {
|
55
55
|
address?: string | undefined;
|
56
56
|
id?: string | undefined;
|
57
|
-
items
|
58
|
-
page
|
57
|
+
items: number;
|
58
|
+
page: number;
|
59
59
|
};
|
60
60
|
headers: unknown;
|
61
61
|
response: {
|
@@ -19,10 +19,10 @@ export declare const CreateCreatorDto: import("@sinclair/typebox").TObject<{
|
|
19
19
|
name: import("@sinclair/typebox").TString;
|
20
20
|
}>;
|
21
21
|
export declare const GetManyCreatorQuery: import("@sinclair/typebox").TObject<{
|
22
|
+
page: import("@sinclair/typebox").TNumber;
|
23
|
+
items: import("@sinclair/typebox").TNumber;
|
22
24
|
id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
23
25
|
address: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
24
|
-
page: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
25
|
-
items: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
26
26
|
}>;
|
27
27
|
export declare const UpdateCreatorDto: import("@sinclair/typebox").TObject<{
|
28
28
|
addresses: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
@@ -7,8 +7,14 @@ export declare class DynamicDataService {
|
|
7
7
|
*/
|
8
8
|
static checkValidUpdate(opportunityId: string, newApr: number): Promise<boolean>;
|
9
9
|
static update(chainId: ChainId, type: CampaignType, campaigns: CampaignParameters<CampaignType>[], dryRun?: boolean): Promise<unknown[]>;
|
10
|
+
static modifyCampaignAPRWithHooks<C extends CampaignType>(campaignDailyValue: number, aprCampaignValue: number, campaign: CampaignParameters<C>): Promise<number>;
|
10
11
|
/**
|
11
12
|
* @dev Recursive function to handle errors in fetching dynamic data
|
12
13
|
*/
|
13
14
|
static fetchWithRecursiveErrorHandling<R>(fn: (chainId: MerklChainId, campaigns: CampaignParameters<CampaignType>[]) => Promise<R[]>, campaigns: CampaignParameters<CampaignType>[], chainId: number): Promise<R[]>;
|
15
|
+
/**
|
16
|
+
* @deprecated
|
17
|
+
* Used only when the new tvl builder is not available
|
18
|
+
*/
|
19
|
+
static updateWithoutBuilder(chainId: ChainId, type: CampaignType, campaigns: CampaignParameters<CampaignType>[], dryRun?: boolean): Promise<unknown[]>;
|
14
20
|
}
|