@merkl/api 0.16.34 → 0.16.35
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/backgroundJobs/index.js +0 -4
- package/dist/src/backgroundJobs/jobs/opportunityUpdater.js +3 -0
- package/dist/src/eden/index.d.ts +657 -444
- package/dist/src/entities/opportunity.d.ts +3 -1
- package/dist/src/index.d.ts +136 -117
- package/dist/src/jobs/etl/prices.js +9 -2
- package/dist/src/libs/deprecated-merklv3/index.js +1 -1
- package/dist/src/modules/v4/boost/boost.controller.js +1 -1
- package/dist/src/modules/v4/cache/cache.repository.d.ts +1 -0
- package/dist/src/modules/v4/cache/cache.repository.js +19 -0
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +0 -5
- package/dist/src/modules/v4/campaign/campaign.service.js +0 -5
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +120 -57
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +9 -0
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +153 -0
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +3 -1
- package/dist/src/modules/v4/opportunity/opportunity.model.js +2 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +18 -210
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +76 -113
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +219 -64
- package/dist/src/modules/v4/opportunity/opportunity.service.js +19 -21
- package/dist/src/modules/v4/reward/{subservices/converter.d.ts → reward.converter.d.ts} +3 -3
- package/dist/src/modules/v4/reward/{subservices/converter.js → reward.converter.js} +1 -1
- package/dist/src/modules/v4/router.d.ts +120 -57
- package/dist/src/routes/v3/app.js +1 -0
- package/dist/src/routes/v3/blacklist.js +1 -0
- package/dist/src/routes/v3/campaign/delay.js +1 -0
- package/dist/src/routes/v3/campaignClaims.d.ts +3 -1
- package/dist/src/routes/v3/campaignClaims.js +4 -13
- package/dist/src/routes/v3/campaignUnclaimed.js +1 -0
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +9 -1
- package/dist/src/routes/v3/campaignsForMainParameter.js +17 -7
- package/dist/src/routes/v3/campaignsRewardsReport.js +1 -0
- package/dist/src/routes/v3/claims.d.ts +3 -1
- package/dist/src/routes/v3/claims.js +4 -33
- package/dist/src/routes/v3/opportunity.d.ts +7 -7
- package/dist/src/routes/v3/opportunity.js +12 -13
- package/dist/src/routes/v3/recipients.js +1 -0
- package/dist/src/routes/v3/rewards.js +2 -1
- package/dist/src/routes/v3/rewardsReport.js +1 -0
- package/dist/src/routes/v3/router.d.ts +16 -60
- package/dist/src/routes/v3/router.js +0 -6
- package/dist/src/routes/v3/userRewards.js +2 -1
- package/dist/src/types/returnTypes.d.ts +0 -8
- package/dist/src/utils/camelToKebabCase.d.ts +2 -0
- package/dist/src/utils/camelToKebabCase.js +9 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/backgroundJobs/jobs/priceUpdater.d.ts +0 -37
- package/dist/src/backgroundJobs/jobs/priceUpdater.js +0 -21
- package/dist/src/backgroundJobs/jobs/sync.d.ts +0 -40
- package/dist/src/backgroundJobs/jobs/sync.js +0 -33
- package/dist/src/routes/v3/campaignReport.d.ts +0 -43
- package/dist/src/routes/v3/campaignReport.js +0 -22
- package/dist/src/routes/v3/campaignsInfo.d.ts +0 -41
- package/dist/src/routes/v3/campaignsInfo.js +0 -54
- package/dist/src/routes/v3/exports/campaigns.d.ts +0 -43
- package/dist/src/routes/v3/exports/campaigns.js +0 -28
- package/dist/src/routes/v3/tokenUnclaimed.d.ts +0 -44
- package/dist/src/routes/v3/tokenUnclaimed.js +0 -24
- package/dist/src/utils/queries/campaignsForMainParameter.d.ts +0 -2
- package/dist/src/utils/queries/campaignsForMainParameter.js +0 -23
- package/dist/src/utils/queries/claimsOverTime.d.ts +0 -8
- package/dist/src/utils/queries/claimsOverTime.js +0 -111
- package/dist/src/utils/queries/endingCampaigns.d.ts +0 -10
- package/dist/src/utils/queries/endingCampaigns.js +0 -21
- package/dist/src/utils/queries/futureCampaigns.d.ts +0 -3
- package/dist/src/utils/queries/futureCampaigns.js +0 -19
- package/dist/src/utils/queries/mainParameterCampaigns.d.ts +0 -5
- package/dist/src/utils/queries/mainParameterCampaigns.js +0 -11
- package/dist/src/utils/queries/rewardsAmount.d.ts +0 -10
- package/dist/src/utils/queries/rewardsAmount.js +0 -106
- package/dist/src/utils/queries/unclaimed.d.ts +0 -11
- package/dist/src/utils/queries/unclaimed.js +0 -81
@@ -57,24 +57,9 @@ export declare const v3: Elysia<"/v3", false, {
|
|
57
57
|
};
|
58
58
|
headers: unknown;
|
59
59
|
response: {
|
60
|
-
200:
|
61
|
-
|
62
|
-
|
63
|
-
};
|
64
|
-
};
|
65
|
-
} & {
|
66
|
-
v3: {
|
67
|
-
campaignReport: {
|
68
|
-
get: {
|
69
|
-
body: unknown;
|
70
|
-
params: {};
|
71
|
-
query: {
|
72
|
-
chainId: number;
|
73
|
-
campaignId: string;
|
74
|
-
};
|
75
|
-
headers: unknown;
|
76
|
-
response: {
|
77
|
-
200: import("../../utils/queries/rewardsAmount").RewardsAmountQueryOutput;
|
60
|
+
200: {
|
61
|
+
message: string;
|
62
|
+
};
|
78
63
|
};
|
79
64
|
};
|
80
65
|
};
|
@@ -111,28 +96,16 @@ export declare const v3: Elysia<"/v3", false, {
|
|
111
96
|
mainParameter: string;
|
112
97
|
};
|
113
98
|
headers: unknown;
|
114
|
-
response: {
|
115
|
-
200: import("../../types/returnTypes").CampaignsForMainParameterReturnType;
|
116
|
-
};
|
117
|
-
};
|
118
|
-
};
|
119
|
-
};
|
120
|
-
} & {
|
121
|
-
v3: {
|
122
|
-
campaignInfo: {
|
123
|
-
post: {
|
124
|
-
body: {
|
125
|
-
[x: string]: string[];
|
126
|
-
};
|
127
|
-
params: {};
|
128
|
-
query: unknown;
|
129
|
-
headers: unknown;
|
130
99
|
response: {
|
131
100
|
200: {
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
101
|
+
campaignId: string;
|
102
|
+
campaignType: number;
|
103
|
+
rewardToken: string;
|
104
|
+
rewardTokenSymbol: string;
|
105
|
+
amountDecimal: number;
|
106
|
+
startTimestamp: number;
|
107
|
+
endTimestamp: number;
|
108
|
+
}[];
|
136
109
|
};
|
137
110
|
};
|
138
111
|
};
|
@@ -188,7 +161,9 @@ export declare const v3: Elysia<"/v3", false, {
|
|
188
161
|
};
|
189
162
|
headers: unknown;
|
190
163
|
response: {
|
191
|
-
200:
|
164
|
+
200: {
|
165
|
+
message: string;
|
166
|
+
};
|
192
167
|
};
|
193
168
|
};
|
194
169
|
};
|
@@ -409,9 +384,9 @@ export declare const v3: Elysia<"/v3", false, {
|
|
409
384
|
body: unknown;
|
410
385
|
params: {};
|
411
386
|
query: {
|
412
|
-
type?: undefined;
|
387
|
+
type?: number | undefined;
|
413
388
|
tag?: string | undefined;
|
414
|
-
chainId?: undefined;
|
389
|
+
chainId?: number | undefined;
|
415
390
|
action?: undefined;
|
416
391
|
campaigns?: boolean | undefined;
|
417
392
|
mainParameter?: string | undefined;
|
@@ -695,25 +670,6 @@ export declare const v3: Elysia<"/v3", false, {
|
|
695
670
|
};
|
696
671
|
};
|
697
672
|
};
|
698
|
-
} & {
|
699
|
-
v3: {
|
700
|
-
tokenUnclaimed: {
|
701
|
-
get: {
|
702
|
-
body: unknown;
|
703
|
-
params: {};
|
704
|
-
query: {
|
705
|
-
token: string;
|
706
|
-
chainId: number;
|
707
|
-
};
|
708
|
-
headers: unknown;
|
709
|
-
response: {
|
710
|
-
200: {
|
711
|
-
message: string;
|
712
|
-
};
|
713
|
-
};
|
714
|
-
};
|
715
|
-
};
|
716
|
-
};
|
717
673
|
} & {
|
718
674
|
v3: {
|
719
675
|
updates: {
|
@@ -2,11 +2,9 @@ import Elysia from "elysia";
|
|
2
2
|
import app from "./app";
|
3
3
|
import blacklist from "./blacklist";
|
4
4
|
import campaignClaims from "./campaignClaims";
|
5
|
-
import campaignReport from "./campaignReport";
|
6
5
|
import campaignUnclaimed from "./campaignUnclaimed";
|
7
6
|
import campaigns from "./campaigns";
|
8
7
|
import campaignsForMainParameter from "./campaignsForMainParameter";
|
9
|
-
import campaignsInfo from "./campaignsInfo";
|
10
8
|
import campaignsRewardsReport from "./campaignsRewardsReport";
|
11
9
|
import claims from "./claims";
|
12
10
|
import compoundV2 from "./compoundV2";
|
@@ -32,7 +30,6 @@ import rewards from "./rewards";
|
|
32
30
|
import rewardsReport from "./rewardsReport";
|
33
31
|
import silo from "./silo";
|
34
32
|
import token from "./token";
|
35
|
-
import tokenUnclaimed from "./tokenUnclaimed";
|
36
33
|
import uniswapv4 from "./uniswapv4";
|
37
34
|
import updates from "./updates";
|
38
35
|
import userRewards from "./userRewards";
|
@@ -40,10 +37,8 @@ export const v3 = new Elysia({ tags: ["v3"], prefix: "/v3" })
|
|
40
37
|
.use(app)
|
41
38
|
.use(blacklist)
|
42
39
|
.use(campaignClaims)
|
43
|
-
.use(campaignReport)
|
44
40
|
.use(campaigns)
|
45
41
|
.use(campaignsForMainParameter)
|
46
|
-
.use(campaignsInfo)
|
47
42
|
.use(campaignsRewardsReport)
|
48
43
|
.use(campaignUnclaimed)
|
49
44
|
.use(claims)
|
@@ -70,7 +65,6 @@ export const v3 = new Elysia({ tags: ["v3"], prefix: "/v3" })
|
|
70
65
|
.use(rewardsReport)
|
71
66
|
.use(silo)
|
72
67
|
.use(token)
|
73
|
-
.use(tokenUnclaimed)
|
74
68
|
.use(updates)
|
75
69
|
.use(userRewards)
|
76
70
|
.use(uniswapv4);
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
|
2
2
|
import { RewardService, UserRewardV3Dto } from "../../modules/v4/reward";
|
3
|
-
import { RewardConvertorService } from "../../modules/v4/reward/
|
3
|
+
import { RewardConvertorService } from "../../modules/v4/reward/reward.converter";
|
4
4
|
import param from "../../types/parameters";
|
5
5
|
import { InvalidParameter } from "../../utils/error";
|
6
6
|
import { throwOnUnsupportedChainId } from "../../utils/throw";
|
7
7
|
import { t } from "elysia";
|
8
8
|
import { utils } from "ethers";
|
9
9
|
import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
|
10
|
+
// @dev DEPRECATED - conversion to v4 done
|
10
11
|
export const query = t.Object({
|
11
12
|
chainId: param.Chain.type,
|
12
13
|
reloadChainId: t.Optional(t.Number()),
|
@@ -1,11 +1,3 @@
|
|
1
|
-
export type CampaignsForMainParameterReturnType = {
|
2
|
-
campaignId: string;
|
3
|
-
rewardToken: string;
|
4
|
-
rewardTokenSymbol: string;
|
5
|
-
amountDecimal: number;
|
6
|
-
startTimestamp: number;
|
7
|
-
endTimestamp: number;
|
8
|
-
}[];
|
9
1
|
export type OverviewReturnType = {
|
10
2
|
disputes: {
|
11
3
|
[chainId: number]: {
|
@@ -1,3 +1,12 @@
|
|
1
1
|
export function camelToKebabCase(str) {
|
2
2
|
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
3
3
|
}
|
4
|
+
export function kebabToCamelCase(str) {
|
5
|
+
return str.replace(/-./g, match => match[1].toUpperCase());
|
6
|
+
}
|
7
|
+
export function kebabToPascalCase(str) {
|
8
|
+
return str
|
9
|
+
.split("-")
|
10
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
11
|
+
.join("");
|
12
|
+
}
|