@merkl/api 0.20.67 → 0.20.68
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.
@@ -10,6 +10,8 @@ import { apiDbClient } from "@db";
|
|
10
10
|
import { Prisma } from "@db/api";
|
11
11
|
import { ChainInteractionService, DistributionCreatorService, NETWORK_LABELS, bigIntToNumber, } from "@sdk";
|
12
12
|
import { getAddress, parseUnits } from "viem";
|
13
|
+
import { CacheService } from "../cache";
|
14
|
+
import { TTLPresets } from "../cache/cache.model";
|
13
15
|
import { CoingeckoService } from "../coingecko/coingecko.service";
|
14
16
|
import { TokenRepository } from "./token.repository";
|
15
17
|
export class TokenService {
|
@@ -169,7 +171,7 @@ export class TokenService {
|
|
169
171
|
return priceToken;
|
170
172
|
}
|
171
173
|
static async findManyObjectPerAddress(query) {
|
172
|
-
return (await TokenService.findMany
|
174
|
+
return (await CacheService.wrap(TTLPresets.MIN_10, TokenService.findMany, query)).reduce((acc, token) => {
|
173
175
|
acc[token.address] = token;
|
174
176
|
return acc;
|
175
177
|
}, {});
|