@merkl/api 0.10.342 → 0.10.344
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.
- package/dist/src/eden/index.d.ts +122 -6
- package/dist/src/index.d.ts +50 -2
- package/dist/src/libs/campaigns/campaignsDynamicData.js +3 -7
- package/dist/src/modules/v4/boost/boost.controller.d.ts +17 -0
- package/dist/src/modules/v4/boost/boost.controller.js +3 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +2 -2
- package/dist/src/modules/v4/router.d.ts +49 -1
- package/dist/src/modules/v4/token/token.controller.d.ts +31 -0
- package/dist/src/modules/v4/token/token.controller.js +6 -0
- package/dist/src/modules/v4/token/token.repository.d.ts +13 -0
- package/dist/src/modules/v4/token/token.repository.js +11 -0
- package/dist/src/modules/v4/token/token.service.d.ts +14 -0
- package/dist/src/modules/v4/token/token.service.js +17 -2
- package/dist/src/routes/v3/campaigns.d.ts +1 -1
- package/dist/src/routes/v3/router.d.ts +1 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -3,8 +3,10 @@ import { getOnlyUserBalance } from "../../../libs/tokens/balances";
|
|
3
3
|
import { log } from "../../../utils/logger";
|
4
4
|
import { apiDbClient } from "../../../utils/prisma";
|
5
5
|
import { Prisma } from "../../../../database/api/.generated";
|
6
|
-
import { NETWORK_LABELS, bigIntToNumber } from "@sdk";
|
7
|
-
import { parseUnits } from "viem";
|
6
|
+
import { DistributionCreatorService, NETWORK_LABELS, bigIntToNumber } from "@sdk";
|
7
|
+
import { getAddress, parseUnits } from "viem";
|
8
|
+
import { CacheService } from "../cache";
|
9
|
+
import { TTLPresets } from "../cache/cache.model";
|
8
10
|
import { TokenRepository } from "./token.repository";
|
9
11
|
export class TokenService {
|
10
12
|
static hashId(token) {
|
@@ -283,6 +285,19 @@ export class TokenService {
|
|
283
285
|
}
|
284
286
|
}));
|
285
287
|
}
|
288
|
+
static async getValidRewardTokens(chainId) {
|
289
|
+
return await CacheService.wrap(TTLPresets.MIN_5, async (chainId) => {
|
290
|
+
const validRewardTokens = await DistributionCreatorService(chainId).validRewardTokens();
|
291
|
+
return (await TokenRepository.findList(chainId, validRewardTokens.map(t => getAddress(t.token)))).map(x => {
|
292
|
+
return {
|
293
|
+
...x,
|
294
|
+
minimumAmountPerHour: validRewardTokens
|
295
|
+
.find(t => getAddress(t.token) === x.address)
|
296
|
+
?.minimumAmountPerEpoch.toString(),
|
297
|
+
};
|
298
|
+
});
|
299
|
+
}, chainId);
|
300
|
+
}
|
286
301
|
static async update(id, data) {
|
287
302
|
// let iconUri = data.icon;
|
288
303
|
// if (data.iconFile) {
|
@@ -27,8 +27,8 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
|
|
27
27
|
query: {
|
28
28
|
types?: string | number | string[] | number[] | undefined;
|
29
29
|
chainIds?: string | string[] | undefined;
|
30
|
-
creatorTag?: string | undefined;
|
31
30
|
live?: boolean | undefined;
|
31
|
+
creatorTag?: string | undefined;
|
32
32
|
hideTestTokens?: string | undefined;
|
33
33
|
};
|
34
34
|
headers: unknown;
|
@@ -88,8 +88,8 @@ export declare const v3: Elysia<"/v3", false, {
|
|
88
88
|
query: {
|
89
89
|
types?: string | number | string[] | number[] | undefined;
|
90
90
|
chainIds?: string | string[] | undefined;
|
91
|
-
creatorTag?: string | undefined;
|
92
91
|
live?: boolean | undefined;
|
92
|
+
creatorTag?: string | undefined;
|
93
93
|
hideTestTokens?: string | undefined;
|
94
94
|
};
|
95
95
|
headers: unknown;
|