@merkl/api 0.17.0 → 0.17.2
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/database/api/.generated/drizzle/schema.d.ts +0 -18
- package/dist/database/api/.generated/drizzle/schema.js +0 -2
- package/dist/database/api/.generated/drizzle/schema.ts +0 -3
- package/dist/database/api/.generated/edge.js +3 -12
- package/dist/database/api/.generated/index-browser.js +0 -9
- package/dist/database/api/.generated/index.d.ts +1 -148
- package/dist/database/api/.generated/index.js +3 -12
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +8 -8
- package/dist/database/api/.generated/wasm.js +0 -9
- package/dist/src/eden/index.d.ts +200 -75
- package/dist/src/index.d.ts +40 -15
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -4
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +0 -8
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +0 -8
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +0 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +0 -5
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +0 -3
- package/dist/src/modules/v4/protocol/index.d.ts +0 -2
- package/dist/src/modules/v4/protocol/index.js +0 -8
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +40 -10
- package/dist/src/modules/v4/protocol/protocol.controller.js +7 -9
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +0 -1
- package/dist/src/modules/v4/router.d.ts +40 -15
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
@@ -368,7 +368,6 @@ declare const app: Elysia<"", false, {
|
|
368
368
|
computeChainId: number;
|
369
369
|
distributionChainId: number;
|
370
370
|
campaignId: string;
|
371
|
-
distributionType: import("../database/api/.generated").$Enums.DistributionType;
|
372
371
|
rewardTokenId: string;
|
373
372
|
amount: string;
|
374
373
|
opportunityId: string;
|
@@ -1077,7 +1076,6 @@ declare const app: Elysia<"", false, {
|
|
1077
1076
|
computeChainId: number;
|
1078
1077
|
distributionChainId: number;
|
1079
1078
|
campaignId: string;
|
1080
|
-
distributionType: import("../database/api/.generated").$Enums.DistributionType;
|
1081
1079
|
rewardTokenId: string;
|
1082
1080
|
amount: string;
|
1083
1081
|
opportunityId: string;
|
@@ -1129,7 +1127,6 @@ declare const app: Elysia<"", false, {
|
|
1129
1127
|
computeChainId: number;
|
1130
1128
|
distributionChainId: number;
|
1131
1129
|
campaignId: string;
|
1132
|
-
distributionType: import("../database/api/.generated").$Enums.DistributionType;
|
1133
1130
|
rewardTokenId: string;
|
1134
1131
|
amount: string;
|
1135
1132
|
opportunityId: string;
|
@@ -1210,7 +1207,6 @@ declare const app: Elysia<"", false, {
|
|
1210
1207
|
computeChainId: number;
|
1211
1208
|
distributionChainId: number;
|
1212
1209
|
campaignId: string;
|
1213
|
-
distributionType: import("../database/api/.generated").$Enums.DistributionType;
|
1214
1210
|
rewardTokenId: string;
|
1215
1211
|
amount: string;
|
1216
1212
|
opportunityId: string;
|
@@ -1275,7 +1271,6 @@ declare const app: Elysia<"", false, {
|
|
1275
1271
|
computeChainId: number;
|
1276
1272
|
distributionChainId: number;
|
1277
1273
|
campaignId: string;
|
1278
|
-
distributionType: import("../database/api/.generated").$Enums.DistributionType;
|
1279
1274
|
rewardTokenId: string;
|
1280
1275
|
amount: string;
|
1281
1276
|
opportunityId: string;
|
@@ -1410,8 +1405,18 @@ declare const app: Elysia<"", false, {
|
|
1410
1405
|
};
|
1411
1406
|
headers: unknown;
|
1412
1407
|
response: {
|
1413
|
-
|
1414
|
-
|
1408
|
+
200: ({
|
1409
|
+
name: string;
|
1410
|
+
url: string;
|
1411
|
+
description: string;
|
1412
|
+
id: string;
|
1413
|
+
tags: string[];
|
1414
|
+
icon: string;
|
1415
|
+
} & {
|
1416
|
+
dailyRewards?: number | undefined;
|
1417
|
+
numberOfLiveCampaigns?: number | undefined;
|
1418
|
+
opportunityLiveTags?: string[] | undefined;
|
1419
|
+
})[];
|
1415
1420
|
};
|
1416
1421
|
};
|
1417
1422
|
};
|
@@ -1425,8 +1430,7 @@ declare const app: Elysia<"", false, {
|
|
1425
1430
|
query: unknown;
|
1426
1431
|
headers: unknown;
|
1427
1432
|
response: {
|
1428
|
-
|
1429
|
-
200: any;
|
1433
|
+
200: number;
|
1430
1434
|
};
|
1431
1435
|
};
|
1432
1436
|
};
|
@@ -1442,8 +1446,17 @@ declare const app: Elysia<"", false, {
|
|
1442
1446
|
query: unknown;
|
1443
1447
|
headers: unknown;
|
1444
1448
|
response: {
|
1445
|
-
|
1446
|
-
|
1449
|
+
200: {
|
1450
|
+
name: string;
|
1451
|
+
url: string;
|
1452
|
+
description: string;
|
1453
|
+
id: string;
|
1454
|
+
tags: string[];
|
1455
|
+
icon: string;
|
1456
|
+
dailyRewards?: number | undefined;
|
1457
|
+
numberOfLiveCampaigns?: number | undefined;
|
1458
|
+
opportunityLiveTags?: string[] | undefined;
|
1459
|
+
} | null;
|
1447
1460
|
};
|
1448
1461
|
};
|
1449
1462
|
};
|
@@ -1466,8 +1479,14 @@ declare const app: Elysia<"", false, {
|
|
1466
1479
|
authorization: string;
|
1467
1480
|
};
|
1468
1481
|
response: {
|
1469
|
-
|
1470
|
-
|
1482
|
+
200: {
|
1483
|
+
name: string;
|
1484
|
+
url: string;
|
1485
|
+
description: string;
|
1486
|
+
id: string;
|
1487
|
+
tags: string[];
|
1488
|
+
icon: string;
|
1489
|
+
};
|
1471
1490
|
};
|
1472
1491
|
};
|
1473
1492
|
};
|
@@ -1490,8 +1509,14 @@ declare const app: Elysia<"", false, {
|
|
1490
1509
|
authorization: string;
|
1491
1510
|
};
|
1492
1511
|
response: {
|
1493
|
-
|
1494
|
-
|
1512
|
+
200: {
|
1513
|
+
name: string;
|
1514
|
+
url: string;
|
1515
|
+
description: string;
|
1516
|
+
id: string;
|
1517
|
+
tags: string[];
|
1518
|
+
icon: string;
|
1519
|
+
};
|
1495
1520
|
};
|
1496
1521
|
};
|
1497
1522
|
};
|
@@ -47,7 +47,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
47
47
|
computeChainId: number;
|
48
48
|
distributionChainId: number;
|
49
49
|
campaignId: string;
|
50
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
51
50
|
rewardTokenId: string;
|
52
51
|
amount: string;
|
53
52
|
opportunityId: string;
|
@@ -99,7 +98,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
99
98
|
computeChainId: number;
|
100
99
|
distributionChainId: number;
|
101
100
|
campaignId: string;
|
102
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
103
101
|
rewardTokenId: string;
|
104
102
|
amount: string;
|
105
103
|
opportunityId: string;
|
@@ -180,7 +178,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
180
178
|
computeChainId: number;
|
181
179
|
distributionChainId: number;
|
182
180
|
campaignId: string;
|
183
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
184
181
|
rewardTokenId: string;
|
185
182
|
amount: string;
|
186
183
|
opportunityId: string;
|
@@ -245,7 +242,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
245
242
|
computeChainId: number;
|
246
243
|
distributionChainId: number;
|
247
244
|
campaignId: string;
|
248
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
249
245
|
rewardTokenId: string;
|
250
246
|
amount: string;
|
251
247
|
opportunityId: string;
|
@@ -82,7 +82,6 @@ export declare abstract class CampaignRepository {
|
|
82
82
|
computeChainId: number;
|
83
83
|
distributionChainId: number;
|
84
84
|
campaignId: string;
|
85
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
86
85
|
rewardTokenId: string;
|
87
86
|
amount: string;
|
88
87
|
opportunityId: string;
|
@@ -123,7 +122,6 @@ export declare abstract class CampaignRepository {
|
|
123
122
|
computeChainId: number;
|
124
123
|
distributionChainId: number;
|
125
124
|
campaignId: string;
|
126
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
127
125
|
rewardTokenId: string;
|
128
126
|
amount: string;
|
129
127
|
opportunityId: string;
|
@@ -158,7 +156,6 @@ export declare abstract class CampaignRepository {
|
|
158
156
|
computeChainId: number;
|
159
157
|
distributionChainId: number;
|
160
158
|
campaignId: string;
|
161
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
162
159
|
rewardTokenId: string;
|
163
160
|
amount: string;
|
164
161
|
opportunityId: string;
|
@@ -201,7 +198,6 @@ export declare abstract class CampaignRepository {
|
|
201
198
|
computeChainId: number;
|
202
199
|
distributionChainId: number;
|
203
200
|
campaignId: string;
|
204
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
205
201
|
rewardTokenId: string;
|
206
202
|
amount: string;
|
207
203
|
opportunityId: string;
|
@@ -254,7 +250,6 @@ export declare abstract class CampaignRepository {
|
|
254
250
|
computeChainId: number;
|
255
251
|
distributionChainId: number;
|
256
252
|
campaignId: string;
|
257
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
258
253
|
rewardTokenId: string;
|
259
254
|
amount: string;
|
260
255
|
opportunityId: string;
|
@@ -316,7 +311,6 @@ export declare abstract class CampaignRepository {
|
|
316
311
|
computeChainId: number;
|
317
312
|
distributionChainId: number;
|
318
313
|
campaignId: string;
|
319
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
320
314
|
rewardTokenId: string;
|
321
315
|
amount: string;
|
322
316
|
opportunityId: string;
|
@@ -338,7 +332,6 @@ export declare abstract class CampaignRepository {
|
|
338
332
|
computeChainId: number;
|
339
333
|
distributionChainId: number;
|
340
334
|
campaignId: string;
|
341
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
342
335
|
rewardTokenId: string;
|
343
336
|
amount: string;
|
344
337
|
opportunityId: string;
|
@@ -354,7 +347,6 @@ export declare abstract class CampaignRepository {
|
|
354
347
|
computeChainId: number;
|
355
348
|
distributionChainId: number;
|
356
349
|
campaignId: string;
|
357
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
358
350
|
rewardTokenId: string;
|
359
351
|
amount: string;
|
360
352
|
opportunityId: string;
|
@@ -14,7 +14,6 @@ export declare abstract class CampaignService {
|
|
14
14
|
computeChainId: number;
|
15
15
|
distributionChainId: number;
|
16
16
|
campaignId: string;
|
17
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
18
17
|
rewardTokenId: string;
|
19
18
|
amount: string;
|
20
19
|
opportunityId: string;
|
@@ -49,7 +48,6 @@ export declare abstract class CampaignService {
|
|
49
48
|
computeChainId: number;
|
50
49
|
distributionChainId: number;
|
51
50
|
campaignId: string;
|
52
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
53
51
|
rewardTokenId: string;
|
54
52
|
amount: string;
|
55
53
|
opportunityId: string;
|
@@ -65,7 +63,6 @@ export declare abstract class CampaignService {
|
|
65
63
|
computeChainId: number;
|
66
64
|
distributionChainId: number;
|
67
65
|
campaignId: string;
|
68
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
69
66
|
rewardTokenId: string;
|
70
67
|
amount: string;
|
71
68
|
opportunityId: string;
|
@@ -89,7 +86,6 @@ export declare abstract class CampaignService {
|
|
89
86
|
computeChainId: number;
|
90
87
|
distributionChainId: number;
|
91
88
|
campaignId: string;
|
92
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
93
89
|
rewardTokenId: string;
|
94
90
|
amount: string;
|
95
91
|
opportunityId: string;
|
@@ -151,7 +147,6 @@ export declare abstract class CampaignService {
|
|
151
147
|
computeChainId: number;
|
152
148
|
distributionChainId: number;
|
153
149
|
campaignId: string;
|
154
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
155
150
|
rewardTokenId: string;
|
156
151
|
amount: string;
|
157
152
|
opportunityId: string;
|
@@ -175,7 +170,6 @@ export declare abstract class CampaignService {
|
|
175
170
|
computeChainId: number;
|
176
171
|
distributionChainId: number;
|
177
172
|
campaignId: string;
|
178
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
179
173
|
rewardTokenId: string;
|
180
174
|
amount: string;
|
181
175
|
opportunityId: string;
|
@@ -228,7 +222,6 @@ export declare abstract class CampaignService {
|
|
228
222
|
computeChainId: number;
|
229
223
|
distributionChainId: number;
|
230
224
|
campaignId: string;
|
231
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
232
225
|
rewardTokenId: string;
|
233
226
|
amount: string;
|
234
227
|
opportunityId: string;
|
@@ -338,7 +331,6 @@ export declare abstract class CampaignService {
|
|
338
331
|
computeChainId: number;
|
339
332
|
distributionChainId: number;
|
340
333
|
campaignId: string;
|
341
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
342
334
|
rewardTokenId: string;
|
343
335
|
amount: string;
|
344
336
|
opportunityId: string;
|
@@ -223,7 +223,6 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
223
223
|
computeChainId: number;
|
224
224
|
distributionChainId: number;
|
225
225
|
campaignId: string;
|
226
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
227
226
|
rewardTokenId: string;
|
228
227
|
amount: string;
|
229
228
|
opportunityId: string;
|
@@ -52,7 +52,6 @@ export declare abstract class OpportunityRepository {
|
|
52
52
|
computeChainId: number;
|
53
53
|
distributionChainId: number;
|
54
54
|
campaignId: string;
|
55
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
56
55
|
rewardTokenId: string;
|
57
56
|
amount: string;
|
58
57
|
opportunityId: string;
|
@@ -186,7 +185,6 @@ export declare abstract class OpportunityRepository {
|
|
186
185
|
computeChainId: number;
|
187
186
|
distributionChainId: number;
|
188
187
|
campaignId: string;
|
189
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
190
188
|
rewardTokenId: string;
|
191
189
|
amount: string;
|
192
190
|
opportunityId: string;
|
@@ -376,7 +374,6 @@ export declare abstract class OpportunityRepository {
|
|
376
374
|
computeChainId: number;
|
377
375
|
distributionChainId: number;
|
378
376
|
campaignId: string;
|
379
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
380
377
|
rewardTokenId: string;
|
381
378
|
amount: string;
|
382
379
|
opportunityId: string;
|
@@ -510,7 +507,6 @@ export declare abstract class OpportunityRepository {
|
|
510
507
|
computeChainId: number;
|
511
508
|
distributionChainId: number;
|
512
509
|
campaignId: string;
|
513
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
514
510
|
rewardTokenId: string;
|
515
511
|
amount: string;
|
516
512
|
opportunityId: string;
|
@@ -688,7 +684,6 @@ export declare abstract class OpportunityRepository {
|
|
688
684
|
computeChainId: number;
|
689
685
|
distributionChainId: number;
|
690
686
|
campaignId: string;
|
691
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
692
687
|
rewardTokenId: string;
|
693
688
|
amount: string;
|
694
689
|
opportunityId: string;
|
@@ -500,7 +500,6 @@ export declare abstract class OpportunityService {
|
|
500
500
|
computeChainId: number;
|
501
501
|
distributionChainId: number;
|
502
502
|
campaignId: string;
|
503
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
504
503
|
rewardTokenId: string;
|
505
504
|
amount: string;
|
506
505
|
opportunityId: string;
|
@@ -647,7 +646,6 @@ export declare abstract class OpportunityService {
|
|
647
646
|
computeChainId: number;
|
648
647
|
distributionChainId: number;
|
649
648
|
campaignId: string;
|
650
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
651
649
|
rewardTokenId: string;
|
652
650
|
amount: string;
|
653
651
|
opportunityId: string;
|
@@ -790,7 +788,6 @@ export declare abstract class OpportunityService {
|
|
790
788
|
computeChainId: number;
|
791
789
|
distributionChainId: number;
|
792
790
|
campaignId: string;
|
793
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
794
791
|
rewardTokenId: string;
|
795
792
|
amount: string;
|
796
793
|
opportunityId: string;
|
@@ -1,10 +1,2 @@
|
|
1
|
-
import { initChainService } from "../chain";
|
2
|
-
import { ProtocolRepository } from "./protocol.repository";
|
3
|
-
import { ProtocolService } from "./protocol.service";
|
4
1
|
export * from "./protocol.model";
|
5
2
|
export * from "./protocol.service";
|
6
|
-
export const initProtocolService = (dbClient) => {
|
7
|
-
const repository = new ProtocolRepository(dbClient);
|
8
|
-
const chainService = initChainService(dbClient);
|
9
|
-
return new ProtocolService(repository, chainService);
|
10
|
-
};
|
@@ -28,8 +28,18 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
|
|
28
28
|
};
|
29
29
|
headers: unknown;
|
30
30
|
response: {
|
31
|
-
|
32
|
-
|
31
|
+
200: ({
|
32
|
+
name: string;
|
33
|
+
url: string;
|
34
|
+
description: string;
|
35
|
+
id: string;
|
36
|
+
tags: string[];
|
37
|
+
icon: string;
|
38
|
+
} & {
|
39
|
+
dailyRewards?: number | undefined;
|
40
|
+
numberOfLiveCampaigns?: number | undefined;
|
41
|
+
opportunityLiveTags?: string[] | undefined;
|
42
|
+
})[];
|
33
43
|
};
|
34
44
|
};
|
35
45
|
};
|
@@ -43,8 +53,7 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
|
|
43
53
|
query: unknown;
|
44
54
|
headers: unknown;
|
45
55
|
response: {
|
46
|
-
|
47
|
-
200: any;
|
56
|
+
200: number;
|
48
57
|
};
|
49
58
|
};
|
50
59
|
};
|
@@ -60,8 +69,17 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
|
|
60
69
|
query: unknown;
|
61
70
|
headers: unknown;
|
62
71
|
response: {
|
63
|
-
|
64
|
-
|
72
|
+
200: {
|
73
|
+
name: string;
|
74
|
+
url: string;
|
75
|
+
description: string;
|
76
|
+
id: string;
|
77
|
+
tags: string[];
|
78
|
+
icon: string;
|
79
|
+
dailyRewards?: number | undefined;
|
80
|
+
numberOfLiveCampaigns?: number | undefined;
|
81
|
+
opportunityLiveTags?: string[] | undefined;
|
82
|
+
} | null;
|
65
83
|
};
|
66
84
|
};
|
67
85
|
};
|
@@ -84,8 +102,14 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
|
|
84
102
|
authorization: string;
|
85
103
|
};
|
86
104
|
response: {
|
87
|
-
|
88
|
-
|
105
|
+
200: {
|
106
|
+
name: string;
|
107
|
+
url: string;
|
108
|
+
description: string;
|
109
|
+
id: string;
|
110
|
+
tags: string[];
|
111
|
+
icon: string;
|
112
|
+
};
|
89
113
|
};
|
90
114
|
};
|
91
115
|
};
|
@@ -108,8 +132,14 @@ export declare const ProtocolController: Elysia<"/protocols", false, {
|
|
108
132
|
authorization: string;
|
109
133
|
};
|
110
134
|
response: {
|
111
|
-
|
112
|
-
|
135
|
+
200: {
|
136
|
+
name: string;
|
137
|
+
url: string;
|
138
|
+
description: string;
|
139
|
+
id: string;
|
140
|
+
tags: string[];
|
141
|
+
icon: string;
|
142
|
+
};
|
113
143
|
};
|
114
144
|
};
|
115
145
|
};
|
@@ -1,30 +1,28 @@
|
|
1
1
|
import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
|
-
import { apiDbClient } from "../../../utils/prisma";
|
3
2
|
import Elysia, { t } from "elysia";
|
4
|
-
import {
|
3
|
+
import { ProtocolService } from ".";
|
5
4
|
import { CreateProtocolDto, GetProtocolsQueryDto, ProtocolIdDto, ProtocolResourceDto, UpdateProtocolDto, } from "./protocol.model";
|
6
|
-
const protocolService = initProtocolService(apiDbClient);
|
7
5
|
// ─── Protocols Controller ────────────────────────────────────────────────────
|
8
6
|
export const ProtocolController = new Elysia({ prefix: "/protocols", detail: { tags: ["Protocols"] } })
|
9
7
|
// ─── Get Many Protocols ──────────────────────────────────────────────
|
10
|
-
.get("/", async ({ query }) => await
|
8
|
+
.get("/", async ({ query }) => await ProtocolService.findMany(query), {
|
11
9
|
query: GetProtocolsQueryDto,
|
12
10
|
response: t.Array(ProtocolResourceDto),
|
13
11
|
detail: { description: "List protocols supported and integrated by Merkl." },
|
14
12
|
})
|
15
13
|
// ─── Count Protocols ─────────────────────────────────────────────────
|
16
|
-
.get("/count", async ({ query }) => await
|
14
|
+
.get("/count", async ({ query }) => await ProtocolService.countMany(query), {
|
17
15
|
detail: { description: "Get the number of protocols correspoinding to the query." },
|
18
16
|
})
|
19
17
|
// ─── Get A Protocol By Its Id Or Name ────────────────────────────────
|
20
18
|
.get("/:id", async ({ params }) => {
|
21
|
-
const fromId = await
|
19
|
+
const fromId = await ProtocolService.getFromId(params.id);
|
22
20
|
if (fromId)
|
23
21
|
return fromId;
|
24
|
-
return await
|
22
|
+
return await ProtocolService.getFromName(params.id);
|
25
23
|
}, { detail: { hide: true } })
|
26
24
|
// ─── Update A Protocol ───────────────────────────────────────────────
|
27
|
-
.patch("/:id", async ({ params, body }) => await
|
25
|
+
.patch("/:id", async ({ params, body }) => await ProtocolService.update(params.id, body), {
|
28
26
|
params: ProtocolIdDto,
|
29
27
|
body: UpdateProtocolDto,
|
30
28
|
headers: AuthorizationHeadersDto,
|
@@ -32,7 +30,7 @@ export const ProtocolController = new Elysia({ prefix: "/protocols", detail: { t
|
|
32
30
|
detail: { hide: true },
|
33
31
|
})
|
34
32
|
// ─── Create A Protocol ───────────────────────────────────────────────
|
35
|
-
.post("/", async ({ body }) => await
|
33
|
+
.post("/", async ({ body }) => await ProtocolService.create(body), {
|
36
34
|
body: CreateProtocolDto,
|
37
35
|
headers: AuthorizationHeadersDto,
|
38
36
|
beforeHandle: BackOfficeGuard,
|
@@ -37,7 +37,6 @@ export declare abstract class ProtocolRepository {
|
|
37
37
|
computeChainId: number;
|
38
38
|
distributionChainId: number;
|
39
39
|
campaignId: string;
|
40
|
-
distributionType: import("../../../../database/api/.generated").$Enums.DistributionType;
|
41
40
|
rewardTokenId: string;
|
42
41
|
amount: string;
|
43
42
|
opportunityId: string;
|
@@ -238,7 +238,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
238
238
|
computeChainId: number;
|
239
239
|
distributionChainId: number;
|
240
240
|
campaignId: string;
|
241
|
-
distributionType: import("../../../database/api/.generated").$Enums.DistributionType;
|
242
241
|
rewardTokenId: string;
|
243
242
|
amount: string;
|
244
243
|
opportunityId: string;
|
@@ -947,7 +946,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
947
946
|
computeChainId: number;
|
948
947
|
distributionChainId: number;
|
949
948
|
campaignId: string;
|
950
|
-
distributionType: import("../../../database/api/.generated").$Enums.DistributionType;
|
951
949
|
rewardTokenId: string;
|
952
950
|
amount: string;
|
953
951
|
opportunityId: string;
|
@@ -999,7 +997,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
999
997
|
computeChainId: number;
|
1000
998
|
distributionChainId: number;
|
1001
999
|
campaignId: string;
|
1002
|
-
distributionType: import("../../../database/api/.generated").$Enums.DistributionType;
|
1003
1000
|
rewardTokenId: string;
|
1004
1001
|
amount: string;
|
1005
1002
|
opportunityId: string;
|
@@ -1080,7 +1077,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1080
1077
|
computeChainId: number;
|
1081
1078
|
distributionChainId: number;
|
1082
1079
|
campaignId: string;
|
1083
|
-
distributionType: import("../../../database/api/.generated").$Enums.DistributionType;
|
1084
1080
|
rewardTokenId: string;
|
1085
1081
|
amount: string;
|
1086
1082
|
opportunityId: string;
|
@@ -1145,7 +1141,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1145
1141
|
computeChainId: number;
|
1146
1142
|
distributionChainId: number;
|
1147
1143
|
campaignId: string;
|
1148
|
-
distributionType: import("../../../database/api/.generated").$Enums.DistributionType;
|
1149
1144
|
rewardTokenId: string;
|
1150
1145
|
amount: string;
|
1151
1146
|
opportunityId: string;
|
@@ -1280,8 +1275,18 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1280
1275
|
};
|
1281
1276
|
headers: unknown;
|
1282
1277
|
response: {
|
1283
|
-
|
1284
|
-
|
1278
|
+
200: ({
|
1279
|
+
name: string;
|
1280
|
+
url: string;
|
1281
|
+
description: string;
|
1282
|
+
id: string;
|
1283
|
+
tags: string[];
|
1284
|
+
icon: string;
|
1285
|
+
} & {
|
1286
|
+
dailyRewards?: number | undefined;
|
1287
|
+
numberOfLiveCampaigns?: number | undefined;
|
1288
|
+
opportunityLiveTags?: string[] | undefined;
|
1289
|
+
})[];
|
1285
1290
|
};
|
1286
1291
|
};
|
1287
1292
|
};
|
@@ -1295,8 +1300,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1295
1300
|
query: unknown;
|
1296
1301
|
headers: unknown;
|
1297
1302
|
response: {
|
1298
|
-
|
1299
|
-
200: any;
|
1303
|
+
200: number;
|
1300
1304
|
};
|
1301
1305
|
};
|
1302
1306
|
};
|
@@ -1312,8 +1316,17 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1312
1316
|
query: unknown;
|
1313
1317
|
headers: unknown;
|
1314
1318
|
response: {
|
1315
|
-
|
1316
|
-
|
1319
|
+
200: {
|
1320
|
+
name: string;
|
1321
|
+
url: string;
|
1322
|
+
description: string;
|
1323
|
+
id: string;
|
1324
|
+
tags: string[];
|
1325
|
+
icon: string;
|
1326
|
+
dailyRewards?: number | undefined;
|
1327
|
+
numberOfLiveCampaigns?: number | undefined;
|
1328
|
+
opportunityLiveTags?: string[] | undefined;
|
1329
|
+
} | null;
|
1317
1330
|
};
|
1318
1331
|
};
|
1319
1332
|
};
|
@@ -1336,8 +1349,14 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1336
1349
|
authorization: string;
|
1337
1350
|
};
|
1338
1351
|
response: {
|
1339
|
-
|
1340
|
-
|
1352
|
+
200: {
|
1353
|
+
name: string;
|
1354
|
+
url: string;
|
1355
|
+
description: string;
|
1356
|
+
id: string;
|
1357
|
+
tags: string[];
|
1358
|
+
icon: string;
|
1359
|
+
};
|
1341
1360
|
};
|
1342
1361
|
};
|
1343
1362
|
};
|
@@ -1360,8 +1379,14 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1360
1379
|
authorization: string;
|
1361
1380
|
};
|
1362
1381
|
response: {
|
1363
|
-
|
1364
|
-
|
1382
|
+
200: {
|
1383
|
+
name: string;
|
1384
|
+
url: string;
|
1385
|
+
description: string;
|
1386
|
+
id: string;
|
1387
|
+
tags: string[];
|
1388
|
+
icon: string;
|
1389
|
+
};
|
1365
1390
|
};
|
1366
1391
|
};
|
1367
1392
|
};
|