@merkl/api 0.10.276 → 0.10.278
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.
@@ -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;
|