@merkl/api 0.10.170 → 0.10.172

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/src/eden/index.d.ts +72 -75
  2. package/dist/src/index.d.ts +24 -25
  3. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/helpers/factoryFinder.js +1 -0
  4. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.d.ts +1 -1
  5. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/PendleYTProcessor.js +1 -3
  6. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.d.ts +3 -1
  7. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/processor/TempestVaultProcessor.js +36 -7
  8. package/dist/src/libs/campaigns/campaignTypes/ERC20SubTypes/subtypesRound1RefactoFinal.js +1 -1
  9. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +4 -4
  10. package/dist/src/modules/v4/campaign/campaign.repository.js +1 -0
  11. package/dist/src/modules/v4/campaign/campaign.service.d.ts +4 -4
  12. package/dist/src/modules/v4/campaign/campaign.service.js +2 -1
  13. package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +15 -15
  14. package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +106 -3
  15. package/dist/src/modules/v4/opportunity/opportunity.repository.js +11 -2
  16. package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +29 -29
  17. package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -1
  18. package/dist/src/modules/v4/router.d.ts +24 -25
  19. package/dist/src/modules/v4/token/token.controller.d.ts +5 -6
  20. package/dist/src/modules/v4/token/token.model.d.ts +2 -1
  21. package/dist/src/modules/v4/token/token.model.js +1 -0
  22. package/dist/src/modules/v4/token/token.repository.d.ts +13 -1
  23. package/dist/src/modules/v4/token/token.repository.js +2 -0
  24. package/dist/src/modules/v4/token/token.service.d.ts +5 -9
  25. package/dist/src/modules/v4/token/token.service.js +11 -2
  26. package/dist/src/routes/v3/blacklist.d.ts +24 -25
  27. package/dist/src/routes/v3/campaigns.d.ts +24 -25
  28. package/dist/src/routes/v3/campaignsInfo.d.ts +24 -25
  29. package/dist/src/routes/v3/multiChainPositions.d.ts +24 -25
  30. package/dist/src/routes/v3/opportunity.d.ts +24 -25
  31. package/dist/src/routes/v3/positions.d.ts +24 -25
  32. package/dist/src/routes/v3/rewards.d.ts +24 -25
  33. package/dist/src/routes/v3/updates.d.ts +24 -25
  34. package/dist/src/routes/v3/userRewards.d.ts +24 -25
  35. package/dist/src/utils/generateCardName.js +1 -0
  36. package/dist/tsconfig.package.tsbuildinfo +1 -1
  37. package/package.json +1 -1
@@ -128,7 +128,7 @@ declare const app: Elysia<"", false, {
128
128
  }[];
129
129
  };
130
130
  id: string;
131
- tokens: {
131
+ tokens: ({
132
132
  symbol: string;
133
133
  name: string | null;
134
134
  id: string;
@@ -136,11 +136,11 @@ declare const app: Elysia<"", false, {
136
136
  address: string;
137
137
  icon: string;
138
138
  decimals: number;
139
- displaySymbol: string;
140
139
  verified: boolean;
141
140
  isTest: boolean;
142
- price: number | null;
143
- }[];
141
+ } & {
142
+ price?: number | null | undefined;
143
+ })[];
144
144
  chain: {
145
145
  name: string;
146
146
  id: number;
@@ -231,7 +231,7 @@ declare const app: Elysia<"", false, {
231
231
  }[];
232
232
  };
233
233
  id: string;
234
- tokens: {
234
+ tokens: ({
235
235
  symbol: string;
236
236
  name: string | null;
237
237
  id: string;
@@ -239,11 +239,11 @@ declare const app: Elysia<"", false, {
239
239
  address: string;
240
240
  icon: string;
241
241
  decimals: number;
242
- displaySymbol: string;
243
242
  verified: boolean;
244
243
  isTest: boolean;
245
- price: number | null;
246
- }[];
244
+ } & {
245
+ price?: number | null | undefined;
246
+ })[];
247
247
  chain: {
248
248
  name: string;
249
249
  id: number;
@@ -282,10 +282,10 @@ declare const app: Elysia<"", false, {
282
282
  address: string;
283
283
  icon: string;
284
284
  decimals: number;
285
- displaySymbol: string;
286
285
  verified: boolean;
287
286
  isTest: boolean;
288
- price: number | null;
287
+ } & {
288
+ price?: number | null | undefined;
289
289
  };
290
290
  distributionChain: {
291
291
  name: string;
@@ -392,7 +392,7 @@ declare const app: Elysia<"", false, {
392
392
  }[];
393
393
  };
394
394
  id: string;
395
- tokens: {
395
+ tokens: ({
396
396
  symbol: string;
397
397
  name: string | null;
398
398
  id: string;
@@ -400,11 +400,11 @@ declare const app: Elysia<"", false, {
400
400
  address: string;
401
401
  icon: string;
402
402
  decimals: number;
403
- displaySymbol: string;
404
403
  verified: boolean;
405
404
  isTest: boolean;
406
- price: number | null;
407
- }[];
405
+ } & {
406
+ price?: number | null | undefined;
407
+ })[];
408
408
  chain: {
409
409
  name: string;
410
410
  id: number;
@@ -488,7 +488,7 @@ declare const app: Elysia<"", false, {
488
488
  headers: unknown;
489
489
  response: {
490
490
  200: {
491
- sum: number | null;
491
+ sum: File;
492
492
  };
493
493
  };
494
494
  };
@@ -557,8 +557,8 @@ declare const app: Elysia<"", false, {
557
557
  mainParameter?: string | undefined;
558
558
  campaignId?: string | undefined;
559
559
  opportunityId?: string | undefined;
560
- tokenSymbol?: string | undefined;
561
560
  test?: boolean | undefined;
561
+ tokenSymbol?: string | undefined;
562
562
  };
563
563
  headers: unknown;
564
564
  response: {
@@ -577,10 +577,10 @@ declare const app: Elysia<"", false, {
577
577
  address: string;
578
578
  icon: string;
579
579
  decimals: number;
580
- displaySymbol: string;
581
580
  verified: boolean;
582
581
  isTest: boolean;
583
- price: number | null;
582
+ } & {
583
+ price?: number | null | undefined;
584
584
  };
585
585
  distributionChain: {
586
586
  name: string;
@@ -628,8 +628,8 @@ declare const app: Elysia<"", false, {
628
628
  mainParameter?: string | undefined;
629
629
  campaignId?: string | undefined;
630
630
  opportunityId?: string | undefined;
631
- tokenSymbol?: string | undefined;
632
631
  test?: boolean | undefined;
632
+ tokenSymbol?: string | undefined;
633
633
  };
634
634
  headers: unknown;
635
635
  response: {
@@ -783,7 +783,6 @@ declare const app: Elysia<"", false, {
783
783
  address: string;
784
784
  icon: string;
785
785
  decimals: number;
786
- displaySymbol: string;
787
786
  verified: boolean;
788
787
  isTest: boolean;
789
788
  price?: number | null | undefined;
@@ -814,7 +813,6 @@ declare const app: Elysia<"", false, {
814
813
  address: string;
815
814
  icon: string;
816
815
  decimals: number;
817
- displaySymbol: string;
818
816
  verified: boolean;
819
817
  isTest: boolean;
820
818
  } & {
@@ -838,10 +836,11 @@ declare const app: Elysia<"", false, {
838
836
  chainId?: any;
839
837
  address?: string | undefined;
840
838
  verified?: boolean | undefined;
839
+ test?: boolean | undefined;
841
840
  };
842
841
  headers: unknown;
843
842
  response: {
844
- 200: ({
843
+ 200: {
845
844
  symbol: string;
846
845
  name: string | null;
847
846
  id: string;
@@ -852,9 +851,8 @@ declare const app: Elysia<"", false, {
852
851
  displaySymbol: string;
853
852
  verified: boolean;
854
853
  isTest: boolean;
855
- } & {
856
- price?: number | null | undefined;
857
- })[];
854
+ price: number | null;
855
+ }[];
858
856
  };
859
857
  };
860
858
  };
@@ -871,6 +869,7 @@ declare const app: Elysia<"", false, {
871
869
  chainId?: any;
872
870
  address?: string | undefined;
873
871
  verified?: boolean | undefined;
872
+ test?: boolean | undefined;
874
873
  };
875
874
  headers: unknown;
876
875
  response: {
@@ -17,6 +17,7 @@ const factoryAddresses = {
17
17
  "0x6fcf753f2C67b83f7B09746Bbc4FA0047b35D050": tokenType.pendle, // Pendle Factory
18
18
  "0x35A338522a435D46f77Be32C70E215B813D0e3aC": tokenType.pendleYT, // Pendle YT Factory
19
19
  "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73": tokenType.pancakeswap, // PancakeSwap Factory BNB
20
+ "0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD": tokenType.pendleYT, // Pendle YT Factory
20
21
  };
21
22
  export function getTypeFromFactoryAddress(address) {
22
23
  if (factoryAddresses[address]) {
@@ -1,5 +1,5 @@
1
1
  import type { Pricer } from "../../../../../utils/pricer";
2
- import { type Campaign, type CampaignParameters } from "@sdk";
2
+ import type { Campaign, CampaignParameters } from "@sdk";
3
3
  import type { tokenType } from "../helpers/tokenType";
4
4
  import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
5
  type callType = {
@@ -1,5 +1,4 @@
1
1
  import { generateCardName } from "../../../../../utils/generateCardName";
2
- import { ChainId } from "@sdk";
3
2
  import { GenericProcessor } from "./GenericProcessor";
4
3
  export class PendleYTProcessor extends GenericProcessor {
5
4
  rounds = {
@@ -14,8 +13,7 @@ export class PendleYTProcessor extends GenericProcessor {
14
13
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
15
14
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
16
15
  const priceTargetToken = (await pricer.get({
17
- address: typeInfo.tokenAddress,
18
- chainId: ChainId.MAINNET,
16
+ symbol: typeInfo.tokenAddress,
19
17
  })) ?? 0;
20
18
  const tvl = priceTargetToken * totalSupply;
21
19
  return {
@@ -1,6 +1,6 @@
1
1
  import type { Pricer } from "../../../../../utils/pricer";
2
2
  import { type Campaign, type CampaignParameters } from "@sdk";
3
- import type { tokenType } from "../helpers/tokenType";
3
+ import type { tokenType, tokenTypeStruct } from "../helpers/tokenType";
4
4
  import { GenericProcessor, type dataType, type mandatoryCallKeys } from "./GenericProcessor";
5
5
  type callType = {
6
6
  key: keyof dataRawTempest;
@@ -23,6 +23,7 @@ type dataRawTempest = callKeysTempest & {
23
23
  amount0Invested: string;
24
24
  amount1Idle: string;
25
25
  amount1Invested: string;
26
+ amountInQueue?: string;
26
27
  decimalsToken0: string;
27
28
  decimalsToken1: string;
28
29
  positionsReturnData: {
@@ -45,6 +46,7 @@ export declare class TempestVaultProcessor extends GenericProcessor<callKeysTemp
45
46
  round4: callType[];
46
47
  };
47
48
  processingRound2(typeInfo: dataRawTempest): void;
49
+ computeRound3(index: number, type: tokenType, typeInfo: dataRawTempest, calls: string[]): tokenTypeStruct;
48
50
  processingRound5(_index: number, type: tokenType, typeInfo: dataRawTempest, _calls: string[], campaign: CampaignParameters<Campaign.ERC20> | CampaignParameters<Campaign.EULER>, pricer: Pricer): Promise<dataTypeTempest>;
49
51
  }
50
52
  export {};
@@ -1,5 +1,5 @@
1
1
  import { generateCardName } from "../../../../../utils/generateCardName";
2
- import { BN2Number } from "@sdk";
2
+ import { BN2Number, NULL_ADDRESS } from "@sdk";
3
3
  import { GenericProcessor } from "./GenericProcessor";
4
4
  export class TempestVaultProcessor extends GenericProcessor {
5
5
  rounds = {
@@ -9,8 +9,8 @@ export class TempestVaultProcessor extends GenericProcessor {
9
9
  ],
10
10
  round2: [
11
11
  { key: "symbolToken0", call: "symbol", target: "addressToken0" },
12
- { key: "symbolToken1", call: "symbol", target: "addressToken1" },
13
12
  { key: "decimalsToken0", call: "decimals", target: "addressToken0" },
13
+ { key: "symbolToken1", call: "symbol", target: "addressToken1" },
14
14
  { key: "decimalsToken1", call: "decimals", target: "addressToken1" },
15
15
  ],
16
16
  round3: [],
@@ -19,17 +19,46 @@ export class TempestVaultProcessor extends GenericProcessor {
19
19
  processingRound2(typeInfo) {
20
20
  typeInfo.addressToken0 = typeInfo.addressesReturnData[0];
21
21
  typeInfo.addressToken1 = typeInfo.addressesReturnData[1];
22
- typeInfo.amount0Invested = typeInfo.positionsReturnData[0];
23
- typeInfo.amount1Invested = typeInfo.positionsReturnData[1];
24
- typeInfo.amount0Idle = typeInfo.positionsReturnData[2];
25
- typeInfo.amount1Idle = typeInfo.positionsReturnData[3];
22
+ typeInfo.amount0Invested = typeInfo.positionsReturnData[0].toString();
23
+ typeInfo.amount1Invested = typeInfo.positionsReturnData[1].toString();
24
+ typeInfo.amount0Idle = typeInfo.positionsReturnData[2].toString();
25
+ typeInfo.amount1Idle = typeInfo.positionsReturnData[3].toString();
26
+ try {
27
+ typeInfo.amountInQueue = typeInfo.positionsReturnData[4].toString();
28
+ }
29
+ catch { }
30
+ if (typeInfo.addressToken0 === NULL_ADDRESS) {
31
+ this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken0");
32
+ typeInfo.symbolToken0 = "ETH";
33
+ typeInfo.decimalsToken0 = "18";
34
+ }
35
+ if (typeInfo.addressToken1 === NULL_ADDRESS) {
36
+ this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken1");
37
+ typeInfo.symbolToken1 = "ETH";
38
+ typeInfo.decimalsToken1 = "18";
39
+ }
40
+ }
41
+ computeRound3(index, type, typeInfo, calls) {
42
+ if (typeInfo.addressToken0 === NULL_ADDRESS) {
43
+ this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken0");
44
+ typeInfo.symbolToken0 = "ETH";
45
+ typeInfo.decimalsToken0 = "18";
46
+ }
47
+ if (typeInfo.addressToken1 === NULL_ADDRESS) {
48
+ this.rounds.round2 = this.rounds.round2.filter(call => call.target !== "addressToken1");
49
+ typeInfo.symbolToken1 = "ETH";
50
+ typeInfo.decimalsToken1 = "18";
51
+ }
52
+ return super.computeRound3(index, type, typeInfo, calls);
26
53
  }
27
54
  async processingRound5(_index, type, typeInfo, _calls, campaign, pricer) {
28
55
  const { whitelistedSupplyTargetToken, totalSupply, blacklistedSupply } = this.handleWhiteListBlacklistRound5(typeInfo, campaign);
29
56
  const decimalsToken0 = Number(typeInfo.decimalsToken0);
30
57
  const decimalsToken1 = Number(typeInfo.decimalsToken1);
31
58
  const amount0 = BN2Number(typeInfo.amount0Idle, decimalsToken0) + BN2Number(typeInfo.amount0Invested, decimalsToken0);
32
- const amount1 = BN2Number(typeInfo.amount1Idle, decimalsToken1) + BN2Number(typeInfo.amount1Invested, decimalsToken1);
59
+ const amount1 = BN2Number(typeInfo.amount1Idle, decimalsToken1) +
60
+ BN2Number(typeInfo.amount1Invested, decimalsToken1) +
61
+ (!!typeInfo.amountInQueue ? BN2Number(typeInfo.amountInQueue, decimalsToken1) : 0);
33
62
  const tokenAPRice = (await pricer.get({ symbol: typeInfo.symbolToken0 })) ?? 0;
34
63
  const tokenBPrice = (await pricer.get({ symbol: typeInfo.symbolToken1 })) ?? 0;
35
64
  const tvl = tokenAPRice * amount0 + tokenBPrice * amount1;
@@ -91,7 +91,7 @@ function satisfiesNameConditions(name, type) {
91
91
  case tokenType.maha:
92
92
  return lowerCaseName.includes("staked") && lowerCaseName.includes("maha");
93
93
  case tokenType.tempest:
94
- return lowerCaseName.startsWith("ts");
94
+ return lowerCaseName.startsWith("ts") || lowerCaseName.startsWith("tempest");
95
95
  default:
96
96
  return false;
97
97
  }
@@ -71,8 +71,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
71
71
  mainParameter?: string | undefined;
72
72
  campaignId?: string | undefined;
73
73
  opportunityId?: string | undefined;
74
- tokenSymbol?: string | undefined;
75
74
  test?: boolean | undefined;
75
+ tokenSymbol?: string | undefined;
76
76
  };
77
77
  headers: unknown;
78
78
  response: {
@@ -91,10 +91,10 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
91
91
  address: string;
92
92
  icon: string;
93
93
  decimals: number;
94
- displaySymbol: string;
95
94
  verified: boolean;
96
95
  isTest: boolean;
97
- price: number | null;
96
+ } & {
97
+ price?: number | null | undefined;
98
98
  };
99
99
  distributionChain: {
100
100
  name: string;
@@ -142,8 +142,8 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
142
142
  mainParameter?: string | undefined;
143
143
  campaignId?: string | undefined;
144
144
  opportunityId?: string | undefined;
145
- tokenSymbol?: string | undefined;
146
145
  test?: boolean | undefined;
146
+ tokenSymbol?: string | undefined;
147
147
  };
148
148
  headers: unknown;
149
149
  response: {
@@ -26,6 +26,7 @@ export class CampaignRepository {
26
26
  RewardToken: {
27
27
  address: tokenAddress ? tokenAddress : undefined,
28
28
  symbol: tokenSymbol ? tokenSymbol : undefined,
29
+ displaySymbol: tokenSymbol ? tokenSymbol : undefined,
29
30
  isTest: !test ? false : undefined,
30
31
  },
31
32
  },
@@ -43,10 +43,10 @@ export declare abstract class CampaignService {
43
43
  address: string;
44
44
  icon: string;
45
45
  decimals: number;
46
- displaySymbol: string;
47
46
  verified: boolean;
48
47
  isTest: boolean;
49
- price: number | null;
48
+ } & {
49
+ price?: number | null | undefined;
50
50
  };
51
51
  distributionChain: {
52
52
  name: string;
@@ -177,10 +177,10 @@ export declare abstract class CampaignService {
177
177
  address: string;
178
178
  icon: string;
179
179
  decimals: number;
180
- displaySymbol: string;
181
180
  verified: boolean;
182
181
  isTest: boolean;
183
- price: number | null;
182
+ } & {
183
+ price?: number | null | undefined;
184
184
  };
185
185
  distributionChain: {
186
186
  name: string;
@@ -8,6 +8,7 @@ import { log } from "../../../utils/logger";
8
8
  import { NETWORK_LABELS } from "@sdk";
9
9
  import moment from "moment";
10
10
  import { StatusService } from "../status";
11
+ import { TokenService } from "../token";
11
12
  export class CampaignService {
12
13
  static hashId(campaign) {
13
14
  return Bun.hash(`${campaign.distributionChain}${campaign.campaignId}`).toString();
@@ -169,7 +170,7 @@ export class CampaignService {
169
170
  ...c,
170
171
  params: params,
171
172
  chain: ComputeChain,
172
- rewardToken: RewardToken,
173
+ rewardToken: TokenService.format(RewardToken),
173
174
  distributionChain: DistributionChain === null ? undefined : DistributionChain,
174
175
  // Todo: need to be change to single 1 to 1 with campaign
175
176
  campaignStatus: CampaignStatus?.[0],
@@ -101,7 +101,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
101
101
  }[];
102
102
  };
103
103
  id: string;
104
- tokens: {
104
+ tokens: ({
105
105
  symbol: string;
106
106
  name: string | null;
107
107
  id: string;
@@ -109,11 +109,11 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
109
109
  address: string;
110
110
  icon: string;
111
111
  decimals: number;
112
- displaySymbol: string;
113
112
  verified: boolean;
114
113
  isTest: boolean;
115
- price: number | null;
116
- }[];
114
+ } & {
115
+ price?: number | null | undefined;
116
+ })[];
117
117
  chain: {
118
118
  name: string;
119
119
  id: number;
@@ -204,7 +204,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
204
204
  }[];
205
205
  };
206
206
  id: string;
207
- tokens: {
207
+ tokens: ({
208
208
  symbol: string;
209
209
  name: string | null;
210
210
  id: string;
@@ -212,11 +212,11 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
212
212
  address: string;
213
213
  icon: string;
214
214
  decimals: number;
215
- displaySymbol: string;
216
215
  verified: boolean;
217
216
  isTest: boolean;
218
- price: number | null;
219
- }[];
217
+ } & {
218
+ price?: number | null | undefined;
219
+ })[];
220
220
  chain: {
221
221
  name: string;
222
222
  id: number;
@@ -255,10 +255,10 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
255
255
  address: string;
256
256
  icon: string;
257
257
  decimals: number;
258
- displaySymbol: string;
259
258
  verified: boolean;
260
259
  isTest: boolean;
261
- price: number | null;
260
+ } & {
261
+ price?: number | null | undefined;
262
262
  };
263
263
  distributionChain: {
264
264
  name: string;
@@ -365,7 +365,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
365
365
  }[];
366
366
  };
367
367
  id: string;
368
- tokens: {
368
+ tokens: ({
369
369
  symbol: string;
370
370
  name: string | null;
371
371
  id: string;
@@ -373,11 +373,11 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
373
373
  address: string;
374
374
  icon: string;
375
375
  decimals: number;
376
- displaySymbol: string;
377
376
  verified: boolean;
378
377
  isTest: boolean;
379
- price: number | null;
380
- }[];
378
+ } & {
379
+ price?: number | null | undefined;
380
+ })[];
381
381
  chain: {
382
382
  name: string;
383
383
  id: number;
@@ -461,7 +461,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
461
461
  headers: unknown;
462
462
  response: {
463
463
  200: {
464
- sum: number | null;
464
+ sum: File;
465
465
  };
466
466
  };
467
467
  };
@@ -332,7 +332,110 @@ export declare abstract class OpportunityRepository {
332
332
  apr: number;
333
333
  dailyRewards: number;
334
334
  })[]>;
335
- static findMany(query: GetOpportunitiesQueryModel): Promise<{
335
+ static findMany(query: GetOpportunitiesQueryModel): Promise<({
336
+ Chain: {
337
+ name: string;
338
+ id: number;
339
+ icon: string;
340
+ };
341
+ Tokens: {
342
+ symbol: string;
343
+ name: string | null;
344
+ id: string;
345
+ chainId: number;
346
+ address: string;
347
+ icon: string;
348
+ decimals: number;
349
+ displaySymbol: string;
350
+ verified: boolean;
351
+ isTest: boolean;
352
+ price: number | null;
353
+ }[];
354
+ Protocols: {
355
+ name: string;
356
+ url: string;
357
+ description: string;
358
+ id: string;
359
+ tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
360
+ icon: string;
361
+ }[];
362
+ MainProtocol: {
363
+ name: string;
364
+ url: string;
365
+ description: string;
366
+ id: string;
367
+ tags: import("../../../../database/api/.generated").$Enums.ProtocolTag[];
368
+ icon: string;
369
+ } | null;
370
+ TvlRecords: ({
371
+ TvlBreakdown: {
372
+ type: import("../../../../database/api/.generated").$Enums.TvlType;
373
+ id: number;
374
+ identifier: string;
375
+ value: number;
376
+ tvlRecordId: string;
377
+ }[];
378
+ } & {
379
+ total: number;
380
+ id: string;
381
+ timestamp: bigint;
382
+ opportunityId: string;
383
+ })[];
384
+ AprRecords: ({
385
+ AprBreakdown: {
386
+ type: import("../../../../database/api/.generated").$Enums.AprType;
387
+ id: number;
388
+ identifier: string;
389
+ value: number;
390
+ aprRecordId: string;
391
+ }[];
392
+ } & {
393
+ id: string;
394
+ timestamp: bigint;
395
+ opportunityId: string;
396
+ cumulated: number;
397
+ })[];
398
+ DailyRewardsRecords: ({
399
+ DailyRewardsBreakdown: ({
400
+ Campaign: {
401
+ startTimestamp: bigint;
402
+ endTimestamp: bigint;
403
+ amount: string;
404
+ RewardToken: {
405
+ symbol: string;
406
+ name: string | null;
407
+ id: string;
408
+ chainId: number;
409
+ address: string;
410
+ icon: string;
411
+ decimals: number;
412
+ displaySymbol: string;
413
+ verified: boolean;
414
+ isTest: boolean;
415
+ price: number | null;
416
+ };
417
+ CampaignStatus: {
418
+ error: string;
419
+ details: Prisma.JsonValue;
420
+ status: import("../../../../database/api/.generated").$Enums.RunStatus;
421
+ campaignId: string;
422
+ computedUntil: bigint;
423
+ processingStarted: bigint;
424
+ }[];
425
+ };
426
+ } & {
427
+ id: number;
428
+ value: number;
429
+ campaignId: string;
430
+ dailyRewardsRecordId: string;
431
+ })[];
432
+ } & {
433
+ total: number;
434
+ id: string;
435
+ timestamp: bigint;
436
+ opportunityId: string;
437
+ })[];
438
+ } & {
336
439
  name: string;
337
440
  type: import("../../../../database/api/.generated").$Enums.CampaignType;
338
441
  id: string;
@@ -345,7 +448,7 @@ export declare abstract class OpportunityRepository {
345
448
  tvl: number;
346
449
  apr: number;
347
450
  dailyRewards: number;
348
- }[]>;
451
+ })[]>;
349
452
  static findLiveWithFirstCampaign(chainId: MerklChainId): Promise<({
350
453
  Chain: {
351
454
  name: string;
@@ -599,6 +702,6 @@ export declare abstract class OpportunityRepository {
599
702
  dailyRewards: number;
600
703
  }>;
601
704
  static aggregateSum(field: keyof Prisma.OpportunitySumAggregateInputType, query: GetOpportunitiesQueryModel): Promise<{
602
- sum: number | null;
705
+ sum: never;
603
706
  }>;
604
707
  }
@@ -155,7 +155,7 @@ export class OpportunityRepository {
155
155
  status: !status ? undefined : { in: status },
156
156
  },
157
157
  { mainProtocolId: !protocols ? undefined : { in: protocols } },
158
- test ? undefined : { Campaigns: { some: { RewardToken: { isTest: false } } } },
158
+ { Campaigns: test ? undefined : { some: { RewardToken: { isTest: false } } } },
159
159
  ],
160
160
  },
161
161
  };
@@ -250,7 +250,16 @@ export class OpportunityRepository {
250
250
  timestamp: dailyRewards.timestamp,
251
251
  Opportunity: { connect: { id: opportunityId } },
252
252
  total: dailyRewards.total,
253
- DailyRewardsBreakdown: { createMany: { data: dailyRewards.breakdowns } },
253
+ DailyRewardsBreakdown: {
254
+ createMany: {
255
+ data: dailyRewards.breakdowns.map(breakdown => {
256
+ return {
257
+ campaignId: breakdown.campaignId,
258
+ value: breakdown.value,
259
+ };
260
+ }),
261
+ },
262
+ },
254
263
  },
255
264
  include: { DailyRewardsBreakdown: true },
256
265
  });