@merkl/api 0.17.3 → 0.17.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.
@@ -108,23 +108,23 @@ export class OpportunityConvertorService {
108
108
  : undefined,
109
109
  tags: opportunity.tags,
110
110
  rewardTokenIcons: opportunity.campaigns
111
- .map(campaign => campaign.rewardToken.symbol)
111
+ ?.map(campaign => campaign.rewardToken.symbol)
112
112
  .reduce((acc, curr) => {
113
113
  if (!acc.includes(curr))
114
114
  acc.push(curr);
115
115
  return acc;
116
- }, []),
116
+ }, []) ?? [],
117
117
  campaigns: {
118
118
  type: CampaignEnum[opportunity.type],
119
- ids: opportunity.campaigns.map(campaign => campaign.campaignId),
119
+ ids: opportunity.campaigns?.map(campaign => campaign.campaignId) ?? [],
120
120
  active: withCampaigns
121
121
  ? opportunity.campaigns
122
- .filter(campaign => campaign.startTimestamp < BigInt(now) && BigInt(now) < campaign.endTimestamp)
122
+ ?.filter(campaign => campaign.startTimestamp < BigInt(now) && BigInt(now) < campaign.endTimestamp)
123
123
  .map(campaign => OpportunityConvertorService.convertV4CampaignToV3(CampaignEnum[campaign.type], campaign, opportunity))
124
124
  : undefined,
125
125
  inactive: withCampaigns
126
126
  ? opportunity.campaigns
127
- .filter(campaign => !(campaign.startTimestamp < BigInt(now) && BigInt(now) < campaign.endTimestamp))
127
+ ?.filter(campaign => !(campaign.startTimestamp < BigInt(now) && BigInt(now) < campaign.endTimestamp))
128
128
  .map(campaign => OpportunityConvertorService.convertV4CampaignToV3(CampaignEnum[campaign.type], campaign, opportunity))
129
129
  : undefined,
130
130
  },
@@ -160,13 +160,13 @@ export class OpportunityConvertorService {
160
160
  return res;
161
161
  }
162
162
  static async setV3Opportunities(showCampaigns, test, identifier, chainId) {
163
- return await CacheService.set(TTLPresets.MIN_5, OpportunityConvertorService.#extractV3Opportunities, showCampaigns, test, identifier, chainId);
163
+ return await CacheService.set(TTLPresets.MIN_30, OpportunityConvertorService.#extractV3Opportunities, showCampaigns, test, identifier, chainId);
164
164
  }
165
165
  static async logKeyAndTTLV3Opportunities(showCampaigns, test, identifier, chainId) {
166
166
  const [key, ttl] = await CacheService.keyAndTTL(OpportunityConvertorService.#extractV3Opportunities, showCampaigns, test, identifier, chainId);
167
167
  log.info(`Args: ${showCampaigns}, ${test}, ${identifier}, ${chainId}, Key: ${key}, TTL: ${ttl}`);
168
168
  }
169
169
  static async wrapV3Opportunities(showCampaigns, test, identifier, chainId) {
170
- return await CacheService.wrap(TTLPresets.MIN_30, OpportunityConvertorService.#extractV3Opportunities, showCampaigns, test, identifier, chainId);
170
+ return await CacheService.wrap(TTLPresets.MIN_5, OpportunityConvertorService.#extractV3Opportunities, showCampaigns, test, identifier, chainId);
171
171
  }
172
172
  }
@@ -2036,8 +2036,17 @@ export declare const v4: Elysia<"/v4", false, {
2036
2036
  query: unknown;
2037
2037
  headers: unknown;
2038
2038
  response: {
2039
- [x: string]: any;
2040
- 200: any;
2039
+ 200: {
2040
+ name: string;
2041
+ id: number;
2042
+ icon: string;
2043
+ explorers: {
2044
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
2045
+ url: string;
2046
+ id: string;
2047
+ chainId: number;
2048
+ }[];
2049
+ } | null;
2041
2050
  };
2042
2051
  };
2043
2052
  };
@@ -2053,8 +2062,17 @@ export declare const v4: Elysia<"/v4", false, {
2053
2062
  };
2054
2063
  headers: unknown;
2055
2064
  response: {
2056
- [x: string]: any;
2057
- 200: any;
2065
+ 200: {
2066
+ name: string;
2067
+ id: number;
2068
+ icon: string;
2069
+ explorers: {
2070
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
2071
+ url: string;
2072
+ id: string;
2073
+ chainId: number;
2074
+ }[];
2075
+ }[];
2058
2076
  };
2059
2077
  };
2060
2078
  };
@@ -2070,8 +2088,7 @@ export declare const v4: Elysia<"/v4", false, {
2070
2088
  };
2071
2089
  headers: unknown;
2072
2090
  response: {
2073
- [x: string]: any;
2074
- 200: any;
2091
+ 200: number;
2075
2092
  };
2076
2093
  };
2077
2094
  };
@@ -2093,8 +2110,11 @@ export declare const v4: Elysia<"/v4", false, {
2093
2110
  authorization: string;
2094
2111
  };
2095
2112
  response: {
2096
- [x: string]: any;
2097
- 200: any;
2113
+ 200: {
2114
+ name: string;
2115
+ id: number;
2116
+ icon: string;
2117
+ };
2098
2118
  };
2099
2119
  };
2100
2120
  };
@@ -2116,8 +2136,14 @@ export declare const v4: Elysia<"/v4", false, {
2116
2136
  authorization: string;
2117
2137
  };
2118
2138
  response: {
2119
- [x: string]: any;
2120
- 200: any;
2139
+ 200: {
2140
+ Explorer: {
2141
+ type: import("../../../database/api/.generated").$Enums.ExplorerType;
2142
+ url: string;
2143
+ id: string;
2144
+ chainId: number;
2145
+ }[];
2146
+ };
2121
2147
  };
2122
2148
  };
2123
2149
  };
@@ -50,7 +50,9 @@ export class TokenRepository {
50
50
  { displaySymbol: { equals: query.displaySymbol, mode: "insensitive" } },
51
51
  ...ids,
52
52
  ]
53
- : [...ids],
53
+ : ids.length
54
+ ? [...ids]
55
+ : undefined,
54
56
  address: query.address ? { equals: query.address, mode: "insensitive" } : undefined,
55
57
  chainId: query.chainId ? { equals: query.chainId } : undefined,
56
58
  name: query.name ? { contains: query.name, mode: "insensitive" } : undefined,