@merkl/api 0.19.37 → 0.19.39
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 +124 -5
- package/dist/database/api/.generated/drizzle/schema.js +9 -2
- package/dist/database/api/.generated/drizzle/schema.ts +9 -2
- package/dist/database/api/.generated/edge.js +17 -3
- package/dist/database/api/.generated/index-browser.js +14 -0
- package/dist/database/api/.generated/index.d.ts +388 -40
- package/dist/database/api/.generated/index.js +17 -3
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +8 -1
- package/dist/database/api/.generated/wasm.js +14 -0
- package/dist/src/eden/index.d.ts +25 -0
- package/dist/src/engine/opportunityMetadata/implementations/Compound.d.ts +1 -2
- package/dist/src/engine/opportunityMetadata/implementations/Compound.js +1 -4
- package/dist/src/engine/opportunityMetadata/implementations/Morpho.d.ts +7 -1
- package/dist/src/engine/opportunityMetadata/implementations/Morpho.js +5 -2
- package/dist/src/index.d.ts +5 -0
- package/dist/src/jobs/pendings.js +4 -1
- package/dist/src/jobs/reward-breakdowns.js +3 -0
- package/dist/src/modules/v4/apr/apr.model.d.ts +1 -1
- package/dist/src/modules/v4/computedValue/computedValue.controller.d.ts +2 -0
- package/dist/src/modules/v4/computedValue/computedValue.repository.d.ts +2 -0
- package/dist/src/modules/v4/computedValue/computedValue.repository.js +2 -0
- package/dist/src/modules/v4/computedValue/computedValue.service.d.ts +3 -0
- package/dist/src/modules/v4/computedValue/computedValue.service.js +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +3 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +17 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -0
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +9 -0
- package/dist/src/modules/v4/reward/reward.model.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +6 -2
- package/dist/src/modules/v4/reward/reward.repository.js +1 -0
- package/dist/src/modules/v4/reward/reward.service.d.ts +10 -2
- package/dist/src/modules/v4/reward/reward.service.js +4 -1
- package/dist/src/modules/v4/router.d.ts +5 -0
- package/dist/src/modules/v4/tvl/tvl.model.d.ts +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -181,6 +181,7 @@ export class OpportunityRepository {
|
|
181
181
|
name: newOpp.name,
|
182
182
|
status: newOpp.status,
|
183
183
|
type: newOpp.type,
|
184
|
+
depositUrl: newOpp.depositUrl,
|
184
185
|
Chain: { connect: { id: newOpp.chainId } },
|
185
186
|
MainProtocol: !!newOpp.mainProtocol ? { connect: { id: newOpp.mainProtocol } } : undefined,
|
186
187
|
Protocols: {
|
@@ -206,6 +207,7 @@ export class OpportunityRepository {
|
|
206
207
|
name: newOpp.name,
|
207
208
|
status: newOpp.status,
|
208
209
|
type: newOpp.type,
|
210
|
+
depositUrl: newOpp.depositUrl,
|
209
211
|
Chain: { connect: { id: newOpp.chainId } },
|
210
212
|
MainProtocol: !!newOpp.mainProtocol
|
211
213
|
? { connect: { id: newOpp.mainProtocol } }
|
@@ -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" | "uuid">;
|
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,12 @@ export declare abstract class RewardRepository {
|
|
77
77
|
};
|
78
78
|
} & {
|
79
79
|
pending: string;
|
80
|
-
id:
|
80
|
+
id: number;
|
81
81
|
reason: string;
|
82
|
+
uuid: string;
|
82
83
|
campaignId: string;
|
83
84
|
amount: string;
|
85
|
+
stringId: string;
|
84
86
|
claimed: string;
|
85
87
|
protocolId: string | null;
|
86
88
|
rewardId: string;
|
@@ -102,10 +104,12 @@ export declare abstract class RewardRepository {
|
|
102
104
|
};
|
103
105
|
} & {
|
104
106
|
pending: string;
|
105
|
-
id:
|
107
|
+
id: number;
|
106
108
|
reason: string;
|
109
|
+
uuid: string;
|
107
110
|
campaignId: string;
|
108
111
|
amount: string;
|
112
|
+
stringId: string;
|
109
113
|
claimed: string;
|
110
114
|
protocolId: string | null;
|
111
115
|
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,12 @@ export declare abstract class RewardService {
|
|
399
403
|
};
|
400
404
|
} & {
|
401
405
|
pending: string;
|
402
|
-
id:
|
406
|
+
id: number;
|
403
407
|
reason: string;
|
408
|
+
uuid: string;
|
404
409
|
campaignId: string;
|
405
410
|
amount: string;
|
411
|
+
stringId: string;
|
406
412
|
claimed: string;
|
407
413
|
protocolId: string | null;
|
408
414
|
rewardId: string;
|
@@ -700,10 +706,12 @@ export declare abstract class RewardService {
|
|
700
706
|
};
|
701
707
|
} & {
|
702
708
|
pending: string;
|
703
|
-
id:
|
709
|
+
id: number;
|
704
710
|
reason: string;
|
711
|
+
uuid: string;
|
705
712
|
campaignId: string;
|
706
713
|
amount: string;
|
714
|
+
stringId: string;
|
707
715
|
claimed: string;
|
708
716
|
protocolId: string | null;
|
709
717
|
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, uuid, 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;
|
@@ -4438,7 +4441,9 @@ export declare const v4: Elysia<"/v4", false, {
|
|
4438
4441
|
200: {
|
4439
4442
|
id: number;
|
4440
4443
|
reason: string;
|
4444
|
+
uuid: string;
|
4441
4445
|
campaignId: string;
|
4446
|
+
stringId: string;
|
4442
4447
|
boost: number | null;
|
4443
4448
|
}[];
|
4444
4449
|
};
|
@@ -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<{
|