@merkl/api 0.17.16 → 0.17.18
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 +76 -326
- package/dist/src/entities/opportunity.d.ts +3 -0
- package/dist/src/entities/opportunity.js +12 -4
- package/dist/src/errors/HttpError.d.ts +2 -2
- package/dist/src/index.d.ts +20 -74
- package/dist/src/jobs/etl/update-dynamic-data.js +2 -80
- package/dist/src/libs/campaigns/campaignTypes/MORPHODynamicData.js +2 -1
- package/dist/src/libs/getTokensList.d.ts +3 -0
- package/dist/src/libs/getTokensList.js +3 -1
- package/dist/src/libs/positions/clamm/thegraph/index.d.ts +3 -0
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +18 -0
- package/dist/src/modules/v4/campaign/campaign.controller.js +24 -0
- package/dist/src/modules/v4/campaign/campaign.repository.d.ts +16 -1
- package/dist/src/modules/v4/campaign/campaign.repository.js +2 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +16 -1
- package/dist/src/modules/v4/campaign/campaign.service.js +2 -2
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +0 -72
- package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +1 -16
- package/dist/src/modules/v4/dynamicData/dynamicData.service.d.ts +4 -9
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +77 -81
- package/dist/src/modules/v4/router.d.ts +18 -72
- package/dist/src/routes/v3/app.d.ts +3 -0
- package/dist/src/routes/v3/app.js +3 -1
- package/dist/src/routes/v3/campaign/delay.d.ts +3 -0
- package/dist/src/routes/v3/campaign/delay.js +3 -1
- package/dist/src/routes/v3/campaignUnclaimed.d.ts +3 -0
- package/dist/src/routes/v3/campaignUnclaimed.js +3 -1
- package/dist/src/routes/v3/campaigns.d.ts +1 -1
- package/dist/src/routes/v3/campaignsForMainParameter.d.ts +3 -0
- package/dist/src/routes/v3/campaignsRewardsReport.d.ts +3 -0
- package/dist/src/routes/v3/campaignsRewardsReport.js +3 -1
- package/dist/src/routes/v3/recipients.d.ts +3 -0
- package/dist/src/routes/v3/recipients.js +3 -1
- package/dist/src/routes/v3/rewards.d.ts +3 -0
- package/dist/src/routes/v3/rewards.js +3 -1
- package/dist/src/routes/v3/rewardsReport.d.ts +3 -0
- package/dist/src/routes/v3/rewardsReport.js +3 -1
- package/dist/src/routes/v3/router.d.ts +2 -2
- package/dist/src/routes/v3/updates.d.ts +3 -0
- package/dist/src/routes/v3/userRewards.d.ts +5 -2
- package/dist/src/routes/v3/userRewards.js +4 -3
- package/dist/src/utils/prices/priceService.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -1,12 +1,15 @@
|
|
1
|
+
import { HttpError } from "../../../errors";
|
1
2
|
import { campaignsDynamicData } from "../../../libs/campaigns/campaignsDynamicData";
|
2
|
-
// import { campaignsDynamicData } from "../../../libs/campaigns/campaignsDynamicData";
|
3
|
-
import { CampaignRepository } from "../campaign/campaign.repository";
|
4
|
-
import { CampaignService } from "../campaign/campaign.service";
|
5
3
|
import { OpportunityService } from "../opportunity/opportunity.service";
|
4
|
+
import bigintToString from "../../../utils/bigintToString";
|
6
5
|
import { executeSimple } from "../../../utils/execute";
|
7
6
|
import { log } from "../../../utils/logger";
|
8
7
|
import { Campaign, NETWORK_LABELS } from "@sdk";
|
9
|
-
import {
|
8
|
+
import { Campaign as CampaignEnum } from "@sdk";
|
9
|
+
import { AprService } from "../apr";
|
10
|
+
import { OpportunityRepository } from "../opportunity/opportunity.repository";
|
11
|
+
import { RewardService } from "../reward";
|
12
|
+
import { TvlService } from "../tvl";
|
10
13
|
export class DynamicDataService {
|
11
14
|
static async queryERC20DynamicData(chainId, tokenAddress, decimals = 18) {
|
12
15
|
const campaigns = [
|
@@ -50,88 +53,81 @@ export class DynamicDataService {
|
|
50
53
|
type: result[0]?.type ?? "defaultType",
|
51
54
|
};
|
52
55
|
}
|
53
|
-
static
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
campaignId: campaign.id ? campaign.id : "0xdefaultid",
|
68
|
-
opportunityIdentifier: "0xdefaultopportunityid",
|
69
|
-
id: campaign.id ? campaign.id : "0xdefaultid",
|
70
|
-
distributionChainId: campaign.distributionChainId ? campaign.distributionChainId : 1,
|
71
|
-
rewardTokenId: campaign.rewardTokenId ? campaign.rewardTokenId : "0xdefaultrewardtokenid",
|
72
|
-
opportunityId: campaign.opportunityId ? campaign.opportunityId : "0xdefaultopportunityid",
|
73
|
-
identifier: campaign.identifier ? campaign.identifier : "defaultidentifier",
|
74
|
-
mainParameter: DynamicDataService.generateMainParameter(campaign),
|
75
|
-
};
|
76
|
-
return campaignParameters;
|
77
|
-
}
|
78
|
-
static generateMainParameter(campaign) {
|
79
|
-
let targetToken;
|
80
|
-
let parsedParams;
|
81
|
-
if (campaign.type === "CLAMM") {
|
82
|
-
parsedParams = campaign.params;
|
83
|
-
targetToken = parsedParams.poolAddress;
|
84
|
-
}
|
85
|
-
else if (campaign.type === Campaign[Campaign.AMBIENTPROCESSOR]) {
|
86
|
-
parsedParams = campaign.params;
|
87
|
-
targetToken = parsedParams.poolId;
|
88
|
-
}
|
89
|
-
else if (campaign.type === Campaign[Campaign.UNISWAP_V4]) {
|
90
|
-
parsedParams = campaign.params;
|
91
|
-
targetToken = `0x${parsedParams.poolId.slice(-40)}`;
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
parsedParams = campaign.params;
|
95
|
-
targetToken = parsedParams.targetToken;
|
56
|
+
static async updateForCampaignType(campaigns, type) {
|
57
|
+
const chainId = campaigns[0].computeChainId;
|
58
|
+
const dynamicDataArray = [];
|
59
|
+
const dynamicData = await executeSimple(chainId, campaignsDynamicData(chainId, campaigns, type));
|
60
|
+
const oppMap = {};
|
61
|
+
for (const data of dynamicData) {
|
62
|
+
if (!!data) {
|
63
|
+
// Main Parameter OVERRIDING
|
64
|
+
if (data.campaignType === CampaignEnum.SILO && data.campaignParameters.whitelist?.length === 1)
|
65
|
+
data.mainParameter = `${data.mainParameter}-${data.campaignParameters.whitelist[0]}`;
|
66
|
+
if (!oppMap[`${data.campaignType}_${data.mainParameter}`])
|
67
|
+
oppMap[`${data.campaignType}_${data.mainParameter}`] = {};
|
68
|
+
oppMap[`${data.campaignType}_${data.mainParameter}`][data.campaignId] = data;
|
69
|
+
}
|
96
70
|
}
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
71
|
+
for (const entry of Object.entries(oppMap)) {
|
72
|
+
const [type, mainParameter] = entry[0].split("_");
|
73
|
+
const apr = AprService.extractFromDynamicData(+type, Object.values(entry[1]));
|
74
|
+
const tvl = TvlService.extractFromDynamicData(+type, Object.values(entry[1]));
|
75
|
+
const dailyRewards = await RewardService.extractDailyRewardsRecordFromDynamicData(+type, Object.values(entry[1]));
|
76
|
+
const opportunityId = OpportunityService.hashId({
|
77
|
+
chainId,
|
78
|
+
identifier: mainParameter,
|
79
|
+
type: Campaign[+type],
|
80
|
+
});
|
81
|
+
try {
|
82
|
+
await OpportunityRepository.updateRecords(opportunityId, apr, tvl, dailyRewards);
|
83
|
+
}
|
84
|
+
catch (err) {
|
85
|
+
throw new HttpError("Failed to update dynamic data", 500, {
|
86
|
+
err,
|
87
|
+
opportunityId,
|
88
|
+
campaigns: Object.values(entry[1]),
|
89
|
+
dynamicData: bigintToString({
|
90
|
+
campaignId: Object.values(entry[1])[0].campaignId,
|
91
|
+
apr,
|
92
|
+
tvl,
|
93
|
+
dailyRewards,
|
94
|
+
}),
|
95
|
+
});
|
96
|
+
}
|
97
|
+
dynamicDataArray.push(bigintToString({ campaignId: Object.values(entry[1])[0].campaignId, apr, tvl, dailyRewards }));
|
101
98
|
}
|
102
|
-
return
|
103
|
-
}
|
104
|
-
static async queryDynamicData(campaign) {
|
105
|
-
const campaignParameters = DynamicDataService.generateDummyData(campaign);
|
106
|
-
return await DynamicDataService.#getMultipleDynamicData([campaignParameters]);
|
107
|
-
}
|
108
|
-
static async queryDynamicDataFromCampaignId(query) {
|
109
|
-
const campaigns = await CampaignRepository.findMany(query);
|
110
|
-
const campaign = campaigns[0];
|
111
|
-
return DynamicDataService.queryDynamicData(CampaignService.format(campaign));
|
99
|
+
return dynamicDataArray;
|
112
100
|
}
|
113
|
-
static async
|
114
|
-
const
|
115
|
-
const
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
101
|
+
static async updateForCampaigns(campaigns) {
|
102
|
+
const campaignTypeToCampaigns = new Map();
|
103
|
+
for (const campaign of campaigns) {
|
104
|
+
const type = campaign.campaignType;
|
105
|
+
let campaigns = campaignTypeToCampaigns.get(campaign.campaignType);
|
106
|
+
if (!campaigns)
|
107
|
+
campaigns = [campaign];
|
108
|
+
else
|
109
|
+
campaigns.push(campaign);
|
110
|
+
campaignTypeToCampaigns.set(type, campaigns);
|
111
|
+
}
|
112
|
+
const dynamicDataArray = [];
|
113
|
+
for (const [campaignType, campaigns] of campaignTypeToCampaigns.entries()) {
|
114
|
+
try {
|
115
|
+
log.info(`updating dynamic data for ${campaigns.length} campaigns of type ${CampaignEnum[campaignType]}`);
|
116
|
+
try {
|
117
|
+
dynamicDataArray.push(await DynamicDataService.updateForCampaignType(campaigns, campaignType));
|
118
|
+
}
|
119
|
+
catch (err) {
|
120
|
+
console.error(`Failed to update dynamic data for campaign type ${CampaignEnum[campaignType]}`, err);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
catch (err) {
|
124
|
+
throw new HttpError(`Failed to update dynamic data for campaign type ${CampaignEnum[campaignType]}`, 500, {
|
125
|
+
err: err,
|
126
|
+
campaigns: campaigns,
|
131
127
|
});
|
132
|
-
result.push({ ...resultDynamicData.find(data => data.campaignId === campaign.campaignId), ...resultMetaData });
|
133
128
|
}
|
129
|
+
// 2. Call updateDynamicData with each entries of the map (process by campaign type)
|
134
130
|
}
|
135
|
-
return
|
131
|
+
return dynamicDataArray.flat();
|
136
132
|
}
|
137
133
|
}
|
@@ -1015,6 +1015,24 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1015
1015
|
};
|
1016
1016
|
};
|
1017
1017
|
};
|
1018
|
+
} & {
|
1019
|
+
":campaignId": {
|
1020
|
+
"dynamic-data": {
|
1021
|
+
put: {
|
1022
|
+
body: unknown;
|
1023
|
+
params: {
|
1024
|
+
campaignId: string;
|
1025
|
+
};
|
1026
|
+
query: unknown;
|
1027
|
+
headers: {
|
1028
|
+
authorization: string;
|
1029
|
+
};
|
1030
|
+
response: {
|
1031
|
+
200: unknown[];
|
1032
|
+
};
|
1033
|
+
};
|
1034
|
+
};
|
1035
|
+
};
|
1018
1036
|
} & {
|
1019
1037
|
index: {
|
1020
1038
|
get: {
|
@@ -3183,78 +3201,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
3183
3201
|
};
|
3184
3202
|
};
|
3185
3203
|
};
|
3186
|
-
} & {
|
3187
|
-
"dynamic-data": {
|
3188
|
-
"from-config": {
|
3189
|
-
post: {
|
3190
|
-
body: {
|
3191
|
-
id?: string | undefined;
|
3192
|
-
tags?: string[] | undefined;
|
3193
|
-
identifier?: string | undefined;
|
3194
|
-
subType?: number | undefined;
|
3195
|
-
chain?: {} | undefined;
|
3196
|
-
chainId?: number | undefined;
|
3197
|
-
startTimestamp?: string | undefined;
|
3198
|
-
endTimestamp?: string | undefined;
|
3199
|
-
distributionChainId?: number | undefined;
|
3200
|
-
campaignId?: string | undefined;
|
3201
|
-
rewardTokenId?: string | undefined;
|
3202
|
-
amount?: string | undefined;
|
3203
|
-
opportunityId?: string | undefined;
|
3204
|
-
creatorAddress?: string | undefined;
|
3205
|
-
campaignStatus?: {} | undefined;
|
3206
|
-
rewardToken?: {} | undefined;
|
3207
|
-
rewardTokenAddress?: string | undefined;
|
3208
|
-
distributionChain?: {} | undefined;
|
3209
|
-
opportunityIdentifier?: string | undefined;
|
3210
|
-
type: string;
|
3211
|
-
params: {};
|
3212
|
-
computeChainId: number;
|
3213
|
-
};
|
3214
|
-
params: {};
|
3215
|
-
query: unknown;
|
3216
|
-
headers: {
|
3217
|
-
authorization: string;
|
3218
|
-
};
|
3219
|
-
response: {
|
3220
|
-
200: any[];
|
3221
|
-
};
|
3222
|
-
};
|
3223
|
-
};
|
3224
|
-
};
|
3225
|
-
} & {
|
3226
|
-
"dynamic-data": {
|
3227
|
-
"from-existing": {
|
3228
|
-
get: {
|
3229
|
-
body: unknown;
|
3230
|
-
params: {};
|
3231
|
-
query: {
|
3232
|
-
type?: string | undefined;
|
3233
|
-
items?: number | undefined;
|
3234
|
-
subType?: number | undefined;
|
3235
|
-
page?: number | undefined;
|
3236
|
-
chainId?: number | undefined;
|
3237
|
-
startTimestamp?: string | undefined;
|
3238
|
-
endTimestamp?: string | undefined;
|
3239
|
-
tokenAddress?: string | undefined;
|
3240
|
-
campaignId?: string | undefined;
|
3241
|
-
opportunityId?: string | undefined;
|
3242
|
-
creatorAddress?: string | undefined;
|
3243
|
-
creatorId?: string | undefined;
|
3244
|
-
mainParameter?: string | undefined;
|
3245
|
-
test?: boolean | undefined;
|
3246
|
-
creatorTag?: string | undefined;
|
3247
|
-
tokenSymbol?: string | undefined;
|
3248
|
-
};
|
3249
|
-
headers: {
|
3250
|
-
authorization: string;
|
3251
|
-
};
|
3252
|
-
response: {
|
3253
|
-
200: any[];
|
3254
|
-
};
|
3255
|
-
};
|
3256
|
-
};
|
3257
|
-
};
|
3258
3204
|
};
|
3259
3205
|
} & {
|
3260
3206
|
v4: {
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import type Elysia from "elysia";
|
2
|
+
/**
|
3
|
+
* @deprecated - can be removed once old apps are not in used anymore
|
4
|
+
*/
|
2
5
|
export declare const response: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
3
6
|
rate: import("@sinclair/typebox").TNumber;
|
4
7
|
token: import("@sinclair/typebox").TString;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { getTokensListWithCache } from "../../libs/getTokensList";
|
2
2
|
import { Pricer } from "../../utils/pricer";
|
3
3
|
import { t } from "elysia";
|
4
|
-
|
4
|
+
/**
|
5
|
+
* @deprecated - can be removed once old apps are not in used anymore
|
6
|
+
*/
|
5
7
|
export const response = t.Array(t.Object({ rate: t.Number(), token: t.String() }));
|
6
8
|
export default (app) => app.get("/app", async () => {
|
7
9
|
const json = {};
|
@@ -4,7 +4,9 @@ import { engineDbClient } from "../../../utils/prisma";
|
|
4
4
|
import { ChainId, isSupportedChain } from "@sdk";
|
5
5
|
import { t } from "elysia";
|
6
6
|
import moment from "moment";
|
7
|
-
|
7
|
+
/**
|
8
|
+
* @deprecated - to remove in favor of new status page
|
9
|
+
*/
|
8
10
|
export const query = t.Object({
|
9
11
|
onlyLive: t.Optional(t.Boolean()),
|
10
12
|
});
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { RewardService } from "../../modules/v4/reward";
|
2
2
|
import { t } from "elysia";
|
3
3
|
import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
|
4
|
-
|
4
|
+
/**
|
5
|
+
* @deprecated - conversion to v4 done
|
6
|
+
*/
|
5
7
|
export const query = t.Object({
|
6
8
|
campaignIds: t.String(),
|
7
9
|
chainId: t.Numeric(),
|
@@ -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
|
-
live?: boolean | undefined;
|
31
30
|
creatorTag?: string | undefined;
|
31
|
+
live?: boolean | undefined;
|
32
32
|
hideTestTokens?: string | undefined;
|
33
33
|
};
|
34
34
|
headers: unknown;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import { type Elysia } from "elysia";
|
2
|
+
/**
|
3
|
+
* @deprecated - conversion to v4 done
|
4
|
+
*/
|
2
5
|
export declare const query: import("@sinclair/typebox").TObject<{
|
3
6
|
chain_campaignIds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTemplateLiteral<[import("@sinclair/typebox").TUnion<import("elysia").TSchema[]>, import("@sinclair/typebox").TLiteral<"_">, import("@sinclair/typebox").TString]>>;
|
4
7
|
from: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
@@ -2,7 +2,9 @@ import { RewardService } from "../../modules/v4/reward";
|
|
2
2
|
import { t } from "elysia";
|
3
3
|
import { ChainCampaignId } from "../../types/parameters/ChainCampaignId";
|
4
4
|
import { Timestamp } from "../../types/parameters/Timestamp";
|
5
|
-
|
5
|
+
/**
|
6
|
+
* @deprecated - conversion to v4 done
|
7
|
+
*/
|
6
8
|
export const query = t.Object({
|
7
9
|
chain_campaignIds: t.Array(ChainCampaignId.type, {
|
8
10
|
style: "pipeDelimited",
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { RewardService } from "../../modules/v4/reward";
|
2
2
|
import { t } from "elysia";
|
3
3
|
import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
|
4
|
-
|
4
|
+
/**
|
5
|
+
* @deprecated - conversion to v4 done
|
6
|
+
*/
|
5
7
|
export default (app) => app.use(checkQueryChainIdValidity()).get("/recipients", async ({ query }) => {
|
6
8
|
const campaignId = query.campaignId;
|
7
9
|
const chainId = query.chainId;
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import type Elysia from "elysia";
|
2
|
+
/**
|
3
|
+
* @deprecated - conversion to v4 done
|
4
|
+
*/
|
2
5
|
export declare const query: import("@sinclair/typebox").TObject<{
|
3
6
|
chainIds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>]>>;
|
4
7
|
user: import("@sinclair/typebox").TString;
|
@@ -3,7 +3,9 @@ import { RewardConvertorService } from "../../modules/v4/reward/reward.converter
|
|
3
3
|
import { ChainId, isSupportedChain } from "@sdk";
|
4
4
|
import { t } from "elysia";
|
5
5
|
import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
|
6
|
-
|
6
|
+
/**
|
7
|
+
* @deprecated - conversion to v4 done
|
8
|
+
*/
|
7
9
|
export const query = t.Object({
|
8
10
|
chainIds: t.Optional(t.Union([t.String(), t.Array(t.String())])),
|
9
11
|
user: t.String(),
|
@@ -2,7 +2,9 @@ import { RewardService } from "../../modules/v4/reward";
|
|
2
2
|
import { t } from "elysia";
|
3
3
|
import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
|
4
4
|
import { InvalidParameter } from "../../utils/error";
|
5
|
-
|
5
|
+
/**
|
6
|
+
* @deprecated - conversion to v4 done
|
7
|
+
*/
|
6
8
|
export const query = t.Object({
|
7
9
|
campaignId: t.String(),
|
8
10
|
chainId: t.Numeric(),
|
@@ -73,8 +73,8 @@ export declare const v3: Elysia<"/v3", false, {
|
|
73
73
|
query: {
|
74
74
|
types?: string | number | string[] | number[] | undefined;
|
75
75
|
chainIds?: string | string[] | undefined;
|
76
|
-
live?: boolean | undefined;
|
77
76
|
creatorTag?: string | undefined;
|
77
|
+
live?: boolean | undefined;
|
78
78
|
hideTestTokens?: string | undefined;
|
79
79
|
};
|
80
80
|
headers: unknown;
|
@@ -703,7 +703,7 @@ export declare const v3: Elysia<"/v3", false, {
|
|
703
703
|
proof?: string | undefined;
|
704
704
|
mainParameter?: string | undefined;
|
705
705
|
reloadChainId?: number | undefined;
|
706
|
-
chainId:
|
706
|
+
chainId: number;
|
707
707
|
user: string;
|
708
708
|
};
|
709
709
|
headers: unknown;
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import type Elysia from "elysia";
|
2
|
+
/**
|
3
|
+
* @deprecated - conversion to v4 done
|
4
|
+
*/
|
2
5
|
export declare const query: import("@sinclair/typebox").TObject<{
|
3
|
-
chainId: import("@sinclair/typebox").
|
6
|
+
chainId: import("@sinclair/typebox").TNumber;
|
4
7
|
reloadChainId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
5
8
|
mainParameter: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
6
9
|
proof: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
@@ -29,7 +32,7 @@ declare const _default: (app: Elysia) => Elysia<"", false, {
|
|
29
32
|
proof?: string | undefined;
|
30
33
|
mainParameter?: string | undefined;
|
31
34
|
reloadChainId?: number | undefined;
|
32
|
-
chainId:
|
35
|
+
chainId: number;
|
33
36
|
user: string;
|
34
37
|
};
|
35
38
|
headers: unknown;
|
@@ -1,15 +1,16 @@
|
|
1
1
|
import checkQueryAddressValidity from "../../hooks/checkQueryAddressValidity";
|
2
2
|
import { RewardService, UserRewardV3Dto } from "../../modules/v4/reward";
|
3
3
|
import { RewardConvertorService } from "../../modules/v4/reward/reward.converter";
|
4
|
-
import param from "../../types/parameters";
|
5
4
|
import { InvalidParameter } from "../../utils/error";
|
6
5
|
import { throwOnUnsupportedChainId } from "../../utils/throw";
|
7
6
|
import { t } from "elysia";
|
8
7
|
import { utils } from "ethers";
|
9
8
|
import checkQueryChainIdValidity from "../../hooks/checkQueryChainIdValidity";
|
10
|
-
|
9
|
+
/**
|
10
|
+
* @deprecated - conversion to v4 done
|
11
|
+
*/
|
11
12
|
export const query = t.Object({
|
12
|
-
chainId:
|
13
|
+
chainId: t.Number(),
|
13
14
|
reloadChainId: t.Optional(t.Number()),
|
14
15
|
mainParameter: t.Optional(t.String()),
|
15
16
|
proof: t.Optional(t.String()),
|
@@ -263,7 +263,9 @@ export default class PriceService {
|
|
263
263
|
this._prices[`r${xUpper}`] = this._prices[x];
|
264
264
|
this._prices[`variableDebt${xUpper}`] = this._prices[x];
|
265
265
|
}
|
266
|
-
/**
|
266
|
+
/**
|
267
|
+
* @deprecated - Fill all BorrowStaker prices
|
268
|
+
*/
|
267
269
|
const tokens = await getTokensListWithCache();
|
268
270
|
for (const chainIdString of Object.keys(tokens)) {
|
269
271
|
const chainId = Number.parseInt(chainIdString);
|