@merkl/api 0.20.156 → 0.20.157

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.
@@ -1476,6 +1476,19 @@ declare const eden: {
1476
1476
  };
1477
1477
  }>>;
1478
1478
  };
1479
+ tvls: ((params: {
1480
+ opportunityId: string | number;
1481
+ }) => {
1482
+ put: (body: unknown, options: {
1483
+ headers: {
1484
+ authorization: string;
1485
+ };
1486
+ query?: Record<string, unknown> | undefined;
1487
+ fetch?: RequestInit | undefined;
1488
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1489
+ 200: unknown[];
1490
+ }>>;
1491
+ }) & {};
1479
1492
  index: {
1480
1493
  get: (options: {
1481
1494
  headers?: Record<string, unknown> | undefined;
@@ -1748,47 +1761,20 @@ declare const eden: {
1748
1761
  }>>;
1749
1762
  };
1750
1763
  };
1751
- "dry-runtvl": ((params: {
1752
- campaignId: string | number;
1753
- }) => {
1754
- get: (options: {
1755
- headers: {
1756
- authorization: string;
1757
- };
1758
- query?: Record<string, unknown> | undefined;
1759
- fetch?: RequestInit | undefined;
1760
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1761
- 200: unknown[];
1762
- }>>;
1763
- }) & {};
1764
- "dry-runtvls": ((params: {
1765
- opportunityId: string | number;
1766
- }) => {
1767
- get: (options: {
1768
- headers: {
1769
- authorization: string;
1770
- };
1771
- query?: Record<string, unknown> | undefined;
1772
- fetch?: RequestInit | undefined;
1773
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1774
- 200: unknown[];
1775
- }>>;
1776
- }) & {};
1777
1764
  "dry-run": {
1778
- tvls: {
1779
- list: {
1780
- post: (body: string[], options: {
1781
- headers: {
1782
- authorization: string;
1783
- };
1784
- query?: Record<string, unknown> | undefined;
1785
- fetch?: RequestInit | undefined;
1786
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1787
- 200: unknown[];
1788
- }>>;
1789
- };
1790
- };
1791
- tvl: {
1765
+ tvl: ((params: {
1766
+ campaignId: string | number;
1767
+ }) => {
1768
+ get: (options: {
1769
+ headers: {
1770
+ authorization: string;
1771
+ };
1772
+ query?: Record<string, unknown> | undefined;
1773
+ fetch?: RequestInit | undefined;
1774
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1775
+ 200: unknown[];
1776
+ }>>;
1777
+ }) & {
1792
1778
  post: (body: {
1793
1779
  id?: string | undefined;
1794
1780
  subType?: number | undefined;
@@ -1834,6 +1820,31 @@ declare const eden: {
1834
1820
  };
1835
1821
  }>>;
1836
1822
  };
1823
+ tvls: ((params: {
1824
+ opportunityId: string | number;
1825
+ }) => {
1826
+ get: (options: {
1827
+ headers: {
1828
+ authorization: string;
1829
+ };
1830
+ query?: Record<string, unknown> | undefined;
1831
+ fetch?: RequestInit | undefined;
1832
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1833
+ 200: unknown[];
1834
+ }>>;
1835
+ }) & {
1836
+ list: {
1837
+ post: (body: string[], options: {
1838
+ headers: {
1839
+ authorization: string;
1840
+ };
1841
+ query?: Record<string, unknown> | undefined;
1842
+ fetch?: RequestInit | undefined;
1843
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
1844
+ 200: unknown[];
1845
+ }>>;
1846
+ };
1847
+ };
1837
1848
  metadata: {
1838
1849
  post: (body: {
1839
1850
  id?: string | undefined;
@@ -2054,17 +2065,6 @@ declare const eden: {
2054
2065
  };
2055
2066
  };
2056
2067
  };
2057
- campaignstvls: ((params: {
2058
- opportunityId: string | number;
2059
- }) => {
2060
- put: (body?: unknown, options?: {
2061
- headers?: Record<string, unknown> | undefined;
2062
- query?: Record<string, unknown> | undefined;
2063
- fetch?: RequestInit | undefined;
2064
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
2065
- 200: unknown[];
2066
- }>>;
2067
- }) & {};
2068
2068
  campaignscount: {
2069
2069
  "by-chains": {
2070
2070
  get: (options: {
@@ -6840,6 +6840,24 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
6840
6840
  };
6841
6841
  };
6842
6842
  };
6843
+ } & {
6844
+ tvls: {
6845
+ ":opportunityId": {
6846
+ put: {
6847
+ body: unknown;
6848
+ params: {
6849
+ opportunityId: string;
6850
+ };
6851
+ query: unknown;
6852
+ headers: {
6853
+ authorization: string;
6854
+ };
6855
+ response: {
6856
+ 200: unknown[];
6857
+ };
6858
+ };
6859
+ };
6860
+ };
6843
6861
  } & {
6844
6862
  index: {
6845
6863
  get: {
@@ -7120,21 +7138,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7120
7138
  };
7121
7139
  };
7122
7140
  };
7123
- campaignstvls: {
7124
- ":opportunityId": {
7125
- put: {
7126
- body: unknown;
7127
- params: {
7128
- opportunityId: string;
7129
- };
7130
- query: unknown;
7131
- headers: unknown;
7132
- response: {
7133
- 200: unknown[];
7134
- };
7135
- };
7136
- };
7137
- };
7138
7141
  } & {
7139
7142
  campaigns: {
7140
7143
  index: {
@@ -7416,37 +7419,41 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
7416
7419
  } & {
7417
7420
  v4: {
7418
7421
  campaigns: {
7419
- "dry-runtvl": {
7420
- ":campaignId": {
7421
- get: {
7422
- body: unknown;
7423
- params: {
7424
- campaignId: string;
7425
- };
7426
- query: unknown;
7427
- headers: {
7428
- authorization: string;
7429
- };
7430
- response: {
7431
- 200: unknown[];
7422
+ "dry-run": {
7423
+ tvl: {
7424
+ ":campaignId": {
7425
+ get: {
7426
+ body: unknown;
7427
+ params: {
7428
+ campaignId: string;
7429
+ };
7430
+ query: unknown;
7431
+ headers: {
7432
+ authorization: string;
7433
+ };
7434
+ response: {
7435
+ 200: unknown[];
7436
+ };
7432
7437
  };
7433
7438
  };
7434
7439
  };
7435
7440
  };
7436
7441
  } & {
7437
- "dry-runtvls": {
7438
- ":opportunityId": {
7439
- get: {
7440
- body: unknown;
7441
- params: {
7442
- opportunityId: string;
7443
- };
7444
- query: unknown;
7445
- headers: {
7446
- authorization: string;
7447
- };
7448
- response: {
7449
- 200: unknown[];
7442
+ "dry-run": {
7443
+ tvls: {
7444
+ ":opportunityId": {
7445
+ get: {
7446
+ body: unknown;
7447
+ params: {
7448
+ opportunityId: string;
7449
+ };
7450
+ query: unknown;
7451
+ headers: {
7452
+ authorization: string;
7453
+ };
7454
+ response: {
7455
+ 200: unknown[];
7456
+ };
7450
7457
  };
7451
7458
  };
7452
7459
  };
@@ -13285,6 +13292,19 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13285
13292
  };
13286
13293
  }>>;
13287
13294
  };
13295
+ tvls: ((params: {
13296
+ opportunityId: string | number;
13297
+ }) => {
13298
+ put: (body: unknown, options: {
13299
+ headers: {
13300
+ authorization: string;
13301
+ };
13302
+ query?: Record<string, unknown> | undefined;
13303
+ fetch?: RequestInit | undefined;
13304
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13305
+ 200: unknown[];
13306
+ }>>;
13307
+ }) & {};
13288
13308
  index: {
13289
13309
  get: (options: {
13290
13310
  headers?: Record<string, unknown> | undefined;
@@ -13557,47 +13577,20 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13557
13577
  }>>;
13558
13578
  };
13559
13579
  };
13560
- "dry-runtvl": ((params: {
13561
- campaignId: string | number;
13562
- }) => {
13563
- get: (options: {
13564
- headers: {
13565
- authorization: string;
13566
- };
13567
- query?: Record<string, unknown> | undefined;
13568
- fetch?: RequestInit | undefined;
13569
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13570
- 200: unknown[];
13571
- }>>;
13572
- }) & {};
13573
- "dry-runtvls": ((params: {
13574
- opportunityId: string | number;
13575
- }) => {
13576
- get: (options: {
13577
- headers: {
13578
- authorization: string;
13579
- };
13580
- query?: Record<string, unknown> | undefined;
13581
- fetch?: RequestInit | undefined;
13582
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13583
- 200: unknown[];
13584
- }>>;
13585
- }) & {};
13586
13580
  "dry-run": {
13587
- tvls: {
13588
- list: {
13589
- post: (body: string[], options: {
13590
- headers: {
13591
- authorization: string;
13592
- };
13593
- query?: Record<string, unknown> | undefined;
13594
- fetch?: RequestInit | undefined;
13595
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13596
- 200: unknown[];
13597
- }>>;
13598
- };
13599
- };
13600
- tvl: {
13581
+ tvl: ((params: {
13582
+ campaignId: string | number;
13583
+ }) => {
13584
+ get: (options: {
13585
+ headers: {
13586
+ authorization: string;
13587
+ };
13588
+ query?: Record<string, unknown> | undefined;
13589
+ fetch?: RequestInit | undefined;
13590
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13591
+ 200: unknown[];
13592
+ }>>;
13593
+ }) & {
13601
13594
  post: (body: {
13602
13595
  id?: string | undefined;
13603
13596
  subType?: number | undefined;
@@ -13643,6 +13636,31 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13643
13636
  };
13644
13637
  }>>;
13645
13638
  };
13639
+ tvls: ((params: {
13640
+ opportunityId: string | number;
13641
+ }) => {
13642
+ get: (options: {
13643
+ headers: {
13644
+ authorization: string;
13645
+ };
13646
+ query?: Record<string, unknown> | undefined;
13647
+ fetch?: RequestInit | undefined;
13648
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13649
+ 200: unknown[];
13650
+ }>>;
13651
+ }) & {
13652
+ list: {
13653
+ post: (body: string[], options: {
13654
+ headers: {
13655
+ authorization: string;
13656
+ };
13657
+ query?: Record<string, unknown> | undefined;
13658
+ fetch?: RequestInit | undefined;
13659
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13660
+ 200: unknown[];
13661
+ }>>;
13662
+ };
13663
+ };
13646
13664
  metadata: {
13647
13665
  post: (body: {
13648
13666
  id?: string | undefined;
@@ -13863,17 +13881,6 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
13863
13881
  };
13864
13882
  };
13865
13883
  };
13866
- campaignstvls: ((params: {
13867
- opportunityId: string | number;
13868
- }) => {
13869
- put: (body?: unknown, options?: {
13870
- headers?: Record<string, unknown> | undefined;
13871
- query?: Record<string, unknown> | undefined;
13872
- fetch?: RequestInit | undefined;
13873
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
13874
- 200: unknown[];
13875
- }>>;
13876
- }) & {};
13877
13884
  campaignscount: {
13878
13885
  "by-chains": {
13879
13886
  get: (options: {
@@ -1552,6 +1552,24 @@ declare const app: Elysia<"", false, {
1552
1552
  };
1553
1553
  };
1554
1554
  };
1555
+ } & {
1556
+ tvls: {
1557
+ ":opportunityId": {
1558
+ put: {
1559
+ body: unknown;
1560
+ params: {
1561
+ opportunityId: string;
1562
+ };
1563
+ query: unknown;
1564
+ headers: {
1565
+ authorization: string;
1566
+ };
1567
+ response: {
1568
+ 200: unknown[];
1569
+ };
1570
+ };
1571
+ };
1572
+ };
1555
1573
  } & {
1556
1574
  index: {
1557
1575
  get: {
@@ -1832,21 +1850,6 @@ declare const app: Elysia<"", false, {
1832
1850
  };
1833
1851
  };
1834
1852
  };
1835
- campaignstvls: {
1836
- ":opportunityId": {
1837
- put: {
1838
- body: unknown;
1839
- params: {
1840
- opportunityId: string;
1841
- };
1842
- query: unknown;
1843
- headers: unknown;
1844
- response: {
1845
- 200: unknown[];
1846
- };
1847
- };
1848
- };
1849
- };
1850
1853
  } & {
1851
1854
  campaigns: {
1852
1855
  index: {
@@ -2128,37 +2131,41 @@ declare const app: Elysia<"", false, {
2128
2131
  } & {
2129
2132
  v4: {
2130
2133
  campaigns: {
2131
- "dry-runtvl": {
2132
- ":campaignId": {
2133
- get: {
2134
- body: unknown;
2135
- params: {
2136
- campaignId: string;
2137
- };
2138
- query: unknown;
2139
- headers: {
2140
- authorization: string;
2141
- };
2142
- response: {
2143
- 200: unknown[];
2134
+ "dry-run": {
2135
+ tvl: {
2136
+ ":campaignId": {
2137
+ get: {
2138
+ body: unknown;
2139
+ params: {
2140
+ campaignId: string;
2141
+ };
2142
+ query: unknown;
2143
+ headers: {
2144
+ authorization: string;
2145
+ };
2146
+ response: {
2147
+ 200: unknown[];
2148
+ };
2144
2149
  };
2145
2150
  };
2146
2151
  };
2147
2152
  };
2148
2153
  } & {
2149
- "dry-runtvls": {
2150
- ":opportunityId": {
2151
- get: {
2152
- body: unknown;
2153
- params: {
2154
- opportunityId: string;
2155
- };
2156
- query: unknown;
2157
- headers: {
2158
- authorization: string;
2159
- };
2160
- response: {
2161
- 200: unknown[];
2154
+ "dry-run": {
2155
+ tvls: {
2156
+ ":opportunityId": {
2157
+ get: {
2158
+ body: unknown;
2159
+ params: {
2160
+ opportunityId: string;
2161
+ };
2162
+ query: unknown;
2163
+ headers: {
2164
+ authorization: string;
2165
+ };
2166
+ response: {
2167
+ 200: unknown[];
2168
+ };
2162
2169
  };
2163
2170
  };
2164
2171
  };
@@ -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-runtvl": {
17
- ":campaignId": {
18
- get: {
19
- body: unknown;
20
- params: {
21
- campaignId: string;
22
- };
23
- query: unknown;
24
- headers: {
25
- authorization: string;
26
- };
27
- response: {
28
- 200: unknown[];
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-runtvls": {
35
- ":opportunityId": {
36
- get: {
37
- body: unknown;
38
- params: {
39
- opportunityId: string;
40
- };
41
- query: unknown;
42
- headers: {
43
- authorization: string;
44
- };
45
- response: {
46
- 200: unknown[];
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,7 +29,7 @@ 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
35
  status: "LIVE",
@@ -40,6 +40,10 @@ export const CampaignTestController = new Elysia({
40
40
  if (!campaigns.length)
41
41
  throw new NotFoundError("Opportunity not found");
42
42
  return await DynamicDataService.update(campaigns[0]?.computeChainId, campaigns[0].campaignType, campaigns, true);
43
+ }, {
44
+ beforeHandle: BackOfficeGuard,
45
+ headers: AuthorizationHeadersDto,
46
+ detail: { hide: true },
43
47
  })
44
48
  // ─── Test TVL computation with a list of campaignId ───────────────────────
45
49
  .post("/tvls/list", async ({ body }) => {