@merkl/api 0.10.138 → 0.10.139

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.
Files changed (62) hide show
  1. package/dist/src/eden/index.d.ts +291 -520
  2. package/dist/src/index.d.ts +99 -186
  3. package/dist/src/index.js +1 -1
  4. package/dist/src/libs/deprecated-merklv3/index.js +1 -1
  5. package/dist/src/modules/v4/blacklist/blacklist.controller.d.ts +0 -21
  6. package/dist/src/modules/v4/blacklist/blacklist.controller.js +2 -2
  7. package/dist/src/modules/v4/blacklist/blacklist.repository.d.ts +0 -8
  8. package/dist/src/modules/v4/blacklist/blacklist.repository.js +1 -4
  9. package/dist/src/modules/v4/blacklist/blacklist.service.d.ts +1 -9
  10. package/dist/src/modules/v4/blacklist/blacklist.service.js +1 -4
  11. package/dist/src/modules/v4/campaign/campaign.controller.d.ts +3 -3
  12. package/dist/src/modules/v4/campaign/campaign.controller.js +8 -6
  13. package/dist/src/modules/v4/campaign/campaign.service.js +1 -2
  14. package/dist/src/modules/v4/chain/chain.controller.js +2 -1
  15. package/dist/src/modules/v4/dynamicData/dynamicData.controller.d.ts +20 -26
  16. package/dist/src/modules/v4/dynamicData/dynamicData.controller.js +5 -5
  17. package/dist/src/modules/v4/enso/enso.service.d.ts +1 -1
  18. package/dist/src/modules/v4/{participate/participate.controller.d.ts → interaction/interaction.controller.d.ts} +6 -6
  19. package/dist/src/modules/v4/{participate/participate.controller.js → interaction/interaction.controller.js} +12 -13
  20. package/dist/src/modules/v4/{participate/participate.model.d.ts → interaction/interaction.model.d.ts} +12 -12
  21. package/dist/src/modules/v4/{participate/participate.model.js → interaction/interaction.model.js} +3 -3
  22. package/dist/src/modules/v4/{participate/participate.service.d.ts → interaction/interaction.service.d.ts} +5 -5
  23. package/dist/src/modules/v4/{participate/participate.service.js → interaction/interaction.service.js} +3 -3
  24. package/dist/src/modules/v4/merklRoot/merklRoot.controller.d.ts +2 -2
  25. package/dist/src/modules/v4/merklRoot/merklRoot.controller.js +2 -2
  26. package/dist/src/modules/v4/opportunity/opportunity.controller.js +5 -1
  27. package/dist/src/modules/v4/price/price.controller.js +3 -0
  28. package/dist/src/modules/v4/reward/reward.controller.d.ts +31 -29
  29. package/dist/src/modules/v4/reward/reward.controller.js +3 -3
  30. package/dist/src/modules/v4/reward/{rewardConvertor.service.d.ts → subservices/converter.d.ts} +2 -2
  31. package/dist/src/modules/v4/reward/{rewardConvertor.service.js → subservices/converter.js} +1 -1
  32. package/dist/src/modules/v4/router.d.ts +99 -186
  33. package/dist/src/modules/v4/router.js +2 -2
  34. package/dist/src/modules/v4/status/status.controller.d.ts +40 -102
  35. package/dist/src/modules/v4/status/status.controller.js +16 -22
  36. package/dist/src/modules/v4/status/status.model.d.ts +33 -26
  37. package/dist/src/modules/v4/status/status.model.js +9 -20
  38. package/dist/src/modules/v4/status/status.repository.d.ts +12 -42
  39. package/dist/src/modules/v4/status/status.repository.js +10 -22
  40. package/dist/src/modules/v4/status/status.service.d.ts +4 -36
  41. package/dist/src/modules/v4/status/status.service.js +9 -18
  42. package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.d.ts +1 -1
  43. package/dist/src/modules/v4/uniswapV4/uniswapV4.controller.js +1 -1
  44. package/dist/src/modules/v4/user/user.controller.js +3 -2
  45. package/dist/src/routes/v3/ERC20Campaigns.d.ts +99 -186
  46. package/dist/src/routes/v3/blacklist.d.ts +99 -186
  47. package/dist/src/routes/v3/campaigns.d.ts +99 -186
  48. package/dist/src/routes/v3/campaignsInfo.d.ts +99 -186
  49. package/dist/src/routes/v3/multiChainPositions.d.ts +99 -186
  50. package/dist/src/routes/v3/opportunity.d.ts +99 -186
  51. package/dist/src/routes/v3/positions.d.ts +99 -186
  52. package/dist/src/routes/v3/rewards.d.ts +99 -186
  53. package/dist/src/routes/v3/rewards.js +1 -1
  54. package/dist/src/routes/v3/updates.d.ts +99 -186
  55. package/dist/src/routes/v3/userRewards.d.ts +99 -186
  56. package/dist/src/routes/v3/userRewards.js +1 -1
  57. package/dist/tsconfig.package.tsbuildinfo +1 -1
  58. package/package.json +1 -2
  59. package/dist/src/modules/v4/apr/apr.repository.d.ts +0 -0
  60. package/dist/src/modules/v4/apr/apr.repository.js +0 -1
  61. package/dist/src/modules/v4/tvl/tvl.repository.d.ts +0 -0
  62. package/dist/src/modules/v4/tvl/tvl.repository.js +0 -1
@@ -598,7 +598,7 @@ declare const app: Elysia<"", false, {
598
598
  };
599
599
  };
600
600
  } & {
601
- campaignsToProcess: {
601
+ "campaigns-to-process": {
602
602
  index: {
603
603
  get: {
604
604
  body: unknown;
@@ -620,7 +620,7 @@ declare const app: Elysia<"", false, {
620
620
  };
621
621
  };
622
622
  } & {
623
- campaignsToProcess: {
623
+ "campaigns-to-process": {
624
624
  count: {
625
625
  get: {
626
626
  body: unknown;
@@ -636,7 +636,7 @@ declare const app: Elysia<"", false, {
636
636
  };
637
637
  };
638
638
  } & {
639
- campaignsToProcess: {
639
+ "campaigns-to-process": {
640
640
  index: {
641
641
  post: {
642
642
  body: unknown;
@@ -935,35 +935,37 @@ declare const app: Elysia<"", false, {
935
935
  };
936
936
  } & {
937
937
  rewards: {
938
- pendings: {
939
- post: {
940
- body: {
941
- distributionChainId: number;
942
- campaignId: string;
943
- root: string;
944
- rewardToken: string;
945
- toUpdate: {
946
- auxiliaryData1?: string | undefined;
947
- auxiliaryData2?: string | undefined;
948
- reason: string;
949
- pending: string;
950
- recipient: string;
951
- }[];
952
- toCreate: {
953
- auxiliaryData1?: string | undefined;
954
- auxiliaryData2?: string | undefined;
955
- reason: string;
956
- pending: string;
957
- recipient: string;
958
- }[];
959
- };
960
- params: {};
961
- query: unknown;
962
- headers: {
963
- authorization: string;
964
- };
965
- response: {
966
- 200: boolean;
938
+ engine: {
939
+ pendings: {
940
+ post: {
941
+ body: {
942
+ distributionChainId: number;
943
+ campaignId: string;
944
+ root: string;
945
+ rewardToken: string;
946
+ toUpdate: {
947
+ auxiliaryData1?: string | undefined;
948
+ auxiliaryData2?: string | undefined;
949
+ reason: string;
950
+ pending: string;
951
+ recipient: string;
952
+ }[];
953
+ toCreate: {
954
+ auxiliaryData1?: string | undefined;
955
+ auxiliaryData2?: string | undefined;
956
+ reason: string;
957
+ pending: string;
958
+ recipient: string;
959
+ }[];
960
+ };
961
+ params: {};
962
+ query: unknown;
963
+ headers: {
964
+ authorization: string;
965
+ };
966
+ response: {
967
+ 200: boolean;
968
+ };
967
969
  };
968
970
  };
969
971
  };
@@ -1271,27 +1273,6 @@ declare const app: Elysia<"", false, {
1271
1273
  v4: {
1272
1274
  blacklists: {
1273
1275
  index: {
1274
- get: {
1275
- body: unknown;
1276
- params: {};
1277
- query: unknown;
1278
- headers: unknown;
1279
- response: {
1280
- 200: {
1281
- id: string;
1282
- chainId: number;
1283
- poolAddress: string;
1284
- userAddress: string;
1285
- arrestTimestamp: bigint;
1286
- arrestDetails: import("database/api/.generated/runtime/library").JsonValue;
1287
- }[];
1288
- };
1289
- };
1290
- };
1291
- };
1292
- } & {
1293
- blacklists: {
1294
- all: {
1295
1276
  get: {
1296
1277
  body: unknown;
1297
1278
  params: {};
@@ -1718,7 +1699,7 @@ declare const app: Elysia<"", false, {
1718
1699
  } & {
1719
1700
  v4: {
1720
1701
  roots: {
1721
- timestamps: {
1702
+ index: {
1722
1703
  get: {
1723
1704
  body: unknown;
1724
1705
  params: {};
@@ -1741,7 +1722,7 @@ declare const app: Elysia<"", false, {
1741
1722
  };
1742
1723
  } & {
1743
1724
  roots: {
1744
- index: {
1725
+ live: {
1745
1726
  get: {
1746
1727
  body: unknown;
1747
1728
  params: {};
@@ -1760,7 +1741,7 @@ declare const app: Elysia<"", false, {
1760
1741
  };
1761
1742
  } & {
1762
1743
  v4: {
1763
- participate: {
1744
+ interaction: {
1764
1745
  targets: {
1765
1746
  get: {
1766
1747
  body: unknown;
@@ -1772,13 +1753,13 @@ declare const app: Elysia<"", false, {
1772
1753
  };
1773
1754
  headers: unknown;
1774
1755
  response: {
1775
- 200: import("./modules/v4/participate/participate.model").ParticipateTarget[] | undefined;
1756
+ 200: import("./modules/v4/interaction/interaction.model").InteractionTarget[] | undefined;
1776
1757
  };
1777
1758
  };
1778
1759
  };
1779
1760
  };
1780
1761
  } & {
1781
- participate: {
1762
+ interaction: {
1782
1763
  protocols: {
1783
1764
  get: {
1784
1765
  body: unknown;
@@ -1801,7 +1782,7 @@ declare const app: Elysia<"", false, {
1801
1782
  };
1802
1783
  };
1803
1784
  } & {
1804
- participate: {
1785
+ interaction: {
1805
1786
  quote: {
1806
1787
  get: {
1807
1788
  body: unknown;
@@ -1827,7 +1808,7 @@ declare const app: Elysia<"", false, {
1827
1808
  };
1828
1809
  };
1829
1810
  } & {
1830
- participate: {
1811
+ interaction: {
1831
1812
  transaction: {
1832
1813
  get: {
1833
1814
  body: unknown;
@@ -2049,31 +2030,25 @@ declare const app: Elysia<"", false, {
2049
2030
  };
2050
2031
  } & {
2051
2032
  v4: {
2052
- dynamicData: {
2053
- chainId: {
2054
- ":chainId": {
2055
- token: {
2056
- ":tokenAddress": {
2057
- get: {
2058
- body: unknown;
2059
- params: {
2060
- chainId: number;
2061
- tokenAddress: string;
2062
- };
2063
- query: unknown;
2064
- headers: {
2065
- authorization: string;
2066
- };
2067
- response: {
2068
- 200: {
2069
- tvl: number;
2070
- totalSupply: number;
2071
- cardName: string;
2072
- blacklistedSupply: number;
2073
- priceTargetToken: number;
2074
- };
2075
- };
2076
- };
2033
+ "dynamic-data": {
2034
+ index: {
2035
+ get: {
2036
+ body: unknown;
2037
+ params: {};
2038
+ query: {
2039
+ chainId: number;
2040
+ tokenAddress: string;
2041
+ };
2042
+ headers: {
2043
+ authorization: string;
2044
+ };
2045
+ response: {
2046
+ 200: {
2047
+ tvl: number;
2048
+ totalSupply: number;
2049
+ cardName: string;
2050
+ blacklistedSupply: number;
2051
+ priceTargetToken: number;
2077
2052
  };
2078
2053
  };
2079
2054
  };
@@ -2082,11 +2057,11 @@ declare const app: Elysia<"", false, {
2082
2057
  };
2083
2058
  } & {
2084
2059
  v4: {
2085
- campaignStatus: {
2060
+ "campaign-status": {
2086
2061
  engine: {
2087
- post: {
2088
- body: {
2089
- status: {
2062
+ ":campaignId": {
2063
+ put: {
2064
+ body: {
2090
2065
  value: "SUCCESS";
2091
2066
  computedUntil: number;
2092
2067
  } | {
@@ -2100,90 +2075,74 @@ declare const app: Elysia<"", false, {
2100
2075
  details: string;
2101
2076
  value: "FAILED";
2102
2077
  };
2103
- campaignId: string;
2104
- distributionChain: number;
2105
- };
2106
- params: {};
2107
- query: unknown;
2108
- headers: {
2109
- authorization: string;
2110
- };
2111
- response: {
2112
- 200: void;
2078
+ params: {
2079
+ campaignId: string;
2080
+ };
2081
+ query: unknown;
2082
+ headers: {
2083
+ authorization: string;
2084
+ };
2085
+ response: {
2086
+ 200: void;
2087
+ };
2113
2088
  };
2114
2089
  };
2115
2090
  };
2116
2091
  };
2117
2092
  } & {
2118
- campaignStatus: {
2119
- index: {
2120
- get: {
2121
- body: unknown;
2122
- params: {};
2123
- query: unknown;
2124
- headers: unknown;
2125
- response: {
2126
- 200: {
2127
- error: string;
2128
- details: import("database/api/.generated/runtime/library").JsonValue;
2129
- status: import("../database/api/.generated").$Enums.RunStatus;
2093
+ "campaign-status": {
2094
+ engine: {
2095
+ overlaps: {
2096
+ get: {
2097
+ body: unknown;
2098
+ params: {};
2099
+ query: {
2130
2100
  campaignId: string;
2131
- computedUntil: bigint;
2132
- processingStarted: bigint;
2133
- }[];
2101
+ distributionChain: number;
2102
+ };
2103
+ headers: {
2104
+ authorization: string;
2105
+ };
2106
+ response: {
2107
+ 200: boolean;
2108
+ };
2134
2109
  };
2135
2110
  };
2136
2111
  };
2137
2112
  };
2138
2113
  } & {
2139
- campaignStatus: {
2140
- status: {
2114
+ "campaign-status": {
2115
+ index: {
2141
2116
  get: {
2142
2117
  body: unknown;
2143
2118
  params: {};
2144
2119
  query: {
2145
- status: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[];
2120
+ status?: "PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED" | ("PROCESSING" | "SUCCESS" | "FAILED" | "SKIPPED")[] | undefined;
2121
+ computeChainId?: number | undefined;
2146
2122
  };
2147
2123
  headers: unknown;
2148
2124
  response: {
2149
- 200: ({
2150
- Campaign: {
2151
- type: import("../database/api/.generated").$Enums.CampaignType;
2152
- id: string;
2153
- params: import("database/api/.generated/runtime/library").JsonValue;
2154
- subType: number | null;
2155
- startTimestamp: bigint;
2156
- endTimestamp: bigint;
2157
- computeChainId: number;
2158
- distributionChainId: number;
2159
- campaignId: string;
2160
- rewardTokenId: string;
2161
- amount: string;
2162
- opportunityId: string;
2163
- creatorAddress: string;
2164
- };
2165
- } & {
2125
+ 200: {
2166
2126
  error: string;
2167
2127
  details: import("database/api/.generated/runtime/library").JsonValue;
2168
2128
  status: import("../database/api/.generated").$Enums.RunStatus;
2169
2129
  campaignId: string;
2170
2130
  computedUntil: bigint;
2171
2131
  processingStarted: bigint;
2172
- })[];
2132
+ }[];
2173
2133
  };
2174
2134
  };
2175
2135
  };
2176
2136
  };
2177
2137
  } & {
2178
- campaignStatus: {
2179
- unique: {
2138
+ "campaign-status": {
2139
+ ":campaignId": {
2180
2140
  get: {
2181
2141
  body: unknown;
2182
- params: {};
2183
- query: {
2142
+ params: {
2184
2143
  campaignId: string;
2185
- distributionChain: number;
2186
2144
  };
2145
+ query: unknown;
2187
2146
  headers: unknown;
2188
2147
  response: {
2189
2148
  200: {
@@ -2198,52 +2157,6 @@ declare const app: Elysia<"", false, {
2198
2157
  };
2199
2158
  };
2200
2159
  };
2201
- } & {
2202
- campaignStatus: {
2203
- computeChain: {
2204
- ":chainId": {
2205
- get: {
2206
- body: unknown;
2207
- params: {
2208
- chainId: number;
2209
- };
2210
- query: unknown;
2211
- headers: unknown;
2212
- response: {
2213
- 200: {
2214
- error: string;
2215
- details: import("database/api/.generated/runtime/library").JsonValue;
2216
- status: import("../database/api/.generated").$Enums.RunStatus;
2217
- campaignId: string;
2218
- computedUntil: bigint;
2219
- processingStarted: bigint;
2220
- }[];
2221
- };
2222
- };
2223
- };
2224
- };
2225
- };
2226
- } & {
2227
- campaignStatus: {
2228
- engine: {
2229
- overlaps: {
2230
- get: {
2231
- body: unknown;
2232
- params: {};
2233
- query: {
2234
- campaignId: string;
2235
- distributionChain: number;
2236
- };
2237
- headers: {
2238
- authorization: string;
2239
- };
2240
- response: {
2241
- 200: boolean;
2242
- };
2243
- };
2244
- };
2245
- };
2246
- };
2247
2160
  };
2248
2161
  }, {
2249
2162
  derive: {};
package/dist/src/index.js CHANGED
@@ -32,7 +32,7 @@ const app = new Elysia({
32
32
  version: "1.0.1",
33
33
  },
34
34
  },
35
- exclude: [/v4\/(?!users\/[^/]+\/rewards$).*/, /v1\/.*/, /v2\/.*/],
35
+ exclude: [/engine\/*/, /v1\/.*/, /v2\/.*/],
36
36
  }))
37
37
  .use(cors())
38
38
  .get("/", () => "Merkl API")
@@ -1,5 +1,5 @@
1
1
  import { Redis } from "../../cache";
2
- import { RewardConvertorService } from "../../modules/v4/reward/rewardConvertor.service";
2
+ import { RewardConvertorService } from "../../modules/v4/reward/subservices/converter";
3
3
  import { AMM, ANGLE_NETWORKS, Campaign, NETWORK_LABELS, } from "@sdk";
4
4
  import Big from "big.js";
5
5
  import { utils } from "ethers";
@@ -14,27 +14,6 @@ export declare const BlacklistController: Elysia<"/blacklists", false, {
14
14
  }, {
15
15
  blacklists: {
16
16
  index: {
17
- get: {
18
- body: unknown;
19
- params: {};
20
- query: unknown;
21
- headers: unknown;
22
- response: {
23
- 200: {
24
- id: string;
25
- chainId: number;
26
- poolAddress: string;
27
- userAddress: string;
28
- arrestTimestamp: bigint;
29
- arrestDetails: import("database/api/.generated/runtime/library").JsonValue;
30
- }[];
31
- };
32
- };
33
- };
34
- };
35
- } & {
36
- blacklists: {
37
- all: {
38
17
  get: {
39
18
  body: unknown;
40
19
  params: {};
@@ -7,8 +7,6 @@ import { BlacklistService } from "./blacklist.service";
7
7
  export const BlacklistController = new Elysia({ prefix: "/blacklists", detail: { tags: ["Blacklists"] } })
8
8
  // ─── Get Entire Blacklist ────────────────────────────────────────────
9
9
  .get("/", async () => await BlacklistService.findMany())
10
- // ─── Get Blacklist From Cache ────────────────────────────────────────
11
- .get("/all", async () => await BlacklistService.getMany())
12
10
  // ─── Check If An Address Is Blacklisted ──────────────────────────────
13
11
  .get("/check/:address", async ({ params }) => await BlacklistService.isBlacklisted(params.address), {
14
12
  params: CheckBlacklistDto,
@@ -29,6 +27,7 @@ export const BlacklistController = new Elysia({ prefix: "/blacklists", detail: {
29
27
  body.poolAddress = throwOnInvalidRequiredAddress(body.poolAddress ?? NULL_ADDRESS);
30
28
  throwOnUnsupportedChainId(body.chainId);
31
29
  },
30
+ detail: { hide: true },
32
31
  })
33
32
  // ─── Remove A User From Blacklist ────────────────────────────────────
34
33
  .delete("/user/:address", async ({ params }) => await BlacklistService.remove(params.address), {
@@ -38,4 +37,5 @@ export const BlacklistController = new Elysia({ prefix: "/blacklists", detail: {
38
37
  await BackOfficeGuard({ headers });
39
38
  params.address = throwOnInvalidRequiredAddress(params.address);
40
39
  },
40
+ detail: { hide: true },
41
41
  });
@@ -1,14 +1,6 @@
1
1
  import type { AddBlacklistModel } from "./blacklist.model";
2
2
  export declare class BlacklistRepository {
3
3
  static findMany(): Promise<{
4
- id: string;
5
- chainId: number;
6
- poolAddress: string;
7
- userAddress: string;
8
- arrestTimestamp: bigint;
9
- arrestDetails: import("database/api/.generated/runtime/library").JsonValue;
10
- }[]>;
11
- static getMany(): Promise<{
12
4
  [address: string]: boolean;
13
5
  }>;
14
6
  static check(address: string): Promise<boolean>;
@@ -3,10 +3,7 @@ import { NULL_ADDRESS } from "@sdk";
3
3
  import { utils } from "ethers";
4
4
  export class BlacklistRepository {
5
5
  static async findMany() {
6
- return await apiDbClient.blacklist.findMany();
7
- }
8
- static async getMany() {
9
- return (await BlacklistRepository.findMany()).reduce((prev, { userAddress, arrestTimestamp }) => {
6
+ return (await apiDbClient.blacklist.findMany()).reduce((prev, { userAddress, arrestTimestamp }) => {
10
7
  if (!!arrestTimestamp) {
11
8
  prev[utils.getAddress(userAddress)] = true;
12
9
  }
@@ -2,17 +2,9 @@ import type { ChainId } from "@sdk";
2
2
  import type { AddBlacklistModel } from ".";
3
3
  export declare class BlacklistService {
4
4
  static hashId(chainId: ChainId, userAddress: string, poolAddress: string): string;
5
- static getMany(): Promise<{
5
+ static findMany(): Promise<{
6
6
  [address: string]: boolean;
7
7
  }>;
8
- static findMany(): Promise<{
9
- id: string;
10
- chainId: number;
11
- poolAddress: string;
12
- userAddress: string;
13
- arrestTimestamp: bigint;
14
- arrestDetails: import("database/api/.generated/runtime/library").JsonValue;
15
- }[]>;
16
8
  static isBlacklisted(address: string): Promise<boolean>;
17
9
  static remove(address: string): Promise<boolean>;
18
10
  static add(x: AddBlacklistModel): Promise<{
@@ -6,11 +6,8 @@ export class BlacklistService {
6
6
  static hashId(chainId, userAddress, poolAddress) {
7
7
  return Bun.hash(`${chainId}${userAddress}${poolAddress}`).toString();
8
8
  }
9
- static async getMany() {
10
- return await CacheService.wrap(TTLPresets.MIN_5, BlacklistRepository.getMany);
11
- }
12
9
  static async findMany() {
13
- return await BlacklistRepository.findMany();
10
+ return await CacheService.wrap(TTLPresets.MIN_5, BlacklistRepository.findMany);
14
11
  }
15
12
  static async isBlacklisted(address) {
16
13
  return BlacklistRepository.check(utils.getAddress(address));
@@ -140,7 +140,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
140
140
  };
141
141
  };
142
142
  } & {
143
- campaignsToProcess: {
143
+ "campaigns-to-process": {
144
144
  index: {
145
145
  get: {
146
146
  body: unknown;
@@ -162,7 +162,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
162
162
  };
163
163
  };
164
164
  } & {
165
- campaignsToProcess: {
165
+ "campaigns-to-process": {
166
166
  count: {
167
167
  get: {
168
168
  body: unknown;
@@ -178,7 +178,7 @@ export declare const CampaignController: Elysia<"/campaigns", false, {
178
178
  };
179
179
  };
180
180
  } & {
181
- campaignsToProcess: {
181
+ "campaigns-to-process": {
182
182
  index: {
183
183
  post: {
184
184
  body: unknown;
@@ -1,7 +1,7 @@
1
1
  import { AuthorizationHeadersDto, EngineGuard } from "../../../guards/Engine.guard";
2
2
  import Elysia from "elysia";
3
3
  import { throwOnUnsupportedChainId } from "src/utils/throw";
4
- import { ChainDto } from "../status";
4
+ import { ChainUniqueDto } from "../chain";
5
5
  import { CreateCampaignDto, GetCampaignQueryDto } from "./campaign.model";
6
6
  import { CampaignService } from "./campaign.service";
7
7
  // ─── Campaigns Controller ────────────────────────────────────────────────────
@@ -11,34 +11,36 @@ export const CampaignController = new Elysia({ prefix: "/campaigns", detail: { t
11
11
  beforeHandle: EngineGuard,
12
12
  headers: AuthorizationHeadersDto,
13
13
  body: CreateCampaignDto,
14
+ detail: { hide: true },
14
15
  })
15
16
  // ─── Get Many Campaigns ──────────────────────────────────────────────
16
17
  .get("/", async ({ query }) => await CampaignService.findMany(query), { query: GetCampaignQueryDto })
17
18
  // ─── Get Total Campaigns Count ───────────────────────────────────────
18
19
  .get("/count", async ({ query }) => await CampaignService.countMany(query), { query: GetCampaignQueryDto })
19
- .group("/campaignsToProcess", app => {
20
+ .group("/campaigns-to-process", app => {
20
21
  return (app
21
- // ─── Get the List of CampaignsToProcess ─────────────────────────────-
22
+ // ─── Get The List Of Campaigns To Process ────
22
23
  .get("/", async ({ query }) => await CampaignService.findCampaignsToProcess(query.chainId), {
23
- query: ChainDto,
24
+ query: ChainUniqueDto,
24
25
  beforeHandle: ({ query }) => {
25
26
  throwOnUnsupportedChainId(query.chainId);
26
27
  },
27
28
  })
28
29
  // ─── Get Count of CampaignsToProcess ─────────────────────────────────
29
30
  .get("/count", async ({ query }) => (await CampaignService.findCampaignsToProcess(query.chainId)).length, {
30
- query: ChainDto,
31
+ query: ChainUniqueDto,
31
32
  beforeHandle: ({ query }) => {
32
33
  throwOnUnsupportedChainId(query.chainId);
33
34
  },
34
35
  })
35
36
  // ─── Returns a CampaignId to Process and flags it as PROCESSING ──────-
36
37
  .post("/", async ({ query }) => await CampaignService.pickCampaignToProcess(query.chainId), {
37
- query: ChainDto,
38
+ query: ChainUniqueDto,
38
39
  beforeHandle: async ({ query, headers }) => {
39
40
  await EngineGuard({ headers });
40
41
  throwOnUnsupportedChainId(query.chainId);
41
42
  },
42
43
  headers: AuthorizationHeadersDto,
44
+ detail: { hide: true },
43
45
  }));
44
46
  });
@@ -87,8 +87,7 @@ export class CampaignService {
87
87
  await StatusService.update({
88
88
  distributionChain: chainId,
89
89
  campaignId: campaign.campaignId,
90
- status: { value: "PROCESSING" },
91
- });
90
+ }, { value: "PROCESSING" });
92
91
  return campaign.campaignId;
93
92
  }
94
93
  catch { }
@@ -27,11 +27,12 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
27
27
  .get("/count", async ({ query }) => await ChainService.countMany(query), {
28
28
  query: GetChainQueryDto,
29
29
  })
30
- // ─── Get All Supported Chains ────────────────────────────────────────
31
30
  .group("/explorers", app => {
31
+ // ─── Create An Explorer ──────────────────────────────────────
32
32
  return app.post("", async ({ body: { chainId, type, url } }) => await ExplorerService.create(chainId, type, url), {
33
33
  beforeHandle: TokenAuthGuard,
34
34
  headers: AuthorizationHeadersDto,
35
35
  body: CreateChainExplorerDto,
36
+ detail: { hide: true },
36
37
  });
37
38
  });