@merkl/api 0.20.57 → 0.20.59

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.
@@ -531,6 +531,7 @@ declare const eden: {
531
531
  get: (options: {
532
532
  headers?: Record<string, unknown> | undefined;
533
533
  query: {
534
+ search?: string | undefined;
534
535
  name?: string | undefined;
535
536
  type?: string | undefined;
536
537
  status?: string | undefined;
@@ -726,6 +727,7 @@ declare const eden: {
726
727
  get: (options: {
727
728
  headers?: Record<string, unknown> | undefined;
728
729
  query: {
730
+ search?: string | undefined;
729
731
  name?: string | undefined;
730
732
  type?: string | undefined;
731
733
  status?: string | undefined;
@@ -936,6 +938,7 @@ declare const eden: {
936
938
  get: (options: {
937
939
  headers?: Record<string, unknown> | undefined;
938
940
  query: {
941
+ search?: string | undefined;
939
942
  name?: string | undefined;
940
943
  type?: string | undefined;
941
944
  status?: string | undefined;
@@ -970,6 +973,7 @@ declare const eden: {
970
973
  get: (options: {
971
974
  headers?: Record<string, unknown> | undefined;
972
975
  query: {
976
+ search?: string | undefined;
973
977
  name?: string | undefined;
974
978
  type?: string | undefined;
975
979
  status?: string | undefined;
@@ -1004,6 +1008,7 @@ declare const eden: {
1004
1008
  get: (options: {
1005
1009
  headers?: Record<string, unknown> | undefined;
1006
1010
  query: {
1011
+ search?: string | undefined;
1007
1012
  name?: string | undefined;
1008
1013
  type?: string | undefined;
1009
1014
  status?: string | undefined;
@@ -4554,6 +4559,7 @@ declare const eden: {
4554
4559
  get: (options: {
4555
4560
  headers?: Record<string, unknown> | undefined;
4556
4561
  query: {
4562
+ search?: string | undefined;
4557
4563
  name?: string | undefined;
4558
4564
  type?: string | undefined;
4559
4565
  status?: string | undefined;
@@ -4749,6 +4755,7 @@ declare const eden: {
4749
4755
  get: (options: {
4750
4756
  headers?: Record<string, unknown> | undefined;
4751
4757
  query: {
4758
+ search?: string | undefined;
4752
4759
  name?: string | undefined;
4753
4760
  type?: string | undefined;
4754
4761
  status?: string | undefined;
@@ -4959,6 +4966,7 @@ declare const eden: {
4959
4966
  get: (options: {
4960
4967
  headers?: Record<string, unknown> | undefined;
4961
4968
  query: {
4969
+ search?: string | undefined;
4962
4970
  name?: string | undefined;
4963
4971
  type?: string | undefined;
4964
4972
  status?: string | undefined;
@@ -4993,6 +5001,7 @@ declare const eden: {
4993
5001
  get: (options: {
4994
5002
  headers?: Record<string, unknown> | undefined;
4995
5003
  query: {
5004
+ search?: string | undefined;
4996
5005
  name?: string | undefined;
4997
5006
  type?: string | undefined;
4998
5007
  status?: string | undefined;
@@ -5027,6 +5036,7 @@ declare const eden: {
5027
5036
  get: (options: {
5028
5037
  headers?: Record<string, unknown> | undefined;
5029
5038
  query: {
5039
+ search?: string | undefined;
5030
5040
  name?: string | undefined;
5031
5041
  type?: string | undefined;
5032
5042
  status?: string | undefined;
@@ -8720,8 +8730,9 @@ declare const eden: {
8720
8730
  query?: Record<string, unknown> | undefined;
8721
8731
  fetch?: RequestInit | undefined;
8722
8732
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
8723
- [x: string]: any;
8724
- 200: any;
8733
+ 200: {
8734
+ [x: string]: any;
8735
+ } | undefined;
8725
8736
  }>>;
8726
8737
  }) & {
8727
8738
  index: {
@@ -8730,8 +8741,11 @@ declare const eden: {
8730
8741
  query?: Record<string, unknown> | undefined;
8731
8742
  fetch?: RequestInit | undefined;
8732
8743
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
8733
- [x: string]: any;
8734
- 200: any;
8744
+ 200: {
8745
+ [x: string]: {
8746
+ [poolId: string]: UniswapV4PoolType;
8747
+ } | undefined;
8748
+ } | null;
8735
8749
  }>>;
8736
8750
  };
8737
8751
  pool: ((params: {
@@ -9091,6 +9105,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9091
9105
  body: unknown;
9092
9106
  params: {};
9093
9107
  query: {
9108
+ search?: string | undefined;
9094
9109
  name?: string | undefined;
9095
9110
  type?: string | undefined;
9096
9111
  status?: string | undefined;
@@ -9291,6 +9306,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9291
9306
  body: unknown;
9292
9307
  params: {};
9293
9308
  query: {
9309
+ search?: string | undefined;
9294
9310
  name?: string | undefined;
9295
9311
  type?: string | undefined;
9296
9312
  status?: string | undefined;
@@ -9793,6 +9809,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9793
9809
  field: never;
9794
9810
  };
9795
9811
  query: {
9812
+ search?: string | undefined;
9796
9813
  name?: string | undefined;
9797
9814
  type?: string | undefined;
9798
9815
  status?: string | undefined;
@@ -9835,6 +9852,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9835
9852
  field: never;
9836
9853
  };
9837
9854
  query: {
9855
+ search?: string | undefined;
9838
9856
  name?: string | undefined;
9839
9857
  type?: string | undefined;
9840
9858
  status?: string | undefined;
@@ -9878,6 +9896,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
9878
9896
  field: never;
9879
9897
  };
9880
9898
  query: {
9899
+ search?: string | undefined;
9881
9900
  name?: string | undefined;
9882
9901
  type?: string | undefined;
9883
9902
  status?: string | undefined;
@@ -14676,8 +14695,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14676
14695
  query: unknown;
14677
14696
  headers: unknown;
14678
14697
  response: {
14679
- [x: string]: any;
14680
- 200: any;
14698
+ 200: {
14699
+ [x: string]: {
14700
+ [poolId: string]: UniswapV4PoolType;
14701
+ } | undefined;
14702
+ } | null;
14681
14703
  };
14682
14704
  };
14683
14705
  };
@@ -14691,8 +14713,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
14691
14713
  query: unknown;
14692
14714
  headers: unknown;
14693
14715
  response: {
14694
- [x: string]: any;
14695
- 200: any;
14716
+ 200: {
14717
+ [x: string]: any;
14718
+ } | undefined;
14696
14719
  };
14697
14720
  };
14698
14721
  };
@@ -15253,6 +15276,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15253
15276
  get: (options: {
15254
15277
  headers?: Record<string, unknown> | undefined;
15255
15278
  query: {
15279
+ search?: string | undefined;
15256
15280
  name?: string | undefined;
15257
15281
  type?: string | undefined;
15258
15282
  status?: string | undefined;
@@ -15448,6 +15472,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15448
15472
  get: (options: {
15449
15473
  headers?: Record<string, unknown> | undefined;
15450
15474
  query: {
15475
+ search?: string | undefined;
15451
15476
  name?: string | undefined;
15452
15477
  type?: string | undefined;
15453
15478
  status?: string | undefined;
@@ -15658,6 +15683,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15658
15683
  get: (options: {
15659
15684
  headers?: Record<string, unknown> | undefined;
15660
15685
  query: {
15686
+ search?: string | undefined;
15661
15687
  name?: string | undefined;
15662
15688
  type?: string | undefined;
15663
15689
  status?: string | undefined;
@@ -15692,6 +15718,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15692
15718
  get: (options: {
15693
15719
  headers?: Record<string, unknown> | undefined;
15694
15720
  query: {
15721
+ search?: string | undefined;
15695
15722
  name?: string | undefined;
15696
15723
  type?: string | undefined;
15697
15724
  status?: string | undefined;
@@ -15726,6 +15753,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
15726
15753
  get: (options: {
15727
15754
  headers?: Record<string, unknown> | undefined;
15728
15755
  query: {
15756
+ search?: string | undefined;
15729
15757
  name?: string | undefined;
15730
15758
  type?: string | undefined;
15731
15759
  status?: string | undefined;
@@ -19276,6 +19304,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19276
19304
  get: (options: {
19277
19305
  headers?: Record<string, unknown> | undefined;
19278
19306
  query: {
19307
+ search?: string | undefined;
19279
19308
  name?: string | undefined;
19280
19309
  type?: string | undefined;
19281
19310
  status?: string | undefined;
@@ -19471,6 +19500,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19471
19500
  get: (options: {
19472
19501
  headers?: Record<string, unknown> | undefined;
19473
19502
  query: {
19503
+ search?: string | undefined;
19474
19504
  name?: string | undefined;
19475
19505
  type?: string | undefined;
19476
19506
  status?: string | undefined;
@@ -19681,6 +19711,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19681
19711
  get: (options: {
19682
19712
  headers?: Record<string, unknown> | undefined;
19683
19713
  query: {
19714
+ search?: string | undefined;
19684
19715
  name?: string | undefined;
19685
19716
  type?: string | undefined;
19686
19717
  status?: string | undefined;
@@ -19715,6 +19746,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19715
19746
  get: (options: {
19716
19747
  headers?: Record<string, unknown> | undefined;
19717
19748
  query: {
19749
+ search?: string | undefined;
19718
19750
  name?: string | undefined;
19719
19751
  type?: string | undefined;
19720
19752
  status?: string | undefined;
@@ -19749,6 +19781,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
19749
19781
  get: (options: {
19750
19782
  headers?: Record<string, unknown> | undefined;
19751
19783
  query: {
19784
+ search?: string | undefined;
19752
19785
  name?: string | undefined;
19753
19786
  type?: string | undefined;
19754
19787
  status?: string | undefined;
@@ -23442,8 +23475,9 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
23442
23475
  query?: Record<string, unknown> | undefined;
23443
23476
  fetch?: RequestInit | undefined;
23444
23477
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
23445
- [x: string]: any;
23446
- 200: any;
23478
+ 200: {
23479
+ [x: string]: any;
23480
+ } | undefined;
23447
23481
  }>>;
23448
23482
  }) & {
23449
23483
  index: {
@@ -23452,8 +23486,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
23452
23486
  query?: Record<string, unknown> | undefined;
23453
23487
  fetch?: RequestInit | undefined;
23454
23488
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
23455
- [x: string]: any;
23456
- 200: any;
23489
+ 200: {
23490
+ [x: string]: {
23491
+ [poolId: string]: UniswapV4PoolType;
23492
+ } | undefined;
23493
+ } | null;
23457
23494
  }>>;
23458
23495
  };
23459
23496
  pool: ((params: {
@@ -1,4 +1,4 @@
1
- import { Campaign, type CampaignParameters, type MerklChainId } from "@sdk";
1
+ import { type Campaign, type CampaignParameters, type MerklChainId } from "@sdk";
2
2
  import type { DynamicDataBuilder } from "../interface";
3
3
  export type ERC20SupportedCampaignType = Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR | Campaign.EULER | Campaign.ERC20_FIX_APR;
4
4
  export declare class Erc20DynamicData implements DynamicDataBuilder<ERC20SupportedCampaignType> {
@@ -9,7 +9,8 @@ import { TokenRepository } from "@/modules/v4/token/token.repository";
9
9
  import { TokenService } from "@/modules/v4/token/token.service";
10
10
  import { log } from "@/utils/logger";
11
11
  import { Pricer } from "@/utils/pricer";
12
- import { BN2Number, BalancerPoolInterface, BalancerV3StablePoolInterface, Campaign, ChainId, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
12
+ import { BN2Number, BalancerPoolInterface, BalancerV3StablePoolInterface, ChainId, ChainInteractionService, ERC20Interface, EnzymeInterface, FactoryInterface, LayerBankERC20Interface, MetamorphoInterface, YEAR, getEnv, } from "@sdk";
13
+ import { getFixedApr, hasFixedAprConfig } from "../utils/getFixedApr";
13
14
  export class Erc20DynamicData {
14
15
  async build(chainId, campaigns) {
15
16
  const pricer = await Pricer.load();
@@ -160,17 +161,8 @@ export class Erc20DynamicData {
160
161
  if (rewardToken.isPoint) {
161
162
  apr = apr / 365 / 100;
162
163
  }
163
- else if (campaign.campaignType === Campaign.ERC20_FIX_APR &&
164
- ["tacBTC", "tacETH", "tacUSD"].includes(campaign.campaignParameters.symbolTargetToken)) {
165
- if (campaign.campaignParameters.symbolTargetToken === "tacBTC") {
166
- apr = 27.92;
167
- }
168
- else if (campaign.campaignParameters.symbolTargetToken === "tacETH") {
169
- apr = 32.58;
170
- }
171
- else if (campaign.campaignParameters.symbolTargetToken === "tacUSD") {
172
- apr = 46.54;
173
- }
164
+ else if (hasFixedAprConfig(campaign.campaignParameters)) {
165
+ apr = getFixedApr(campaign, priceRewardToken, priceTargetToken);
174
166
  }
175
167
  if (campaign.chainId === ChainId.ETHERLINK) {
176
168
  whitelistedSupplyTargetToken = tokenTypesByCampaign[campaign.campaignId].typeInfo.totalSupply;
@@ -0,0 +1,9 @@
1
+ import type { Campaign, CampaignParameters } from "@sdk";
2
+ export type BaseFixAPRConfig = {
3
+ apr: string;
4
+ targetTokenPricing: boolean;
5
+ rewardTokenPricing: boolean;
6
+ };
7
+ export type FixedAprCampaignType = Campaign.ERC20_FIX_APR | Campaign.HYPERDRIVELOGFIXPROCESSOR;
8
+ export declare function hasFixedAprConfig<T>(params: T): params is T & BaseFixAPRConfig;
9
+ export declare function getFixedApr(campaignParameters: CampaignParameters<FixedAprCampaignType>, priceRewardToken: number, priceTargetToken: number): number;
@@ -0,0 +1,35 @@
1
+ // Type guard to check if campaign parameters have fixed APR config
2
+ export function hasFixedAprConfig(params) {
3
+ return (typeof params === "object" &&
4
+ params !== null &&
5
+ "targetTokenPricing" in params &&
6
+ "rewardTokenPricing" in params &&
7
+ "apr" in params);
8
+ }
9
+ // TODO: Enhance APR display for non-dollar denominations when front-end is ready.
10
+ // This should handle cases where one or both token price are unavailable, showing the APR as a direct ratio
11
+ // (e.g., X reward tokens per Y target tokens) instead of dollar values.
12
+ export function getFixedApr(campaignParameters, priceRewardToken, priceTargetToken) {
13
+ const { targetTokenPricing, rewardTokenPricing, apr: fixedApr } = campaignParameters.campaignParameters;
14
+ const targetApr = Number(fixedApr);
15
+ // Handle all pricing configurations
16
+ if (targetTokenPricing && rewardTokenPricing) {
17
+ // Case 1: Fixed $ amount of reward per $ of liquidity
18
+ return targetApr * 100;
19
+ }
20
+ if (targetTokenPricing && !rewardTokenPricing) {
21
+ // Case 2: Fixed # amount of reward per $ of liquidity
22
+ // Return 0 if reward token price is invalid
23
+ return !priceRewardToken ? 0 : targetApr * priceRewardToken * 100;
24
+ }
25
+ if (!targetTokenPricing && rewardTokenPricing) {
26
+ // Case 3: Fixed $ amount of reward per # of liquidity
27
+ // Return 0 if target token price is invalid
28
+ return !priceTargetToken || priceTargetToken === 0 ? 0 : targetApr * (1 / priceTargetToken) * 100;
29
+ }
30
+ // Case 4: Fixed # amount of reward per # of liquidity
31
+ // Return 0 if either price is invalid
32
+ return !priceRewardToken || !priceTargetToken || priceTargetToken === 0
33
+ ? 0
34
+ : targetApr * (priceRewardToken / priceTargetToken) * 100;
35
+ }
@@ -334,6 +334,7 @@ declare const app: Elysia<"", false, {
334
334
  body: unknown;
335
335
  params: {};
336
336
  query: {
337
+ search?: string | undefined;
337
338
  name?: string | undefined;
338
339
  type?: string | undefined;
339
340
  status?: string | undefined;
@@ -534,6 +535,7 @@ declare const app: Elysia<"", false, {
534
535
  body: unknown;
535
536
  params: {};
536
537
  query: {
538
+ search?: string | undefined;
537
539
  name?: string | undefined;
538
540
  type?: string | undefined;
539
541
  status?: string | undefined;
@@ -1036,6 +1038,7 @@ declare const app: Elysia<"", false, {
1036
1038
  field: never;
1037
1039
  };
1038
1040
  query: {
1041
+ search?: string | undefined;
1039
1042
  name?: string | undefined;
1040
1043
  type?: string | undefined;
1041
1044
  status?: string | undefined;
@@ -1078,6 +1081,7 @@ declare const app: Elysia<"", false, {
1078
1081
  field: never;
1079
1082
  };
1080
1083
  query: {
1084
+ search?: string | undefined;
1081
1085
  name?: string | undefined;
1082
1086
  type?: string | undefined;
1083
1087
  status?: string | undefined;
@@ -1121,6 +1125,7 @@ declare const app: Elysia<"", false, {
1121
1125
  field: never;
1122
1126
  };
1123
1127
  query: {
1128
+ search?: string | undefined;
1124
1129
  name?: string | undefined;
1125
1130
  type?: string | undefined;
1126
1131
  status?: string | undefined;
@@ -5919,8 +5924,11 @@ declare const app: Elysia<"", false, {
5919
5924
  query: unknown;
5920
5925
  headers: unknown;
5921
5926
  response: {
5922
- [x: string]: any;
5923
- 200: any;
5927
+ 200: {
5928
+ [x: string]: {
5929
+ [poolId: string]: UniswapV4PoolType;
5930
+ } | undefined;
5931
+ } | null;
5924
5932
  };
5925
5933
  };
5926
5934
  };
@@ -5934,8 +5942,9 @@ declare const app: Elysia<"", false, {
5934
5942
  query: unknown;
5935
5943
  headers: unknown;
5936
5944
  response: {
5937
- [x: string]: any;
5938
- 200: any;
5945
+ 200: {
5946
+ [x: string]: any;
5947
+ } | undefined;
5939
5948
  };
5940
5949
  };
5941
5950
  };
@@ -189,6 +189,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
189
189
  body: unknown;
190
190
  params: {};
191
191
  query: {
192
+ search?: string | undefined;
192
193
  name?: string | undefined;
193
194
  type?: string | undefined;
194
195
  status?: string | undefined;
@@ -389,6 +390,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
389
390
  body: unknown;
390
391
  params: {};
391
392
  query: {
393
+ search?: string | undefined;
392
394
  name?: string | undefined;
393
395
  type?: string | undefined;
394
396
  status?: string | undefined;
@@ -891,6 +893,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
891
893
  field: never;
892
894
  };
893
895
  query: {
896
+ search?: string | undefined;
894
897
  name?: string | undefined;
895
898
  type?: string | undefined;
896
899
  status?: string | undefined;
@@ -933,6 +936,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
933
936
  field: never;
934
937
  };
935
938
  query: {
939
+ search?: string | undefined;
936
940
  name?: string | undefined;
937
941
  type?: string | undefined;
938
942
  status?: string | undefined;
@@ -976,6 +980,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
976
980
  field: never;
977
981
  };
978
982
  query: {
983
+ search?: string | undefined;
979
984
  name?: string | undefined;
980
985
  type?: string | undefined;
981
986
  status?: string | undefined;
@@ -293,6 +293,7 @@ export declare const AggregationResourceDto: import("@sinclair/typebox").TObject
293
293
  }>;
294
294
  export declare const GetOpportunitiesQueryDto: import("@sinclair/typebox").TObject<{
295
295
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
296
+ search: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
296
297
  campaignId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
297
298
  chainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
298
299
  action: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRegExp>;
@@ -52,6 +52,7 @@ export const AggregationResourceDto = t.Object({
52
52
  });
53
53
  export const GetOpportunitiesQueryDto = t.Object({
54
54
  name: t.Optional(t.String({ description: "Filter by name" })),
55
+ search: t.Optional(t.String({ description: "Search amongst multiple values (token, protocols, tags, campaigns)" })),
55
56
  campaignId: t.Optional(t.String({ description: "Search the opportunity linked to a given campaignId" })),
56
57
  //TODO: find a systemic way of handling query param arrays
57
58
  chainId: t.Optional(t.RegExp(/^\d+(,\d+)*$/, {
@@ -15,6 +15,7 @@ export class OpportunityRepository {
15
15
  const actions = query.action?.split(",");
16
16
  const status = query.status?.split(",");
17
17
  const tokens = query.tokens?.split(",");
18
+ const search = query.search?.split(" ");
18
19
  const rewardTokenSymbol = query.rewardTokenSymbol;
19
20
  const types = query.type?.split(",");
20
21
  const protocols = query.mainProtocolId?.split(",");
@@ -29,31 +30,57 @@ export class OpportunityRepository {
29
30
  return {
30
31
  orderBy,
31
32
  where: {
32
- tags: !filters.tags ? undefined : { has: filters.tags },
33
- type: !filters.type ? undefined : { in: types },
34
- tvl: filters.minimumTvl ? { gte: filters.minimumTvl } : undefined,
35
- chainId: !chainIds ? undefined : { in: chainIds },
36
- name: !filters.name ? undefined : { contains: filters.name, mode: "insensitive" },
37
- action: !actions ? undefined : { in: actions },
38
- status: !status ? undefined : { in: status },
39
- mainProtocolId: !protocols ? undefined : { in: protocols, mode: "insensitive" },
40
- identifier: !identifier ? undefined : { in: identifiers, mode: "insensitive" },
41
- Campaigns: test && !creatorAddress && !rewardTokenSymbol && !filters.campaignId
42
- ? undefined
43
- : {
44
- some: {
45
- campaignId: filters.campaignId ? filters.campaignId : undefined,
46
- RewardToken: test && !rewardTokenSymbol
47
- ? undefined
48
- : {
49
- isTest: !test ? false : undefined,
50
- isPoint: point,
51
- symbol: rewardTokenSymbol ? { equals: rewardTokenSymbol, mode: "insensitive" } : undefined,
33
+ AND: [
34
+ {
35
+ tags: !filters.tags ? undefined : { has: filters.tags },
36
+ type: !filters.type ? undefined : { in: types },
37
+ tvl: filters.minimumTvl ? { gte: filters.minimumTvl } : undefined,
38
+ chainId: !chainIds ? undefined : { in: chainIds },
39
+ name: !filters.name ? undefined : { contains: filters.name, mode: "insensitive" },
40
+ action: !actions ? undefined : { in: actions },
41
+ status: !status ? undefined : { in: status },
42
+ mainProtocolId: !protocols ? undefined : { in: protocols, mode: "insensitive" },
43
+ identifier: !identifier ? undefined : { in: identifiers, mode: "insensitive" },
44
+ Campaigns: test && !creatorAddress && !rewardTokenSymbol && !filters.campaignId
45
+ ? undefined
46
+ : {
47
+ some: {
48
+ campaignId: filters.campaignId ? filters.campaignId : undefined,
49
+ RewardToken: test && !rewardTokenSymbol
50
+ ? undefined
51
+ : {
52
+ isTest: !test ? false : undefined,
53
+ isPoint: point,
54
+ symbol: rewardTokenSymbol
55
+ ? { equals: rewardTokenSymbol, mode: "insensitive" }
56
+ : undefined,
57
+ },
58
+ creatorAddress: creatorAddress ? creatorAddress : undefined,
52
59
  },
53
- creatorAddress: creatorAddress ? creatorAddress : undefined,
54
- },
60
+ },
61
+ Tokens: { some: { symbol: { in: tokens } } },
55
62
  },
56
- Tokens: { some: { symbol: { in: tokens } } },
63
+ !search
64
+ ? {}
65
+ : {
66
+ AND: search?.map(keyword => ({
67
+ OR: [
68
+ { id: { contains: keyword, mode: "insensitive" } },
69
+ { name: { contains: keyword, mode: "insensitive" } },
70
+ { identifier: { contains: keyword, mode: "insensitive" } },
71
+ { explorerAddress: { contains: keyword, mode: "insensitive" } },
72
+ { type: { contains: keyword, mode: "insensitive" } },
73
+ { MainProtocol: { name: { contains: keyword, mode: "insensitive" } } },
74
+ { mainProtocolId: { contains: keyword, mode: "insensitive" } },
75
+ { Tokens: { some: { name: { contains: keyword, mode: "insensitive" } } } },
76
+ { Tokens: { some: { symbol: { contains: keyword, mode: "insensitive" } } } },
77
+ { Campaigns: { some: { campaignId: { contains: keyword, mode: "insensitive" } } } },
78
+ { Campaigns: { some: { id: { contains: keyword, mode: "insensitive" } } } },
79
+ { Chain: { name: { contains: keyword, mode: "insensitive" } } },
80
+ ],
81
+ })),
82
+ },
83
+ ],
57
84
  },
58
85
  };
59
86
  }
@@ -269,6 +296,7 @@ export class OpportunityRepository {
269
296
  const withPoints = query.point ?? false;
270
297
  const withCampaigns = query.campaigns ?? false;
271
298
  const args = OpportunityRepository.#transformQueryToPrismaFilters(query);
299
+ const search = query.search ?? undefined;
272
300
  return await apiDbClient.opportunity.findMany({
273
301
  take: items === 0 ? undefined : items,
274
302
  skip: page * items,
@@ -204,6 +204,7 @@ export declare const v4: Elysia<"/v4", false, {
204
204
  body: unknown;
205
205
  params: {};
206
206
  query: {
207
+ search?: string | undefined;
207
208
  name?: string | undefined;
208
209
  type?: string | undefined;
209
210
  status?: string | undefined;
@@ -404,6 +405,7 @@ export declare const v4: Elysia<"/v4", false, {
404
405
  body: unknown;
405
406
  params: {};
406
407
  query: {
408
+ search?: string | undefined;
407
409
  name?: string | undefined;
408
410
  type?: string | undefined;
409
411
  status?: string | undefined;
@@ -906,6 +908,7 @@ export declare const v4: Elysia<"/v4", false, {
906
908
  field: never;
907
909
  };
908
910
  query: {
911
+ search?: string | undefined;
909
912
  name?: string | undefined;
910
913
  type?: string | undefined;
911
914
  status?: string | undefined;
@@ -948,6 +951,7 @@ export declare const v4: Elysia<"/v4", false, {
948
951
  field: never;
949
952
  };
950
953
  query: {
954
+ search?: string | undefined;
951
955
  name?: string | undefined;
952
956
  type?: string | undefined;
953
957
  status?: string | undefined;
@@ -991,6 +995,7 @@ export declare const v4: Elysia<"/v4", false, {
991
995
  field: never;
992
996
  };
993
997
  query: {
998
+ search?: string | undefined;
994
999
  name?: string | undefined;
995
1000
  type?: string | undefined;
996
1001
  status?: string | undefined;
@@ -776,8 +776,11 @@ export declare const v3: Elysia<"/v3", false, {
776
776
  query: unknown;
777
777
  headers: unknown;
778
778
  response: {
779
- [x: string]: any;
780
- 200: any;
779
+ 200: {
780
+ [x: string]: {
781
+ [poolId: string]: UniswapV4PoolType;
782
+ } | undefined;
783
+ } | null;
781
784
  };
782
785
  };
783
786
  };
@@ -791,8 +794,9 @@ export declare const v3: Elysia<"/v3", false, {
791
794
  query: unknown;
792
795
  headers: unknown;
793
796
  response: {
794
- [x: string]: any;
795
- 200: any;
797
+ 200: {
798
+ [x: string]: any;
799
+ } | undefined;
796
800
  };
797
801
  };
798
802
  };