@merkl/api 0.10.280 → 0.10.281
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 +62 -0
- package/dist/src/index.d.ts +24 -0
- package/dist/src/libs/campaigns/campaignTypes/CLAMMDynamicData.js +2 -8
- package/dist/src/modules/v4/boost/boost.controller.d.ts +44 -0
- package/dist/src/modules/v4/boost/boost.controller.js +14 -0
- package/dist/src/modules/v4/boost/boost.model.d.ts +6 -0
- package/dist/src/modules/v4/boost/boost.model.js +10 -0
- package/dist/src/modules/v4/boost/boost.service.d.ts +3 -0
- package/dist/src/modules/v4/boost/boost.service.js +6 -0
- package/dist/src/modules/v4/boost/index.d.ts +2 -0
- package/dist/src/modules/v4/boost/index.js +2 -0
- package/dist/src/modules/v4/reward/reward.service.js +1 -1
- package/dist/src/modules/v4/router.d.ts +24 -0
- package/dist/src/modules/v4/router.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -2210,6 +2210,25 @@ declare const eden: {
|
|
2210
2210
|
}>>;
|
2211
2211
|
};
|
2212
2212
|
};
|
2213
|
+
boosts: {
|
2214
|
+
euler: {
|
2215
|
+
post: (body: {
|
2216
|
+
address: string;
|
2217
|
+
score: string;
|
2218
|
+
}[] | {
|
2219
|
+
addresses: string[];
|
2220
|
+
}, options: {
|
2221
|
+
headers: {
|
2222
|
+
authorization: string;
|
2223
|
+
};
|
2224
|
+
query?: Record<string, unknown> | undefined;
|
2225
|
+
fetch?: RequestInit | undefined;
|
2226
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
2227
|
+
[x: string]: any;
|
2228
|
+
200: any;
|
2229
|
+
}>>;
|
2230
|
+
};
|
2231
|
+
};
|
2213
2232
|
};
|
2214
2233
|
v3: {
|
2215
2234
|
app: {
|
@@ -5545,6 +5564,30 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
5545
5564
|
};
|
5546
5565
|
};
|
5547
5566
|
};
|
5567
|
+
} & {
|
5568
|
+
v4: {
|
5569
|
+
boosts: {
|
5570
|
+
euler: {
|
5571
|
+
post: {
|
5572
|
+
body: {
|
5573
|
+
addresses: string[];
|
5574
|
+
} | {
|
5575
|
+
address: string;
|
5576
|
+
score: string;
|
5577
|
+
}[];
|
5578
|
+
params: {};
|
5579
|
+
query: unknown;
|
5580
|
+
headers: {
|
5581
|
+
authorization: string;
|
5582
|
+
};
|
5583
|
+
response: {
|
5584
|
+
[x: string]: any;
|
5585
|
+
200: any;
|
5586
|
+
};
|
5587
|
+
};
|
5588
|
+
};
|
5589
|
+
};
|
5590
|
+
};
|
5548
5591
|
} & {
|
5549
5592
|
v3: {
|
5550
5593
|
app: {
|
@@ -8515,6 +8558,25 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
8515
8558
|
}>>;
|
8516
8559
|
};
|
8517
8560
|
};
|
8561
|
+
boosts: {
|
8562
|
+
euler: {
|
8563
|
+
post: (body: {
|
8564
|
+
address: string;
|
8565
|
+
score: string;
|
8566
|
+
}[] | {
|
8567
|
+
addresses: string[];
|
8568
|
+
}, options: {
|
8569
|
+
headers: {
|
8570
|
+
authorization: string;
|
8571
|
+
};
|
8572
|
+
query?: Record<string, unknown> | undefined;
|
8573
|
+
fetch?: RequestInit | undefined;
|
8574
|
+
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
8575
|
+
[x: string]: any;
|
8576
|
+
200: any;
|
8577
|
+
}>>;
|
8578
|
+
};
|
8579
|
+
};
|
8518
8580
|
};
|
8519
8581
|
v3: {
|
8520
8582
|
app: {
|
package/dist/src/index.d.ts
CHANGED
@@ -2750,6 +2750,30 @@ declare const app: Elysia<"", false, {
|
|
2750
2750
|
};
|
2751
2751
|
};
|
2752
2752
|
};
|
2753
|
+
} & {
|
2754
|
+
v4: {
|
2755
|
+
boosts: {
|
2756
|
+
euler: {
|
2757
|
+
post: {
|
2758
|
+
body: {
|
2759
|
+
addresses: string[];
|
2760
|
+
} | {
|
2761
|
+
address: string;
|
2762
|
+
score: string;
|
2763
|
+
}[];
|
2764
|
+
params: {};
|
2765
|
+
query: unknown;
|
2766
|
+
headers: {
|
2767
|
+
authorization: string;
|
2768
|
+
};
|
2769
|
+
response: {
|
2770
|
+
[x: string]: any;
|
2771
|
+
200: any;
|
2772
|
+
};
|
2773
|
+
};
|
2774
|
+
};
|
2775
|
+
};
|
2776
|
+
};
|
2753
2777
|
} & {
|
2754
2778
|
v3: {
|
2755
2779
|
app: {
|
@@ -67,10 +67,7 @@ export async function CLAMMDynamicData(chainId, campaigns) {
|
|
67
67
|
A51Strategies = await fetchA51Strategies(chainId, [...new Set(A51Pools)]);
|
68
68
|
}
|
69
69
|
for (const pool of poolList) {
|
70
|
-
|
71
|
-
if (pool.amm === AMM.SyncswapV3) {
|
72
|
-
poolInterface = PoolInterface[AMMAlgorithm.Neptune];
|
73
|
-
}
|
70
|
+
const poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
|
74
71
|
const d = campaigns?.filter(campaign => campaign.mainParameter.toLowerCase() === pool.mainParameter.toLowerCase())[0];
|
75
72
|
calls.push({
|
76
73
|
allowFailure: true,
|
@@ -287,10 +284,7 @@ export async function CLAMMDynamicData(chainId, campaigns) {
|
|
287
284
|
let i = 0;
|
288
285
|
if (!!poolList) {
|
289
286
|
for (const pool of poolList) {
|
290
|
-
|
291
|
-
if (pool.amm === AMM.SyncswapV3) {
|
292
|
-
poolInterface = PoolInterface[AMMAlgorithm.Neptune];
|
293
|
-
}
|
287
|
+
const poolInterface = PoolInterface[AMMAlgorithmMapping[pool.amm]];
|
294
288
|
// This liquidity call gives the active liquidity on the pool. To get the total liquidity we would need to loop over all positions
|
295
289
|
let poolTotalLiquidity;
|
296
290
|
let sqrtPrice;
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import Elysia from "elysia";
|
2
|
+
export declare const BoostController: Elysia<"/boosts", false, {
|
3
|
+
decorator: {};
|
4
|
+
store: {};
|
5
|
+
derive: {};
|
6
|
+
resolve: {};
|
7
|
+
}, {
|
8
|
+
type: {};
|
9
|
+
error: {};
|
10
|
+
}, {
|
11
|
+
schema: {};
|
12
|
+
macro: {};
|
13
|
+
macroFn: {};
|
14
|
+
}, {
|
15
|
+
boosts: {
|
16
|
+
euler: {
|
17
|
+
post: {
|
18
|
+
body: {
|
19
|
+
addresses: string[];
|
20
|
+
} | {
|
21
|
+
address: string;
|
22
|
+
score: string;
|
23
|
+
}[];
|
24
|
+
params: {};
|
25
|
+
query: unknown;
|
26
|
+
headers: {
|
27
|
+
authorization: string;
|
28
|
+
};
|
29
|
+
response: {
|
30
|
+
[x: string]: any;
|
31
|
+
200: any;
|
32
|
+
};
|
33
|
+
};
|
34
|
+
};
|
35
|
+
};
|
36
|
+
}, {
|
37
|
+
derive: {};
|
38
|
+
resolve: {};
|
39
|
+
schema: {};
|
40
|
+
}, {
|
41
|
+
derive: {};
|
42
|
+
resolve: {};
|
43
|
+
schema: {};
|
44
|
+
}>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
|
+
import Elysia from "elysia";
|
3
|
+
import { getEulerBoostBody } from "./boost.model";
|
4
|
+
import { BoostService } from "./boost.service";
|
5
|
+
export const BoostController = new Elysia({ prefix: "/boosts", detail: { tags: ["Boosts"], hide: true } })
|
6
|
+
// ─── Get Euler Boost ─────────────────────────────────────────────────
|
7
|
+
.post("/euler", async ({ body }) => await BoostService.getEulerBoost(), {
|
8
|
+
body: getEulerBoostBody,
|
9
|
+
headers: AuthorizationHeadersDto,
|
10
|
+
beforeHandle: async ({ headers }) => {
|
11
|
+
await BackOfficeGuard({ headers });
|
12
|
+
},
|
13
|
+
detail: { hide: true },
|
14
|
+
});
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const getEulerBoostBody: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
2
|
+
addresses: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
3
|
+
}>, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
4
|
+
address: import("@sinclair/typebox").TString;
|
5
|
+
score: import("@sinclair/typebox").TString;
|
6
|
+
}>>]>;
|
@@ -238,7 +238,7 @@ export class RewardService {
|
|
238
238
|
distributionChain: data.distributionChainId,
|
239
239
|
campaignId: data.campaignId,
|
240
240
|
});
|
241
|
-
const ids = (await RewardRepository.findManyBreakdownUniques(rewardTokenId,
|
241
|
+
const ids = (await RewardRepository.findManyBreakdownUniques(rewardTokenId, data.root, campaignId)).map(({ Reward, reason }) => Bun.hash(`${Reward.recipient}${reason}`).toString());
|
242
242
|
const toUpdate = [];
|
243
243
|
const toCreate = [];
|
244
244
|
for (const point of data.data) {
|
@@ -2628,6 +2628,30 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2628
2628
|
};
|
2629
2629
|
};
|
2630
2630
|
};
|
2631
|
+
} & {
|
2632
|
+
v4: {
|
2633
|
+
boosts: {
|
2634
|
+
euler: {
|
2635
|
+
post: {
|
2636
|
+
body: {
|
2637
|
+
addresses: string[];
|
2638
|
+
} | {
|
2639
|
+
address: string;
|
2640
|
+
score: string;
|
2641
|
+
}[];
|
2642
|
+
params: {};
|
2643
|
+
query: unknown;
|
2644
|
+
headers: {
|
2645
|
+
authorization: string;
|
2646
|
+
};
|
2647
|
+
response: {
|
2648
|
+
[x: string]: any;
|
2649
|
+
200: any;
|
2650
|
+
};
|
2651
|
+
};
|
2652
|
+
};
|
2653
|
+
};
|
2654
|
+
};
|
2631
2655
|
}, {
|
2632
2656
|
derive: {};
|
2633
2657
|
resolve: {};
|
@@ -15,6 +15,7 @@ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
15
15
|
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node";
|
16
16
|
import { PrismaInstrumentation } from "@prisma/instrumentation";
|
17
17
|
import Elysia from "elysia";
|
18
|
+
import { BoostController } from "./boost";
|
18
19
|
import { ClaimController } from "./claims";
|
19
20
|
import { DynamicDataController } from "./dynamicData";
|
20
21
|
import { InteractionController } from "./interaction/interaction.controller";
|
@@ -63,4 +64,5 @@ export const v4 = new Elysia({ tags: ["v4"], prefix: "/v4" })
|
|
63
64
|
.use(StatusController)
|
64
65
|
.use(LiquidityController)
|
65
66
|
.use(ClaimController)
|
66
|
-
.use(ProgramPayloadController)
|
67
|
+
.use(ProgramPayloadController)
|
68
|
+
.use(BoostController);
|