@merkl/api 0.19.37 → 0.19.38

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 (37) hide show
  1. package/dist/database/api/.generated/drizzle/schema.d.ts +90 -5
  2. package/dist/database/api/.generated/drizzle/schema.js +7 -2
  3. package/dist/database/api/.generated/drizzle/schema.ts +7 -2
  4. package/dist/database/api/.generated/edge.js +13 -3
  5. package/dist/database/api/.generated/index-browser.js +10 -0
  6. package/dist/database/api/.generated/index.d.ts +296 -40
  7. package/dist/database/api/.generated/index.js +13 -3
  8. package/dist/database/api/.generated/package.json +1 -1
  9. package/dist/database/api/.generated/schema.prisma +6 -1
  10. package/dist/database/api/.generated/wasm.js +10 -0
  11. package/dist/src/eden/index.d.ts +20 -0
  12. package/dist/src/engine/opportunityMetadata/implementations/Compound.d.ts +1 -2
  13. package/dist/src/engine/opportunityMetadata/implementations/Compound.js +1 -4
  14. package/dist/src/engine/opportunityMetadata/implementations/Morpho.d.ts +7 -1
  15. package/dist/src/engine/opportunityMetadata/implementations/Morpho.js +5 -2
  16. package/dist/src/index.d.ts +4 -0
  17. package/dist/src/jobs/pendings.js +4 -1
  18. package/dist/src/jobs/reward-breakdowns.js +3 -0
  19. package/dist/src/modules/v4/apr/apr.model.d.ts +1 -1
  20. package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +1 -0
  21. package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +1 -0
  22. package/dist/src/modules/v4/computedValue/computedValue.repository.js +2 -0
  23. package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +2 -0
  24. package/dist/src/modules/v4/computedValue/computedValue.service.js +3 -0
  25. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +3 -0
  26. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +17 -0
  27. package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -0
  28. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +9 -0
  29. package/dist/src/modules/v4/reward/reward.model.d.ts +2 -2
  30. package/dist/src/modules/v4/reward/reward.repository.d.ts +4 -2
  31. package/dist/src/modules/v4/reward/reward.repository.js +1 -0
  32. package/dist/src/modules/v4/reward/reward.service.d.ts +8 -2
  33. package/dist/src/modules/v4/reward/reward.service.js +4 -1
  34. package/dist/src/modules/v4/router.d.ts +4 -0
  35. package/dist/src/modules/v4/tvl/tvl.model.d.ts +1 -1
  36. package/dist/tsconfig.package.tsbuildinfo +1 -1
  37. package/package.json +1 -1
@@ -396,6 +396,7 @@ export declare abstract class OpportunityService {
396
396
  breakdowns: {
397
397
  id: number;
398
398
  type: import("@db/api").$Enums.AprType;
399
+ uuid: string;
399
400
  identifier: string;
400
401
  value: number;
401
402
  aprRecordId: string;
@@ -408,6 +409,7 @@ export declare abstract class OpportunityService {
408
409
  breakdowns: {
409
410
  id: number;
410
411
  type: import("@db/api").$Enums.TvlType;
412
+ uuid: string;
411
413
  identifier: string;
412
414
  value: number;
413
415
  tvlRecordId: string;
@@ -419,6 +421,7 @@ export declare abstract class OpportunityService {
419
421
  timestamp: bigint;
420
422
  breakdowns: {
421
423
  id: number;
424
+ uuid: string;
422
425
  value: number;
423
426
  campaignId: string;
424
427
  dailyRewardsRecordId: string;
@@ -564,6 +567,7 @@ export declare abstract class OpportunityService {
564
567
  breakdowns: {
565
568
  id: number;
566
569
  type: import("@db/api").$Enums.AprType;
570
+ uuid: string;
567
571
  identifier: string;
568
572
  value: number;
569
573
  aprRecordId: string;
@@ -576,6 +580,7 @@ export declare abstract class OpportunityService {
576
580
  breakdowns: {
577
581
  id: number;
578
582
  type: import("@db/api").$Enums.TvlType;
583
+ uuid: string;
579
584
  identifier: string;
580
585
  value: number;
581
586
  tvlRecordId: string;
@@ -587,6 +592,7 @@ export declare abstract class OpportunityService {
587
592
  timestamp: bigint;
588
593
  breakdowns: {
589
594
  id: number;
595
+ uuid: string;
590
596
  value: number;
591
597
  campaignId: string;
592
598
  dailyRewardsRecordId: string;
@@ -728,6 +734,7 @@ export declare abstract class OpportunityService {
728
734
  breakdowns: {
729
735
  id: number;
730
736
  type: import("@db/api").$Enums.AprType;
737
+ uuid: string;
731
738
  identifier: string;
732
739
  value: number;
733
740
  aprRecordId: string;
@@ -740,6 +747,7 @@ export declare abstract class OpportunityService {
740
747
  breakdowns: {
741
748
  id: number;
742
749
  type: import("@db/api").$Enums.TvlType;
750
+ uuid: string;
743
751
  identifier: string;
744
752
  value: number;
745
753
  tvlRecordId: string;
@@ -751,6 +759,7 @@ export declare abstract class OpportunityService {
751
759
  timestamp: bigint;
752
760
  breakdowns: {
753
761
  id: number;
762
+ uuid: string;
754
763
  value: number;
755
764
  campaignId: string;
756
765
  dailyRewardsRecordId: string;
@@ -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">;
20
+ export type RewardBreakdown = Resource<"RewardBreakdown", "id" | "rewardId" | "protocolId" | "stringId">;
21
21
  /**
22
22
  * Daily Rewards
23
23
  * @description Describes rewards breakdown from the opportunity view
@@ -31,7 +31,7 @@ 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", {
34
+ export type DailyRewardsBreakdown = Resource<"DailyRewardsBreakdown", "id" | "dailyRewardsRecordId" | "uuid", {
35
35
  token: Token["model"];
36
36
  amount: bigint;
37
37
  }>;
@@ -77,10 +77,11 @@ export declare abstract class RewardRepository {
77
77
  };
78
78
  } & {
79
79
  pending: string;
80
- id: bigint;
80
+ id: number;
81
81
  reason: string;
82
82
  campaignId: string;
83
83
  amount: string;
84
+ stringId: string;
84
85
  claimed: string;
85
86
  protocolId: string | null;
86
87
  rewardId: string;
@@ -102,10 +103,11 @@ export declare abstract class RewardRepository {
102
103
  };
103
104
  } & {
104
105
  pending: string;
105
- id: bigint;
106
+ id: number;
106
107
  reason: string;
107
108
  campaignId: string;
108
109
  amount: string;
110
+ stringId: string;
109
111
  claimed: string;
110
112
  protocolId: string | null;
111
113
  rewardId: string;
@@ -42,6 +42,7 @@ export class RewardRepository {
42
42
  dataPerCampaign.breakdowns.map(breakdown => {
43
43
  const rewardId = RewardService.hashId(dataPerCampaign.root, breakdown.recipient, TokenService.hashId({ address: dataPerCampaign.rewardToken, chainId: dataPerCampaign.distributionChainId }));
44
44
  breakdownsToCreate.push({
45
+ stringId: RewardService.hashBreakdownId(rewardId, campaignId, breakdown.reason),
45
46
  rewardId,
46
47
  protocolId: breakdown.protocolId ? breakdown.protocolId : undefined,
47
48
  campaignId,
@@ -6,6 +6,7 @@ import type { CampaignIdModel, CampaignIdWithoutPageModel, CreateManyBreakdownMo
6
6
  import { RewardRepository } from "./reward.repository";
7
7
  export declare abstract class RewardService {
8
8
  static hashId(root: string, recipient: string, rewardTokenId: string): string;
9
+ static hashBreakdownId(rewardId: string, campaignId: string, reason: string): string;
9
10
  static hashDailyRewardsRecordId(opportunityId: string, timestamp: bigint): string;
10
11
  static createManyReward(rewards: CreateManyRewardModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
11
12
  static getTotalDistributedByOpportunities(since: number): Promise<Map<{
@@ -16,6 +17,7 @@ export declare abstract class RewardService {
16
17
  breakdowns: {
17
18
  id: number;
18
19
  type: import("@db/api").$Enums.AprType;
20
+ uuid: string;
19
21
  identifier: string;
20
22
  value: number;
21
23
  aprRecordId: string;
@@ -28,6 +30,7 @@ export declare abstract class RewardService {
28
30
  breakdowns: {
29
31
  id: number;
30
32
  type: import("@db/api").$Enums.TvlType;
33
+ uuid: string;
31
34
  identifier: string;
32
35
  value: number;
33
36
  tvlRecordId: string;
@@ -39,6 +42,7 @@ export declare abstract class RewardService {
39
42
  timestamp: bigint;
40
43
  breakdowns: {
41
44
  id: number;
45
+ uuid: string;
42
46
  value: number;
43
47
  campaignId: string;
44
48
  dailyRewardsRecordId: string;
@@ -399,10 +403,11 @@ export declare abstract class RewardService {
399
403
  };
400
404
  } & {
401
405
  pending: string;
402
- id: bigint;
406
+ id: number;
403
407
  reason: string;
404
408
  campaignId: string;
405
409
  amount: string;
410
+ stringId: string;
406
411
  claimed: string;
407
412
  protocolId: string | null;
408
413
  rewardId: string;
@@ -700,10 +705,11 @@ export declare abstract class RewardService {
700
705
  };
701
706
  } & {
702
707
  pending: string;
703
- id: bigint;
708
+ id: number;
704
709
  reason: string;
705
710
  campaignId: string;
706
711
  amount: string;
712
+ stringId: string;
707
713
  claimed: string;
708
714
  protocolId: string | null;
709
715
  rewardId: string;
@@ -14,6 +14,9 @@ export class RewardService {
14
14
  static hashId(root, recipient, rewardTokenId) {
15
15
  return Bun.hash(`${root}${recipient}${rewardTokenId}`).toString();
16
16
  }
17
+ static hashBreakdownId(rewardId, campaignId, reason) {
18
+ return Bun.hash(`${rewardId}${campaignId}${reason}`).toString();
19
+ }
17
20
  static hashDailyRewardsRecordId(opportunityId, timestamp) {
18
21
  return Bun.hash(`${opportunityId}${timestamp}`).toString();
19
22
  }
@@ -76,7 +79,7 @@ export class RewardService {
76
79
  * @returns a RewardBreakdown model
77
80
  */
78
81
  static formatBreakdown(breakdown) {
79
- const { Campaign, id, rewardId, protocolId, ...rest } = breakdown;
82
+ const { Campaign, id, stringId, rewardId, protocolId, ...rest } = breakdown;
80
83
  return {
81
84
  ...rest,
82
85
  campaignId: Campaign.campaignId,
@@ -154,6 +154,7 @@ export declare const v4: Elysia<"/v4", false, {
154
154
  breakdowns: {
155
155
  id: number;
156
156
  type: import("@db/api").$Enums.AprType;
157
+ uuid: string;
157
158
  identifier: string;
158
159
  value: number;
159
160
  aprRecordId: string;
@@ -166,6 +167,7 @@ export declare const v4: Elysia<"/v4", false, {
166
167
  breakdowns: {
167
168
  id: number;
168
169
  type: import("@db/api").$Enums.TvlType;
170
+ uuid: string;
169
171
  identifier: string;
170
172
  value: number;
171
173
  tvlRecordId: string;
@@ -177,6 +179,7 @@ export declare const v4: Elysia<"/v4", false, {
177
179
  timestamp: bigint;
178
180
  breakdowns: {
179
181
  id: number;
182
+ uuid: string;
180
183
  value: number;
181
184
  campaignId: string;
182
185
  dailyRewardsRecordId: string;
@@ -4439,6 +4442,7 @@ export declare const v4: Elysia<"/v4", false, {
4439
4442
  id: number;
4440
4443
  reason: string;
4441
4444
  campaignId: string;
4445
+ stringId: string;
4442
4446
  boost: number | null;
4443
4447
  }[];
4444
4448
  };
@@ -12,7 +12,7 @@ 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">;
15
+ export type TvlBreakdown = Resource<"TVLBreakdown", "id" | "tvlRecordId" | "uuid">;
16
16
  export declare const TvlBreakdownResourceDto: import("@sinclair/typebox").TObject<{
17
17
  id: import("@sinclair/typebox").TNumber;
18
18
  type: import("@sinclair/typebox").TEnum<{