@merkl/api 0.20.116 → 0.20.117

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.
@@ -61,7 +61,7 @@ export class NoLinkVaultProcessor extends GenericProcessor {
61
61
  tvl,
62
62
  blacklistedSupply,
63
63
  cardName: generateCardName(type, typeInfo, campaign),
64
- tokensDisplay: [{ symbol: typeInfo.baseSymbol, address: typeInfo.base }],
64
+ tokensDisplay: [{ symbol: typeInfo.tokenAddress, address: typeInfo.tokenAddress }],
65
65
  };
66
66
  }
67
67
  computeRound1(type, typeInfo) {
@@ -184,6 +184,30 @@ declare const app: Elysia<"", false, {
184
184
  };
185
185
  response: {
186
186
  200: {
187
+ Tokens: {
188
+ symbol: string;
189
+ id: string;
190
+ name: string | null;
191
+ icon: string;
192
+ address: string;
193
+ chainId: number;
194
+ decimals: number;
195
+ displaySymbol: string;
196
+ verified: boolean;
197
+ isTest: boolean;
198
+ isPoint: boolean;
199
+ isPreTGE: boolean;
200
+ isNative: boolean;
201
+ price: number | null;
202
+ }[];
203
+ Protocols: {
204
+ id: string;
205
+ name: string;
206
+ url: string;
207
+ description: string;
208
+ tags: string[];
209
+ icon: string;
210
+ }[];
187
211
  id: string;
188
212
  name: string;
189
213
  type: string;
@@ -200,7 +224,7 @@ declare const app: Elysia<"", false, {
200
224
  apr: number;
201
225
  dailyRewards: number;
202
226
  lastCampaignCreatedAt: Date;
203
- } | null;
227
+ };
204
228
  };
205
229
  };
206
230
  };
@@ -262,6 +286,30 @@ declare const app: Elysia<"", false, {
262
286
  };
263
287
  response: {
264
288
  200: {
289
+ Tokens: {
290
+ symbol: string;
291
+ id: string;
292
+ name: string | null;
293
+ icon: string;
294
+ address: string;
295
+ chainId: number;
296
+ decimals: number;
297
+ displaySymbol: string;
298
+ verified: boolean;
299
+ isTest: boolean;
300
+ isPoint: boolean;
301
+ isPreTGE: boolean;
302
+ isNative: boolean;
303
+ price: number | null;
304
+ }[];
305
+ Protocols: {
306
+ id: string;
307
+ name: string;
308
+ url: string;
309
+ description: string;
310
+ tags: string[];
311
+ icon: string;
312
+ }[];
265
313
  id: string;
266
314
  name: string;
267
315
  type: string;
@@ -306,7 +354,7 @@ declare const app: Elysia<"", false, {
306
354
  depositUrl: string | undefined;
307
355
  explorerAddress: string | undefined;
308
356
  tags: string[];
309
- } | null;
357
+ };
310
358
  };
311
359
  };
312
360
  };
@@ -327,6 +375,30 @@ declare const app: Elysia<"", false, {
327
375
  };
328
376
  response: {
329
377
  200: {
378
+ Tokens: {
379
+ symbol: string;
380
+ id: string;
381
+ name: string | null;
382
+ icon: string;
383
+ address: string;
384
+ chainId: number;
385
+ decimals: number;
386
+ displaySymbol: string;
387
+ verified: boolean;
388
+ isTest: boolean;
389
+ isPoint: boolean;
390
+ isPreTGE: boolean;
391
+ isNative: boolean;
392
+ price: number | null;
393
+ }[];
394
+ Protocols: {
395
+ id: string;
396
+ name: string;
397
+ url: string;
398
+ description: string;
399
+ tags: string[];
400
+ icon: string;
401
+ }[];
330
402
  id: string;
331
403
  name: string;
332
404
  type: string;
@@ -371,7 +443,7 @@ declare const app: Elysia<"", false, {
371
443
  depositUrl: string | undefined;
372
444
  explorerAddress: string | undefined;
373
445
  tags: string[];
374
- } | null;
446
+ };
375
447
  };
376
448
  };
377
449
  };
@@ -1260,6 +1332,30 @@ declare const app: Elysia<"", false, {
1260
1332
  };
1261
1333
  response: {
1262
1334
  200: {
1335
+ Tokens: {
1336
+ symbol: string;
1337
+ id: string;
1338
+ name: string | null;
1339
+ icon: string;
1340
+ address: string;
1341
+ chainId: number;
1342
+ decimals: number;
1343
+ displaySymbol: string;
1344
+ verified: boolean;
1345
+ isTest: boolean;
1346
+ isPoint: boolean;
1347
+ isPreTGE: boolean;
1348
+ isNative: boolean;
1349
+ price: number | null;
1350
+ }[];
1351
+ Protocols: {
1352
+ id: string;
1353
+ name: string;
1354
+ url: string;
1355
+ description: string;
1356
+ tags: string[];
1357
+ icon: string;
1358
+ }[];
1263
1359
  id: string;
1264
1360
  name: string;
1265
1361
  type: string;
@@ -1304,7 +1400,7 @@ declare const app: Elysia<"", false, {
1304
1400
  depositUrl: string | undefined;
1305
1401
  explorerAddress: string | undefined;
1306
1402
  tags: string[];
1307
- } | null | undefined;
1403
+ } | undefined;
1308
1404
  };
1309
1405
  };
1310
1406
  };
@@ -2103,6 +2199,30 @@ declare const app: Elysia<"", false, {
2103
2199
  };
2104
2200
  response: {
2105
2201
  200: {
2202
+ Tokens: {
2203
+ symbol: string;
2204
+ id: string;
2205
+ name: string | null;
2206
+ icon: string;
2207
+ address: string;
2208
+ chainId: number;
2209
+ decimals: number;
2210
+ displaySymbol: string;
2211
+ verified: boolean;
2212
+ isTest: boolean;
2213
+ isPoint: boolean;
2214
+ isPreTGE: boolean;
2215
+ isNative: boolean;
2216
+ price: number | null;
2217
+ }[];
2218
+ Protocols: {
2219
+ id: string;
2220
+ name: string;
2221
+ url: string;
2222
+ description: string;
2223
+ tags: string[];
2224
+ icon: string;
2225
+ }[];
2106
2226
  id: string;
2107
2227
  name: string;
2108
2228
  type: string;
@@ -2147,7 +2267,7 @@ declare const app: Elysia<"", false, {
2147
2267
  depositUrl: string | undefined;
2148
2268
  explorerAddress: string | undefined;
2149
2269
  tags: string[];
2150
- } | null | undefined;
2270
+ } | undefined;
2151
2271
  };
2152
2272
  };
2153
2273
  };
@@ -2167,6 +2287,30 @@ declare const app: Elysia<"", false, {
2167
2287
  };
2168
2288
  response: {
2169
2289
  200: {
2290
+ Tokens: {
2291
+ symbol: string;
2292
+ id: string;
2293
+ name: string | null;
2294
+ icon: string;
2295
+ address: string;
2296
+ chainId: number;
2297
+ decimals: number;
2298
+ displaySymbol: string;
2299
+ verified: boolean;
2300
+ isTest: boolean;
2301
+ isPoint: boolean;
2302
+ isPreTGE: boolean;
2303
+ isNative: boolean;
2304
+ price: number | null;
2305
+ }[];
2306
+ Protocols: {
2307
+ id: string;
2308
+ name: string;
2309
+ url: string;
2310
+ description: string;
2311
+ tags: string[];
2312
+ icon: string;
2313
+ }[];
2170
2314
  id: string;
2171
2315
  name: string;
2172
2316
  type: string;
@@ -2211,7 +2355,7 @@ declare const app: Elysia<"", false, {
2211
2355
  depositUrl: string | undefined;
2212
2356
  explorerAddress: string | undefined;
2213
2357
  tags: string[];
2214
- } | null | undefined;
2358
+ } | undefined;
2215
2359
  };
2216
2360
  };
2217
2361
  };
@@ -38,6 +38,30 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
38
38
  };
39
39
  response: {
40
40
  200: {
41
+ Tokens: {
42
+ symbol: string;
43
+ id: string;
44
+ name: string | null;
45
+ icon: string;
46
+ address: string;
47
+ chainId: number;
48
+ decimals: number;
49
+ displaySymbol: string;
50
+ verified: boolean;
51
+ isTest: boolean;
52
+ isPoint: boolean;
53
+ isPreTGE: boolean;
54
+ isNative: boolean;
55
+ price: number | null;
56
+ }[];
57
+ Protocols: {
58
+ id: string;
59
+ name: string;
60
+ url: string;
61
+ description: string;
62
+ tags: string[];
63
+ icon: string;
64
+ }[];
41
65
  id: string;
42
66
  name: string;
43
67
  type: string;
@@ -82,7 +106,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
82
106
  depositUrl: string | undefined;
83
107
  explorerAddress: string | undefined;
84
108
  tags: string[];
85
- } | null | undefined;
109
+ } | undefined;
86
110
  };
87
111
  };
88
112
  };
@@ -148,7 +148,32 @@ export declare abstract class CampaignService {
148
148
  computeChainId?: number;
149
149
  type?: string;
150
150
  }): Promise<number>;
151
- static create(body: Omit<CreateCampaignModel, "id">, dryRun?: boolean): Promise<{
151
+ static create(body: Omit<CreateCampaignModel, "id">, dryRun?: boolean): Promise<({
152
+ Tokens: {
153
+ symbol: string;
154
+ id: string;
155
+ name: string | null;
156
+ icon: string;
157
+ address: string;
158
+ chainId: number;
159
+ decimals: number;
160
+ displaySymbol: string;
161
+ verified: boolean;
162
+ isTest: boolean;
163
+ isPoint: boolean;
164
+ isPreTGE: boolean;
165
+ isNative: boolean;
166
+ price: number | null;
167
+ }[];
168
+ Protocols: {
169
+ id: string;
170
+ name: string;
171
+ url: string;
172
+ description: string;
173
+ tags: string[];
174
+ icon: string;
175
+ }[];
176
+ } & {
152
177
  id: string;
153
178
  name: string;
154
179
  type: string;
@@ -165,7 +190,7 @@ export declare abstract class CampaignService {
165
190
  apr: number;
166
191
  dailyRewards: number;
167
192
  lastCampaignCreatedAt: Date;
168
- } | {
193
+ }) | {
169
194
  id: string;
170
195
  chainId: number;
171
196
  type: string;
@@ -193,7 +218,7 @@ export declare abstract class CampaignService {
193
218
  depositUrl: string | undefined;
194
219
  explorerAddress: string | undefined;
195
220
  tags: string[];
196
- } | null | undefined>;
221
+ } | undefined>;
197
222
  /**
198
223
  * @dev back-office function
199
224
  * @dev deprecated should be replaced with a manual override
@@ -149,6 +149,30 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
149
149
  };
150
150
  response: {
151
151
  200: {
152
+ Tokens: {
153
+ symbol: string;
154
+ id: string;
155
+ name: string | null;
156
+ icon: string;
157
+ address: string;
158
+ chainId: number;
159
+ decimals: number;
160
+ displaySymbol: string;
161
+ verified: boolean;
162
+ isTest: boolean;
163
+ isPoint: boolean;
164
+ isPreTGE: boolean;
165
+ isNative: boolean;
166
+ price: number | null;
167
+ }[];
168
+ Protocols: {
169
+ id: string;
170
+ name: string;
171
+ url: string;
172
+ description: string;
173
+ tags: string[];
174
+ icon: string;
175
+ }[];
152
176
  id: string;
153
177
  name: string;
154
178
  type: string;
@@ -193,7 +217,7 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
193
217
  depositUrl: string | undefined;
194
218
  explorerAddress: string | undefined;
195
219
  tags: string[];
196
- } | null | undefined;
220
+ } | undefined;
197
221
  };
198
222
  };
199
223
  };
@@ -213,6 +237,30 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
213
237
  };
214
238
  response: {
215
239
  200: {
240
+ Tokens: {
241
+ symbol: string;
242
+ id: string;
243
+ name: string | null;
244
+ icon: string;
245
+ address: string;
246
+ chainId: number;
247
+ decimals: number;
248
+ displaySymbol: string;
249
+ verified: boolean;
250
+ isTest: boolean;
251
+ isPoint: boolean;
252
+ isPreTGE: boolean;
253
+ isNative: boolean;
254
+ price: number | null;
255
+ }[];
256
+ Protocols: {
257
+ id: string;
258
+ name: string;
259
+ url: string;
260
+ description: string;
261
+ tags: string[];
262
+ icon: string;
263
+ }[];
216
264
  id: string;
217
265
  name: string;
218
266
  type: string;
@@ -257,7 +305,7 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
257
305
  depositUrl: string | undefined;
258
306
  explorerAddress: string | undefined;
259
307
  tags: string[];
260
- } | null | undefined;
308
+ } | undefined;
261
309
  };
262
310
  };
263
311
  };
@@ -39,6 +39,30 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
39
39
  };
40
40
  response: {
41
41
  200: {
42
+ Tokens: {
43
+ symbol: string;
44
+ id: string;
45
+ name: string | null;
46
+ icon: string;
47
+ address: string;
48
+ chainId: number;
49
+ decimals: number;
50
+ displaySymbol: string;
51
+ verified: boolean;
52
+ isTest: boolean;
53
+ isPoint: boolean;
54
+ isPreTGE: boolean;
55
+ isNative: boolean;
56
+ price: number | null;
57
+ }[];
58
+ Protocols: {
59
+ id: string;
60
+ name: string;
61
+ url: string;
62
+ description: string;
63
+ tags: string[];
64
+ icon: string;
65
+ }[];
42
66
  id: string;
43
67
  name: string;
44
68
  type: string;
@@ -55,7 +79,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
55
79
  apr: number;
56
80
  dailyRewards: number;
57
81
  lastCampaignCreatedAt: Date;
58
- } | null;
82
+ };
59
83
  };
60
84
  };
61
85
  };
@@ -117,6 +141,30 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
117
141
  };
118
142
  response: {
119
143
  200: {
144
+ Tokens: {
145
+ symbol: string;
146
+ id: string;
147
+ name: string | null;
148
+ icon: string;
149
+ address: string;
150
+ chainId: number;
151
+ decimals: number;
152
+ displaySymbol: string;
153
+ verified: boolean;
154
+ isTest: boolean;
155
+ isPoint: boolean;
156
+ isPreTGE: boolean;
157
+ isNative: boolean;
158
+ price: number | null;
159
+ }[];
160
+ Protocols: {
161
+ id: string;
162
+ name: string;
163
+ url: string;
164
+ description: string;
165
+ tags: string[];
166
+ icon: string;
167
+ }[];
120
168
  id: string;
121
169
  name: string;
122
170
  type: string;
@@ -161,7 +209,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
161
209
  depositUrl: string | undefined;
162
210
  explorerAddress: string | undefined;
163
211
  tags: string[];
164
- } | null;
212
+ };
165
213
  };
166
214
  };
167
215
  };
@@ -182,6 +230,30 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
182
230
  };
183
231
  response: {
184
232
  200: {
233
+ Tokens: {
234
+ symbol: string;
235
+ id: string;
236
+ name: string | null;
237
+ icon: string;
238
+ address: string;
239
+ chainId: number;
240
+ decimals: number;
241
+ displaySymbol: string;
242
+ verified: boolean;
243
+ isTest: boolean;
244
+ isPoint: boolean;
245
+ isPreTGE: boolean;
246
+ isNative: boolean;
247
+ price: number | null;
248
+ }[];
249
+ Protocols: {
250
+ id: string;
251
+ name: string;
252
+ url: string;
253
+ description: string;
254
+ tags: string[];
255
+ icon: string;
256
+ }[];
185
257
  id: string;
186
258
  name: string;
187
259
  type: string;
@@ -226,7 +298,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
226
298
  depositUrl: string | undefined;
227
299
  explorerAddress: string | undefined;
228
300
  tags: string[];
229
- } | null;
301
+ };
230
302
  };
231
303
  };
232
304
  };
@@ -1,6 +1,7 @@
1
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 { log } from "@/utils/logger";
4
5
  import { ChainId } from "@sdk";
5
6
  import Elysia, { t } from "elysia";
6
7
  import { GetCampaignQueryDto } from "../campaign";
@@ -49,6 +50,7 @@ export const OpportunityController = new Elysia({
49
50
  }));
50
51
  }
51
52
  catch (err) {
53
+ log.error("error recreating opportunity", err);
52
54
  if (err.code && err.code === "P2025")
53
55
  throw new NotFoundError();
54
56
  throw err;
@@ -10,6 +10,31 @@ export declare abstract class OpportunityRepository {
10
10
  static create(newOpp: CreateOpportunityModel & {
11
11
  id: string;
12
12
  }, upsert?: boolean): Promise<{
13
+ Tokens: {
14
+ symbol: string;
15
+ id: string;
16
+ name: string | null;
17
+ icon: string;
18
+ address: string;
19
+ chainId: number;
20
+ decimals: number;
21
+ displaySymbol: string;
22
+ verified: boolean;
23
+ isTest: boolean;
24
+ isPoint: boolean;
25
+ isPreTGE: boolean;
26
+ isNative: boolean;
27
+ price: number | null;
28
+ }[];
29
+ Protocols: {
30
+ id: string;
31
+ name: string;
32
+ url: string;
33
+ description: string;
34
+ tags: string[];
35
+ icon: string;
36
+ }[];
37
+ } & {
13
38
  id: string;
14
39
  name: string;
15
40
  type: string;
@@ -26,7 +51,7 @@ export declare abstract class OpportunityRepository {
26
51
  apr: number;
27
52
  dailyRewards: number;
28
53
  lastCampaignCreatedAt: Date;
29
- } | null>;
54
+ }>;
30
55
  static findUnique(id: string): Promise<({
31
56
  Chain: {
32
57
  id: number;
@@ -265,7 +265,7 @@ export class OpportunityRepository {
265
265
  });
266
266
  else
267
267
  await apiDbClient.opportunity.create({ data });
268
- return await apiDbClient.opportunity.findUnique({ where: { id: newOpp.id } });
268
+ return await OpportunityRepository.findUniqueOrThrow(newOpp.id, true, true);
269
269
  }
270
270
  // ─── Find ────────────────────────────────────────────────────────────
271
271
  static async findUnique(id) {