@merkl/api 0.10.131 → 0.10.133

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. package/dist/src/constants.d.ts +1 -0
  2. package/dist/src/constants.js +1 -0
  3. package/dist/src/eden/index.d.ts +16 -25
  4. package/dist/src/index.d.ts +4 -7
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicDataRefacto.js +4 -8
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.d.ts +3 -2
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/tokenType.js +11 -3
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.d.ts +50 -0
  9. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/MaverickBPProcessor.js +75 -0
  10. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/processorMapping.js +2 -0
  11. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +2 -0
  12. package/dist/src/modules/v4/blacklist/blacklist.controller.js +2 -6
  13. package/dist/src/modules/v4/campaign/campaign.controller.js +6 -18
  14. package/dist/src/modules/v4/chain/chain.controller.js +3 -6
  15. package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +1 -4
  16. package/dist/src/modules/v4/enso/enso.service.d.ts +1 -0
  17. package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +2 -6
  18. package/dist/src/modules/v4/opportunity/opportunity.controller.js +3 -9
  19. package/dist/src/modules/v4/participate/participate.controller.d.ts +1 -0
  20. package/dist/src/modules/v4/participate/participate.controller.js +5 -3
  21. package/dist/src/modules/v4/price/price.controller.js +11 -21
  22. package/dist/src/modules/v4/protocol/protocol.controller.d.ts +3 -7
  23. package/dist/src/modules/v4/protocol/protocol.controller.js +4 -9
  24. package/dist/src/modules/v4/protocol/protocol.model.d.ts +2 -2
  25. package/dist/src/modules/v4/protocol/protocol.model.js +4 -1
  26. package/dist/src/modules/v4/protocol/protocol.service.js +4 -3
  27. package/dist/src/modules/v4/router.d.ts +4 -7
  28. package/dist/src/modules/v4/status/status.controller.js +6 -18
  29. package/dist/src/modules/v4/token/token.controller.js +3 -6
  30. package/dist/src/routes/v3/ERC20Campaigns.d.ts +4 -7
  31. package/dist/src/routes/v3/blacklist.d.ts +4 -7
  32. package/dist/src/routes/v3/campaigns.d.ts +4 -7
  33. package/dist/src/routes/v3/campaignsInfo.d.ts +4 -7
  34. package/dist/src/routes/v3/multiChainPositions.d.ts +4 -7
  35. package/dist/src/routes/v3/opportunity.d.ts +4 -7
  36. package/dist/src/routes/v3/positions.d.ts +4 -7
  37. package/dist/src/routes/v3/rewards.d.ts +4 -7
  38. package/dist/src/routes/v3/updates.d.ts +4 -7
  39. package/dist/src/routes/v3/userRewards.d.ts +4 -7
  40. package/dist/src/utils/decodeCalls.js +3 -1
  41. package/dist/src/utils/encodeCalls.js +7 -1
  42. package/dist/src/utils/generateCardName.js +2 -0
  43. package/dist/tsconfig.package.tsbuildinfo +1 -1
  44. package/package.json +4 -3
  45. package/dist/src/modules/v4/apr/apr.controller.d.ts +0 -0
  46. package/dist/src/modules/v4/apr/apr.controller.js +0 -1
  47. package/dist/src/modules/v4/tvl/tvl.controller.d.ts +0 -0
  48. package/dist/src/modules/v4/tvl/tvl.controller.js +0 -1
@@ -348,3 +348,4 @@ export declare const constantChain: {
348
348
  glcr?: undefined;
349
349
  };
350
350
  };
351
+ export declare const MAVERICK_ZKSYNC_BP_LENS_ADDRESS = "0xd32CE31CaC98CAC0631764B8286358c0606D87F9";
@@ -117,3 +117,4 @@ export const constantChain = {
117
117
  cake: "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
118
118
  },
119
119
  };
120
+ export const MAVERICK_ZKSYNC_BP_LENS_ADDRESS = "0xd32CE31CaC98CAC0631764B8286358c0606D87F9";
@@ -550,6 +550,7 @@ declare const eden: {
550
550
  name: string;
551
551
  url: string;
552
552
  description: string;
553
+ id: string;
553
554
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
554
555
  icon: string;
555
556
  } | null;
@@ -571,23 +572,18 @@ declare const eden: {
571
572
  name: string;
572
573
  url: string;
573
574
  description: string;
575
+ id: string;
574
576
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
575
577
  icon: string;
576
578
  } & {})[] | null;
577
579
  }>>;
578
580
  };
579
581
  count: {
580
- get: (options: {
582
+ get: (options?: {
581
583
  headers?: Record<string, unknown> | undefined;
582
- query: {
583
- name?: string | undefined;
584
- id?: string[] | undefined;
585
- items?: number | undefined;
586
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
587
- page?: number | undefined;
588
- };
584
+ query?: Record<string, unknown> | undefined;
589
585
  fetch?: RequestInit | undefined;
590
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
586
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
591
587
  200: number;
592
588
  }>>;
593
589
  };
@@ -1430,6 +1426,7 @@ declare const eden: {
1430
1426
  name: string;
1431
1427
  url: string;
1432
1428
  description: string;
1429
+ id: string;
1433
1430
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
1434
1431
  icon: string;
1435
1432
  } & {})[] | null;
@@ -2422,6 +2419,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2422
2419
  name: string;
2423
2420
  url: string;
2424
2421
  description: string;
2422
+ id: string;
2425
2423
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
2426
2424
  icon: string;
2427
2425
  } | null;
@@ -2448,6 +2446,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2448
2446
  name: string;
2449
2447
  url: string;
2450
2448
  description: string;
2449
+ id: string;
2451
2450
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
2452
2451
  icon: string;
2453
2452
  } & {})[] | null;
@@ -2461,13 +2460,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2461
2460
  get: {
2462
2461
  body: unknown;
2463
2462
  params: {};
2464
- query: {
2465
- name?: string | undefined;
2466
- id?: string[] | undefined;
2467
- items?: number | undefined;
2468
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
2469
- page?: number | undefined;
2470
- };
2463
+ query: unknown;
2471
2464
  headers: unknown;
2472
2465
  response: {
2473
2466
  200: number;
@@ -3547,6 +3540,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
3547
3540
  name: string;
3548
3541
  url: string;
3549
3542
  description: string;
3543
+ id: string;
3550
3544
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
3551
3545
  icon: string;
3552
3546
  } & {})[] | null;
@@ -4557,6 +4551,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4557
4551
  name: string;
4558
4552
  url: string;
4559
4553
  description: string;
4554
+ id: string;
4560
4555
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
4561
4556
  icon: string;
4562
4557
  } | null;
@@ -4578,23 +4573,18 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4578
4573
  name: string;
4579
4574
  url: string;
4580
4575
  description: string;
4576
+ id: string;
4581
4577
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
4582
4578
  icon: string;
4583
4579
  } & {})[] | null;
4584
4580
  }>>;
4585
4581
  };
4586
4582
  count: {
4587
- get: (options: {
4583
+ get: (options?: {
4588
4584
  headers?: Record<string, unknown> | undefined;
4589
- query: {
4590
- name?: string | undefined;
4591
- id?: string[] | undefined;
4592
- items?: number | undefined;
4593
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
4594
- page?: number | undefined;
4595
- };
4585
+ query?: Record<string, unknown> | undefined;
4596
4586
  fetch?: RequestInit | undefined;
4597
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4587
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4598
4588
  200: number;
4599
4589
  }>>;
4600
4590
  };
@@ -5437,6 +5427,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
5437
5427
  name: string;
5438
5428
  url: string;
5439
5429
  description: string;
5430
+ id: string;
5440
5431
  tags: import("../../database/api/.generated").$Enums.ProtocolTag[];
5441
5432
  icon: string;
5442
5433
  } & {})[] | null;
@@ -639,6 +639,7 @@ declare const app: Elysia<"", false, {
639
639
  name: string;
640
640
  url: string;
641
641
  description: string;
642
+ id: string;
642
643
  tags: import("../database/api/.generated").$Enums.ProtocolTag[];
643
644
  icon: string;
644
645
  } | null;
@@ -665,6 +666,7 @@ declare const app: Elysia<"", false, {
665
666
  name: string;
666
667
  url: string;
667
668
  description: string;
669
+ id: string;
668
670
  tags: import("../database/api/.generated").$Enums.ProtocolTag[];
669
671
  icon: string;
670
672
  } & {})[] | null;
@@ -678,13 +680,7 @@ declare const app: Elysia<"", false, {
678
680
  get: {
679
681
  body: unknown;
680
682
  params: {};
681
- query: {
682
- name?: string | undefined;
683
- id?: string[] | undefined;
684
- items?: number | undefined;
685
- tags?: ("AMM" | "ALM" | "DEX" | "LENDING")[] | undefined;
686
- page?: number | undefined;
687
- };
683
+ query: unknown;
688
684
  headers: unknown;
689
685
  response: {
690
686
  200: number;
@@ -1764,6 +1760,7 @@ declare const app: Elysia<"", false, {
1764
1760
  name: string;
1765
1761
  url: string;
1766
1762
  description: string;
1763
+ id: string;
1767
1764
  tags: import("../database/api/.generated").$Enums.ProtocolTag[];
1768
1765
  icon: string;
1769
1766
  } & {})[] | null;
@@ -33,23 +33,19 @@ export async function ERC20DynamicDataRefacto(chainId, campaigns) {
33
33
  allowFailure: true,
34
34
  callData: FactoryInterface.encodeFunctionData("factory"),
35
35
  target: campaign.campaignParameters.targetToken,
36
- });
37
- callsRounds1.push({
36
+ }, {
38
37
  allowFailure: true,
39
38
  callData: MetamorphoInterface.encodeFunctionData("MORPHO"),
40
39
  target: campaign.campaignParameters.targetToken,
41
- });
42
- callsRounds1.push({
40
+ }, {
43
41
  allowFailure: true,
44
42
  callData: ERC20Interface.encodeFunctionData("name"),
45
43
  target: campaign.campaignParameters.targetToken,
46
- });
47
- callsRounds1.push({
44
+ }, {
48
45
  allowFailure: true,
49
46
  callData: BalancerPoolInterface.encodeFunctionData("getPoolId"),
50
47
  target: campaign.campaignParameters.targetToken,
51
- });
52
- callsRounds1.push({
48
+ }, {
53
49
  allowFailure: true,
54
50
  callData: EnzymeInterface.encodeFunctionData("getCreator"),
55
51
  target: campaign.campaignParameters.targetToken,
@@ -46,10 +46,11 @@ export declare enum tokenType {
46
46
  koi = "koi",
47
47
  baseswap = "baseswap",
48
48
  zkswap = "zkswap",
49
- pendle = "pendle",
50
49
  ironcladStaking = "ironcladStaking",
51
50
  rfx = "rfx",
52
- woofi = "woofi"
51
+ woofi = "woofi",
52
+ pendle = "pendle",
53
+ maverickBoostedPosition = "maverickBoostedPosition"
53
54
  }
54
55
  export declare const tokenTypeToProtocol: {
55
56
  [key in tokenType]: {
@@ -47,10 +47,11 @@ export var tokenType;
47
47
  tokenType["koi"] = "koi";
48
48
  tokenType["baseswap"] = "baseswap";
49
49
  tokenType["zkswap"] = "zkswap";
50
- tokenType["pendle"] = "pendle";
51
50
  tokenType["ironcladStaking"] = "ironcladStaking";
52
51
  tokenType["rfx"] = "rfx";
53
52
  tokenType["woofi"] = "woofi";
53
+ tokenType["pendle"] = "pendle";
54
+ tokenType["maverickBoostedPosition"] = "maverickBoostedPosition";
54
55
  })(tokenType || (tokenType = {}));
55
56
  export const tokenTypeToProtocol = {
56
57
  [tokenType.aave_borrowing]: { protocol: "Aave" },
@@ -100,7 +101,14 @@ export const tokenTypeToProtocol = {
100
101
  [tokenType.zerolend_borrowing]: { protocol: "ZeroLend" },
101
102
  [tokenType.zerolend_lending]: { protocol: "ZeroLend" },
102
103
  [tokenType.zkswap]: { protocol: "ZKSwap" },
103
- [tokenType.ironcladStaking]: { protocol: "Ironclad" },
104
104
  [tokenType.rfx]: { protocol: "RFX" },
105
- [tokenType.woofi]: { protocol: "Woofi" },
105
+ [tokenType.woofi]: {
106
+ protocol: "Woofi",
107
+ },
108
+ [tokenType.ironcladStaking]: {
109
+ protocol: "Ironclad",
110
+ },
111
+ [tokenType.maverickBoostedPosition]: {
112
+ protocol: "Maverick",
113
+ },
106
114
  };
@@ -0,0 +1,50 @@
1
+ import type { Pricer } from "../../../../../utils/pricer";
2
+ import { type Campaign, type CampaignParameters } from "@sdk";
3
+ import type { tokenType } from "../helpers/tokenType";
4
+ import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
+ type callType = {
6
+ key: keyof dataRawMaverickBP;
7
+ call: string;
8
+ target: keyof callKeysMaverickBP;
9
+ metaData?: keyof callKeysMaverickBP;
10
+ };
11
+ type callKeysMaverickBP = mandatoryCallKeys & {
12
+ boostedPositionInformation: string;
13
+ tokenA: string;
14
+ tokenB: string;
15
+ lensAddress: string;
16
+ };
17
+ type dataRawMaverickBP = callKeysMaverickBP & {
18
+ amountA: string;
19
+ amountB: string;
20
+ decimalsTokenA: string;
21
+ decimalsTokenB: string;
22
+ bpInfoReturnData: {
23
+ [key: string]: string | number;
24
+ };
25
+ symbolTokenA: string;
26
+ symbolTokenB: string;
27
+ };
28
+ type dataTypeMaverickBP = dataType & {
29
+ amountA: number;
30
+ amountB: number;
31
+ decimalsTokenA: number;
32
+ decimalsTokenB: number;
33
+ lensAddress: string;
34
+ symbolTokenA: string;
35
+ symbolTokenB: string;
36
+ tokenA: string;
37
+ tokenB: string;
38
+ };
39
+ export declare class MaverickBPProcessor extends GenericProcessor<callKeysMaverickBP, dataRawMaverickBP, dataTypeMaverickBP> {
40
+ rounds: {
41
+ round1: callType[];
42
+ round2: callType[];
43
+ round3: callType[];
44
+ round4: callType[];
45
+ };
46
+ processingRound1(typeInfo: dataRawMaverickBP): void;
47
+ processingRound2(typeInfo: dataRawMaverickBP): void;
48
+ processingRound5(_index: number, type: tokenType, typeInfo: dataRawMaverickBP, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeMaverickBP>;
49
+ }
50
+ export {};
@@ -0,0 +1,75 @@
1
+ import { MAVERICK_ZKSYNC_BP_LENS_ADDRESS } from "../../../../../constants";
2
+ import { generateCardName } from "../../../../../utils/generateCardName";
3
+ import { BN2Number } from "@sdk";
4
+ import { GenericProcessor } from "./GenericProcessor";
5
+ export class MaverickBPProcessor extends GenericProcessor {
6
+ rounds = {
7
+ round1: [
8
+ {
9
+ key: "bpInfoReturnData",
10
+ call: "boostedPositionInformation",
11
+ target: "lensAddress",
12
+ metaData: "tokenAddress",
13
+ },
14
+ ],
15
+ round2: [
16
+ {
17
+ key: "symbolTokenA",
18
+ call: "symbol",
19
+ target: "tokenA",
20
+ },
21
+ {
22
+ key: "symbolTokenB",
23
+ call: "symbol",
24
+ target: "tokenB",
25
+ },
26
+ {
27
+ key: "decimalsTokenA",
28
+ call: "decimals",
29
+ target: "tokenA",
30
+ },
31
+ {
32
+ key: "decimalsTokenB",
33
+ call: "decimals",
34
+ target: "tokenB",
35
+ },
36
+ ],
37
+ round3: [],
38
+ round4: [{ key: "totalSupply", call: "totalSupply", target: "tokenAddress" }],
39
+ };
40
+ processingRound1(typeInfo) {
41
+ typeInfo.lensAddress = MAVERICK_ZKSYNC_BP_LENS_ADDRESS;
42
+ }
43
+ processingRound2(typeInfo) {
44
+ typeInfo.tokenA = typeInfo.bpInfoReturnData.tokenA;
45
+ typeInfo.tokenB = typeInfo.bpInfoReturnData.tokenB;
46
+ typeInfo.amountA = typeInfo.bpInfoReturnData.amountA.toString();
47
+ typeInfo.amountB = typeInfo.bpInfoReturnData.amountB.toString();
48
+ }
49
+ async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
50
+ const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
51
+ const decimalsTokenA = Number(typeInfo.decimalsTokenA);
52
+ const decimalsTokenB = Number(typeInfo.decimalsTokenB);
53
+ const amountA = BN2Number(typeInfo.amountA, decimalsTokenA);
54
+ const amountB = BN2Number(typeInfo.amountB, decimalsTokenB);
55
+ const tokenAPRice = (await pricer.get({ symbol: typeInfo.symbolTokenA })) ?? 0;
56
+ const tokenBPrice = (await pricer.get({ symbol: typeInfo.symbolTokenB })) ?? 0;
57
+ // Not rebased (ie divided by 10edecimals)
58
+ const tvl = tokenAPRice * amountA + tokenBPrice * amountB;
59
+ const priceTargetToken = tvl / totalSupply;
60
+ const { bpInfoReturnData, ...rest } = typeInfo;
61
+ return {
62
+ ...rest,
63
+ blacklistedSupply,
64
+ amountA,
65
+ amountB,
66
+ decimalsTokenA,
67
+ decimalsTokenB,
68
+ cardName: generateCardName(type, typeInfo, campaign),
69
+ priceTargetToken: priceTargetToken,
70
+ totalSupply,
71
+ tvl,
72
+ whitelistedSupplyTargetToken,
73
+ };
74
+ }
75
+ }
@@ -13,6 +13,7 @@ import { FluidProcessor } from "./FluidProcessor";
13
13
  import { FraxProcessor } from "./FraxProcessor";
14
14
  import { GearboxProcessor } from "./GearboxProcessor";
15
15
  import { GenericProcessor } from "./GenericProcessor";
16
+ import { MaverickBPProcessor } from "./MaverickBPProcessor";
16
17
  import { MetamorphoProcessor } from "./MetamorphoProcessor";
17
18
  import { PendleProcessor } from "./PendleProcessor";
18
19
  import { RadiantProcessor } from "./RadiantProcessor";
@@ -74,4 +75,5 @@ export const processorMapping = {
74
75
  [tokenType.ironcladStaking]: GenericProcessor,
75
76
  [tokenType.rfx]: RfxProcessor,
76
77
  [tokenType.woofi]: WoofiProcessor,
78
+ [tokenType.maverickBoostedPosition]: MaverickBPProcessor,
77
79
  };
@@ -81,6 +81,8 @@ function satisfiesNameConditions(name, type) {
81
81
  return lowerCaseName === "ironclad token";
82
82
  case tokenType.woofi:
83
83
  return lowerCaseName.includes("woofi");
84
+ case tokenType.maverickBoostedPosition:
85
+ return lowerCaseName.includes("maverick");
84
86
  default:
85
87
  return false;
86
88
  }
@@ -6,13 +6,9 @@ import { AddBlacklistDto, CheckBlacklistDto, RemoveBlacklistDto } from "./blackl
6
6
  import { BlacklistService } from "./blacklist.service";
7
7
  export const BlacklistController = new Elysia({ prefix: "/blacklists", detail: { tags: ["Blacklists"] } })
8
8
  // ─── Get Entire Blacklist ────────────────────────────────────────────
9
- .get("/", async () => {
10
- return await BlacklistService.findMany();
11
- })
9
+ .get("/", async () => await BlacklistService.findMany())
12
10
  // ─── Get Blacklist From Cache ────────────────────────────────────────
13
- .get("/all", async () => {
14
- return await BlacklistService.getMany();
15
- })
11
+ .get("/all", async () => await BlacklistService.getMany())
16
12
  // ─── Check If An Address Is Blacklisted ──────────────────────────────
17
13
  .get("/check/:address", async ({ params }) => await BlacklistService.isBlacklisted(params.address), {
18
14
  params: CheckBlacklistDto,
@@ -7,45 +7,33 @@ import { CampaignService } from "./campaign.service";
7
7
  // ─── Campaigns Controller ────────────────────────────────────────────────────
8
8
  export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { tags: ["Campaigns"] } })
9
9
  // ─── Create A Campaign ───────────────────────────────────────────────
10
- .post("/", async ({ body }) => {
11
- return await CampaignService.create(body);
12
- }, {
10
+ .post("/", async ({ body }) => await CampaignService.create(body), {
13
11
  beforeHandle: EngineGuard,
14
12
  headers: AuthorizationHeadersDto,
15
13
  body: CreateCampaignDto,
16
14
  })
17
15
  // ─── Get Many Campaigns ──────────────────────────────────────────────
18
- .get("/", async ({ query }) => {
19
- return await CampaignService.findMany(query);
20
- }, { query: GetCampaignQueryDto })
16
+ .get("/", async ({ query }) => await CampaignService.findMany(query), { query: GetCampaignQueryDto })
21
17
  // ─── Get Total Campaigns Count ───────────────────────────────────────
22
- .get("/count", async ({ query }) => {
23
- return await CampaignService.countMany(query);
24
- }, { query: GetCampaignQueryDto })
18
+ .get("/count", async ({ query }) => await CampaignService.countMany(query), { query: GetCampaignQueryDto })
25
19
  .group("/campaignsToProcess", app => {
26
20
  return (app
27
21
  // ─── Get the List of CampaignsToProcess ─────────────────────────────-
28
- .get("/", async ({ query }) => {
29
- return await CampaignService.findCampaignsToProcess(query.chainId);
30
- }, {
22
+ .get("/", async ({ query }) => await CampaignService.findCampaignsToProcess(query.chainId), {
31
23
  query: ChainDto,
32
24
  beforeHandle: ({ query }) => {
33
25
  throwOnUnsupportedChainId(query.chainId);
34
26
  },
35
27
  })
36
28
  // ─── Get Count of CampaignsToProcess ─────────────────────────────────
37
- .get("/count", async ({ query }) => {
38
- return (await CampaignService.findCampaignsToProcess(query.chainId)).length;
39
- }, {
29
+ .get("/count", async ({ query }) => (await CampaignService.findCampaignsToProcess(query.chainId)).length, {
40
30
  query: ChainDto,
41
31
  beforeHandle: ({ query }) => {
42
32
  throwOnUnsupportedChainId(query.chainId);
43
33
  },
44
34
  })
45
35
  // ─── Returns a CampaignId to Process and flags it as PROCESSING ──────-
46
- .post("/", async ({ query }) => {
47
- return await CampaignService.pickCampaignToProcess(query.chainId);
48
- }, {
36
+ .post("/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
49
37
  query: ChainDto,
50
38
  beforeHandle: async ({ query, headers }) => {
51
39
  await EngineGuard({ headers });
@@ -23,16 +23,13 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
23
23
  }, {
24
24
  query: GetChainQueryDto,
25
25
  })
26
- .get("/count", async ({ query }) => {
27
- return await ChainService.countMany(query);
28
- }, {
26
+ // ─── Count Chains ────────────────────────────────────────
27
+ .get("/count", async ({ query }) => await ChainService.countMany(query), {
29
28
  query: GetChainQueryDto,
30
29
  })
31
30
  // ─── Get All Supported Chains ────────────────────────────────────────
32
31
  .group("/explorers", app => {
33
- return app.post("", async ({ body: { chainId, type, url } }) => {
34
- return await ExplorerService.create(chainId, type, url);
35
- }, {
32
+ return app.post("", async ({ body: { chainId, type, url } }) => await ExplorerService.create(chainId, type, url), {
36
33
  beforeHandle: TokenAuthGuard,
37
34
  headers: AuthorizationHeadersDto,
38
35
  body: CreateChainExplorerDto,
@@ -5,11 +5,8 @@ import { DynamicDataSourceIdentifier } from "./dynamicData.model";
5
5
  import { DynamicDataService } from "./dynamicData.service";
6
6
  // ─── DynamicDatas Controller ───────────────────────────────────────────────────────
7
7
  export const DynamicDataController = new Elysia({ prefix: "/dynamicData", detail: { tags: ["DynamicData"] } })
8
- // ─── Get All DynamicDatas ──────────────────────────────────────────────────
9
8
  // ─── Get type Info By Token Address ───────────────────────────────────────
10
- .get("/chainId/:chainId/token/:tokenAddress", async ({ params }) => {
11
- return await DynamicDataService.queryERC20DynamicData(params.chainId, params.tokenAddress);
12
- }, {
9
+ .get("/chainId/:chainId/token/:tokenAddress", async ({ params }) => await DynamicDataService.queryERC20DynamicData(params.chainId, params.tokenAddress), {
13
10
  params: DynamicDataSourceIdentifier,
14
11
  headers: AuthorizationHeadersDto,
15
12
  beforeHandle: ({ params, headers }) => {
@@ -9,6 +9,7 @@ export declare abstract class EnsoService {
9
9
  name: string;
10
10
  url: string;
11
11
  description: string;
12
+ id: string;
12
13
  tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
13
14
  icon: string;
14
15
  } & {})[] | null>;
@@ -5,15 +5,11 @@ import { MerklRootService } from "./merklRoot.service";
5
5
  // ─── Merkl Roots Controller ──────────────────────────────────────────────────
6
6
  export const MerklRootController = new Elysia({ prefix: "/roots", detail: { tags: ["Roots"] } })
7
7
  // ─── Get Merkl Root By Timestamp ─────────────────────────────────────
8
- .get("/timestamps", async ({ query }) => {
9
- return await MerklRootService.rootForTimestamp(query);
10
- }, {
8
+ .get("/timestamps", async ({ query }) => await MerklRootService.rootForTimestamp(query), {
11
9
  query: RootByTimestampsDto,
12
10
  beforeHandle: async ({ query }) => {
13
11
  throwOnUnsupportedChainId(query.chainId);
14
12
  },
15
13
  })
16
14
  // ─── Get all live Merkl Roots ─────────────────────────────────────────
17
- .get("/", async () => {
18
- return await MerklRootService.fetchAll();
19
- });
15
+ .get("/", async () => await MerklRootService.fetchAll());
@@ -8,9 +8,7 @@ import { validateId } from "./validate-id.pipe";
8
8
  // ─── Opportunities Controller ────────────────────────────────────────────────
9
9
  export const OpportunityController = new Elysia({ prefix: "/opportunities", detail: { tags: ["Opportunities"] } })
10
10
  // ─── Create An Opportunity ───────────────────────────────────────────
11
- .post("/", async ({ body }) => {
12
- return await OpportunityService.create(body);
13
- }, {
11
+ .post("/", async ({ body }) => await OpportunityService.create(body), {
14
12
  beforeHandle: TokenAuthGuard,
15
13
  headers: AuthorizationHeadersDto,
16
14
  body: CreateOpportunityDto,
@@ -58,12 +56,8 @@ export const OpportunityController = new Elysia({ prefix: "/opportunities", deta
58
56
  beforeHandle: validateId,
59
57
  })
60
58
  // ─── Get All Opportunities ───────────────────────────────────────────
61
- .get("/", async ({ query }) => {
62
- return await OpportunityService.getMany(query);
63
- }, {
59
+ .get("/", async ({ query }) => await OpportunityService.getMany(query), {
64
60
  query: GetOpportunitiesQueryDto,
65
61
  })
66
62
  // ─── Get Opportunities Count ─────────────────────────────────────────
67
- .get("/count", async ({ query }) => {
68
- return await OpportunityService.countMany(query);
69
- }, { query: GetOpportunitiesQueryDto });
63
+ .get("/count", async ({ query }) => await OpportunityService.countMany(query), { query: GetOpportunitiesQueryDto });
@@ -44,6 +44,7 @@ export declare const ParticipateController: Elysia<"/participate", false, {
44
44
  name: string;
45
45
  url: string;
46
46
  description: string;
47
+ id: string;
47
48
  tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
48
49
  icon: string;
49
50
  } & {})[] | null;
@@ -4,6 +4,7 @@ import { GetParticipateProtocolsQueryDto, GetParticipateQuoteQueryDto, GetPartic
4
4
  import { ParticipateService } from "./participate.service";
5
5
  // ─── Participate Controller ──────────────────────────────────────────────────
6
6
  export const ParticipateController = new Elysia({ prefix: "/participate", detail: { tags: ["Participate"] } })
7
+ // ─── Get All Targets ───────────────────────────────────────────────
7
8
  .get("/targets", async ({ query: { protocolId, chainId, identifier } }) => {
8
9
  if (identifier)
9
10
  return await ParticipateService.getTarget(chainId, protocolId, identifier);
@@ -15,15 +16,15 @@ export const ParticipateController = new Elysia({ prefix: "/participate", detail
15
16
  description: "Retrieves all the pool/token/contract",
16
17
  },
17
18
  })
18
- .get("/protocols", async ({ query }) => {
19
- return await EnsoService.getCompatibleProtocols(query);
20
- }, {
19
+ // ─── Get All Compatible Protocols ───────────────────────────────────────
20
+ .get("/protocols", async ({ query }) => await EnsoService.getCompatibleProtocols(query), {
21
21
  query: GetParticipateProtocolsQueryDto,
22
22
  detail: {
23
23
  summary: "Interactable protocols",
24
24
  description: "Retrieves protocols integrated by merkl which supports being interacted with",
25
25
  },
26
26
  })
27
+ // ─── Get Quote ───────────────────────────────────────────────────────
27
28
  .get("/quote", async ({ query: { protocolId, chainId, identifier, userAddress, fromAmount, fromTokenAddress } }) => {
28
29
  const [target] = (await ParticipateService.getTarget(chainId, protocolId, identifier)) ?? [];
29
30
  //TODO: throw error
@@ -44,6 +45,7 @@ export const ParticipateController = new Elysia({ prefix: "/participate", detail
44
45
  description: "",
45
46
  },
46
47
  })
48
+ // ─── Get Transaction ─────────────────────────────────────────────────
47
49
  .get("/transaction", async ({ query: { protocolId, chainId, identifier, userAddress, fromAmount, fromTokenAddress } }) => {
48
50
  const [target] = (await ParticipateService.getTarget(chainId, protocolId, identifier)) ?? [];
49
51
  //TODO: throw error