@merkl/api 0.10.220 → 0.10.222
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/libs/campaigns/campaignTypes/ERC20DynamicData.js +6 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +10 -2
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +14 -0
- package/dist/src/modules/v4/opportunity/opportunity.repository.js +10 -2
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -26,8 +26,12 @@ export async function ERC20DynamicData(chainId, campaigns) {
|
|
26
26
|
].includes(campaign.campaignId)) {
|
27
27
|
campaign.campaignParameters.url = "https://moonwell.fi/markets/supply/base/usdc";
|
28
28
|
}
|
29
|
-
if (
|
30
|
-
|
29
|
+
if ([
|
30
|
+
"0x2d3ae0a97c6f73ad37c1a9cc5e360f72b206ee61d96952fe772b3ab02f8a5713",
|
31
|
+
"0x653ec2bd4aa79b74a2d6c3240ebe3bc4afb679ea6963c2c8afceef69c7c914f9",
|
32
|
+
].includes(campaign.campaignId)) {
|
33
|
+
campaign.campaignParameters.url =
|
34
|
+
"https://app.zerolend.xyz/reserve-overview/?underlyingAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&marketName=proto_mainnet_rwa_v3&utm_source=Merkle&utm_medium=Website&utm_campaign=MerklMagic30";
|
31
35
|
}
|
32
36
|
callsRounds1.push({
|
33
37
|
allowFailure: true,
|
@@ -69,11 +69,20 @@ export const OpportunityController = new Elysia({
|
|
69
69
|
if (!params.id.includes("-"))
|
70
70
|
return await OpportunityService.getUniqueWithCampaignsOrThrow(params.id);
|
71
71
|
const [chainId, type, identifier] = params.id.split("-");
|
72
|
-
|
72
|
+
const oppWithCampaigns = await OpportunityService.getUniqueWithCampaignsOrThrow({
|
73
73
|
chainId: +chainId,
|
74
74
|
type: type,
|
75
75
|
identifier,
|
76
76
|
});
|
77
|
+
// Todo: need to be refactor Parsing issue
|
78
|
+
const campaignsFormatted = oppWithCampaigns.campaigns.map(campaign => {
|
79
|
+
if (!campaign.distributionChain)
|
80
|
+
return campaign;
|
81
|
+
const distributionChain = campaign.distributionChain;
|
82
|
+
const { Explorer } = distributionChain;
|
83
|
+
return { ...campaign, distributionChain: { ...campaign.distributionChain, explorers: Explorer } };
|
84
|
+
});
|
85
|
+
return { ...oppWithCampaigns, campaigns: campaignsFormatted };
|
77
86
|
}
|
78
87
|
catch (err) {
|
79
88
|
if (err.code && err.code === "P2025")
|
@@ -98,7 +107,6 @@ export const OpportunityController = new Elysia({
|
|
98
107
|
params: OpportunityAggregateFieldDto,
|
99
108
|
query: GetOpportunitiesQueryDto,
|
100
109
|
response: AggregationResourceDto,
|
101
|
-
detail: { hide: true },
|
102
110
|
})
|
103
111
|
// ─── Update An Opportunity ───────────────────────────────────────────
|
104
112
|
.patch("/:id", async ({ params, body }) => await OpportunityService.update(params.id, body), {
|
@@ -126,6 +126,13 @@ export declare abstract class OpportunityRepository {
|
|
126
126
|
}>;
|
127
127
|
static findUniqueOrThrowWithCampaigns(id: string): Promise<{
|
128
128
|
Chain: {
|
129
|
+
Explorer: {
|
130
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
131
|
+
url: string;
|
132
|
+
id: string;
|
133
|
+
chainId: number;
|
134
|
+
}[];
|
135
|
+
} & {
|
129
136
|
name: string;
|
130
137
|
id: number;
|
131
138
|
icon: string;
|
@@ -137,6 +144,13 @@ export declare abstract class OpportunityRepository {
|
|
137
144
|
icon: string;
|
138
145
|
};
|
139
146
|
DistributionChain: {
|
147
|
+
Explorer: {
|
148
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
149
|
+
url: string;
|
150
|
+
id: string;
|
151
|
+
chainId: number;
|
152
|
+
}[];
|
153
|
+
} & {
|
140
154
|
name: string;
|
141
155
|
id: number;
|
142
156
|
icon: string;
|
@@ -83,12 +83,20 @@ export class OpportunityRepository {
|
|
83
83
|
const b = await apiDbClient.opportunity.findUniqueOrThrow({
|
84
84
|
include: {
|
85
85
|
...OpportunityRepository.#getRecordInclusion(),
|
86
|
-
Chain:
|
86
|
+
Chain: {
|
87
|
+
include: {
|
88
|
+
Explorer: true,
|
89
|
+
},
|
90
|
+
},
|
87
91
|
Campaigns: {
|
88
92
|
include: {
|
89
93
|
RewardToken: true,
|
90
94
|
ComputeChain: true,
|
91
|
-
DistributionChain:
|
95
|
+
DistributionChain: {
|
96
|
+
include: {
|
97
|
+
Explorer: true,
|
98
|
+
},
|
99
|
+
},
|
92
100
|
CampaignStatus: true, // [][0]
|
93
101
|
},
|
94
102
|
orderBy: {
|