@merkl/api 0.20.100 → 0.20.101
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/engine/erc20SubTypeProcessors/GenericProcessor.js +0 -3
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +7 -5
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/utils/generateIcons.d.ts +0 -3
- package/dist/src/utils/generateIcons.js +0 -65
@@ -2,7 +2,6 @@ import { TokenService } from "@/modules/v4/token/token.service";
|
|
2
2
|
import { decodeCall } from "@/utils/decodeCalls";
|
3
3
|
import { createCall } from "@/utils/encodeCalls";
|
4
4
|
import { generateCardName } from "@/utils/generateCardName";
|
5
|
-
import { generateIcons } from "@/utils/generateIcons";
|
6
5
|
import { BN2Number } from "@sdk";
|
7
6
|
import { tokenTypeToProtocolAndAction } from "./helpers/tokenType";
|
8
7
|
export var Round;
|
@@ -186,7 +185,6 @@ export class GenericProcessor {
|
|
186
185
|
calls: [],
|
187
186
|
typeInfo: {
|
188
187
|
...outputInfo,
|
189
|
-
icons: generateIcons(type, typeInfo, campaign),
|
190
188
|
},
|
191
189
|
});
|
192
190
|
}
|
@@ -195,7 +193,6 @@ export class GenericProcessor {
|
|
195
193
|
calls: [],
|
196
194
|
typeInfo: {
|
197
195
|
...outputInfo,
|
198
|
-
icons: generateIcons(type, typeInfo, campaign),
|
199
196
|
},
|
200
197
|
};
|
201
198
|
}
|
@@ -78,13 +78,13 @@ export class DynamicDataService {
|
|
78
78
|
const dailyAmount = isWithinTimespan ? BigInt(record.campaign.amount) / BigInt(dayspan) : BigInt(0);
|
79
79
|
let token;
|
80
80
|
try {
|
81
|
-
token = await TokenService.findUniqueOrThrow({ address: rewardToken, chainId });
|
81
|
+
token = await TokenService.findUniqueOrThrow({ address: rewardToken, chainId: record.campaign.chainId });
|
82
82
|
}
|
83
83
|
catch {
|
84
|
-
await TokenService.findManyOrCreate([{ address: rewardToken, chainId }]);
|
85
|
-
token = await TokenService.findUniqueOrThrow({ address: rewardToken, chainId });
|
84
|
+
await TokenService.findManyOrCreate([{ address: rewardToken, chainId: record.campaign.chainId }]);
|
85
|
+
token = await TokenService.findUniqueOrThrow({ address: rewardToken, chainId: record.campaign.chainId });
|
86
86
|
}
|
87
|
-
const campaignDailyValue = await TokenService.getValueByTokenId(TokenService.hashId({ address: rewardToken, chainId }), dailyAmount);
|
87
|
+
const campaignDailyValue = await TokenService.getValueByTokenId(TokenService.hashId({ address: rewardToken, chainId: record.campaign.chainId }), dailyAmount);
|
88
88
|
dailyRewards.total += campaignDailyValue;
|
89
89
|
if (campaignDailyValue > 0) {
|
90
90
|
dailyRewards.breakdowns.push({
|
@@ -106,6 +106,8 @@ export class DynamicDataService {
|
|
106
106
|
else {
|
107
107
|
aprCampaignValue = (campaignDailyValue * 365 * 100) / record.tvl;
|
108
108
|
}
|
109
|
+
if (aprCampaignValue === Number.POSITIVE_INFINITY)
|
110
|
+
aprCampaignValue = 10_001;
|
109
111
|
if (aprCampaignValue > 0) {
|
110
112
|
apr.cumulated += aprCampaignValue;
|
111
113
|
apr.breakdowns.push({
|
@@ -116,7 +118,7 @@ export class DynamicDataService {
|
|
116
118
|
}
|
117
119
|
}
|
118
120
|
catch (_err) {
|
119
|
-
log.
|
121
|
+
log.error("failed to calculate daily rewards", _err);
|
120
122
|
}
|
121
123
|
}
|
122
124
|
updates.push({
|