@merkl/api 0.12.3 → 0.12.5

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/src/backgroundJobs/index.js +9 -0
  2. package/dist/src/cache/declaration.d.ts +1 -1
  3. package/dist/src/cache/declaration.js +1 -1
  4. package/dist/src/eden/index.d.ts +115 -75
  5. package/dist/src/index.d.ts +23 -15
  6. package/dist/src/libs/campaigns/utils/getEulerV2Vaults.d.ts +1 -0
  7. package/dist/src/libs/campaigns/utils/getEulerV2Vaults.js +1 -1
  8. package/dist/src/libs/campaigns/utils/getUniswapV4Pools.d.ts +1 -0
  9. package/dist/src/libs/campaigns/utils/getUniswapV4Pools.js +4 -4
  10. package/dist/src/libs/positions/EigenLayer/index.js +3 -3
  11. package/dist/src/libs/positions/types.d.ts +1 -1
  12. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +1 -1
  13. package/dist/src/modules/v4/campaign/campaign.repository.d.ts +9 -9
  14. package/dist/src/modules/v4/campaign/campaign.service.d.ts +1 -1
  15. package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +1 -1
  16. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +3 -3
  17. package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +5 -5
  18. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +72 -72
  19. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +1 -1
  20. package/dist/src/modules/v4/reward/reward.controller.d.ts +12 -4
  21. package/dist/src/modules/v4/reward/reward.repository.d.ts +11 -7
  22. package/dist/src/modules/v4/reward/reward.service.d.ts +10 -5
  23. package/dist/src/modules/v4/router.d.ts +23 -15
  24. package/dist/src/modules/v4/status/status.controller.d.ts +6 -6
  25. package/dist/src/modules/v4/status/status.repository.d.ts +6 -6
  26. package/dist/src/modules/v4/status/status.service.d.ts +6 -6
  27. package/dist/src/modules/v4/token/token.repository.d.ts +2 -2
  28. package/dist/src/modules/v4/token/token.service.d.ts +2 -3
  29. package/dist/src/modules/v4/user/user.repository.d.ts +1 -1
  30. package/dist/src/modules/v4/user/user.service.d.ts +1 -1
  31. package/dist/src/routes/v3/euler.js +1 -1
  32. package/dist/src/utils/prisma.d.ts +16 -3
  33. package/dist/src/utils/prisma.js +2 -1
  34. package/dist/tsconfig.package.tsbuildinfo +1 -1
  35. package/package.json +1 -1
@@ -81,8 +81,12 @@ export declare const RewardController: Elysia<"/rewards", false, {
81
81
  };
82
82
  headers: unknown;
83
83
  response: {
84
- [x: string]: any;
85
- 200: any;
84
+ 200: {
85
+ amount: string;
86
+ claimed: string;
87
+ pending: string;
88
+ recipient: string;
89
+ }[];
86
90
  };
87
91
  };
88
92
  };
@@ -146,8 +150,12 @@ export declare const RewardController: Elysia<"/rewards", false, {
146
150
  };
147
151
  headers: unknown;
148
152
  response: {
149
- [x: string]: any;
150
- 200: any;
153
+ 200: {
154
+ amount: string;
155
+ claimed: string;
156
+ pending: string;
157
+ recipient: string;
158
+ }[];
151
159
  };
152
160
  };
153
161
  };
@@ -1,9 +1,8 @@
1
- import type { Prisma } from "../../../../database/api/.generated";
2
1
  import type { ChainId } from "@sdk";
3
2
  import type { BreakdownForCampaignsRaw, CampaignIdModel, CampaignIdWithoutPageModel, CreateManyBreakdownModel, CreateManyRewardModel, TokenIdModel } from "./reward.model";
4
3
  export declare abstract class RewardRepository {
5
- static createManyReward(rewards: CreateManyRewardModel): Promise<Prisma.BatchPayload>;
6
- static createManyBreakdown(data: CreateManyBreakdownModel): Promise<Prisma.BatchPayload>;
4
+ static createManyReward(rewards: CreateManyRewardModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
5
+ static createManyBreakdown(data: CreateManyBreakdownModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
7
6
  static getByRecipient(recipient: string, roots: string[], withToken: boolean, withTestTokens: boolean, chainFilter?: ChainId[]): Promise<({
8
7
  RewardToken: {
9
8
  symbol: string;
@@ -20,7 +19,6 @@ export declare abstract class RewardRepository {
20
19
  };
21
20
  Breakdown: ({
22
21
  Campaign: {
23
- campaignId: string;
24
22
  Opportunity: {
25
23
  Chain: {
26
24
  name: string;
@@ -71,6 +69,7 @@ export declare abstract class RewardRepository {
71
69
  apr: number;
72
70
  dailyRewards: number;
73
71
  };
72
+ campaignId: string;
74
73
  };
75
74
  } & {
76
75
  reason: string;
@@ -121,8 +120,8 @@ export declare abstract class RewardRepository {
121
120
  rewardCount: number;
122
121
  breakdownCount: number;
123
122
  }>;
124
- static updateRewardClaimed(recipient: string, rewardTokenId: string, amount: string): Promise<Prisma.BatchPayload>;
125
- static updateBreakdownClaimed(recipient: string, rewardTokenId: string, campaignId: string, reason: string, amount: string): Promise<Prisma.BatchPayload>;
123
+ static updateRewardClaimed(recipient: string, rewardTokenId: string, amount: string): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
124
+ static updateBreakdownClaimed(recipient: string, rewardTokenId: string, campaignId: string, reason: string, amount: string): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
126
125
  static findManyRootsWithRewardOnChain(chainId: number): Promise<string[]>;
127
126
  static breakdownForCampaign(root: string, id: string, query: CampaignIdModel): Promise<BreakdownForCampaignsRaw[]>;
128
127
  static totalForCampaign(campaignId: string, root: string): Promise<{
@@ -132,7 +131,12 @@ export declare abstract class RewardRepository {
132
131
  static countForCampaign(campaignId: string, root: string): Promise<{
133
132
  count: number;
134
133
  }>;
135
- static breakdownForToken(root: string, id: string, query: TokenIdModel): Promise<any>;
134
+ static breakdownForToken(root: string, id: string, query: TokenIdModel): Promise<{
135
+ amount: string;
136
+ claimed: string;
137
+ pending: string;
138
+ recipient: string;
139
+ }[]>;
136
140
  static totalForToken(tokenId: string, root: string): Promise<{
137
141
  tokenId: string;
138
142
  amount: bigint;
@@ -7,7 +7,7 @@ import { RewardRepository } from "./reward.repository";
7
7
  export declare abstract class RewardService {
8
8
  static hashId(root: string, recipient: string, rewardTokenId: string): string;
9
9
  static hashDailyRewardsRecordId(opportunityId: string, timestamp: bigint): string;
10
- static createManyReward(rewards: CreateManyRewardModel): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload>;
10
+ static createManyReward(rewards: CreateManyRewardModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
11
11
  /**
12
12
  * Format the reward breakdown to conform to its resource model declaration
13
13
  * @param breakdown straight from db
@@ -153,7 +153,7 @@ export declare abstract class RewardService {
153
153
  root: string;
154
154
  proofs: string[];
155
155
  }[];
156
- static createManyBreakdown(data: CreateManyBreakdownModel): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload | undefined>;
156
+ static createManyBreakdown(data: CreateManyBreakdownModel): Promise<import("database/api/.generated/runtime/library").GetBatchResult | undefined>;
157
157
  static getByRecipient(recipient: string, roots: string[], withToken?: boolean, withTestTokens?: boolean, chainFilter?: ChainId[]): Promise<({
158
158
  RewardToken: {
159
159
  symbol: string;
@@ -170,7 +170,6 @@ export declare abstract class RewardService {
170
170
  };
171
171
  Breakdown: ({
172
172
  Campaign: {
173
- campaignId: string;
174
173
  Opportunity: {
175
174
  Chain: {
176
175
  name: string;
@@ -221,6 +220,7 @@ export declare abstract class RewardService {
221
220
  apr: number;
222
221
  dailyRewards: number;
223
222
  };
223
+ campaignId: string;
224
224
  };
225
225
  } & {
226
226
  reason: string;
@@ -459,7 +459,6 @@ export declare abstract class RewardService {
459
459
  };
460
460
  Breakdown: ({
461
461
  Campaign: {
462
- campaignId: string;
463
462
  Opportunity: {
464
463
  Chain: {
465
464
  name: string;
@@ -510,6 +509,7 @@ export declare abstract class RewardService {
510
509
  apr: number;
511
510
  dailyRewards: number;
512
511
  };
512
+ campaignId: string;
513
513
  };
514
514
  } & {
515
515
  reason: string;
@@ -550,7 +550,12 @@ export declare abstract class RewardService {
550
550
  campaignId: string;
551
551
  amount: bigint;
552
552
  }>;
553
- static breakdownForToken(query: TokenIdModel): Promise<any>;
553
+ static breakdownForToken(query: TokenIdModel): Promise<{
554
+ amount: string;
555
+ claimed: string;
556
+ pending: string;
557
+ recipient: string;
558
+ }[]>;
554
559
  static countForToken(query: TokenIdModel): Promise<{
555
560
  count: number;
556
561
  }>;
@@ -281,7 +281,6 @@ export declare const v4: Elysia<"/v4", false, {
281
281
  tags: string[];
282
282
  icon: string;
283
283
  } | null | undefined;
284
- depositUrl?: string | undefined;
285
284
  aprRecord?: {
286
285
  timestamp: string | bigint;
287
286
  cumulated: number;
@@ -293,6 +292,7 @@ export declare const v4: Elysia<"/v4", false, {
293
292
  aprRecordId: string;
294
293
  }[];
295
294
  } | undefined;
295
+ depositUrl?: string | undefined;
296
296
  tvlRecord?: {
297
297
  total: number;
298
298
  timestamp: string | bigint;
@@ -405,7 +405,6 @@ export declare const v4: Elysia<"/v4", false, {
405
405
  tags: string[];
406
406
  icon: string;
407
407
  } | null | undefined;
408
- depositUrl?: string | undefined;
409
408
  aprRecord?: {
410
409
  timestamp: string | bigint;
411
410
  cumulated: number;
@@ -417,6 +416,7 @@ export declare const v4: Elysia<"/v4", false, {
417
416
  aprRecordId: string;
418
417
  }[];
419
418
  } | undefined;
419
+ depositUrl?: string | undefined;
420
420
  tvlRecord?: {
421
421
  total: number;
422
422
  timestamp: string | bigint;
@@ -564,7 +564,6 @@ export declare const v4: Elysia<"/v4", false, {
564
564
  tags: string[];
565
565
  icon: string;
566
566
  } | null | undefined;
567
- depositUrl?: string | undefined;
568
567
  aprRecord?: {
569
568
  timestamp: string | bigint;
570
569
  cumulated: number;
@@ -576,6 +575,7 @@ export declare const v4: Elysia<"/v4", false, {
576
575
  aprRecordId: string;
577
576
  }[];
578
577
  } | undefined;
578
+ depositUrl?: string | undefined;
579
579
  tvlRecord?: {
580
580
  total: number;
581
581
  timestamp: string | bigint;
@@ -1056,10 +1056,10 @@ export declare const v4: Elysia<"/v4", false, {
1056
1056
  response: {
1057
1057
  200: {
1058
1058
  endTimestamp: bigint;
1059
- campaignId: string;
1060
1059
  CampaignStatus: {
1061
1060
  computedUntil: bigint;
1062
1061
  }[];
1062
+ campaignId: string;
1063
1063
  }[];
1064
1064
  };
1065
1065
  };
@@ -1576,8 +1576,12 @@ export declare const v4: Elysia<"/v4", false, {
1576
1576
  };
1577
1577
  headers: unknown;
1578
1578
  response: {
1579
- [x: string]: any;
1580
- 200: any;
1579
+ 200: {
1580
+ amount: string;
1581
+ claimed: string;
1582
+ pending: string;
1583
+ recipient: string;
1584
+ }[];
1581
1585
  };
1582
1586
  };
1583
1587
  };
@@ -1641,8 +1645,12 @@ export declare const v4: Elysia<"/v4", false, {
1641
1645
  };
1642
1646
  headers: unknown;
1643
1647
  response: {
1644
- [x: string]: any;
1645
- 200: any;
1648
+ 200: {
1649
+ amount: string;
1650
+ claimed: string;
1651
+ pending: string;
1652
+ recipient: string;
1653
+ }[];
1646
1654
  };
1647
1655
  };
1648
1656
  };
@@ -2959,13 +2967,13 @@ export declare const v4: Elysia<"/v4", false, {
2959
2967
  chainId?: number | undefined;
2960
2968
  startTimestamp?: string | undefined;
2961
2969
  endTimestamp?: string | undefined;
2970
+ campaignStatus?: {} | undefined;
2962
2971
  distributionChainId?: number | undefined;
2963
2972
  campaignId?: string | undefined;
2964
2973
  rewardTokenId?: string | undefined;
2965
2974
  amount?: string | undefined;
2966
2975
  opportunityId?: string | undefined;
2967
2976
  creatorAddress?: string | undefined;
2968
- campaignStatus?: {} | undefined;
2969
2977
  rewardToken?: {} | undefined;
2970
2978
  rewardTokenAddress?: string | undefined;
2971
2979
  distributionChain?: {} | undefined;
@@ -3139,12 +3147,6 @@ export declare const v4: Elysia<"/v4", false, {
3139
3147
  delayFormatted: string;
3140
3148
  startTimestamp: bigint;
3141
3149
  endTimestamp: bigint;
3142
- computeChainId: number;
3143
- distributionChainId: number;
3144
- campaignId: string;
3145
- Opportunity: {
3146
- name: string;
3147
- };
3148
3150
  CampaignStatus: {
3149
3151
  error: string;
3150
3152
  details: import("database/api/.generated/runtime/library").JsonValue;
@@ -3153,6 +3155,12 @@ export declare const v4: Elysia<"/v4", false, {
3153
3155
  computedUntil: bigint;
3154
3156
  processingStarted: bigint;
3155
3157
  }[];
3158
+ Opportunity: {
3159
+ name: string;
3160
+ };
3161
+ computeChainId: number;
3162
+ distributionChainId: number;
3163
+ campaignId: string;
3156
3164
  }[];
3157
3165
  };
3158
3166
  };
@@ -130,12 +130,6 @@ export declare const StatusController: Elysia<"/campaign-status", false, {
130
130
  delayFormatted: string;
131
131
  startTimestamp: bigint;
132
132
  endTimestamp: bigint;
133
- computeChainId: number;
134
- distributionChainId: number;
135
- campaignId: string;
136
- Opportunity: {
137
- name: string;
138
- };
139
133
  CampaignStatus: {
140
134
  error: string;
141
135
  details: import("database/api/.generated/runtime/library").JsonValue;
@@ -144,6 +138,12 @@ export declare const StatusController: Elysia<"/campaign-status", false, {
144
138
  computedUntil: bigint;
145
139
  processingStarted: bigint;
146
140
  }[];
141
+ Opportunity: {
142
+ name: string;
143
+ };
144
+ computeChainId: number;
145
+ distributionChainId: number;
146
+ campaignId: string;
147
147
  }[];
148
148
  };
149
149
  };
@@ -70,12 +70,6 @@ export declare class StatusRepository {
70
70
  static findManyDelay(query: DelayModel): Promise<{
71
71
  startTimestamp: bigint;
72
72
  endTimestamp: bigint;
73
- computeChainId: number;
74
- distributionChainId: number;
75
- campaignId: string;
76
- Opportunity: {
77
- name: string;
78
- };
79
73
  CampaignStatus: {
80
74
  error: string;
81
75
  details: Prisma.JsonValue;
@@ -84,5 +78,11 @@ export declare class StatusRepository {
84
78
  computedUntil: bigint;
85
79
  processingStarted: bigint;
86
80
  }[];
81
+ Opportunity: {
82
+ name: string;
83
+ };
84
+ computeChainId: number;
85
+ distributionChainId: number;
86
+ campaignId: string;
87
87
  }[]>;
88
88
  }
@@ -40,12 +40,6 @@ export declare class StatusService {
40
40
  delayFormatted: string;
41
41
  startTimestamp: bigint;
42
42
  endTimestamp: bigint;
43
- computeChainId: number;
44
- distributionChainId: number;
45
- campaignId: string;
46
- Opportunity: {
47
- name: string;
48
- };
49
43
  CampaignStatus: {
50
44
  error: string;
51
45
  details: import("database/api/.generated/runtime/library").JsonValue;
@@ -54,5 +48,11 @@ export declare class StatusService {
54
48
  computedUntil: bigint;
55
49
  processingStarted: bigint;
56
50
  }[];
51
+ Opportunity: {
52
+ name: string;
53
+ };
54
+ computeChainId: number;
55
+ distributionChainId: number;
56
+ campaignId: string;
57
57
  }[]>;
58
58
  }
@@ -67,14 +67,14 @@ export declare abstract class TokenRepository {
67
67
  * @param price value
68
68
  * @param excludeAddresses to not update even if symbol match
69
69
  */
70
- static updateSymbolPrices(symbol: string, price: number, excludeAddresses: string[]): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload>;
70
+ static updateSymbolPrices(symbol: string, price: number, excludeAddresses: string[]): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
71
71
  /**
72
72
  * Updates price of tokens that share the same address
73
73
  * @param address
74
74
  * @param price value
75
75
  * @param chainId
76
76
  */
77
- static updateAddressPrices(address: string, price: number, chainId?: number): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload>;
77
+ static updateAddressPrices(address: string, price: number, chainId?: number): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
78
78
  static findChains(): Promise<Record<string, ChainId>>;
79
79
  /**
80
80
  * create a token on database
@@ -1,6 +1,5 @@
1
1
  import type { CreateTokenModel, GetTokenQueryModel, Token, TokenModel, TokenUnique, UpdateTokenModel } from "./";
2
2
  import type { Pricer } from "../../../utils/pricer";
3
- import { Prisma } from "../../../../database/api/.generated";
4
3
  import { type ChainId } from "@sdk";
5
4
  import { TokenRepository } from "./token.repository";
6
5
  export declare abstract class TokenService {
@@ -72,14 +71,14 @@ export declare abstract class TokenService {
72
71
  * @param price value
73
72
  * @param excludeAddresses to not update symbols that defined using addresses
74
73
  */
75
- static updateSymbolPrices(symbol: string, price: number, excludeAddresses: string[]): Promise<Prisma.BatchPayload>;
74
+ static updateSymbolPrices(symbol: string, price: number, excludeAddresses: string[]): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
76
75
  /**
77
76
  * Updates price of tokens that share the same address
78
77
  * @param address
79
78
  * @param price value
80
79
  * @param chainId
81
80
  */
82
- static updateAddressPrices(address: string, price: number, chainId?: number): Promise<Prisma.BatchPayload>;
81
+ static updateAddressPrices(address: string, price: number, chainId?: number): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
83
82
  /**
84
83
  * Updates price of tokens that share the same symbol
85
84
  * @param symbol
@@ -20,7 +20,7 @@ export declare abstract class UserRepository {
20
20
  address: string;
21
21
  creatorId: string | null;
22
22
  }>;
23
- static createMany(users: UserModel[]): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload>;
23
+ static createMany(users: UserModel[]): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
24
24
  static updateTags(address: string, tags: string[]): Promise<{
25
25
  tags: string[];
26
26
  address: string;
@@ -20,7 +20,7 @@ export declare abstract class UserService {
20
20
  address: string;
21
21
  creatorId: string | null;
22
22
  }>;
23
- static createMany(users: UserModel[]): Promise<import("../../../../database/api/.generated").Prisma.BatchPayload>;
23
+ static createMany(users: UserModel[]): Promise<import("database/api/.generated/runtime/library").GetBatchResult>;
24
24
  static updateTags(user: string, tags: string[]): Promise<{
25
25
  tags: string[];
26
26
  address: string;
@@ -5,5 +5,5 @@ export default (app) => app.get("/euler", async () => {
5
5
  return await getEulerV2VaultsWithCache();
6
6
  }, {
7
7
  query: t.Object({}),
8
- tags: ["Protocols"],
8
+ tags: ["euler"],
9
9
  });
@@ -1,12 +1,25 @@
1
- import { PrismaClient as ApiPrismaClient } from "../../database/api/.generated";
2
1
  import { PrismaClient as EnginePrismaClient } from "../../database/engine/.generated";
3
- export declare const apiDbClient: ApiPrismaClient<{
2
+ export declare const apiDbClient: import("database/api/.generated/runtime/library").DynamicClientExtensionThis<import("../../database/api/.generated").Prisma.TypeMap<import("database/api/.generated/runtime/library").InternalArgs & {
3
+ result: {};
4
+ model: {};
5
+ query: {};
6
+ client: {
7
+ $drizzle: () => import("drizzle-orm/prisma/pg").PrismaPgDatabase;
8
+ };
9
+ }, import("../../database/api/.generated").Prisma.PrismaClientOptions>, import("../../database/api/.generated").Prisma.TypeMapCb, {
10
+ result: {};
11
+ model: {};
12
+ query: {};
13
+ client: {
14
+ $drizzle: () => import("drizzle-orm/prisma/pg").PrismaPgDatabase;
15
+ };
16
+ }, {
4
17
  datasources: {
5
18
  db: {
6
19
  url: string;
7
20
  };
8
21
  };
9
- }, never, import("database/api/.generated/runtime/library").DefaultArgs>;
22
+ }>;
10
23
  export declare const engineDbClient: EnginePrismaClient<{
11
24
  datasources: {
12
25
  db: {
@@ -1,8 +1,9 @@
1
1
  import { PrismaClient as ApiPrismaClient } from "../../database/api/.generated";
2
2
  import { PrismaClient as EnginePrismaClient } from "../../database/engine/.generated";
3
+ import { drizzle } from "drizzle-orm/prisma/pg";
3
4
  export const apiDbClient = new ApiPrismaClient({
4
5
  datasources: { db: { url: `${process.env.DATABASE_API_URL}&connection_limit=250&pool_timeout=15` } },
5
- });
6
+ }).$extends(drizzle());
6
7
  export const engineDbClient = new EnginePrismaClient({
7
8
  datasources: {
8
9
  db: {