@merkl/api 0.10.153 → 0.10.154

Sign up to get free protection for your applications and to get access to all the features.
@@ -541,17 +541,6 @@ declare const eden: {
541
541
  }[];
542
542
  }[];
543
543
  }>>;
544
- post: (body: unknown, options: {
545
- headers: {
546
- authorization: string;
547
- };
548
- query: {
549
- chainId: number;
550
- };
551
- fetch?: RequestInit | undefined;
552
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
553
- 200: string;
554
- }>>;
555
544
  };
556
545
  count: {
557
546
  get: (options: {
@@ -564,6 +553,21 @@ declare const eden: {
564
553
  200: number;
565
554
  }>>;
566
555
  };
556
+ engine: {
557
+ "": {
558
+ post: (body: unknown, options: {
559
+ headers: {
560
+ authorization: string;
561
+ };
562
+ query: {
563
+ chainId: number;
564
+ };
565
+ fetch?: RequestInit | undefined;
566
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
567
+ 200: string;
568
+ }>>;
569
+ };
570
+ };
567
571
  };
568
572
  };
569
573
  protocols: ((params: {
@@ -2398,18 +2402,20 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
2398
2402
  };
2399
2403
  } & {
2400
2404
  "campaigns-to-process": {
2401
- index: {
2402
- post: {
2403
- body: unknown;
2404
- params: {};
2405
- query: {
2406
- chainId: number;
2407
- };
2408
- headers: {
2409
- authorization: string;
2410
- };
2411
- response: {
2412
- 200: string;
2405
+ engine: {
2406
+ "": {
2407
+ post: {
2408
+ body: unknown;
2409
+ params: {};
2410
+ query: {
2411
+ chainId: number;
2412
+ };
2413
+ headers: {
2414
+ authorization: string;
2415
+ };
2416
+ response: {
2417
+ 200: string;
2418
+ };
2413
2419
  };
2414
2420
  };
2415
2421
  };
@@ -4494,17 +4500,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4494
4500
  }[];
4495
4501
  }[];
4496
4502
  }>>;
4497
- post: (body: unknown, options: {
4498
- headers: {
4499
- authorization: string;
4500
- };
4501
- query: {
4502
- chainId: number;
4503
- };
4504
- fetch?: RequestInit | undefined;
4505
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4506
- 200: string;
4507
- }>>;
4508
4503
  };
4509
4504
  count: {
4510
4505
  get: (options: {
@@ -4517,6 +4512,21 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
4517
4512
  200: number;
4518
4513
  }>>;
4519
4514
  };
4515
+ engine: {
4516
+ "": {
4517
+ post: (body: unknown, options: {
4518
+ headers: {
4519
+ authorization: string;
4520
+ };
4521
+ query: {
4522
+ chainId: number;
4523
+ };
4524
+ fetch?: RequestInit | undefined;
4525
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
4526
+ 200: string;
4527
+ }>>;
4528
+ };
4529
+ };
4520
4530
  };
4521
4531
  };
4522
4532
  protocols: ((params: {
@@ -640,18 +640,20 @@ declare const app: Elysia<"", false, {
640
640
  };
641
641
  } & {
642
642
  "campaigns-to-process": {
643
- index: {
644
- post: {
645
- body: unknown;
646
- params: {};
647
- query: {
648
- chainId: number;
649
- };
650
- headers: {
651
- authorization: string;
652
- };
653
- response: {
654
- 200: string;
643
+ engine: {
644
+ "": {
645
+ post: {
646
+ body: unknown;
647
+ params: {};
648
+ query: {
649
+ chainId: number;
650
+ };
651
+ headers: {
652
+ authorization: string;
653
+ };
654
+ response: {
655
+ 200: string;
656
+ };
655
657
  };
656
658
  };
657
659
  };
@@ -40,7 +40,10 @@ function satisfiesNameConditions(name, type) {
40
40
  case tokenType.moonwell:
41
41
  return lowerCaseName.includes("moonwell");
42
42
  case tokenType.curve_2:
43
- return lowerCaseName === "crvusd/frax" || lowerCaseName === "ezeth/wfrxeth" || lowerCaseName === "pufeth/wsteth";
43
+ return (lowerCaseName === "crvusd/frax" ||
44
+ lowerCaseName === "ezeth/wfrxeth" ||
45
+ lowerCaseName === "pufeth/wsteth" ||
46
+ lowerCaseName === "hai/lusd");
44
47
  case tokenType.silostaking:
45
48
  return lowerCaseName === "isei";
46
49
  case tokenType.beefy:
@@ -1,4 +1,3 @@
1
- import { engineDbClient } from "../../../utils/prisma";
2
1
  import { apiDbClient } from "src/utils/prisma";
3
2
  export const getLastEligibilityRatio = async (campaign, chainId, currentRoot, backupCampaignIds) => {
4
3
  if (campaign.campaignId === "0x6acb7a8cd2646f18e6e438658273bbee1ed6d664c19779d144cc339decf240ca") {
@@ -30,16 +29,26 @@ export const getLastEligibilityRatio = async (campaign, chainId, currentRoot, ba
30
29
  if (auxLastEligibilityRatio === undefined || auxLastEligibilityRatio === null) {
31
30
  // Otherwise we search in the backup campaigns
32
31
  for (const campaignId of backupCampaignIds) {
33
- auxLastEligibilityRatio = (await engineDbClient.leaves.findFirst({
32
+ const auxLastEligibilityRatioString = (await apiDbClient.rewardBreakdown.findFirst({
34
33
  select: {
35
34
  auxiliaryData1: true,
36
35
  },
37
36
  where: {
38
- chainId: chainId,
39
- campaignId,
40
- root: currentRoot,
37
+ Reward: {
38
+ RewardToken: {
39
+ chainId,
40
+ },
41
+ root: currentRoot,
42
+ },
43
+ campaignId: campaignId,
41
44
  },
42
- }))?.auxiliaryData1?.toNumber();
45
+ orderBy: {
46
+ amount: "desc",
47
+ },
48
+ }))?.auxiliaryData1;
49
+ auxLastEligibilityRatio = !!auxLastEligibilityRatioString
50
+ ? Number.parseFloat(auxLastEligibilityRatioString)
51
+ : null;
43
52
  if (!!auxLastEligibilityRatio)
44
53
  break;
45
54
  }
@@ -179,18 +179,20 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
179
179
  };
180
180
  } & {
181
181
  "campaigns-to-process": {
182
- index: {
183
- post: {
184
- body: unknown;
185
- params: {};
186
- query: {
187
- chainId: number;
188
- };
189
- headers: {
190
- authorization: string;
191
- };
192
- response: {
193
- 200: string;
182
+ engine: {
183
+ "": {
184
+ post: {
185
+ body: unknown;
186
+ params: {};
187
+ query: {
188
+ chainId: number;
189
+ };
190
+ headers: {
191
+ authorization: string;
192
+ };
193
+ response: {
194
+ 200: string;
195
+ };
194
196
  };
195
197
  };
196
198
  };
@@ -34,7 +34,7 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
34
34
  },
35
35
  })
36
36
  // ─── Returns a CampaignId to Process and flags it as PROCESSING ──────-
37
- .post("/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
37
+ .post("/engine/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
38
38
  query: ChainUniqueDto,
39
39
  beforeHandle: async ({ query, headers }) => {
40
40
  await EngineGuard({ headers });
@@ -622,18 +622,20 @@ export declare const v4: Elysia<"/v4", false, {
622
622
  };
623
623
  } & {
624
624
  "campaigns-to-process": {
625
- index: {
626
- post: {
627
- body: unknown;
628
- params: {};
629
- query: {
630
- chainId: number;
631
- };
632
- headers: {
633
- authorization: string;
634
- };
635
- response: {
636
- 200: string;
625
+ engine: {
626
+ "": {
627
+ post: {
628
+ body: unknown;
629
+ params: {};
630
+ query: {
631
+ chainId: number;
632
+ };
633
+ headers: {
634
+ authorization: string;
635
+ };
636
+ response: {
637
+ 200: string;
638
+ };
637
639
  };
638
640
  };
639
641
  };
@@ -648,18 +648,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
648
648
  };
649
649
  } & {
650
650
  "campaigns-to-process": {
651
- index: {
652
- post: {
653
- body: unknown;
654
- params: {};
655
- query: {
656
- chainId: number;
657
- };
658
- headers: {
659
- authorization: string;
660
- };
661
- response: {
662
- 200: string;
651
+ engine: {
652
+ "": {
653
+ post: {
654
+ body: unknown;
655
+ params: {};
656
+ query: {
657
+ chainId: number;
658
+ };
659
+ headers: {
660
+ authorization: string;
661
+ };
662
+ response: {
663
+ 200: string;
664
+ };
663
665
  };
664
666
  };
665
667
  };
@@ -646,18 +646,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
646
646
  };
647
647
  } & {
648
648
  "campaigns-to-process": {
649
- index: {
650
- post: {
651
- body: unknown;
652
- params: {};
653
- query: {
654
- chainId: number;
655
- };
656
- headers: {
657
- authorization: string;
658
- };
659
- response: {
660
- 200: string;
649
+ engine: {
650
+ "": {
651
+ post: {
652
+ body: unknown;
653
+ params: {};
654
+ query: {
655
+ chainId: number;
656
+ };
657
+ headers: {
658
+ authorization: string;
659
+ };
660
+ response: {
661
+ 200: string;
662
+ };
661
663
  };
662
664
  };
663
665
  };
@@ -649,18 +649,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
649
649
  };
650
650
  } & {
651
651
  "campaigns-to-process": {
652
- index: {
653
- post: {
654
- body: unknown;
655
- params: {};
656
- query: {
657
- chainId: number;
658
- };
659
- headers: {
660
- authorization: string;
661
- };
662
- response: {
663
- 200: string;
652
+ engine: {
653
+ "": {
654
+ post: {
655
+ body: unknown;
656
+ params: {};
657
+ query: {
658
+ chainId: number;
659
+ };
660
+ headers: {
661
+ authorization: string;
662
+ };
663
+ response: {
664
+ 200: string;
665
+ };
664
666
  };
665
667
  };
666
668
  };
@@ -640,18 +640,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
640
640
  };
641
641
  } & {
642
642
  "campaigns-to-process": {
643
- index: {
644
- post: {
645
- body: unknown;
646
- params: {};
647
- query: {
648
- chainId: number;
649
- };
650
- headers: {
651
- authorization: string;
652
- };
653
- response: {
654
- 200: string;
643
+ engine: {
644
+ "": {
645
+ post: {
646
+ body: unknown;
647
+ params: {};
648
+ query: {
649
+ chainId: number;
650
+ };
651
+ headers: {
652
+ authorization: string;
653
+ };
654
+ response: {
655
+ 200: string;
656
+ };
655
657
  };
656
658
  };
657
659
  };
@@ -645,18 +645,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
645
645
  };
646
646
  } & {
647
647
  "campaigns-to-process": {
648
- index: {
649
- post: {
650
- body: unknown;
651
- params: {};
652
- query: {
653
- chainId: number;
654
- };
655
- headers: {
656
- authorization: string;
657
- };
658
- response: {
659
- 200: string;
648
+ engine: {
649
+ "": {
650
+ post: {
651
+ body: unknown;
652
+ params: {};
653
+ query: {
654
+ chainId: number;
655
+ };
656
+ headers: {
657
+ authorization: string;
658
+ };
659
+ response: {
660
+ 200: string;
661
+ };
660
662
  };
661
663
  };
662
664
  };
@@ -663,18 +663,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
663
663
  };
664
664
  } & {
665
665
  "campaigns-to-process": {
666
- index: {
667
- post: {
668
- body: unknown;
669
- params: {};
670
- query: {
671
- chainId: number;
672
- };
673
- headers: {
674
- authorization: string;
675
- };
676
- response: {
677
- 200: string;
666
+ engine: {
667
+ "": {
668
+ post: {
669
+ body: unknown;
670
+ params: {};
671
+ query: {
672
+ chainId: number;
673
+ };
674
+ headers: {
675
+ authorization: string;
676
+ };
677
+ response: {
678
+ 200: string;
679
+ };
678
680
  };
679
681
  };
680
682
  };
@@ -664,18 +664,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
664
664
  };
665
665
  } & {
666
666
  "campaigns-to-process": {
667
- index: {
668
- post: {
669
- body: unknown;
670
- params: {};
671
- query: {
672
- chainId: number;
673
- };
674
- headers: {
675
- authorization: string;
676
- };
677
- response: {
678
- 200: string;
667
+ engine: {
668
+ "": {
669
+ post: {
670
+ body: unknown;
671
+ params: {};
672
+ query: {
673
+ chainId: number;
674
+ };
675
+ headers: {
676
+ authorization: string;
677
+ };
678
+ response: {
679
+ 200: string;
680
+ };
679
681
  };
680
682
  };
681
683
  };
@@ -646,18 +646,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
646
646
  };
647
647
  } & {
648
648
  "campaigns-to-process": {
649
- index: {
650
- post: {
651
- body: unknown;
652
- params: {};
653
- query: {
654
- chainId: number;
655
- };
656
- headers: {
657
- authorization: string;
658
- };
659
- response: {
660
- 200: string;
649
+ engine: {
650
+ "": {
651
+ post: {
652
+ body: unknown;
653
+ params: {};
654
+ query: {
655
+ chainId: number;
656
+ };
657
+ headers: {
658
+ authorization: string;
659
+ };
660
+ response: {
661
+ 200: string;
662
+ };
661
663
  };
662
664
  };
663
665
  };
@@ -647,18 +647,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
647
647
  };
648
648
  } & {
649
649
  "campaigns-to-process": {
650
- index: {
651
- post: {
652
- body: unknown;
653
- params: {};
654
- query: {
655
- chainId: number;
656
- };
657
- headers: {
658
- authorization: string;
659
- };
660
- response: {
661
- 200: string;
650
+ engine: {
651
+ "": {
652
+ post: {
653
+ body: unknown;
654
+ params: {};
655
+ query: {
656
+ chainId: number;
657
+ };
658
+ headers: {
659
+ authorization: string;
660
+ };
661
+ response: {
662
+ 200: string;
663
+ };
662
664
  };
663
665
  };
664
666
  };
@@ -649,18 +649,20 @@ declare const _default: (app: App) => import("elysia").default<"", false, {
649
649
  };
650
650
  } & {
651
651
  "campaigns-to-process": {
652
- index: {
653
- post: {
654
- body: unknown;
655
- params: {};
656
- query: {
657
- chainId: number;
658
- };
659
- headers: {
660
- authorization: string;
661
- };
662
- response: {
663
- 200: string;
652
+ engine: {
653
+ "": {
654
+ post: {
655
+ body: unknown;
656
+ params: {};
657
+ query: {
658
+ chainId: number;
659
+ };
660
+ headers: {
661
+ authorization: string;
662
+ };
663
+ response: {
664
+ 200: string;
665
+ };
664
666
  };
665
667
  };
666
668
  };