@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.
@@ -20,8 +20,11 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
20
20
  query: unknown;
21
21
  headers: unknown;
22
22
  response: {
23
- [x: string]: any;
24
- 200: any;
23
+ 200: {
24
+ [x: string]: {
25
+ [poolId: string]: UniswapV4PoolType;
26
+ } | undefined;
27
+ } | null;
25
28
  };
26
29
  };
27
30
  };
@@ -35,8 +38,9 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
35
38
  query: unknown;
36
39
  headers: unknown;
37
40
  response: {
38
- [x: string]: any;
39
- 200: any;
41
+ 200: {
42
+ [x: string]: any;
43
+ } | undefined;
40
44
  };
41
45
  };
42
46
  };
@@ -1,16 +1,16 @@
1
- import { Redis } from "@/cache";
1
+ import { CacheService } from "@/modules/v4/cache";
2
2
  import { ChainUniqueDto } from "@/modules/v4/chain/chain.model";
3
- import { Bytes32Dto, UniV4ChainIdArray } from "@/modules/v4/uniswap/uniswap.model";
3
+ import { Bytes32Dto, UniV4ChainIdArray, } from "@/modules/v4/uniswap/uniswap.model";
4
4
  import { UniswapService } from "@/modules/v4/uniswap/uniswap.service";
5
5
  import { UnsupportedNetwork } from "@/utils/error";
6
6
  export default (app) => app.group("/uniswapv4", router => router
7
7
  .get("/", async () => {
8
- return await Redis.getOrSet("UniswapV4Pools", UniswapService.getUniswapV4Pools);
8
+ return await CacheService.get(UniswapService.getUniswapV4Pools, []);
9
9
  }, {
10
10
  tags: ["uniswapv4"],
11
11
  })
12
12
  .get("/:chainId", async ({ params }) => {
13
- return (await Redis.getOrSet("UniswapV4Pools", UniswapService.getUniswapV4Pools, params.chainId))[params.chainId];
13
+ return (await CacheService.get(UniswapService.getUniswapV4Pools, []))?.[params.chainId];
14
14
  }, {
15
15
  params: ChainUniqueDto,
16
16
  beforeHandle: ({ params }) => {
@@ -20,7 +20,7 @@ export default (app) => app.group("/uniswapv4", router => router
20
20
  tags: ["uniswapv4"],
21
21
  })
22
22
  .get("/pool/:poolId", async ({ params }) => {
23
- return Object.values((await Redis.getOrSet("UniswapV4Pools", UniswapService.getUniswapV4Pools)))
23
+ return Object.values((await CacheService.get(UniswapService.getUniswapV4Pools, [])))
24
24
  .flatMap(x => (x ? Object.values(x) : []))
25
25
  .filter(p => p.poolId === params.poolId);
26
26
  }, {