@merkl/api 0.21.36 → 0.21.38
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 +1758 -1351
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -0
- package/dist/src/engine/implementations/Erc20/subTypes/detect.js +108 -97
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +8 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/aave/metadata.d.ts +1 -1
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.d.ts +17 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/metadata.js +38 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/pino/tvl.js +83 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.d.ts +30 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/metadata.js +65 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/uniswapV2/tvl.js +94 -0
- package/dist/src/engine/implementations/Erc20/subTypes/index.d.ts +2 -1
- package/dist/src/engine/implementations/Erc20/subTypes/index.js +1 -0
- package/dist/src/engine/implementations/JsonAirdrop/metadata.d.ts +2 -2
- package/dist/src/index.d.ts +545 -396
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +1 -1
- package/dist/src/modules/v4/campaign/campaign.service.d.ts +5 -1
- package/dist/src/modules/v4/campaign/campaign.service.js +41 -2
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +385 -240
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +41 -15
- package/dist/src/modules/v4/creator/creator.controller.d.ts +157 -153
- package/dist/src/modules/v4/creator/creator.controller.js +11 -11
- package/dist/src/modules/v4/creator/creator.model.d.ts +2 -2
- package/dist/src/modules/v4/creator/creator.model.js +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +2 -2
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +3 -3
- package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.model.js +1 -0
- package/dist/src/modules/v4/reward/reward.repository.js +1 -1
- package/dist/src/modules/v4/router.d.ts +545 -396
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -17,17 +17,20 @@ export const CampaignTestController = new Elysia({
|
|
17
17
|
headers: AuthorizationHeadersDto,
|
18
18
|
beforeHandle: BackOfficeGuard,
|
19
19
|
})
|
20
|
+
.group("/tvl", app => app
|
20
21
|
// ─── Test TVL computation given a campaignId ───────────────────────
|
21
|
-
.get("/
|
22
|
+
.get("/campaign/:campaignId", async ({ params }) => {
|
22
23
|
const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))?.[0]?.id;
|
23
24
|
if (!id)
|
24
25
|
throw new NotFoundError();
|
25
26
|
const campaign = await CampaignService.findUniqueOrThrow(id, true);
|
26
27
|
const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(CampaignType[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
|
27
28
|
return await DynamicDataService.update(campaignV3.computeChainId, campaignV3.campaignType, [campaignV3], true);
|
29
|
+
}, {
|
30
|
+
params: t.Object({ campaignId: t.String() }),
|
28
31
|
})
|
29
|
-
// ─── Test TVL computation given
|
30
|
-
.get("/
|
32
|
+
// ─── Test TVL computation given an opportunityId ───────────────────────
|
33
|
+
.get("/opportunity/:opportunityId", async ({ params }) => {
|
31
34
|
const campaigns = (await CampaignService.findMany({
|
32
35
|
opportunityId: params.opportunityId,
|
33
36
|
test: true,
|
@@ -38,14 +41,18 @@ export const CampaignTestController = new Elysia({
|
|
38
41
|
throw new NotFoundError("Opportunity not found");
|
39
42
|
return await DynamicDataService.update(campaigns[0]?.computeChainId, campaigns[0].campaignType, campaigns, true);
|
40
43
|
}, {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
+
params: t.Object({ opportunityId: t.String() }),
|
45
|
+
})
|
46
|
+
// ─── Test TVL computation given a target token address ───────────────────────
|
47
|
+
.get("/erc20", async ({ query }) => {
|
48
|
+
const campaign = await CampaignService.createFakeERC20Campaign(query);
|
49
|
+
return await DynamicDataService.update(campaign.computeChainId, campaign.campaignType, [campaign], true);
|
50
|
+
}, {
|
51
|
+
query: t.Object({ address: t.String(), chainId: t.Numeric() }),
|
44
52
|
})
|
45
53
|
// ─── Test TVL computation with a list of campaignId ───────────────────────
|
46
|
-
.post("/
|
54
|
+
.post("/list", async ({ body }) => {
|
47
55
|
const listCampaigns = [];
|
48
|
-
const type = undefined;
|
49
56
|
for (const campaignId of body) {
|
50
57
|
const id = (await CampaignService.findMany({ campaignId: campaignId, test: true }))?.[0]?.id;
|
51
58
|
if (!id)
|
@@ -54,20 +61,27 @@ export const CampaignTestController = new Elysia({
|
|
54
61
|
const campaignV3 = OpportunityConvertorService.convertV4CampaignToV3(CampaignType[campaign.type], CampaignService.format(campaign), campaign.Opportunity.identifier);
|
55
62
|
listCampaigns.push(campaignV3);
|
56
63
|
}
|
57
|
-
|
58
|
-
|
64
|
+
for (const campaign of listCampaigns) {
|
65
|
+
if (campaign.campaignType !== listCampaigns[0].campaignType) {
|
66
|
+
throw new InvalidParameter("All campaigns must be of the same type");
|
67
|
+
}
|
68
|
+
if (campaign.computeChainId !== listCampaigns[0].computeChainId) {
|
69
|
+
throw new InvalidParameter("All campaigns must have the same computeChainId");
|
70
|
+
}
|
71
|
+
}
|
59
72
|
return await DynamicDataService.update(listCampaigns[0].computeChainId, listCampaigns[0].campaignType, listCampaigns, true);
|
60
73
|
}, { body: CampaignsDto })
|
61
74
|
// ─── Test TVL computation with campaign config ───────────────────────
|
62
|
-
.post("/
|
75
|
+
.post("/", async ({ body }) => {
|
63
76
|
const campaign = CampaignService.createFakeCampaign(body);
|
64
77
|
return await DynamicDataService.update(campaign.computeChainId, campaign.campaignType, [campaign], true);
|
65
78
|
}, {
|
66
79
|
body: CampaignConfigMinimal,
|
67
|
-
})
|
80
|
+
}))
|
81
|
+
.group("/metadata", app => app
|
68
82
|
// ─── Test Opportunity creation through a campaign config ───────────────────────
|
69
83
|
// @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
|
70
|
-
.post("/
|
84
|
+
.post("/", async ({ body }) => {
|
71
85
|
const engineCampaign = CampaignService.createFakeCampaignEngine(body);
|
72
86
|
return await CampaignService.create(engineCampaign, true);
|
73
87
|
}, {
|
@@ -75,7 +89,7 @@ export const CampaignTestController = new Elysia({
|
|
75
89
|
})
|
76
90
|
// ─── Test Opportunity creation through a campaign Id and a chain ───────────────────────
|
77
91
|
// @dev Starts from the engine db to debug opportunity creation failing and preventing the api db to be filled
|
78
|
-
.get("/
|
92
|
+
.get("/", async ({ query }) => {
|
79
93
|
if (!query.distributionChain) {
|
80
94
|
try {
|
81
95
|
query.distributionChain = (await CampaignService.findMany({ campaignId: query.campaignId, test: true }))?.[0]?.distributionChainId;
|
@@ -98,4 +112,16 @@ export const CampaignTestController = new Elysia({
|
|
98
112
|
distributionChain: t.Optional(t.Numeric()),
|
99
113
|
campaignId: t.String(),
|
100
114
|
}),
|
101
|
-
})
|
115
|
+
})
|
116
|
+
.get("/erc20", async ({ query }) => {
|
117
|
+
const campaign = await CampaignService.createFakeERC20Campaign(query);
|
118
|
+
const engineCampaign = CampaignService.createFakeCampaignEngine({
|
119
|
+
...campaign,
|
120
|
+
type: CampaignType[CampaignType.ERC20],
|
121
|
+
params: campaign.campaignParameters,
|
122
|
+
distributionChainId: campaign.chainId,
|
123
|
+
});
|
124
|
+
return await CampaignService.create(engineCampaign, true);
|
125
|
+
}, {
|
126
|
+
query: t.Object({ address: t.String(), chainId: t.Numeric() }),
|
127
|
+
})));
|
@@ -67,11 +67,11 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
67
67
|
};
|
68
68
|
} & {
|
69
69
|
creators: {
|
70
|
-
":
|
70
|
+
":creatorId": {
|
71
71
|
get: {
|
72
72
|
body: unknown;
|
73
73
|
params: {
|
74
|
-
|
74
|
+
creatorId: string;
|
75
75
|
};
|
76
76
|
query: unknown;
|
77
77
|
headers: unknown;
|
@@ -93,7 +93,7 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
93
93
|
};
|
94
94
|
} & {
|
95
95
|
creators: {
|
96
|
-
":
|
96
|
+
":creatorId": {
|
97
97
|
patch: {
|
98
98
|
body: {
|
99
99
|
icon?: string | undefined;
|
@@ -101,7 +101,7 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
101
101
|
addresses: string[];
|
102
102
|
};
|
103
103
|
params: {
|
104
|
-
|
104
|
+
creatorId: string;
|
105
105
|
};
|
106
106
|
query: unknown;
|
107
107
|
headers: {
|
@@ -120,11 +120,11 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
120
120
|
};
|
121
121
|
} & {
|
122
122
|
creators: {
|
123
|
-
":
|
123
|
+
":creatorId": {
|
124
124
|
delete: {
|
125
125
|
body: unknown;
|
126
126
|
params: {
|
127
|
-
|
127
|
+
creatorId: string;
|
128
128
|
};
|
129
129
|
query: unknown;
|
130
130
|
headers: {
|
@@ -143,24 +143,26 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
143
143
|
};
|
144
144
|
} & {
|
145
145
|
creators: {
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
146
|
+
user: {
|
147
|
+
":address": {
|
148
|
+
dashboard: {
|
149
|
+
get: {
|
150
|
+
body: unknown;
|
151
|
+
params: {
|
152
|
+
address: string;
|
153
|
+
};
|
154
|
+
query: unknown;
|
155
|
+
headers: unknown;
|
156
|
+
response: {
|
157
|
+
200: {
|
158
|
+
pastCampaigns: number;
|
159
|
+
liveCampaigns: number;
|
160
|
+
futureCampaigns: number;
|
161
|
+
totalTvl: number;
|
162
|
+
totalWallets: number;
|
163
|
+
totalCampaigns: number;
|
164
|
+
creatorId: string | null;
|
165
|
+
};
|
164
166
|
};
|
165
167
|
};
|
166
168
|
};
|
@@ -169,138 +171,140 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
169
171
|
};
|
170
172
|
} & {
|
171
173
|
creators: {
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
174
|
+
user: {
|
175
|
+
":address": {
|
176
|
+
campaigns: {
|
177
|
+
get: {
|
178
|
+
body: unknown;
|
179
|
+
params: {
|
180
|
+
address: string;
|
181
|
+
};
|
182
|
+
query: {
|
183
|
+
status?: "PAST" | "LIVE" | "FUTURE" | undefined;
|
184
|
+
};
|
185
|
+
headers: unknown;
|
186
|
+
response: {
|
187
|
+
200: ({
|
188
|
+
Opportunity: {
|
189
|
+
status: import("@db/api").$Enums.Status;
|
190
|
+
type: string;
|
191
|
+
name: string;
|
192
|
+
description: string;
|
193
|
+
id: string;
|
194
|
+
tags: string[];
|
195
|
+
identifier: string;
|
196
|
+
action: import("@db/api").$Enums.OpportunityAction;
|
197
|
+
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
198
|
+
chainId: number;
|
199
|
+
howToSteps: string[];
|
200
|
+
depositUrl: string | null;
|
201
|
+
explorerAddress: string | null;
|
202
|
+
mainProtocolId: string | null;
|
203
|
+
tvl: number;
|
204
|
+
apr: number;
|
205
|
+
dailyRewards: number;
|
206
|
+
lastCampaignCreatedAt: Date;
|
207
|
+
};
|
208
|
+
} & {
|
187
209
|
type: string;
|
188
|
-
|
189
|
-
description: string;
|
190
|
-
id: string;
|
191
|
-
tags: string[];
|
192
|
-
identifier: string;
|
193
|
-
action: import("@db/api").$Enums.OpportunityAction;
|
194
|
-
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
195
|
-
chainId: number;
|
196
|
-
howToSteps: string[];
|
197
|
-
depositUrl: string | null;
|
198
|
-
explorerAddress: string | null;
|
199
|
-
mainProtocolId: string | null;
|
200
|
-
tvl: number;
|
201
|
-
apr: number;
|
202
|
-
dailyRewards: number;
|
203
|
-
lastCampaignCreatedAt: Date;
|
204
|
-
};
|
205
|
-
} & {
|
206
|
-
type: string;
|
207
|
-
description: string | null;
|
208
|
-
id: string;
|
209
|
-
params: import("database/api/.generated/runtime/library").JsonValue;
|
210
|
-
subType: number | null;
|
211
|
-
computeChainId: number;
|
212
|
-
distributionChainId: number;
|
213
|
-
campaignId: string;
|
214
|
-
distributionType: import("@db/api").$Enums.DistributionType;
|
215
|
-
rewardTokenId: string;
|
216
|
-
amount: string;
|
217
|
-
opportunityId: string;
|
218
|
-
startTimestamp: bigint;
|
219
|
-
endTimestamp: bigint;
|
220
|
-
creatorAddress: string;
|
221
|
-
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
222
|
-
createdAt: Date;
|
223
|
-
rootCampaignId: string | null;
|
224
|
-
parentCampaignId: string | null;
|
225
|
-
})[] | {
|
226
|
-
params: any;
|
227
|
-
chain: {
|
228
|
-
name: string;
|
229
|
-
id: number;
|
230
|
-
icon: string;
|
231
|
-
};
|
232
|
-
endTimestamp: number;
|
233
|
-
startTimestamp: number;
|
234
|
-
rewardToken: {
|
235
|
-
symbol: string;
|
236
|
-
name: string | null;
|
210
|
+
description: string | null;
|
237
211
|
id: string;
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
verified: boolean;
|
243
|
-
isTest: boolean;
|
244
|
-
isPoint: boolean;
|
245
|
-
isPreTGE: boolean;
|
246
|
-
isNative: boolean;
|
247
|
-
} & {
|
248
|
-
price?: number | null | undefined;
|
249
|
-
};
|
250
|
-
distributionChain: {
|
251
|
-
name: string;
|
252
|
-
id: number;
|
253
|
-
icon: string;
|
254
|
-
} | undefined;
|
255
|
-
campaignStatus: {
|
256
|
-
computedUntil: number;
|
257
|
-
processingStarted: number;
|
258
|
-
status: import("@db/api").$Enums.RunStatus;
|
259
|
-
error: string;
|
260
|
-
details: import("database/api/.generated/runtime/library").JsonValue;
|
212
|
+
params: import("database/api/.generated/runtime/library").JsonValue;
|
213
|
+
subType: number | null;
|
214
|
+
computeChainId: number;
|
215
|
+
distributionChainId: number;
|
261
216
|
campaignId: string;
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
217
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
218
|
+
rewardTokenId: string;
|
219
|
+
amount: string;
|
220
|
+
opportunityId: string;
|
221
|
+
startTimestamp: bigint;
|
222
|
+
endTimestamp: bigint;
|
223
|
+
creatorAddress: string;
|
224
|
+
manualOverrides: import("@db/api").$Enums.CampaignManualOverride[];
|
225
|
+
createdAt: Date;
|
226
|
+
rootCampaignId: string | null;
|
227
|
+
parentCampaignId: string | null;
|
228
|
+
})[] | {
|
229
|
+
params: any;
|
230
|
+
chain: {
|
231
|
+
name: string;
|
232
|
+
id: number;
|
233
|
+
icon: string;
|
234
|
+
};
|
235
|
+
endTimestamp: number;
|
236
|
+
startTimestamp: number;
|
237
|
+
rewardToken: {
|
238
|
+
symbol: string;
|
239
|
+
name: string | null;
|
240
|
+
id: string;
|
241
|
+
icon: string;
|
242
|
+
address: string;
|
243
|
+
chainId: number;
|
244
|
+
decimals: number;
|
245
|
+
verified: boolean;
|
246
|
+
isTest: boolean;
|
247
|
+
isPoint: boolean;
|
248
|
+
isPreTGE: boolean;
|
249
|
+
isNative: boolean;
|
250
|
+
} & {
|
251
|
+
price?: number | null | undefined;
|
252
|
+
};
|
253
|
+
distributionChain: {
|
254
|
+
name: string;
|
255
|
+
id: number;
|
256
|
+
icon: string;
|
257
|
+
} | undefined;
|
258
|
+
campaignStatus: {
|
259
|
+
computedUntil: number;
|
260
|
+
processingStarted: number;
|
261
|
+
status: import("@db/api").$Enums.RunStatus;
|
262
|
+
error: string;
|
263
|
+
details: import("database/api/.generated/runtime/library").JsonValue;
|
264
|
+
campaignId: string;
|
265
|
+
} | undefined;
|
266
|
+
creatorAddress: string;
|
267
|
+
creator: {
|
268
|
+
tags: string[];
|
269
|
+
address: string;
|
270
|
+
creatorId: string | null;
|
271
|
+
};
|
272
|
+
createdAt: string;
|
273
|
+
description: string | undefined;
|
274
|
+
parentCampaignId: string | undefined;
|
275
|
+
rootCampaignId: string | undefined;
|
276
|
+
Opportunity: {
|
277
|
+
status: import("@db/api").$Enums.Status;
|
278
|
+
type: string;
|
279
|
+
name: string;
|
280
|
+
description: string;
|
281
|
+
id: string;
|
282
|
+
tags: string[];
|
283
|
+
identifier: string;
|
284
|
+
action: import("@db/api").$Enums.OpportunityAction;
|
285
|
+
manualOverrides: import("@db/api").$Enums.OpportunityManualOverride[];
|
286
|
+
chainId: number;
|
287
|
+
howToSteps: string[];
|
288
|
+
depositUrl: string | null;
|
289
|
+
explorerAddress: string | null;
|
290
|
+
mainProtocolId: string | null;
|
291
|
+
tvl: number;
|
292
|
+
apr: number;
|
293
|
+
dailyRewards: number;
|
294
|
+
lastCampaignCreatedAt: Date;
|
295
|
+
};
|
275
296
|
type: string;
|
276
|
-
name: string;
|
277
|
-
description: string;
|
278
297
|
id: string;
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
apr: number;
|
290
|
-
dailyRewards: number;
|
291
|
-
lastCampaignCreatedAt: Date;
|
292
|
-
};
|
293
|
-
type: string;
|
294
|
-
id: string;
|
295
|
-
subType: number | null;
|
296
|
-
computeChainId: number;
|
297
|
-
distributionChainId: number;
|
298
|
-
campaignId: string;
|
299
|
-
distributionType: import("@db/api").$Enums.DistributionType;
|
300
|
-
rewardTokenId: string;
|
301
|
-
amount: string;
|
302
|
-
opportunityId: string;
|
303
|
-
}[];
|
298
|
+
subType: number | null;
|
299
|
+
computeChainId: number;
|
300
|
+
distributionChainId: number;
|
301
|
+
campaignId: string;
|
302
|
+
distributionType: import("@db/api").$Enums.DistributionType;
|
303
|
+
rewardTokenId: string;
|
304
|
+
amount: string;
|
305
|
+
opportunityId: string;
|
306
|
+
}[];
|
307
|
+
};
|
304
308
|
};
|
305
309
|
};
|
306
310
|
};
|
@@ -309,11 +313,11 @@ export declare const CreatorController: Elysia<"/creators", false, {
|
|
309
313
|
} & {
|
310
314
|
creators: {
|
311
315
|
campaigns: {
|
312
|
-
":
|
316
|
+
":campaignId": {
|
313
317
|
get: {
|
314
318
|
body: unknown;
|
315
319
|
params: {
|
316
|
-
|
320
|
+
campaignId: string;
|
317
321
|
};
|
318
322
|
query: unknown;
|
319
323
|
headers: unknown;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { AuthorizationHeadersDto, BackOfficeGuard } from "@/guards/BackOffice.guard";
|
2
2
|
import { Elysia } from "elysia";
|
3
|
-
import { CampaignIdDto, CampaignQueryDto, CreateCreatorDto, CreatorAddressDto, GetManyCreatorQuery, UpdateCreatorDto, } from "./creator.model";
|
3
|
+
import { CampaignIdDto, CampaignQueryDto, CreateCreatorDto, CreatorAddressDto, CreatorIdDto, GetManyCreatorQuery, UpdateCreatorDto, } from "./creator.model";
|
4
4
|
import { CreatorService } from "./creator.service";
|
5
5
|
// ─── Creators Controller ─────────────────────────────────────────────────────
|
6
6
|
export const CreatorController = new Elysia({ prefix: "/creators", detail: { tags: ["Creator"] } })
|
7
|
-
// ───
|
7
|
+
// ─── CRUD OPS ────────────────────────────────────────────────────────────────
|
8
8
|
// ─── Create A Creator ────────────────────────────────────────────────
|
9
9
|
.post("/", async ({ body }) => await CreatorService.create(body), {
|
10
10
|
headers: AuthorizationHeadersDto,
|
@@ -14,30 +14,30 @@ export const CreatorController = new Elysia({ prefix: "/creators", detail: { tag
|
|
14
14
|
// ─── Get Many Creators ───────────────────────────────────────────────
|
15
15
|
.get("/", async ({ query }) => await CreatorService.findMany(query), { query: GetManyCreatorQuery })
|
16
16
|
// ─── Get A Unique Creator By Id ──────────────────────────────────────
|
17
|
-
.get("/:
|
18
|
-
params:
|
17
|
+
.get("/:creatorId", async ({ params: { creatorId } }) => CreatorService.findUnique(creatorId), {
|
18
|
+
params: CreatorIdDto,
|
19
19
|
})
|
20
20
|
// ─── Update A Creator ────────────────────────────────────────────────
|
21
|
-
.patch("/:
|
21
|
+
.patch("/:creatorId", async ({ params: { creatorId }, body }) => CreatorService.update(creatorId, body), {
|
22
22
|
headers: AuthorizationHeadersDto,
|
23
23
|
body: UpdateCreatorDto,
|
24
|
-
params:
|
24
|
+
params: CreatorIdDto,
|
25
25
|
beforeHandle: BackOfficeGuard,
|
26
26
|
})
|
27
27
|
// ─── Delete A Creator ────────────────────────────────────────────────
|
28
|
-
.delete("/:
|
28
|
+
.delete("/:creatorId", async ({ params: { creatorId } }) => CreatorService.delete(creatorId), {
|
29
29
|
headers: AuthorizationHeadersDto,
|
30
|
-
params:
|
30
|
+
params: CreatorIdDto,
|
31
31
|
beforeHandle: BackOfficeGuard,
|
32
32
|
})
|
33
33
|
// ─── Service Specific Methods ────────────────────────────────────────────────
|
34
|
-
.get("/:address/dashboard", async ({ params }) => CreatorService.getGlobalDashboard(params.address), {
|
34
|
+
.get("/user/:address/dashboard", async ({ params }) => CreatorService.getGlobalDashboard(params.address), {
|
35
35
|
params: CreatorAddressDto,
|
36
36
|
})
|
37
|
-
.get("/:address/campaigns", async ({ params: { address }, query }) => CreatorService.getCampaignsFor(address, query.status), {
|
37
|
+
.get("/user/:address/campaigns", async ({ params: { address }, query }) => CreatorService.getCampaignsFor(address, query.status), {
|
38
38
|
params: CreatorAddressDto,
|
39
39
|
query: CampaignQueryDto,
|
40
40
|
})
|
41
|
-
.get("/campaigns/:
|
41
|
+
.get("/campaigns/:campaignId", async ({ params: { campaignId } }) => CreatorService.getCampaignMetrics(campaignId), {
|
42
42
|
params: CampaignIdDto,
|
43
43
|
});
|
@@ -33,7 +33,7 @@ export declare const CreatorAddressDto: import("@sinclair/typebox").TObject<{
|
|
33
33
|
address: import("@sinclair/typebox").TString;
|
34
34
|
}>;
|
35
35
|
export declare const CampaignIdDto: import("@sinclair/typebox").TObject<{
|
36
|
-
|
36
|
+
campaignId: import("@sinclair/typebox").TString;
|
37
37
|
}>;
|
38
38
|
export declare const CampaignStatusDto: import("@sinclair/typebox").TEnum<{
|
39
39
|
PAST: "PAST";
|
@@ -48,7 +48,7 @@ export declare const CampaignQueryDto: import("@sinclair/typebox").TObject<{
|
|
48
48
|
}>>;
|
49
49
|
}>;
|
50
50
|
export declare const CreatorIdDto: import("@sinclair/typebox").TObject<{
|
51
|
-
|
51
|
+
creatorId: import("@sinclair/typebox").TString;
|
52
52
|
}>;
|
53
53
|
export declare const UpdateCreatorRebateDto: import("@sinclair/typebox").TObject<{
|
54
54
|
rebate: import("@sinclair/typebox").TNumber;
|
@@ -28,14 +28,14 @@ export const CreatorAddressDto = t.Object({
|
|
28
28
|
address: t.String(),
|
29
29
|
});
|
30
30
|
export const CampaignIdDto = t.Object({
|
31
|
-
|
31
|
+
campaignId: t.String(),
|
32
32
|
});
|
33
33
|
export const CampaignStatusDto = t.Enum({ PAST: "PAST", LIVE: "LIVE", FUTURE: "FUTURE" });
|
34
34
|
export const CampaignQueryDto = t.Object({
|
35
35
|
status: t.Optional(CampaignStatusDto),
|
36
36
|
});
|
37
37
|
export const CreatorIdDto = t.Object({
|
38
|
-
|
38
|
+
creatorId: t.String(),
|
39
39
|
});
|
40
40
|
export const UpdateCreatorRebateDto = t.Object({
|
41
41
|
rebate: t.Number({ maximum: 100, minimum: 0 }),
|
@@ -1124,7 +1124,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
1124
1124
|
} & {
|
1125
1125
|
price?: number | null | undefined;
|
1126
1126
|
})[];
|
1127
|
-
mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "dlend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "stability" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "termmax" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "punchswap" | "satlayer" | "puffer" | undefined;
|
1127
|
+
mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "pinto" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "dlend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "stability" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "termmax" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "punchswap" | "satlayer" | "puffer" | undefined;
|
1128
1128
|
description: string;
|
1129
1129
|
howToSteps: string[];
|
1130
1130
|
depositUrl: string | undefined;
|
@@ -1302,7 +1302,7 @@ export declare const OpportunityController: Elysia<"/opportunities", false, {
|
|
1302
1302
|
} & {
|
1303
1303
|
price?: number | null | undefined;
|
1304
1304
|
})[];
|
1305
|
-
mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "dlend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "stability" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "termmax" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "punchswap" | "satlayer" | "puffer" | undefined;
|
1305
|
+
mainProtocol: "splice" | "reserve" | "morpho" | "quickswap" | "euler" | "uniswap" | "ambient" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "pinto" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "lnd" | "dlend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "sake" | "sonicmarket" | "stability" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "termmax" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "punchswap" | "satlayer" | "puffer" | undefined;
|
1306
1306
|
description: string;
|
1307
1307
|
howToSteps: string[];
|
1308
1308
|
depositUrl: string | undefined;
|