@merkl/api 0.20.156 → 0.20.158
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 +150 -143
- package/dist/src/engine/deprecated/erc20SubTypeProcessors/helpers/ownerFinder.js +1 -0
- package/dist/src/engine/implementations/Erc20/subTypes/factories.js +4 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.d.ts +16 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/metadata.js +20 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.d.ts +6 -0
- package/dist/src/engine/implementations/Erc20/subTypes/implementations/lendleVaults/tvl.js +53 -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 +48 -41
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +18 -15
- package/dist/src/modules/v4/campaign/campaign.controller.js +5 -1
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +30 -26
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +6 -3
- package/dist/src/modules/v4/price/price.service.js +7 -0
- package/dist/src/modules/v4/router.d.ts +48 -41
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -222,6 +222,24 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
222
222
|
};
|
223
223
|
};
|
224
224
|
};
|
225
|
+
} & {
|
226
|
+
tvls: {
|
227
|
+
":opportunityId": {
|
228
|
+
put: {
|
229
|
+
body: unknown;
|
230
|
+
params: {
|
231
|
+
opportunityId: string;
|
232
|
+
};
|
233
|
+
query: unknown;
|
234
|
+
headers: {
|
235
|
+
authorization: string;
|
236
|
+
};
|
237
|
+
response: {
|
238
|
+
200: unknown[];
|
239
|
+
};
|
240
|
+
};
|
241
|
+
};
|
242
|
+
};
|
225
243
|
} & {
|
226
244
|
index: {
|
227
245
|
get: {
|
@@ -502,21 +520,6 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
|
|
502
520
|
};
|
503
521
|
};
|
504
522
|
};
|
505
|
-
campaignstvls: {
|
506
|
-
":opportunityId": {
|
507
|
-
put: {
|
508
|
-
body: unknown;
|
509
|
-
params: {
|
510
|
-
opportunityId: string;
|
511
|
-
};
|
512
|
-
query: unknown;
|
513
|
-
headers: unknown;
|
514
|
-
response: {
|
515
|
-
200: unknown[];
|
516
|
-
};
|
517
|
-
};
|
518
|
-
};
|
519
|
-
};
|
520
523
|
} & {
|
521
524
|
campaigns: {
|
522
525
|
index: {
|
@@ -47,7 +47,7 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
47
47
|
body: UpdateMetaDataCampaignDto,
|
48
48
|
detail: { hide: true },
|
49
49
|
})
|
50
|
-
.put("tvls/:opportunityId", async ({ params }) => {
|
50
|
+
.put("/tvls/:opportunityId", async ({ params }) => {
|
51
51
|
const campaigns = (await CampaignService.findMany({
|
52
52
|
opportunityId: params.opportunityId,
|
53
53
|
status: "LIVE",
|
@@ -58,6 +58,10 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
|
|
58
58
|
if (!campaigns.length)
|
59
59
|
throw new NotFoundError("Opportunity not found");
|
60
60
|
return await DynamicDataService.update(campaigns[0]?.computeChainId, campaigns[0].campaignType, campaigns);
|
61
|
+
}, {
|
62
|
+
beforeHandle: BackOfficeGuard,
|
63
|
+
headers: AuthorizationHeadersDto,
|
64
|
+
detail: { hide: true },
|
61
65
|
})
|
62
66
|
// ─── Get Many Campaigns ──────────────────────────────────────────────
|
63
67
|
.get("/", async ({ query }) => {
|
@@ -13,37 +13,41 @@ export declare const CampaignTestController: Elysia<"/campaigns", false, {
|
|
13
13
|
macroFn: {};
|
14
14
|
}, {
|
15
15
|
campaigns: {
|
16
|
-
"dry-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
"dry-run": {
|
17
|
+
tvl: {
|
18
|
+
":campaignId": {
|
19
|
+
get: {
|
20
|
+
body: unknown;
|
21
|
+
params: {
|
22
|
+
campaignId: string;
|
23
|
+
};
|
24
|
+
query: unknown;
|
25
|
+
headers: {
|
26
|
+
authorization: string;
|
27
|
+
};
|
28
|
+
response: {
|
29
|
+
200: unknown[];
|
30
|
+
};
|
29
31
|
};
|
30
32
|
};
|
31
33
|
};
|
32
34
|
};
|
33
35
|
} & {
|
34
|
-
"dry-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
"dry-run": {
|
37
|
+
tvls: {
|
38
|
+
":opportunityId": {
|
39
|
+
get: {
|
40
|
+
body: unknown;
|
41
|
+
params: {
|
42
|
+
opportunityId: string;
|
43
|
+
};
|
44
|
+
query: unknown;
|
45
|
+
headers: {
|
46
|
+
authorization: string;
|
47
|
+
};
|
48
|
+
response: {
|
49
|
+
200: unknown[];
|
50
|
+
};
|
47
51
|
};
|
48
52
|
};
|
49
53
|
};
|
@@ -20,7 +20,7 @@ export const CampaignTestController = new Elysia({
|
|
20
20
|
beforeHandle: BackOfficeGuard,
|
21
21
|
})
|
22
22
|
// ─── Test TVL computation given a campaignId ───────────────────────
|
23
|
-
.get("tvl/:campaignId", async ({ params }) => {
|
23
|
+
.get("/tvl/:campaignId", async ({ params }) => {
|
24
24
|
const id = (await CampaignService.findMany({ campaignId: params.campaignId, test: true }))?.[0]?.id;
|
25
25
|
if (!id)
|
26
26
|
throw new NotFoundError();
|
@@ -29,10 +29,9 @@ export const CampaignTestController = new Elysia({
|
|
29
29
|
return await DynamicDataService.update(campaignV3.computeChainId, campaignV3.campaignType, [campaignV3], true);
|
30
30
|
})
|
31
31
|
// ─── Test TVL computation given a campaignId ───────────────────────
|
32
|
-
.get("tvls/:opportunityId", async ({ params }) => {
|
32
|
+
.get("/tvls/:opportunityId", async ({ params }) => {
|
33
33
|
const campaigns = (await CampaignService.findMany({
|
34
34
|
opportunityId: params.opportunityId,
|
35
|
-
status: "LIVE",
|
36
35
|
test: true,
|
37
36
|
withOpportunity: true,
|
38
37
|
items: 10_000,
|
@@ -40,6 +39,10 @@ export const CampaignTestController = new Elysia({
|
|
40
39
|
if (!campaigns.length)
|
41
40
|
throw new NotFoundError("Opportunity not found");
|
42
41
|
return await DynamicDataService.update(campaigns[0]?.computeChainId, campaigns[0].campaignType, campaigns, true);
|
42
|
+
}, {
|
43
|
+
beforeHandle: BackOfficeGuard,
|
44
|
+
headers: AuthorizationHeadersDto,
|
45
|
+
detail: { hide: true },
|
43
46
|
})
|
44
47
|
// ─── Test TVL computation with a list of campaignId ───────────────────────
|
45
48
|
.post("/tvls/list", async ({ body }) => {
|
@@ -2,6 +2,7 @@ import { UnableToFindPrice } from "@/errors";
|
|
2
2
|
import { Pricer } from "@/utils/pricer";
|
3
3
|
import PriceFetcherFactory from "@/utils/prices/priceFetcherFactory";
|
4
4
|
import { PriceSourceMethod } from "@db/api";
|
5
|
+
import { TokenService } from "../token/token.service";
|
5
6
|
import { PriceRepository } from "./price.repository";
|
6
7
|
export class PriceService {
|
7
8
|
// ─── Prices ──────────────────────────────────────────────────────────
|
@@ -39,6 +40,12 @@ export class PriceService {
|
|
39
40
|
if (price === undefined || price === null) {
|
40
41
|
throw new Error();
|
41
42
|
}
|
43
|
+
if (priceSource.symbol.startsWith("0x")) {
|
44
|
+
await TokenService.updateAddressPrices(priceSource.symbol, price);
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
await TokenService.updateSymbolPrices(priceSource.symbol, price, []);
|
48
|
+
}
|
42
49
|
return price;
|
43
50
|
}
|
44
51
|
catch {
|
@@ -1422,6 +1422,24 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1422
1422
|
};
|
1423
1423
|
};
|
1424
1424
|
};
|
1425
|
+
} & {
|
1426
|
+
tvls: {
|
1427
|
+
":opportunityId": {
|
1428
|
+
put: {
|
1429
|
+
body: unknown;
|
1430
|
+
params: {
|
1431
|
+
opportunityId: string;
|
1432
|
+
};
|
1433
|
+
query: unknown;
|
1434
|
+
headers: {
|
1435
|
+
authorization: string;
|
1436
|
+
};
|
1437
|
+
response: {
|
1438
|
+
200: unknown[];
|
1439
|
+
};
|
1440
|
+
};
|
1441
|
+
};
|
1442
|
+
};
|
1425
1443
|
} & {
|
1426
1444
|
index: {
|
1427
1445
|
get: {
|
@@ -1702,21 +1720,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1702
1720
|
};
|
1703
1721
|
};
|
1704
1722
|
};
|
1705
|
-
campaignstvls: {
|
1706
|
-
":opportunityId": {
|
1707
|
-
put: {
|
1708
|
-
body: unknown;
|
1709
|
-
params: {
|
1710
|
-
opportunityId: string;
|
1711
|
-
};
|
1712
|
-
query: unknown;
|
1713
|
-
headers: unknown;
|
1714
|
-
response: {
|
1715
|
-
200: unknown[];
|
1716
|
-
};
|
1717
|
-
};
|
1718
|
-
};
|
1719
|
-
};
|
1720
1723
|
} & {
|
1721
1724
|
campaigns: {
|
1722
1725
|
index: {
|
@@ -1998,37 +2001,41 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1998
2001
|
} & {
|
1999
2002
|
v4: {
|
2000
2003
|
campaigns: {
|
2001
|
-
"dry-
|
2002
|
-
|
2003
|
-
|
2004
|
-
|
2005
|
-
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2004
|
+
"dry-run": {
|
2005
|
+
tvl: {
|
2006
|
+
":campaignId": {
|
2007
|
+
get: {
|
2008
|
+
body: unknown;
|
2009
|
+
params: {
|
2010
|
+
campaignId: string;
|
2011
|
+
};
|
2012
|
+
query: unknown;
|
2013
|
+
headers: {
|
2014
|
+
authorization: string;
|
2015
|
+
};
|
2016
|
+
response: {
|
2017
|
+
200: unknown[];
|
2018
|
+
};
|
2014
2019
|
};
|
2015
2020
|
};
|
2016
2021
|
};
|
2017
2022
|
};
|
2018
2023
|
} & {
|
2019
|
-
"dry-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2024
|
+
"dry-run": {
|
2025
|
+
tvls: {
|
2026
|
+
":opportunityId": {
|
2027
|
+
get: {
|
2028
|
+
body: unknown;
|
2029
|
+
params: {
|
2030
|
+
opportunityId: string;
|
2031
|
+
};
|
2032
|
+
query: unknown;
|
2033
|
+
headers: {
|
2034
|
+
authorization: string;
|
2035
|
+
};
|
2036
|
+
response: {
|
2037
|
+
200: unknown[];
|
2038
|
+
};
|
2032
2039
|
};
|
2033
2040
|
};
|
2034
2041
|
};
|