@merkl/api 0.21.37 → 0.21.39
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 +562 -554
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/factoryFinder.js +1 -0
- package/dist/src/engine/implementations/Erc20/subTypes/detect.js +4 -0
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +8 -0
- 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/index.d.ts +151 -147
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +2 -2
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +2 -2
- package/dist/src/modules/v4/creator/creator.controller.d.ts +149 -145
- package/dist/src/modules/v4/creator/creator.controller.js +2 -2
- package/dist/src/modules/v4/dynamicData/dynamicData.service.js +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.service.js +1 -1
- package/dist/src/modules/v4/router.d.ts +151 -147
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -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;
|
210
|
+
description: string | null;
|
190
211
|
id: string;
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
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;
|
237
|
-
id: string;
|
238
|
-
icon: string;
|
239
|
-
address: string;
|
240
|
-
chainId: number;
|
241
|
-
decimals: number;
|
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
|
};
|
@@ -31,10 +31,10 @@ export const CreatorController = new Elysia({ prefix: "/creators", detail: { tag
|
|
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
|
})
|
@@ -87,7 +87,7 @@ export class DynamicDataService {
|
|
87
87
|
// 2.b.2 Daily rewards is the sum of all daily rewards of the campaigns
|
88
88
|
const timespan = endTimestamp - startTimestamp;
|
89
89
|
const isWithinTimespan = moment().unix() > startTimestamp && moment().unix() < endTimestamp;
|
90
|
-
const dayspan = Math.max(1,
|
90
|
+
const dayspan = Math.max(1, timespan / DAY);
|
91
91
|
let dailyAmount = isWithinTimespan ? BigInt(record.campaign.amount) / BigInt(dayspan) : BigInt(0);
|
92
92
|
let rewardToken;
|
93
93
|
try {
|
@@ -125,7 +125,7 @@ export class OpportunityService {
|
|
125
125
|
});
|
126
126
|
const tokens = (await TokenService.findManyOrCreate(metadata.tokens)).filter(t => t !== undefined);
|
127
127
|
const now = moment().unix();
|
128
|
-
const protocol = (await ProtocolService.findMany({ id: metadata.mainProtocol }))?.[0];
|
128
|
+
const protocol = (await ProtocolService.findMany({ id: metadata.mainProtocol, test: true }))?.[0];
|
129
129
|
const campaignUrl = campaign.params?.url;
|
130
130
|
const opportunity = {
|
131
131
|
id: opportunityId,
|