@merkl/api 0.10.275 → 0.10.277
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/entities/opportunity.js +1 -2
- package/dist/src/libs/positions/prepareFetch.js +0 -2
- package/dist/src/modules/v4/campaign/campaign.service.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.js +2 -2
- package/dist/src/modules/v4/reward/reward.model.d.ts +1 -0
- package/dist/src/modules/v4/reward/reward.repository.js +5 -3
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- /package/dist/src/modules/v4/opportunity/subservices/{getVestMetaData.d.ts → getVestMetaData.service.d.ts} +0 -0
- /package/dist/src/modules/v4/opportunity/subservices/{getVestMetaData.js → getVestMetaData.service.js} +0 -0
@@ -191,10 +191,9 @@ export const extractOpportunities = {
|
|
191
191
|
};
|
192
192
|
return opportunity;
|
193
193
|
},
|
194
|
-
[Campaign.ERC20]: (campaign, campaigns, prices) => {
|
194
|
+
[Campaign.ERC20 | Campaign.ERC20LOGPROCESSOR | Campaign.ERC20REBASELOGPROCESSOR]: (campaign, campaigns, prices) => {
|
195
195
|
const { chainId, tvl, campaignParameters: params, typeInfo, computeChainId, mainParameter } = campaign;
|
196
196
|
const { active, all } = campaigns;
|
197
|
-
// DEPRECATED!!!!
|
198
197
|
const map = {
|
199
198
|
actions: {
|
200
199
|
pool: [
|
@@ -385,8 +385,6 @@ campaign //FIXME
|
|
385
385
|
return prepareCompoundFetch(previous, campaign);
|
386
386
|
case Campaign.EIGENLAYER:
|
387
387
|
return prepareEigenLayerFetch(previous, campaign);
|
388
|
-
case Campaign.VEST:
|
389
|
-
return prepareEigenLayerFetch(previous, campaign);
|
390
388
|
default:
|
391
389
|
return previous;
|
392
390
|
}
|
@@ -137,7 +137,7 @@ export class CampaignService {
|
|
137
137
|
*/
|
138
138
|
static splitOnStatus(campaigns, timestamp = moment().unix()) {
|
139
139
|
const past = campaigns.filter(({ endTimestamp: end }) => end <= timestamp);
|
140
|
-
const live = campaigns.filter(({ startTimestamp: start, endTimestamp: end }) =>
|
140
|
+
const live = campaigns.filter(({ startTimestamp: start, endTimestamp: end }) => timestamp >= start && timestamp < end);
|
141
141
|
const soon = campaigns.filter(({ startTimestamp: start }) => start > timestamp);
|
142
142
|
return { past, live, soon };
|
143
143
|
}
|
@@ -22,7 +22,7 @@ import { getJsonAirdropMetadata } from "./subservices/getJsonAirDropMetadata.ser
|
|
22
22
|
import { getMorphoMetadata } from "./subservices/getMorphoMetadata.service";
|
23
23
|
import { getRadiantMetadata } from "./subservices/getRadiantMetadata.service";
|
24
24
|
import { getSiloMetadata } from "./subservices/getSiloMetadata.service";
|
25
|
-
import { getVestMetaData } from "./subservices/getVestMetaData";
|
25
|
+
import { getVestMetaData } from "./subservices/getVestMetaData.service";
|
26
26
|
export class OpportunityService {
|
27
27
|
static hashId(opportunity) {
|
28
28
|
return Bun.hash(`${opportunity.chainId}${opportunity.type}${opportunity.identifier}`).toString();
|
@@ -109,7 +109,7 @@ export class OpportunityService {
|
|
109
109
|
type: campaignType,
|
110
110
|
identifier: campaign.opportunityIdentifier, // mainParameter
|
111
111
|
name: metadata.name,
|
112
|
-
status: +campaign.startTimestamp
|
112
|
+
status: now >= +campaign.startTimestamp && now < +campaign.endTimestamp
|
113
113
|
? Status.LIVE
|
114
114
|
: now > +campaign.endTimestamp
|
115
115
|
? Status.PAST
|
@@ -225,6 +225,7 @@ export type UserRewardV3Model = typeof UserRewardV3Dto.static;
|
|
225
225
|
export type RewardV3Model = typeof RewardV3Dto.static;
|
226
226
|
export type BreakdownForCampaignsRaw = {
|
227
227
|
amount: string;
|
228
|
+
pending: string;
|
228
229
|
claimed: string;
|
229
230
|
recipient: string;
|
230
231
|
campaignId: string;
|
@@ -208,6 +208,7 @@ export class RewardRepository {
|
|
208
208
|
rb."amount",
|
209
209
|
rb."reason",
|
210
210
|
rb."claimed",
|
211
|
+
rb."pending",
|
211
212
|
r."recipient",
|
212
213
|
t."address" as "rewardTokenAddress"
|
213
214
|
FROM
|
@@ -219,7 +220,7 @@ export class RewardRepository {
|
|
219
220
|
WHERE
|
220
221
|
r."root" = $1 AND rb."campaignId" = $2
|
221
222
|
ORDER BY
|
222
|
-
rb."amount"::numeric DESC
|
223
|
+
(rb."amount"::numeric + rb."pending"::numeric) DESC
|
223
224
|
LIMIT $3
|
224
225
|
OFFSET $4
|
225
226
|
`, root, id, items, items * page);
|
@@ -235,11 +236,12 @@ export class RewardRepository {
|
|
235
236
|
},
|
236
237
|
select: {
|
237
238
|
amount: true,
|
239
|
+
pending: true,
|
238
240
|
campaignId: true,
|
239
241
|
},
|
240
242
|
});
|
241
|
-
const reducedData = totalAmount.reduce((acc, { amount }) => {
|
242
|
-
acc.amount += BigInt(amount);
|
243
|
+
const reducedData = totalAmount.reduce((acc, { amount, pending }) => {
|
244
|
+
acc.amount += BigInt(amount) + BigInt(pending ?? 0);
|
243
245
|
return acc;
|
244
246
|
}, { campaignId, amount: 0n });
|
245
247
|
return reducedData;
|