@merkl/api 0.20.4 → 0.20.6

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.
Files changed (35) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +0 -102
  2. package/dist/database/api/.generated/drizzle/schema.js +5 -11
  3. package/dist/database/api/.generated/drizzle/schema.ts +5 -11
  4. package/dist/database/api/.generated/edge.js +8 -15
  5. package/dist/database/api/.generated/index-browser.js +5 -12
  6. package/dist/database/api/.generated/index.d.ts +149 -464
  7. package/dist/database/api/.generated/index.js +8 -15
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +5 -11
  10. package/dist/database/api/.generated/wasm.js +5 -12
  11. package/dist/src/eden/index.d.ts +65 -90
  12. package/dist/src/index.d.ts +13 -18
  13. package/dist/src/jobs/update-dynamic-data.js +2 -0
  14. package/dist/src/modules/v4/apr/apr.model.d.ts +3 -3
  15. package/dist/src/modules/v4/apr/apr.model.js +1 -1
  16. package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -3
  17. package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +1 -3
  18. package/dist/src/modules/v4/computedValue/computedValue.repository.js +0 -2
  19. package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +1 -3
  20. package/dist/src/modules/v4/dynamicData/dynamicData.service.js +2 -5
  21. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +12 -15
  22. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +6 -6
  23. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +19 -36
  24. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +17 -26
  25. package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
  26. package/dist/src/modules/v4/reward/reward.model.d.ts +4 -4
  27. package/dist/src/modules/v4/reward/reward.model.js +1 -1
  28. package/dist/src/modules/v4/reward/reward.repository.d.ts +2 -4
  29. package/dist/src/modules/v4/reward/reward.service.d.ts +5 -10
  30. package/dist/src/modules/v4/reward/reward.service.js +1 -1
  31. package/dist/src/modules/v4/router.d.ts +13 -18
  32. package/dist/src/modules/v4/tvl/tvl.model.d.ts +3 -3
  33. package/dist/src/modules/v4/tvl/tvl.model.js +1 -1
  34. package/dist/tsconfig.package.tsbuildinfo +1 -1
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { type CreateCampaignModel, type GetCampaignQueryModel } from "@/modules/v4/campaign";
2
2
  import { Prisma, Status } from "@db/api";
3
3
  import { type ChainId, type MerklChainId } from "@sdk";
4
- import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, OpportunityResourceModel, OpportunityUnique, UpdateOpportunityModel } from "./opportunity.model";
4
+ import type { CreateOpportunityModel, GetOpportunitiesQueryModel, LightOpportunityFromDB, Opportunity, OpportunityResourceModel, OpportunityUnique, UpdateOpportunityModel } from "./opportunity.model";
5
5
  import { OpportunityRepository } from "./opportunity.repository";
6
6
  export declare abstract class OpportunityService {
7
7
  #private;
@@ -129,7 +129,7 @@ export declare abstract class OpportunityService {
129
129
  timestamp: string | bigint;
130
130
  cumulated: number;
131
131
  breakdowns: {
132
- id: number;
132
+ id: string;
133
133
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
134
134
  identifier: string;
135
135
  value: number;
@@ -140,7 +140,7 @@ export declare abstract class OpportunityService {
140
140
  total: number;
141
141
  timestamp: string | bigint;
142
142
  breakdowns: {
143
- id: number;
143
+ id: string;
144
144
  type: "TOKEN" | "PROTOCOL";
145
145
  identifier: string;
146
146
  value: number;
@@ -152,7 +152,7 @@ export declare abstract class OpportunityService {
152
152
  total: number;
153
153
  timestamp: string | bigint;
154
154
  breakdowns: {
155
- id: number;
155
+ id: string;
156
156
  token: {
157
157
  price?: number | null | undefined;
158
158
  symbol: string;
@@ -266,7 +266,7 @@ export declare abstract class OpportunityService {
266
266
  timestamp: string | bigint;
267
267
  cumulated: number;
268
268
  breakdowns: {
269
- id: number;
269
+ id: string;
270
270
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
271
271
  identifier: string;
272
272
  value: number;
@@ -277,7 +277,7 @@ export declare abstract class OpportunityService {
277
277
  total: number;
278
278
  timestamp: string | bigint;
279
279
  breakdowns: {
280
- id: number;
280
+ id: string;
281
281
  type: "TOKEN" | "PROTOCOL";
282
282
  identifier: string;
283
283
  value: number;
@@ -289,7 +289,7 @@ export declare abstract class OpportunityService {
289
289
  total: number;
290
290
  timestamp: string | bigint;
291
291
  breakdowns: {
292
- id: number;
292
+ id: string;
293
293
  token: {
294
294
  price?: number | null | undefined;
295
295
  symbol: string;
@@ -400,9 +400,8 @@ export declare abstract class OpportunityService {
400
400
  cumulated: number;
401
401
  timestamp: bigint;
402
402
  breakdowns: {
403
- id: number;
403
+ id: string;
404
404
  type: import("@db/api").$Enums.AprType;
405
- uuid: string;
406
405
  identifier: string;
407
406
  value: number;
408
407
  aprRecordId: string;
@@ -413,9 +412,8 @@ export declare abstract class OpportunityService {
413
412
  total: number;
414
413
  timestamp: bigint;
415
414
  breakdowns: {
416
- id: number;
415
+ id: string;
417
416
  type: import("@db/api").$Enums.TvlType;
418
- uuid: string;
419
417
  identifier: string;
420
418
  value: number;
421
419
  tvlRecordId: string;
@@ -426,8 +424,7 @@ export declare abstract class OpportunityService {
426
424
  total: number;
427
425
  timestamp: bigint;
428
426
  breakdowns: {
429
- id: number;
430
- uuid: string;
427
+ id: string;
431
428
  value: number;
432
429
  campaignId: string;
433
430
  dailyRewardsRecordId: string;
@@ -573,9 +570,8 @@ export declare abstract class OpportunityService {
573
570
  cumulated: number;
574
571
  timestamp: bigint;
575
572
  breakdowns: {
576
- id: number;
573
+ id: string;
577
574
  type: import("@db/api").$Enums.AprType;
578
- uuid: string;
579
575
  identifier: string;
580
576
  value: number;
581
577
  aprRecordId: string;
@@ -586,9 +582,8 @@ export declare abstract class OpportunityService {
586
582
  total: number;
587
583
  timestamp: bigint;
588
584
  breakdowns: {
589
- id: number;
585
+ id: string;
590
586
  type: import("@db/api").$Enums.TvlType;
591
- uuid: string;
592
587
  identifier: string;
593
588
  value: number;
594
589
  tvlRecordId: string;
@@ -599,8 +594,7 @@ export declare abstract class OpportunityService {
599
594
  total: number;
600
595
  timestamp: bigint;
601
596
  breakdowns: {
602
- id: number;
603
- uuid: string;
597
+ id: string;
604
598
  value: number;
605
599
  campaignId: string;
606
600
  dailyRewardsRecordId: string;
@@ -742,9 +736,8 @@ export declare abstract class OpportunityService {
742
736
  cumulated: number;
743
737
  timestamp: bigint;
744
738
  breakdowns: {
745
- id: number;
739
+ id: string;
746
740
  type: import("@db/api").$Enums.AprType;
747
- uuid: string;
748
741
  identifier: string;
749
742
  value: number;
750
743
  aprRecordId: string;
@@ -755,9 +748,8 @@ export declare abstract class OpportunityService {
755
748
  total: number;
756
749
  timestamp: bigint;
757
750
  breakdowns: {
758
- id: number;
751
+ id: string;
759
752
  type: import("@db/api").$Enums.TvlType;
760
- uuid: string;
761
753
  identifier: string;
762
754
  value: number;
763
755
  tvlRecordId: string;
@@ -768,8 +760,7 @@ export declare abstract class OpportunityService {
768
760
  total: number;
769
761
  timestamp: bigint;
770
762
  breakdowns: {
771
- id: number;
772
- uuid: string;
763
+ id: string;
773
764
  value: number;
774
765
  campaignId: string;
775
766
  dailyRewardsRecordId: string;
@@ -954,7 +945,7 @@ export declare abstract class OpportunityService {
954
945
  static aggregateMax(query: GetOpportunitiesQueryModel, field: keyof Prisma.OpportunityMaxAggregateInputType): Promise<{
955
946
  max: string;
956
947
  }>;
957
- static update(id: string, data: UpdateOpportunityModel): Promise<{
948
+ static update(id: string, data: Partial<Opportunity["raw"]>): Promise<{
958
949
  id: string;
959
950
  name: string;
960
951
  type: string;
@@ -206,7 +206,7 @@ export class OpportunityService {
206
206
  };
207
207
  const formated = {
208
208
  ...OpportunityService.formatResponseBase(opp),
209
- apr: opp.status === "LIVE" ? opp.apr : 0,
209
+ apr: opp.apr,
210
210
  aprRecord,
211
211
  tvlRecord: TvlRecords?.map(({ id, total, timestamp, TvlBreakdown: breakdowns }) => ({
212
212
  id,
@@ -17,7 +17,7 @@ export type Reward = Resource<"Reward", "rewardTokenId" | "id", {
17
17
  * @description Describes one reward amount for one token and campaign
18
18
  * @see {@link Resource}
19
19
  */
20
- export type RewardBreakdown = Resource<"RewardBreakdown", "id" | "rewardId" | "protocolId" | "uuid">;
20
+ export type RewardBreakdown = Resource<"RewardBreakdown", "id" | "rewardId" | "protocolId">;
21
21
  /**
22
22
  * Daily Rewards
23
23
  * @description Describes rewards breakdown from the opportunity view
@@ -31,12 +31,12 @@ export type DailyRewardsRecord = Resource<"DailyRewardsRecord", "opportunityId"
31
31
  * @description Describes one rewards value of a campaign
32
32
  * @see {@link Resource}
33
33
  */
34
- export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "dailyRewardsRecordId" | "uuid", {
34
+ export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "dailyRewardsRecordId", {
35
35
  token: Token["model"];
36
36
  amount: bigint;
37
37
  }>;
38
38
  export declare const DailyRewardsBreakdownRecordResourceDto: import("@sinclair/typebox").TObject<{
39
- id: import("@sinclair/typebox").TNumber;
39
+ id: import("@sinclair/typebox").TString;
40
40
  campaignId: import("@sinclair/typebox").TString;
41
41
  value: import("@sinclair/typebox").TNumber;
42
42
  dailyRewardsRecordId: import("@sinclair/typebox").TString;
@@ -59,7 +59,7 @@ export declare const DailyRewardsRecordResourceDto: import("@sinclair/typebox").
59
59
  total: import("@sinclair/typebox").TNumber;
60
60
  timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
61
61
  breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
62
- id: import("@sinclair/typebox").TNumber;
62
+ id: import("@sinclair/typebox").TString;
63
63
  campaignId: import("@sinclair/typebox").TString;
64
64
  value: import("@sinclair/typebox").TNumber;
65
65
  dailyRewardsRecordId: import("@sinclair/typebox").TString;
@@ -2,7 +2,7 @@ import { t } from "elysia";
2
2
  import { TokenResourceDto } from "../token/token.model";
3
3
  // ─── DTOs ────────────────────────────────────────────────────────────────────
4
4
  export const DailyRewardsBreakdownRecordResourceDto = t.Object({
5
- id: t.Number(),
5
+ id: t.String(),
6
6
  campaignId: t.String(),
7
7
  value: t.Number(),
8
8
  dailyRewardsRecordId: t.String(),
@@ -78,9 +78,8 @@ export declare abstract class RewardRepository {
78
78
  };
79
79
  } & {
80
80
  pending: string;
81
- id: number;
81
+ id: string;
82
82
  reason: string;
83
- uuid: string;
84
83
  campaignId: string;
85
84
  amount: string;
86
85
  claimed: string;
@@ -104,9 +103,8 @@ export declare abstract class RewardRepository {
104
103
  };
105
104
  } & {
106
105
  pending: string;
107
- id: number;
106
+ id: string;
108
107
  reason: string;
109
- uuid: string;
110
108
  campaignId: string;
111
109
  amount: string;
112
110
  claimed: string;
@@ -15,9 +15,8 @@ export declare abstract class RewardService {
15
15
  cumulated: number;
16
16
  timestamp: bigint;
17
17
  breakdowns: {
18
- id: number;
18
+ id: string;
19
19
  type: import("@db/api").$Enums.AprType;
20
- uuid: string;
21
20
  identifier: string;
22
21
  value: number;
23
22
  aprRecordId: string;
@@ -28,9 +27,8 @@ export declare abstract class RewardService {
28
27
  total: number;
29
28
  timestamp: bigint;
30
29
  breakdowns: {
31
- id: number;
30
+ id: string;
32
31
  type: import("@db/api").$Enums.TvlType;
33
- uuid: string;
34
32
  identifier: string;
35
33
  value: number;
36
34
  tvlRecordId: string;
@@ -41,8 +39,7 @@ export declare abstract class RewardService {
41
39
  total: number;
42
40
  timestamp: bigint;
43
41
  breakdowns: {
44
- id: number;
45
- uuid: string;
42
+ id: string;
46
43
  value: number;
47
44
  campaignId: string;
48
45
  dailyRewardsRecordId: string;
@@ -408,9 +405,8 @@ export declare abstract class RewardService {
408
405
  };
409
406
  } & {
410
407
  pending: string;
411
- id: number;
408
+ id: string;
412
409
  reason: string;
413
- uuid: string;
414
410
  campaignId: string;
415
411
  amount: string;
416
412
  claimed: string;
@@ -713,9 +709,8 @@ export declare abstract class RewardService {
713
709
  };
714
710
  } & {
715
711
  pending: string;
716
- id: number;
712
+ id: string;
717
713
  reason: string;
718
- uuid: string;
719
714
  campaignId: string;
720
715
  amount: string;
721
716
  claimed: string;
@@ -79,7 +79,7 @@ export class RewardService {
79
79
  * @returns a RewardBreakdown model
80
80
  */
81
81
  static formatBreakdown(breakdown) {
82
- const { Campaign, id, uuid, rewardId, protocolId, ...rest } = breakdown;
82
+ const { Campaign, id, rewardId, protocolId, ...rest } = breakdown;
83
83
  return {
84
84
  ...rest,
85
85
  campaignId: Campaign.campaignId,
@@ -155,9 +155,8 @@ export declare const v4: Elysia<"/v4", false, {
155
155
  cumulated: number;
156
156
  timestamp: bigint;
157
157
  breakdowns: {
158
- id: number;
158
+ id: string;
159
159
  type: import("@db/api").$Enums.AprType;
160
- uuid: string;
161
160
  identifier: string;
162
161
  value: number;
163
162
  aprRecordId: string;
@@ -168,9 +167,8 @@ export declare const v4: Elysia<"/v4", false, {
168
167
  total: number;
169
168
  timestamp: bigint;
170
169
  breakdowns: {
171
- id: number;
170
+ id: string;
172
171
  type: import("@db/api").$Enums.TvlType;
173
- uuid: string;
174
172
  identifier: string;
175
173
  value: number;
176
174
  tvlRecordId: string;
@@ -181,8 +179,7 @@ export declare const v4: Elysia<"/v4", false, {
181
179
  total: number;
182
180
  timestamp: bigint;
183
181
  breakdowns: {
184
- id: number;
185
- uuid: string;
182
+ id: string;
186
183
  value: number;
187
184
  campaignId: string;
188
185
  dailyRewardsRecordId: string;
@@ -383,7 +380,7 @@ export declare const v4: Elysia<"/v4", false, {
383
380
  timestamp: string | bigint;
384
381
  cumulated: number;
385
382
  breakdowns: {
386
- id: number;
383
+ id: string;
387
384
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
388
385
  identifier: string;
389
386
  value: number;
@@ -394,7 +391,7 @@ export declare const v4: Elysia<"/v4", false, {
394
391
  total: number;
395
392
  timestamp: string | bigint;
396
393
  breakdowns: {
397
- id: number;
394
+ id: string;
398
395
  type: "TOKEN" | "PROTOCOL";
399
396
  identifier: string;
400
397
  value: number;
@@ -406,7 +403,7 @@ export declare const v4: Elysia<"/v4", false, {
406
403
  total: number;
407
404
  timestamp: string | bigint;
408
405
  breakdowns: {
409
- id: number;
406
+ id: string;
410
407
  token: {
411
408
  price?: number | null | undefined;
412
409
  symbol: string;
@@ -514,7 +511,7 @@ export declare const v4: Elysia<"/v4", false, {
514
511
  timestamp: string | bigint;
515
512
  cumulated: number;
516
513
  breakdowns: {
517
- id: number;
514
+ id: string;
518
515
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
519
516
  identifier: string;
520
517
  value: number;
@@ -525,7 +522,7 @@ export declare const v4: Elysia<"/v4", false, {
525
522
  total: number;
526
523
  timestamp: string | bigint;
527
524
  breakdowns: {
528
- id: number;
525
+ id: string;
529
526
  type: "TOKEN" | "PROTOCOL";
530
527
  identifier: string;
531
528
  value: number;
@@ -537,7 +534,7 @@ export declare const v4: Elysia<"/v4", false, {
537
534
  total: number;
538
535
  timestamp: string | bigint;
539
536
  breakdowns: {
540
- id: number;
537
+ id: string;
541
538
  token: {
542
539
  price?: number | null | undefined;
543
540
  symbol: string;
@@ -679,7 +676,7 @@ export declare const v4: Elysia<"/v4", false, {
679
676
  timestamp: string | bigint;
680
677
  cumulated: number;
681
678
  breakdowns: {
682
- id: number;
679
+ id: string;
683
680
  type: "CAMPAIGN" | "TOKEN" | "PROTOCOL";
684
681
  identifier: string;
685
682
  value: number;
@@ -690,7 +687,7 @@ export declare const v4: Elysia<"/v4", false, {
690
687
  total: number;
691
688
  timestamp: string | bigint;
692
689
  breakdowns: {
693
- id: number;
690
+ id: string;
694
691
  type: "TOKEN" | "PROTOCOL";
695
692
  identifier: string;
696
693
  value: number;
@@ -702,7 +699,7 @@ export declare const v4: Elysia<"/v4", false, {
702
699
  total: number;
703
700
  timestamp: string | bigint;
704
701
  breakdowns: {
705
- id: number;
702
+ id: string;
706
703
  token: {
707
704
  price?: number | null | undefined;
708
705
  symbol: string;
@@ -4458,11 +4455,9 @@ export declare const v4: Elysia<"/v4", false, {
4458
4455
  headers: unknown;
4459
4456
  response: {
4460
4457
  200: {
4461
- id: number;
4458
+ id: string;
4462
4459
  reason: string;
4463
- uuid: string;
4464
4460
  campaignId: string;
4465
- stringId: string;
4466
4461
  boost: number | null;
4467
4462
  }[];
4468
4463
  };
@@ -12,9 +12,9 @@ export type TvlRecord = Resource<"TVLRecord", "id" | "opportunityId", {
12
12
  * @description Describes one tvl fraction of record
13
13
  * @see {@link Resource}
14
14
  */
15
- export type TvlBreakdown = Resource<"TVLBreakdown", "id" | "tvlRecordId" | "uuid">;
15
+ export type TvlBreakdown = Resource<"TVLBreakdown", "id" | "tvlRecordId">;
16
16
  export declare const TvlBreakdownResourceDto: import("@sinclair/typebox").TObject<{
17
- id: import("@sinclair/typebox").TNumber;
17
+ id: import("@sinclair/typebox").TString;
18
18
  type: import("@sinclair/typebox").TEnum<{
19
19
  TOKEN: "TOKEN";
20
20
  PROTOCOL: "PROTOCOL";
@@ -27,7 +27,7 @@ export declare const TvlRecordResourceDto: import("@sinclair/typebox").TObject<{
27
27
  total: import("@sinclair/typebox").TNumber;
28
28
  timestamp: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TBigInt, import("@sinclair/typebox").TString]>;
29
29
  breakdowns: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
30
- id: import("@sinclair/typebox").TNumber;
30
+ id: import("@sinclair/typebox").TString;
31
31
  type: import("@sinclair/typebox").TEnum<{
32
32
  TOKEN: "TOKEN";
33
33
  PROTOCOL: "PROTOCOL";
@@ -2,7 +2,7 @@ import { TvlType } from "@db/api";
2
2
  import { t } from "elysia";
3
3
  // ─── Dtos ────────────────────────────────────────────────────────────────────
4
4
  export const TvlBreakdownResourceDto = t.Object({
5
- id: t.Number(),
5
+ id: t.String(),
6
6
  type: t.Enum(TvlType),
7
7
  identifier: t.String(),
8
8
  value: t.Number(),