@merkl/api 0.20.161 → 0.20.162
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 +6 -6
- package/dist/src/index.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +2 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +6 -6
- package/dist/src/modules/v4/opportunity/opportunity.service.js +4 -3
- package/dist/src/modules/v4/reward/reward.service.d.ts +2 -2
- package/dist/src/modules/v4/router.d.ts +2 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -721,7 +721,6 @@ declare const eden: {
|
|
721
721
|
timestamp: bigint;
|
722
722
|
breakdowns: {
|
723
723
|
id: string;
|
724
|
-
value: number;
|
725
724
|
campaignId: string;
|
726
725
|
dailyRewardsRecordId: string;
|
727
726
|
token: {
|
@@ -740,7 +739,8 @@ declare const eden: {
|
|
740
739
|
isNative: boolean;
|
741
740
|
price: number | null;
|
742
741
|
};
|
743
|
-
amount:
|
742
|
+
amount: any;
|
743
|
+
value: number;
|
744
744
|
distributionType: import("@db/api").$Enums.DistributionType;
|
745
745
|
}[];
|
746
746
|
};
|
@@ -5813,7 +5813,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5813
5813
|
timestamp: bigint;
|
5814
5814
|
breakdowns: {
|
5815
5815
|
id: string;
|
5816
|
-
value: number;
|
5817
5816
|
campaignId: string;
|
5818
5817
|
dailyRewardsRecordId: string;
|
5819
5818
|
token: {
|
@@ -5832,7 +5831,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5832
5831
|
isNative: boolean;
|
5833
5832
|
price: number | null;
|
5834
5833
|
};
|
5835
|
-
amount:
|
5834
|
+
amount: any;
|
5835
|
+
value: number;
|
5836
5836
|
distributionType: import("@db/api").$Enums.DistributionType;
|
5837
5837
|
}[];
|
5838
5838
|
};
|
@@ -12521,7 +12521,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12521
12521
|
timestamp: bigint;
|
12522
12522
|
breakdowns: {
|
12523
12523
|
id: string;
|
12524
|
-
value: number;
|
12525
12524
|
campaignId: string;
|
12526
12525
|
dailyRewardsRecordId: string;
|
12527
12526
|
token: {
|
@@ -12540,7 +12539,8 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
12540
12539
|
isNative: boolean;
|
12541
12540
|
price: number | null;
|
12542
12541
|
};
|
12543
|
-
amount:
|
12542
|
+
amount: any;
|
12543
|
+
value: number;
|
12544
12544
|
distributionType: import("@db/api").$Enums.DistributionType;
|
12545
12545
|
}[];
|
12546
12546
|
};
|
package/dist/src/index.d.ts
CHANGED
@@ -533,7 +533,6 @@ declare const app: Elysia<"", false, {
|
|
533
533
|
timestamp: bigint;
|
534
534
|
breakdowns: {
|
535
535
|
id: string;
|
536
|
-
value: number;
|
537
536
|
campaignId: string;
|
538
537
|
dailyRewardsRecordId: string;
|
539
538
|
token: {
|
@@ -552,7 +551,8 @@ declare const app: Elysia<"", false, {
|
|
552
551
|
isNative: boolean;
|
553
552
|
price: number | null;
|
554
553
|
};
|
555
|
-
amount:
|
554
|
+
amount: any;
|
555
|
+
value: number;
|
556
556
|
distributionType: import("@db/api").$Enums.DistributionType;
|
557
557
|
}[];
|
558
558
|
};
|
@@ -388,7 +388,6 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
388
388
|
timestamp: bigint;
|
389
389
|
breakdowns: {
|
390
390
|
id: string;
|
391
|
-
value: number;
|
392
391
|
campaignId: string;
|
393
392
|
dailyRewardsRecordId: string;
|
394
393
|
token: {
|
@@ -407,7 +406,8 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
407
406
|
isNative: boolean;
|
408
407
|
price: number | null;
|
409
408
|
};
|
410
|
-
amount:
|
409
|
+
amount: any;
|
410
|
+
value: number;
|
411
411
|
distributionType: import("@db/api").$Enums.DistributionType;
|
412
412
|
}[];
|
413
413
|
};
|
@@ -3,7 +3,7 @@ import type { Campaign } from "@/modules/v4/campaign/campaign.model";
|
|
3
3
|
import type { DailyRewardsRecord } from "@/modules/v4/reward/reward.model";
|
4
4
|
import type { TvlRecord } from "@/modules/v4/tvl/tvl.model";
|
5
5
|
import { type Prisma, Status } from "@db/api";
|
6
|
-
import type
|
6
|
+
import { type MerklChainId } from "@sdk";
|
7
7
|
import type { CreateOpportunityModel, GetOpportunitiesQueryModel, Opportunity } from "./opportunity.model";
|
8
8
|
export declare abstract class OpportunityRepository {
|
9
9
|
#private;
|
@@ -5,6 +5,7 @@ import { TvlService } from "@/modules/v4/tvl/tvl.service";
|
|
5
5
|
import { log } from "@/utils/logger";
|
6
6
|
import { apiDbClient } from "@db";
|
7
7
|
import { Status } from "@db/api";
|
8
|
+
import { bigIntToNumber } from "@sdk";
|
8
9
|
import moment from "moment";
|
9
10
|
export class OpportunityRepository {
|
10
11
|
// ─── Utils ───────────────────────────────────────────────────────────
|
@@ -428,7 +429,7 @@ export class OpportunityRepository {
|
|
428
429
|
createMany: {
|
429
430
|
data: dailyRewards.breakdowns.map(breakdown => ({
|
430
431
|
campaignId: breakdown.campaignId,
|
431
|
-
value: breakdown.
|
432
|
+
value: bigIntToNumber(breakdown.amount, breakdown.token.decimals),
|
432
433
|
})),
|
433
434
|
},
|
434
435
|
},
|
@@ -657,7 +657,6 @@ export declare abstract class OpportunityService {
|
|
657
657
|
timestamp: bigint;
|
658
658
|
breakdowns: {
|
659
659
|
id: string;
|
660
|
-
value: number;
|
661
660
|
campaignId: string;
|
662
661
|
dailyRewardsRecordId: string;
|
663
662
|
token: {
|
@@ -676,7 +675,8 @@ export declare abstract class OpportunityService {
|
|
676
675
|
isNative: boolean;
|
677
676
|
price: number | null;
|
678
677
|
};
|
679
|
-
amount:
|
678
|
+
amount: any;
|
679
|
+
value: number;
|
680
680
|
distributionType: import("@db/api").$Enums.DistributionType;
|
681
681
|
}[];
|
682
682
|
};
|
@@ -847,7 +847,6 @@ export declare abstract class OpportunityService {
|
|
847
847
|
timestamp: bigint;
|
848
848
|
breakdowns: {
|
849
849
|
id: string;
|
850
|
-
value: number;
|
851
850
|
campaignId: string;
|
852
851
|
dailyRewardsRecordId: string;
|
853
852
|
token: {
|
@@ -866,7 +865,8 @@ export declare abstract class OpportunityService {
|
|
866
865
|
isNative: boolean;
|
867
866
|
price: number | null;
|
868
867
|
};
|
869
|
-
amount:
|
868
|
+
amount: any;
|
869
|
+
value: number;
|
870
870
|
distributionType: import("@db/api").$Enums.DistributionType;
|
871
871
|
}[];
|
872
872
|
};
|
@@ -1030,7 +1030,6 @@ export declare abstract class OpportunityService {
|
|
1030
1030
|
timestamp: bigint;
|
1031
1031
|
breakdowns: {
|
1032
1032
|
id: string;
|
1033
|
-
value: number;
|
1034
1033
|
campaignId: string;
|
1035
1034
|
dailyRewardsRecordId: string;
|
1036
1035
|
token: {
|
@@ -1049,7 +1048,8 @@ export declare abstract class OpportunityService {
|
|
1049
1048
|
isNative: boolean;
|
1050
1049
|
price: number | null;
|
1051
1050
|
};
|
1052
|
-
amount:
|
1051
|
+
amount: any;
|
1052
|
+
value: number;
|
1053
1053
|
distributionType: import("@db/api").$Enums.DistributionType;
|
1054
1054
|
}[];
|
1055
1055
|
};
|
@@ -7,7 +7,7 @@ import { TokenService } from "@/modules/v4/token/token.service";
|
|
7
7
|
import { UserService } from "@/modules/v4/user/user.service";
|
8
8
|
import { log } from "@/utils/logger";
|
9
9
|
import { AprType, Status } from "@db/api";
|
10
|
-
import { Campaign as CampaignType } from "@sdk";
|
10
|
+
import { Campaign as CampaignType, numberToBigInt } from "@sdk";
|
11
11
|
import moment from "moment";
|
12
12
|
import { metadataBuilderFactory } from "../../../engine/metadata/factory";
|
13
13
|
import { ChainService } from "../chain/chain.service";
|
@@ -179,10 +179,11 @@ export class OpportunityService {
|
|
179
179
|
id,
|
180
180
|
total,
|
181
181
|
timestamp,
|
182
|
-
breakdowns: breakdowns.map(({ Campaign, ...breakdown }) => {
|
182
|
+
breakdowns: breakdowns.map(({ Campaign, value, ...breakdown }) => {
|
183
183
|
return {
|
184
184
|
token: Campaign.RewardToken,
|
185
|
-
amount:
|
185
|
+
amount: numberToBigInt(value, Campaign.RewardToken.decimals),
|
186
|
+
value: (Campaign.RewardToken.price ?? 1) * value,
|
186
187
|
distributionType: Campaign.distributionType,
|
187
188
|
...breakdown,
|
188
189
|
};
|
@@ -46,7 +46,6 @@ export declare abstract class RewardService {
|
|
46
46
|
timestamp: bigint;
|
47
47
|
breakdowns: {
|
48
48
|
id: string;
|
49
|
-
value: number;
|
50
49
|
campaignId: string;
|
51
50
|
dailyRewardsRecordId: string;
|
52
51
|
token: {
|
@@ -65,7 +64,8 @@ export declare abstract class RewardService {
|
|
65
64
|
isNative: boolean;
|
66
65
|
price: number | null;
|
67
66
|
};
|
68
|
-
amount:
|
67
|
+
amount: any;
|
68
|
+
value: number;
|
69
69
|
distributionType: import("@db/api").$Enums.DistributionType;
|
70
70
|
}[];
|
71
71
|
};
|
@@ -403,7 +403,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
403
403
|
timestamp: bigint;
|
404
404
|
breakdowns: {
|
405
405
|
id: string;
|
406
|
-
value: number;
|
407
406
|
campaignId: string;
|
408
407
|
dailyRewardsRecordId: string;
|
409
408
|
token: {
|
@@ -422,7 +421,8 @@ export declare const v4: Elysia<"/v4", false, {
|
|
422
421
|
isNative: boolean;
|
423
422
|
price: number | null;
|
424
423
|
};
|
425
|
-
amount:
|
424
|
+
amount: any;
|
425
|
+
value: number;
|
426
426
|
distributionType: import("@db/api").$Enums.DistributionType;
|
427
427
|
}[];
|
428
428
|
};
|