@merkl/api 0.10.198 → 0.10.200
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/eden/index.d.ts +2 -6398
- package/dist/src/errors/HttpError.d.ts +5 -0
- package/dist/src/errors/HttpError.js +6 -0
- package/dist/src/errors/NotFound.error.d.ts +4 -0
- package/dist/src/errors/NotFound.error.js +5 -0
- package/dist/src/index.d.ts +1 -2464
- package/dist/src/index.js +56 -7
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +15 -22
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +1 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +8 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GammaProcessor.d.ts +43 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GammaProcessor.js +63 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.d.ts +3 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/GenericProcessor.js +3 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.d.ts +36 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/NoLinkVaultProcessor.js +51 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.d.ts +0 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/StakingProcessor.js +15 -7
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +4 -0
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.d.ts +1 -1
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPrices.js +13 -572
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.d.ts +2 -21
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1.js +197 -1174
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.d.ts +1 -5
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2.js +11 -634
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.d.ts +1 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3.js +10 -380
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.d.ts +3 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4.js +11 -312
- package/dist/src/libs/campaigns/campaignTypes/EulerDynamicData.js +8 -8
- package/dist/src/libs/campaigns/campaignTypes/RadiantDynamicData.js +3 -4
- package/dist/src/libs/campaigns/campaignsDynamicData.js +0 -5
- package/dist/src/modules/v4/accounting/accounting.controller.js +1 -1
- package/dist/src/modules/v4/apr/apr.model.d.ts +26 -0
- package/dist/src/modules/v4/apr/apr.model.js +15 -1
- package/dist/src/modules/v4/blacklist/blacklist.controller.js +1 -1
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +4 -4
- package/dist/src/modules/v4/campaign/campaign.controller.js +14 -4
- package/dist/src/modules/v4/campaign/campaign.model.d.ts +50 -5
- package/dist/src/modules/v4/campaign/campaign.model.js +47 -13
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +2 -2
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +2 -2
- package/dist/src/modules/v4/chain/chain.controller.d.ts +2 -2
- package/dist/src/modules/v4/chain/chain.controller.js +7 -2
- package/dist/src/modules/v4/chain/chain.model.d.ts +6 -1
- package/dist/src/modules/v4/chain/chain.model.js +8 -1
- package/dist/src/modules/v4/chain/chain.repository.js +1 -1
- package/dist/src/modules/v4/claims/claims.controller.js +1 -1
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +4 -1
- package/dist/src/modules/v4/enso/enso.model.d.ts +1 -1
- package/dist/src/modules/v4/enso/enso.model.js +2 -1
- package/dist/src/modules/v4/enso/enso.service.d.ts +0 -1
- package/dist/src/modules/v4/enso/enso.service.js +4 -4
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +26 -17
- package/dist/src/modules/v4/interaction/interaction.controller.js +19 -28
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +17 -5
- package/dist/src/modules/v4/interaction/interaction.model.js +3 -3
- package/dist/src/modules/v4/interaction/interaction.service.d.ts +18 -3
- package/dist/src/modules/v4/interaction/interaction.service.js +89 -11
- package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +72 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +79 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +15 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +84 -0
- package/dist/src/modules/v4/liquidity/liquidity.controller.js +1 -1
- package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +224 -213
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +39 -10
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +252 -22
- package/dist/src/modules/v4/opportunity/opportunity.model.js +58 -15
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +11 -11
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +12 -232
- package/dist/src/modules/v4/opportunity/opportunity.service.js +0 -32
- package/dist/src/modules/v4/price/price.controller.js +1 -1
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +23 -24
- package/dist/src/modules/v4/protocol/protocol.controller.js +15 -9
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +13 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +12 -8
- package/dist/src/modules/v4/reward/reward.controller.js +1 -1
- package/dist/src/modules/v4/reward/reward.model.d.ts +44 -1
- package/dist/src/modules/v4/reward/reward.model.js +15 -0
- package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.service.d.ts +11 -11
- package/dist/src/modules/v4/reward/reward.service.js +1 -2
- package/dist/src/modules/v4/router.d.ts +287 -268
- package/dist/src/modules/v4/status/status.controller.js +2 -3
- package/dist/src/modules/v4/status/status.model.d.ts +12 -0
- package/dist/src/modules/v4/status/status.model.js +12 -0
- package/dist/src/modules/v4/status/status.service.js +0 -1
- package/dist/src/modules/v4/token/token.controller.d.ts +4 -4
- package/dist/src/modules/v4/token/token.controller.js +1 -1
- package/dist/src/modules/v4/token/token.model.d.ts +12 -0
- package/dist/src/modules/v4/token/token.model.js +12 -0
- package/dist/src/modules/v4/token/token.repository.d.ts +2 -2
- package/dist/src/modules/v4/token/token.service.d.ts +7 -7
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +24 -0
- package/dist/src/modules/v4/tvl/tvl.model.js +15 -1
- package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.d.ts +1 -1
- package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.js +9 -8
- package/dist/src/modules/v4/user/user.controller.d.ts +4 -4
- package/dist/src/modules/v4/user/user.controller.js +20 -17
- package/dist/src/modules/v4/user/user.model.d.ts +30 -0
- package/dist/src/modules/v4/user/user.model.js +27 -0
- package/dist/src/modules/v4/zyfi/zyfi.model.d.ts +45 -0
- package/dist/src/modules/v4/zyfi/zyfi.model.js +1 -0
- package/dist/src/modules/v4/zyfi/zyfi.service.d.ts +30 -0
- package/dist/src/modules/v4/zyfi/zyfi.service.js +35 -0
- package/dist/src/plugins/error-handling.plugin.d.ts +2 -2
- package/dist/src/plugins/error-handling.plugin.js +9 -3
- package/dist/src/plugins/logger.plugin.js +1 -20
- package/dist/src/routes/v1/allowances.d.ts +1 -1
- package/dist/src/routes/v1/allowances.js +1 -1
- package/dist/src/routes/v1/balances.d.ts +1 -1
- package/dist/src/routes/v1/balances.js +1 -1
- package/dist/src/routes/v1/prices.d.ts +1 -1
- package/dist/src/routes/v1/prices.js +1 -1
- package/dist/src/routes/v1/router.d.ts +102 -0
- package/dist/src/routes/v1/router.js +6 -0
- package/dist/src/routes/v1/tokens.d.ts +1 -1
- package/dist/src/routes/v1/tokens.js +1 -1
- package/dist/src/routes/v2/merkl.d.ts +5 -5
- package/dist/src/routes/v2/merkl.js +1 -1
- package/dist/src/routes/v2/router.d.ts +46 -0
- package/dist/src/routes/v2/router.js +3 -0
- package/dist/src/routes/v3/app.d.ts +1 -1
- package/dist/src/routes/v3/app.js +1 -1
- package/dist/src/routes/v3/blacklist.d.ts +1 -2479
- package/dist/src/routes/v3/blacklist.js +1 -1
- package/dist/src/routes/v3/campaignClaims.d.ts +1 -1
- package/dist/src/routes/v3/campaignClaims.js +1 -1
- package/dist/src/routes/v3/campaignReport.d.ts +1 -1
- package/dist/src/routes/v3/campaignReport.js +1 -1
- package/dist/src/routes/v3/campaignUnclaimed.d.ts +1 -1
- package/dist/src/routes/v3/campaignUnclaimed.js +1 -1
- package/dist/src/routes/v3/campaigns.d.ts +1 -2483
- package/dist/src/routes/v3/campaigns.js +1 -1
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +1 -1
- package/dist/src/routes/v3/campaignsForMainParameter.js +1 -1
- package/dist/src/routes/v3/campaignsInfo.d.ts +1 -2481
- package/dist/src/routes/v3/campaignsInfo.js +1 -1
- package/dist/src/routes/v3/campaignsRewardsReport.d.ts +1 -1
- package/dist/src/routes/v3/campaignsRewardsReport.js +1 -1
- package/dist/src/routes/v3/claims.d.ts +1 -1
- package/dist/src/routes/v3/claims.js +1 -1
- package/dist/src/routes/v3/compoundV2.d.ts +1 -1
- package/dist/src/routes/v3/compoundV2.js +1 -1
- package/dist/src/routes/v3/createCampaign.d.ts +1 -1
- package/dist/src/routes/v3/createCampaign.js +1 -1
- package/dist/src/routes/v3/dolomite.d.ts +1 -1
- package/dist/src/routes/v3/dolomite.js +1 -1
- package/dist/src/routes/v3/euler.d.ts +1 -1
- package/dist/src/routes/v3/euler.js +1 -1
- package/dist/src/routes/v3/fetch.d.ts +1 -1
- package/dist/src/routes/v3/fetch.js +1 -1
- package/dist/src/routes/v3/health.d.ts +1 -1
- package/dist/src/routes/v3/health.js +1 -1
- package/dist/src/routes/v3/lostyield.d.ts +1 -1
- package/dist/src/routes/v3/lostyield.js +1 -1
- package/dist/src/routes/v3/merkl.d.ts +1 -1
- package/dist/src/routes/v3/merkl.js +1 -1
- package/dist/src/routes/v3/morphoMarkets.d.ts +1 -1
- package/dist/src/routes/v3/morphoMarkets.js +1 -1
- package/dist/src/routes/v3/morphoVaults.d.ts +1 -1
- package/dist/src/routes/v3/morphoVaults.js +1 -1
- package/dist/src/routes/v3/multiChainPositions.d.ts +1 -2480
- package/dist/src/routes/v3/multiChainPositions.js +1 -1
- package/dist/src/routes/v3/opportunity.d.ts +1 -2483
- package/dist/src/routes/v3/opportunity.js +1 -1
- package/dist/src/routes/v3/overview.d.ts +1 -1
- package/dist/src/routes/v3/overview.js +1 -1
- package/dist/src/routes/v3/parse.d.ts +1 -1
- package/dist/src/routes/v3/parse.js +1 -1
- package/dist/src/routes/v3/payload.d.ts +1 -1
- package/dist/src/routes/v3/payload.js +1 -1
- package/dist/src/routes/v3/poolInfo.js +1 -1
- package/dist/src/routes/v3/positions.d.ts +1 -2479
- package/dist/src/routes/v3/positions.js +1 -1
- package/dist/src/routes/v3/radiant.d.ts +1 -1
- package/dist/src/routes/v3/radiant.js +1 -1
- package/dist/src/routes/v3/recipients.d.ts +1 -1
- package/dist/src/routes/v3/recipients.js +1 -1
- package/dist/src/routes/v3/rewards.d.ts +1 -2508
- package/dist/src/routes/v3/rewards.js +1 -1
- package/dist/src/routes/v3/rewardsReport.d.ts +1 -1
- package/dist/src/routes/v3/rewardsReport.js +1 -1
- package/dist/src/routes/v3/router.d.ts +1 -0
- package/dist/src/routes/v3/router.js +74 -0
- package/dist/src/routes/v3/silo.d.ts +1 -1
- package/dist/src/routes/v3/silo.js +1 -1
- package/dist/src/routes/v3/token.d.ts +1 -1
- package/dist/src/routes/v3/token.js +1 -1
- package/dist/src/routes/v3/tokenUnclaimed.d.ts +1 -1
- package/dist/src/routes/v3/tokenUnclaimed.js +1 -1
- package/dist/src/routes/v3/updates.d.ts +1 -2483
- package/dist/src/routes/v3/updates.js +1 -1
- package/dist/src/routes/v3/userRewards.d.ts +1 -2499
- package/dist/src/routes/v3/userRewards.js +1 -1
- package/dist/src/utils/decodeCalls.js +12 -1
- package/dist/src/utils/encodeCalls.js +26 -3
- package/dist/src/utils/generateCardName.js +2 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.js +0 -155
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPricesRefactoFinal.d.ts +0 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesPricesRefactoFinal.js +0 -24
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.d.ts +0 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +0 -230
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2RefactoFinal.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound2RefactoFinal.js +0 -22
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3RefactoFinal.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound3RefactoFinal.js +0 -22
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4RefactoFinal.d.ts +0 -4
- package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound4RefactoFinal.js +0 -22
- package/dist/src/libs/campaigns/campaignsDynamicDataRefacto.d.ts +0 -3
- package/dist/src/libs/campaigns/campaignsDynamicDataRefacto.js +0 -75
@@ -42,13 +42,25 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
42
42
|
};
|
43
43
|
} & {
|
44
44
|
opportunities: {
|
45
|
-
|
45
|
+
index: {
|
46
46
|
get: {
|
47
47
|
body: unknown;
|
48
|
-
params: {
|
49
|
-
|
48
|
+
params: {};
|
49
|
+
query: {
|
50
|
+
sort?: string | undefined;
|
51
|
+
name?: string | undefined;
|
52
|
+
tokens?: string | undefined;
|
53
|
+
status?: string | undefined;
|
54
|
+
items?: number | undefined;
|
55
|
+
tags?: string | undefined;
|
56
|
+
page?: number | undefined;
|
57
|
+
chainId?: string | undefined;
|
58
|
+
action?: string | undefined;
|
59
|
+
mainProtocolId?: string | undefined;
|
60
|
+
order?: string | undefined;
|
61
|
+
test?: boolean | undefined;
|
62
|
+
minimumTvl?: number | undefined;
|
50
63
|
};
|
51
|
-
query: unknown;
|
52
64
|
headers: unknown;
|
53
65
|
response: {
|
54
66
|
200: {
|
@@ -88,9 +100,9 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
88
100
|
symbol: string;
|
89
101
|
name: string | null;
|
90
102
|
id: string;
|
103
|
+
icon: string;
|
91
104
|
chainId: number;
|
92
105
|
address: string;
|
93
|
-
icon: string;
|
94
106
|
decimals: number;
|
95
107
|
displaySymbol: string;
|
96
108
|
verified: boolean;
|
@@ -105,9 +117,9 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
105
117
|
symbol: string;
|
106
118
|
name: string | null;
|
107
119
|
id: string;
|
120
|
+
icon: string;
|
108
121
|
chainId: number;
|
109
122
|
address: string;
|
110
|
-
icon: string;
|
111
123
|
decimals: number;
|
112
124
|
verified: boolean;
|
113
125
|
isTest: boolean;
|
@@ -137,7 +149,143 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
137
149
|
tvl: number;
|
138
150
|
apr: number;
|
139
151
|
dailyRewards: number;
|
140
|
-
}
|
152
|
+
}[];
|
153
|
+
};
|
154
|
+
};
|
155
|
+
};
|
156
|
+
};
|
157
|
+
} & {
|
158
|
+
opportunities: {
|
159
|
+
count: {
|
160
|
+
get: {
|
161
|
+
body: unknown;
|
162
|
+
params: {};
|
163
|
+
query: {
|
164
|
+
sort?: string | undefined;
|
165
|
+
name?: string | undefined;
|
166
|
+
tokens?: string | undefined;
|
167
|
+
status?: string | undefined;
|
168
|
+
items?: number | undefined;
|
169
|
+
tags?: string | undefined;
|
170
|
+
page?: number | undefined;
|
171
|
+
chainId?: string | undefined;
|
172
|
+
action?: string | undefined;
|
173
|
+
mainProtocolId?: string | undefined;
|
174
|
+
order?: string | undefined;
|
175
|
+
test?: boolean | undefined;
|
176
|
+
minimumTvl?: number | undefined;
|
177
|
+
};
|
178
|
+
headers: unknown;
|
179
|
+
response: {
|
180
|
+
200: number;
|
181
|
+
};
|
182
|
+
};
|
183
|
+
};
|
184
|
+
};
|
185
|
+
} & {
|
186
|
+
opportunities: {
|
187
|
+
":id": {
|
188
|
+
get: {
|
189
|
+
body: unknown;
|
190
|
+
params: {
|
191
|
+
id: string;
|
192
|
+
};
|
193
|
+
query: unknown;
|
194
|
+
headers: unknown;
|
195
|
+
response: {
|
196
|
+
200: {
|
197
|
+
protocol?: {
|
198
|
+
name: string;
|
199
|
+
url: string;
|
200
|
+
description: string;
|
201
|
+
id: string;
|
202
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
203
|
+
icon: string;
|
204
|
+
} | null | undefined;
|
205
|
+
aprRecord?: {
|
206
|
+
timestamp: string | bigint;
|
207
|
+
cumulated: number;
|
208
|
+
breakdowns: {
|
209
|
+
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
210
|
+
id: number;
|
211
|
+
identifier: string;
|
212
|
+
value: number;
|
213
|
+
aprRecordId: string;
|
214
|
+
}[];
|
215
|
+
} | undefined;
|
216
|
+
tvlRecord?: {
|
217
|
+
total: number;
|
218
|
+
timestamp: string | bigint;
|
219
|
+
breakdowns: {
|
220
|
+
type: "TOKEN" | "PROTOCOL";
|
221
|
+
id: number;
|
222
|
+
identifier: string;
|
223
|
+
value: number;
|
224
|
+
tvlRecordId: string;
|
225
|
+
}[];
|
226
|
+
} | undefined;
|
227
|
+
rewardsRecord?: {
|
228
|
+
total: number;
|
229
|
+
id: string;
|
230
|
+
timestamp: string | bigint;
|
231
|
+
breakdowns: {
|
232
|
+
token: {
|
233
|
+
price?: number | null | undefined;
|
234
|
+
symbol: string;
|
235
|
+
name: string | null;
|
236
|
+
id: string;
|
237
|
+
icon: string;
|
238
|
+
chainId: number;
|
239
|
+
address: string;
|
240
|
+
decimals: number;
|
241
|
+
verified: boolean;
|
242
|
+
isTest: boolean;
|
243
|
+
};
|
244
|
+
id: number;
|
245
|
+
value: number;
|
246
|
+
campaignId: string;
|
247
|
+
amount: string | bigint;
|
248
|
+
dailyRewardsRecordId: string;
|
249
|
+
}[];
|
250
|
+
} | undefined;
|
251
|
+
name: string;
|
252
|
+
type: string;
|
253
|
+
tokens: {
|
254
|
+
price?: number | null | undefined;
|
255
|
+
symbol: string;
|
256
|
+
name: string | null;
|
257
|
+
id: string;
|
258
|
+
icon: string;
|
259
|
+
chainId: number;
|
260
|
+
address: string;
|
261
|
+
decimals: number;
|
262
|
+
verified: boolean;
|
263
|
+
isTest: boolean;
|
264
|
+
}[];
|
265
|
+
id: string;
|
266
|
+
status: string;
|
267
|
+
tags: string[];
|
268
|
+
identifier: string;
|
269
|
+
chain: {
|
270
|
+
name: string;
|
271
|
+
id: number;
|
272
|
+
icon: string;
|
273
|
+
};
|
274
|
+
chainId: number;
|
275
|
+
action: string;
|
276
|
+
tvl: number;
|
277
|
+
apr: number;
|
278
|
+
dailyRewards: number;
|
279
|
+
};
|
280
|
+
readonly 404: {
|
281
|
+
message: string;
|
282
|
+
name: string;
|
283
|
+
};
|
284
|
+
readonly 500: {
|
285
|
+
code: string;
|
286
|
+
info: string;
|
287
|
+
httpCode: number;
|
288
|
+
};
|
141
289
|
};
|
142
290
|
};
|
143
291
|
};
|
@@ -155,129 +303,113 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
155
303
|
headers: unknown;
|
156
304
|
response: {
|
157
305
|
200: {
|
158
|
-
|
306
|
+
protocol?: {
|
307
|
+
name: string;
|
308
|
+
url: string;
|
309
|
+
description: string;
|
310
|
+
id: string;
|
311
|
+
tags: ("AMM" | "ALM" | "DEX" | "LENDING")[];
|
312
|
+
icon: string;
|
313
|
+
} | null | undefined;
|
314
|
+
aprRecord?: {
|
315
|
+
timestamp: string | bigint;
|
159
316
|
cumulated: number;
|
160
|
-
timestamp: bigint;
|
161
317
|
breakdowns: {
|
162
|
-
type:
|
318
|
+
type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
|
163
319
|
id: number;
|
164
320
|
identifier: string;
|
165
321
|
value: number;
|
166
322
|
aprRecordId: string;
|
167
323
|
}[];
|
168
|
-
};
|
169
|
-
tvlRecord
|
170
|
-
id: string;
|
324
|
+
} | undefined;
|
325
|
+
tvlRecord?: {
|
171
326
|
total: number;
|
172
|
-
timestamp: bigint;
|
327
|
+
timestamp: string | bigint;
|
173
328
|
breakdowns: {
|
174
|
-
type:
|
329
|
+
type: "TOKEN" | "PROTOCOL";
|
175
330
|
id: number;
|
176
331
|
identifier: string;
|
177
332
|
value: number;
|
178
333
|
tvlRecordId: string;
|
179
334
|
}[];
|
180
|
-
};
|
181
|
-
rewardsRecord
|
182
|
-
id: string;
|
335
|
+
} | undefined;
|
336
|
+
rewardsRecord?: {
|
183
337
|
total: number;
|
184
|
-
|
338
|
+
id: string;
|
339
|
+
timestamp: string | bigint;
|
185
340
|
breakdowns: {
|
186
|
-
id: number;
|
187
|
-
value: number;
|
188
|
-
campaignId: string;
|
189
|
-
dailyRewardsRecordId: string;
|
190
341
|
token: {
|
342
|
+
price?: number | null | undefined;
|
191
343
|
symbol: string;
|
192
344
|
name: string | null;
|
193
345
|
id: string;
|
346
|
+
icon: string;
|
194
347
|
chainId: number;
|
195
348
|
address: string;
|
196
|
-
icon: string;
|
197
349
|
decimals: number;
|
198
|
-
displaySymbol: string;
|
199
350
|
verified: boolean;
|
200
351
|
isTest: boolean;
|
201
|
-
price: number | null;
|
202
352
|
};
|
203
|
-
|
353
|
+
id: number;
|
354
|
+
value: number;
|
355
|
+
campaignId: string;
|
356
|
+
amount: string | bigint;
|
357
|
+
dailyRewardsRecordId: string;
|
204
358
|
}[];
|
205
|
-
};
|
206
|
-
|
207
|
-
|
359
|
+
} | undefined;
|
360
|
+
name: string;
|
361
|
+
type: string;
|
362
|
+
tokens: {
|
363
|
+
price?: number | null | undefined;
|
208
364
|
symbol: string;
|
209
365
|
name: string | null;
|
210
366
|
id: string;
|
367
|
+
icon: string;
|
211
368
|
chainId: number;
|
212
369
|
address: string;
|
213
|
-
icon: string;
|
214
370
|
decimals: number;
|
215
371
|
verified: boolean;
|
216
372
|
isTest: boolean;
|
217
|
-
}
|
218
|
-
|
219
|
-
|
373
|
+
}[];
|
374
|
+
id: string;
|
375
|
+
status: string;
|
376
|
+
tags: string[];
|
377
|
+
identifier: string;
|
220
378
|
chain: {
|
221
379
|
name: string;
|
222
380
|
id: number;
|
223
381
|
icon: string;
|
224
382
|
};
|
225
|
-
protocol: {
|
226
|
-
name: string;
|
227
|
-
url: string;
|
228
|
-
description: string;
|
229
|
-
id: string;
|
230
|
-
tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
|
231
|
-
icon: string;
|
232
|
-
} | undefined;
|
233
|
-
name: string;
|
234
|
-
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
235
|
-
status: import("../../../../database/api/.generated").$Enums.Status;
|
236
|
-
tags: string[];
|
237
|
-
identifier: string;
|
238
383
|
chainId: number;
|
239
|
-
action:
|
384
|
+
action: string;
|
240
385
|
tvl: number;
|
241
386
|
apr: number;
|
242
387
|
dailyRewards: number;
|
243
388
|
campaigns: {
|
244
|
-
|
245
|
-
|
389
|
+
campaignStatus?: {
|
390
|
+
error?: string | undefined;
|
391
|
+
details?: any;
|
392
|
+
status: string;
|
393
|
+
campaignId: string;
|
394
|
+
computedUntil: string | bigint;
|
395
|
+
processingStarted: string | bigint;
|
396
|
+
} | undefined;
|
397
|
+
distributionChain?: {
|
246
398
|
name: string;
|
247
399
|
id: number;
|
248
400
|
icon: string;
|
249
|
-
};
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
address: string;
|
256
|
-
icon: string;
|
257
|
-
decimals: number;
|
258
|
-
verified: boolean;
|
259
|
-
isTest: boolean;
|
260
|
-
} & {
|
261
|
-
price?: number | null | undefined;
|
262
|
-
};
|
263
|
-
distributionChain: {
|
401
|
+
} | undefined;
|
402
|
+
type: string;
|
403
|
+
id: string;
|
404
|
+
params: any;
|
405
|
+
subType: number | null;
|
406
|
+
chain: {
|
264
407
|
name: string;
|
265
408
|
id: number;
|
266
409
|
icon: string;
|
267
|
-
} | undefined;
|
268
|
-
campaignStatus: {
|
269
|
-
error: string;
|
270
|
-
details: import("database/api/.generated/runtime/library").JsonValue;
|
271
|
-
status: import("../../../../database/api/.generated").$Enums.RunStatus;
|
272
|
-
campaignId: string;
|
273
|
-
computedUntil: bigint;
|
274
|
-
processingStarted: bigint;
|
275
410
|
};
|
276
|
-
|
277
|
-
|
278
|
-
subType: number | null;
|
279
|
-
startTimestamp: bigint;
|
280
|
-
endTimestamp: bigint;
|
411
|
+
startTimestamp: string | bigint;
|
412
|
+
endTimestamp: string | bigint;
|
281
413
|
computeChainId: number;
|
282
414
|
distributionChainId: number;
|
283
415
|
campaignId: string;
|
@@ -285,151 +417,30 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
285
417
|
amount: string;
|
286
418
|
opportunityId: string;
|
287
419
|
creatorAddress: string;
|
288
|
-
|
289
|
-
|
290
|
-
};
|
291
|
-
};
|
292
|
-
};
|
293
|
-
};
|
294
|
-
};
|
295
|
-
} & {
|
296
|
-
opportunities: {
|
297
|
-
index: {
|
298
|
-
get: {
|
299
|
-
body: unknown;
|
300
|
-
params: {};
|
301
|
-
query: {
|
302
|
-
sort?: "tvl" | "apr" | "rewards" | undefined;
|
303
|
-
name?: string | undefined;
|
304
|
-
tokens?: string | undefined;
|
305
|
-
status?: string | undefined;
|
306
|
-
items?: number | undefined;
|
307
|
-
tags?: string | undefined;
|
308
|
-
chainId?: string | undefined;
|
309
|
-
page?: number | undefined;
|
310
|
-
action?: string | undefined;
|
311
|
-
mainProtocolId?: string | undefined;
|
312
|
-
order?: "asc" | "desc" | undefined;
|
313
|
-
test?: boolean | undefined;
|
314
|
-
minimumTvl?: number | undefined;
|
315
|
-
};
|
316
|
-
headers: unknown;
|
317
|
-
response: {
|
318
|
-
200: {
|
319
|
-
aprRecord: {
|
320
|
-
cumulated: number;
|
321
|
-
timestamp: bigint;
|
322
|
-
breakdowns: {
|
323
|
-
type: import("../../../../database/api/.generated").$Enums.AprType;
|
324
|
-
id: number;
|
325
|
-
identifier: string;
|
326
|
-
value: number;
|
327
|
-
aprRecordId: string;
|
328
|
-
}[];
|
329
|
-
};
|
330
|
-
tvlRecord: {
|
331
|
-
id: string;
|
332
|
-
total: number;
|
333
|
-
timestamp: bigint;
|
334
|
-
breakdowns: {
|
335
|
-
type: import("../../../../database/api/.generated").$Enums.TvlType;
|
336
|
-
id: number;
|
337
|
-
identifier: string;
|
338
|
-
value: number;
|
339
|
-
tvlRecordId: string;
|
340
|
-
}[];
|
341
|
-
};
|
342
|
-
rewardsRecord: {
|
343
|
-
id: string;
|
344
|
-
total: number;
|
345
|
-
timestamp: bigint;
|
346
|
-
breakdowns: {
|
347
|
-
id: number;
|
348
|
-
value: number;
|
349
|
-
campaignId: string;
|
350
|
-
dailyRewardsRecordId: string;
|
351
|
-
token: {
|
420
|
+
rewardToken: {
|
421
|
+
price?: number | null | undefined;
|
352
422
|
symbol: string;
|
353
423
|
name: string | null;
|
354
424
|
id: string;
|
425
|
+
icon: string;
|
355
426
|
chainId: number;
|
356
427
|
address: string;
|
357
|
-
icon: string;
|
358
428
|
decimals: number;
|
359
|
-
displaySymbol: string;
|
360
429
|
verified: boolean;
|
361
430
|
isTest: boolean;
|
362
|
-
price: number | null;
|
363
431
|
};
|
364
|
-
amount: bigint;
|
365
432
|
}[];
|
366
433
|
};
|
367
|
-
|
368
|
-
|
369
|
-
symbol: string;
|
370
|
-
name: string | null;
|
371
|
-
id: string;
|
372
|
-
chainId: number;
|
373
|
-
address: string;
|
374
|
-
icon: string;
|
375
|
-
decimals: number;
|
376
|
-
verified: boolean;
|
377
|
-
isTest: boolean;
|
378
|
-
} & {
|
379
|
-
price?: number | null | undefined;
|
380
|
-
})[];
|
381
|
-
chain: {
|
434
|
+
readonly 404: {
|
435
|
+
message: string;
|
382
436
|
name: string;
|
383
|
-
id: number;
|
384
|
-
icon: string;
|
385
437
|
};
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
icon: string;
|
393
|
-
} | undefined;
|
394
|
-
name: string;
|
395
|
-
type: import("../../../../database/api/.generated").$Enums.CampaignType;
|
396
|
-
status: import("../../../../database/api/.generated").$Enums.Status;
|
397
|
-
tags: string[];
|
398
|
-
identifier: string;
|
399
|
-
chainId: number;
|
400
|
-
action: import("../../../../database/api/.generated").$Enums.OpportunityAction;
|
401
|
-
tvl: number;
|
402
|
-
apr: number;
|
403
|
-
dailyRewards: number;
|
404
|
-
}[];
|
405
|
-
};
|
406
|
-
};
|
407
|
-
};
|
408
|
-
};
|
409
|
-
} & {
|
410
|
-
opportunities: {
|
411
|
-
count: {
|
412
|
-
get: {
|
413
|
-
body: unknown;
|
414
|
-
params: {};
|
415
|
-
query: {
|
416
|
-
sort?: "tvl" | "apr" | "rewards" | undefined;
|
417
|
-
name?: string | undefined;
|
418
|
-
tokens?: string | undefined;
|
419
|
-
status?: string | undefined;
|
420
|
-
items?: number | undefined;
|
421
|
-
tags?: string | undefined;
|
422
|
-
chainId?: string | undefined;
|
423
|
-
page?: number | undefined;
|
424
|
-
action?: string | undefined;
|
425
|
-
mainProtocolId?: string | undefined;
|
426
|
-
order?: "asc" | "desc" | undefined;
|
427
|
-
test?: boolean | undefined;
|
428
|
-
minimumTvl?: number | undefined;
|
429
|
-
};
|
430
|
-
headers: unknown;
|
431
|
-
response: {
|
432
|
-
200: number;
|
438
|
+
readonly 500: {
|
439
|
+
code: string;
|
440
|
+
info: string;
|
441
|
+
httpCode: number;
|
442
|
+
};
|
443
|
+
};
|
433
444
|
};
|
434
445
|
};
|
435
446
|
};
|
@@ -444,17 +455,17 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
444
455
|
field: never;
|
445
456
|
};
|
446
457
|
query: {
|
447
|
-
sort?:
|
458
|
+
sort?: string | undefined;
|
448
459
|
name?: string | undefined;
|
449
460
|
tokens?: string | undefined;
|
450
461
|
status?: string | undefined;
|
451
462
|
items?: number | undefined;
|
452
463
|
tags?: string | undefined;
|
453
|
-
chainId?: string | undefined;
|
454
464
|
page?: number | undefined;
|
465
|
+
chainId?: string | undefined;
|
455
466
|
action?: string | undefined;
|
456
467
|
mainProtocolId?: string | undefined;
|
457
|
-
order?:
|
468
|
+
order?: string | undefined;
|
458
469
|
test?: boolean | undefined;
|
459
470
|
minimumTvl?: number | undefined;
|
460
471
|
};
|
@@ -1,15 +1,17 @@
|
|
1
|
-
import { NotFoundError } from "../../../errors";
|
1
|
+
import { HttpErrorDto, NotFoundError, NotFoundErrorDto } from "../../../errors";
|
2
2
|
import { BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
3
3
|
import { AuthorizationHeadersDto, TokenAuthGuard } from "../../../guards/TokenAuth.guard";
|
4
|
-
import Elysia from "elysia";
|
5
|
-
import { CreateOpportunityDto, GetOpportunitiesQueryDto, OpportunityAggregateFieldDto, OpportunityIdDto, OpportunityUniqueDto, UpdateOpportunityDto, } from "./opportunity.model";
|
4
|
+
import Elysia, { t } from "elysia";
|
5
|
+
import { AggregationResourceDto, CreateOpportunityDto, GetOpportunitiesQueryDto, OpportunityAggregateFieldDto, OpportunityIdDto, OpportunityResourceDto, OpportunityUniqueDto, OpportunityWithCampaignsResourceDto, UpdateOpportunityDto, } from "./opportunity.model";
|
6
6
|
import { OpportunityService } from "./opportunity.service";
|
7
7
|
import { transformId } from "./transform-id.pipe";
|
8
8
|
import { validateId } from "./validate-id.pipe";
|
9
9
|
// ─── Opportunities Controller ────────────────────────────────────────────────
|
10
10
|
export const OpportunityController = new Elysia({
|
11
11
|
prefix: "/opportunities",
|
12
|
-
detail: {
|
12
|
+
detail: {
|
13
|
+
tags: ["Opportunities"],
|
14
|
+
},
|
13
15
|
})
|
14
16
|
// ─── Create An Opportunity ───────────────────────────────────────────
|
15
17
|
.post("/", async ({ body }) => await OpportunityService.create(body), {
|
@@ -17,6 +19,21 @@ export const OpportunityController = new Elysia({
|
|
17
19
|
headers: AuthorizationHeadersDto,
|
18
20
|
body: CreateOpportunityDto,
|
19
21
|
detail: { hide: true },
|
22
|
+
})
|
23
|
+
// ─── Get All Opportunities ───────────────────────────────────────────
|
24
|
+
.get("/", async ({ query }) => await OpportunityService.getMany(query), {
|
25
|
+
query: GetOpportunitiesQueryDto,
|
26
|
+
detail: {
|
27
|
+
description: `**Retrieve Multiple Opportunities**
|
28
|
+
<p>This endpoint enables you to search for opportunities by providing specific criteria through query parameters.</p>`,
|
29
|
+
},
|
30
|
+
response: t.Array(t.Union([OpportunityResourceDto, t.Null()])),
|
31
|
+
})
|
32
|
+
// ─── Get Opportunities Count ─────────────────────────────────────────
|
33
|
+
.get("/count", async ({ query }) => await OpportunityService.countMany(query), {
|
34
|
+
query: GetOpportunitiesQueryDto,
|
35
|
+
detail: { description: "Get the count of opportunities corresponding to the query." },
|
36
|
+
response: { 200: t.Number() },
|
20
37
|
})
|
21
38
|
// ─── Get An Opportunity By Id ────────────────────────────────────────
|
22
39
|
.get("/:id", async ({ params }) => {
|
@@ -33,11 +50,18 @@ export const OpportunityController = new Elysia({
|
|
33
50
|
catch (err) {
|
34
51
|
if (err.code && err.code === "P2025")
|
35
52
|
throw new NotFoundError();
|
53
|
+
throw err;
|
36
54
|
}
|
37
55
|
}, {
|
38
56
|
params: OpportunityUniqueDto,
|
39
57
|
transform: transformId,
|
40
58
|
beforeHandle: validateId,
|
59
|
+
response: {
|
60
|
+
200: OpportunityResourceDto,
|
61
|
+
404: NotFoundErrorDto,
|
62
|
+
500: HttpErrorDto,
|
63
|
+
},
|
64
|
+
detail: { description: "Get a unique opportunity." },
|
41
65
|
})
|
42
66
|
// ─── Get An Opportunity By Id With Related Campaigns ─────────────────
|
43
67
|
.get("/:id/campaigns", async ({ params }) => {
|
@@ -54,22 +78,27 @@ export const OpportunityController = new Elysia({
|
|
54
78
|
catch (err) {
|
55
79
|
if (err.code && err.code === "P2025")
|
56
80
|
throw new NotFoundError();
|
81
|
+
throw err;
|
57
82
|
}
|
58
83
|
}, {
|
59
84
|
params: OpportunityUniqueDto,
|
60
85
|
transform: transformId,
|
61
86
|
beforeHandle: validateId,
|
87
|
+
response: {
|
88
|
+
200: OpportunityWithCampaignsResourceDto,
|
89
|
+
404: NotFoundErrorDto,
|
90
|
+
500: HttpErrorDto,
|
91
|
+
},
|
92
|
+
detail: {
|
93
|
+
description: "Get a unique opportunity, including related [campaigns](#tag/campaigns/).",
|
94
|
+
},
|
62
95
|
})
|
63
|
-
// ─── Get All Opportunities ───────────────────────────────────────────
|
64
|
-
.get("/", async ({ query }) => await OpportunityService.getMany(query), {
|
65
|
-
query: GetOpportunitiesQueryDto,
|
66
|
-
})
|
67
|
-
// ─── Get Opportunities Count ─────────────────────────────────────────
|
68
|
-
.get("/count", async ({ query }) => await OpportunityService.countMany(query), { query: GetOpportunitiesQueryDto })
|
69
96
|
// ─── Get Aggregate Fields ────────────────────────────────────────────
|
70
97
|
.get("/aggregate/:field", async ({ query, params }) => await OpportunityService.aggregate(query, params.field), {
|
71
98
|
params: OpportunityAggregateFieldDto,
|
72
99
|
query: GetOpportunitiesQueryDto,
|
100
|
+
response: AggregationResourceDto,
|
101
|
+
detail: { hide: true },
|
73
102
|
})
|
74
103
|
// ─── Update An Opportunity ───────────────────────────────────────────
|
75
104
|
.patch("/:id", async ({ params, body }) => await OpportunityService.update(params.id, body), {
|