@merkl/api 0.17.3 → 0.17.5
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 +180 -50
- package/dist/src/index.d.ts +36 -10
- package/dist/src/jobs/etl/update-dynamic-data.js +12 -0
- package/dist/src/modules/v4/chain/chain.controller.d.ts +36 -10
- package/dist/src/modules/v4/chain/chain.controller.js +6 -8
- package/dist/src/modules/v4/opportunity/opportunity.converter.d.ts +1 -1
- package/dist/src/modules/v4/opportunity/opportunity.converter.js +7 -7
- package/dist/src/modules/v4/router.d.ts +36 -10
- package/dist/src/modules/v4/token/token.repository.js +3 -1
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/src/eden/index.d.ts
CHANGED
@@ -1839,8 +1839,17 @@ declare const eden: {
|
|
1839
1839
|
query?: Record<string, unknown> | undefined;
|
1840
1840
|
fetch?: RequestInit | undefined;
|
1841
1841
|
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1842
|
-
|
1843
|
-
|
1842
|
+
200: {
|
1843
|
+
name: string;
|
1844
|
+
id: number;
|
1845
|
+
icon: string;
|
1846
|
+
explorers: {
|
1847
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
1848
|
+
url: string;
|
1849
|
+
id: string;
|
1850
|
+
chainId: number;
|
1851
|
+
}[];
|
1852
|
+
} | null;
|
1844
1853
|
}>>;
|
1845
1854
|
patch: (body: {
|
1846
1855
|
icon?: string | undefined;
|
@@ -1853,8 +1862,11 @@ declare const eden: {
|
|
1853
1862
|
query?: Record<string, unknown> | undefined;
|
1854
1863
|
fetch?: RequestInit | undefined;
|
1855
1864
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1856
|
-
|
1857
|
-
|
1865
|
+
200: {
|
1866
|
+
name: string;
|
1867
|
+
id: number;
|
1868
|
+
icon: string;
|
1869
|
+
};
|
1858
1870
|
}>>;
|
1859
1871
|
}) & {
|
1860
1872
|
index: {
|
@@ -1865,8 +1877,17 @@ declare const eden: {
|
|
1865
1877
|
};
|
1866
1878
|
fetch?: RequestInit | undefined;
|
1867
1879
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1868
|
-
|
1869
|
-
|
1880
|
+
200: {
|
1881
|
+
name: string;
|
1882
|
+
id: number;
|
1883
|
+
icon: string;
|
1884
|
+
explorers: {
|
1885
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
1886
|
+
url: string;
|
1887
|
+
id: string;
|
1888
|
+
chainId: number;
|
1889
|
+
}[];
|
1890
|
+
}[];
|
1870
1891
|
}>>;
|
1871
1892
|
post: (body: {
|
1872
1893
|
name: string;
|
@@ -1881,8 +1902,14 @@ declare const eden: {
|
|
1881
1902
|
query?: Record<string, unknown> | undefined;
|
1882
1903
|
fetch?: RequestInit | undefined;
|
1883
1904
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1884
|
-
|
1885
|
-
|
1905
|
+
200: {
|
1906
|
+
Explorer: {
|
1907
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
1908
|
+
url: string;
|
1909
|
+
id: string;
|
1910
|
+
chainId: number;
|
1911
|
+
}[];
|
1912
|
+
};
|
1886
1913
|
}>>;
|
1887
1914
|
};
|
1888
1915
|
count: {
|
@@ -1893,8 +1920,7 @@ declare const eden: {
|
|
1893
1920
|
};
|
1894
1921
|
fetch?: RequestInit | undefined;
|
1895
1922
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
1896
|
-
|
1897
|
-
200: any;
|
1923
|
+
200: number;
|
1898
1924
|
}>>;
|
1899
1925
|
};
|
1900
1926
|
};
|
@@ -5147,8 +5173,17 @@ declare const eden: {
|
|
5147
5173
|
query?: Record<string, unknown> | undefined;
|
5148
5174
|
fetch?: RequestInit | undefined;
|
5149
5175
|
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5150
|
-
|
5151
|
-
|
5176
|
+
200: {
|
5177
|
+
name: string;
|
5178
|
+
id: number;
|
5179
|
+
icon: string;
|
5180
|
+
explorers: {
|
5181
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
5182
|
+
url: string;
|
5183
|
+
id: string;
|
5184
|
+
chainId: number;
|
5185
|
+
}[];
|
5186
|
+
} | null;
|
5152
5187
|
}>>;
|
5153
5188
|
patch: (body: {
|
5154
5189
|
icon?: string | undefined;
|
@@ -5161,8 +5196,11 @@ declare const eden: {
|
|
5161
5196
|
query?: Record<string, unknown> | undefined;
|
5162
5197
|
fetch?: RequestInit | undefined;
|
5163
5198
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5164
|
-
|
5165
|
-
|
5199
|
+
200: {
|
5200
|
+
name: string;
|
5201
|
+
id: number;
|
5202
|
+
icon: string;
|
5203
|
+
};
|
5166
5204
|
}>>;
|
5167
5205
|
}) & {
|
5168
5206
|
index: {
|
@@ -5173,8 +5211,17 @@ declare const eden: {
|
|
5173
5211
|
};
|
5174
5212
|
fetch?: RequestInit | undefined;
|
5175
5213
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5176
|
-
|
5177
|
-
|
5214
|
+
200: {
|
5215
|
+
name: string;
|
5216
|
+
id: number;
|
5217
|
+
icon: string;
|
5218
|
+
explorers: {
|
5219
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
5220
|
+
url: string;
|
5221
|
+
id: string;
|
5222
|
+
chainId: number;
|
5223
|
+
}[];
|
5224
|
+
}[];
|
5178
5225
|
}>>;
|
5179
5226
|
post: (body: {
|
5180
5227
|
name: string;
|
@@ -5189,8 +5236,14 @@ declare const eden: {
|
|
5189
5236
|
query?: Record<string, unknown> | undefined;
|
5190
5237
|
fetch?: RequestInit | undefined;
|
5191
5238
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5192
|
-
|
5193
|
-
|
5239
|
+
200: {
|
5240
|
+
Explorer: {
|
5241
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
5242
|
+
url: string;
|
5243
|
+
id: string;
|
5244
|
+
chainId: number;
|
5245
|
+
}[];
|
5246
|
+
};
|
5194
5247
|
}>>;
|
5195
5248
|
};
|
5196
5249
|
count: {
|
@@ -5201,8 +5254,7 @@ declare const eden: {
|
|
5201
5254
|
};
|
5202
5255
|
fetch?: RequestInit | undefined;
|
5203
5256
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
5204
|
-
|
5205
|
-
200: any;
|
5257
|
+
200: number;
|
5206
5258
|
}>>;
|
5207
5259
|
};
|
5208
5260
|
};
|
@@ -9451,8 +9503,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9451
9503
|
query: unknown;
|
9452
9504
|
headers: unknown;
|
9453
9505
|
response: {
|
9454
|
-
|
9455
|
-
|
9506
|
+
200: {
|
9507
|
+
name: string;
|
9508
|
+
id: number;
|
9509
|
+
icon: string;
|
9510
|
+
explorers: {
|
9511
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
9512
|
+
url: string;
|
9513
|
+
id: string;
|
9514
|
+
chainId: number;
|
9515
|
+
}[];
|
9516
|
+
} | null;
|
9456
9517
|
};
|
9457
9518
|
};
|
9458
9519
|
};
|
@@ -9468,8 +9529,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9468
9529
|
};
|
9469
9530
|
headers: unknown;
|
9470
9531
|
response: {
|
9471
|
-
|
9472
|
-
|
9532
|
+
200: {
|
9533
|
+
name: string;
|
9534
|
+
id: number;
|
9535
|
+
icon: string;
|
9536
|
+
explorers: {
|
9537
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
9538
|
+
url: string;
|
9539
|
+
id: string;
|
9540
|
+
chainId: number;
|
9541
|
+
}[];
|
9542
|
+
}[];
|
9473
9543
|
};
|
9474
9544
|
};
|
9475
9545
|
};
|
@@ -9485,8 +9555,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9485
9555
|
};
|
9486
9556
|
headers: unknown;
|
9487
9557
|
response: {
|
9488
|
-
|
9489
|
-
200: any;
|
9558
|
+
200: number;
|
9490
9559
|
};
|
9491
9560
|
};
|
9492
9561
|
};
|
@@ -9508,8 +9577,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9508
9577
|
authorization: string;
|
9509
9578
|
};
|
9510
9579
|
response: {
|
9511
|
-
|
9512
|
-
|
9580
|
+
200: {
|
9581
|
+
name: string;
|
9582
|
+
id: number;
|
9583
|
+
icon: string;
|
9584
|
+
};
|
9513
9585
|
};
|
9514
9586
|
};
|
9515
9587
|
};
|
@@ -9531,8 +9603,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
9531
9603
|
authorization: string;
|
9532
9604
|
};
|
9533
9605
|
response: {
|
9534
|
-
|
9535
|
-
|
9606
|
+
200: {
|
9607
|
+
Explorer: {
|
9608
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
9609
|
+
url: string;
|
9610
|
+
id: string;
|
9611
|
+
chainId: number;
|
9612
|
+
}[];
|
9613
|
+
};
|
9536
9614
|
};
|
9537
9615
|
};
|
9538
9616
|
};
|
@@ -14045,8 +14123,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14045
14123
|
query?: Record<string, unknown> | undefined;
|
14046
14124
|
fetch?: RequestInit | undefined;
|
14047
14125
|
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14048
|
-
|
14049
|
-
|
14126
|
+
200: {
|
14127
|
+
name: string;
|
14128
|
+
id: number;
|
14129
|
+
icon: string;
|
14130
|
+
explorers: {
|
14131
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
14132
|
+
url: string;
|
14133
|
+
id: string;
|
14134
|
+
chainId: number;
|
14135
|
+
}[];
|
14136
|
+
} | null;
|
14050
14137
|
}>>;
|
14051
14138
|
patch: (body: {
|
14052
14139
|
icon?: string | undefined;
|
@@ -14059,8 +14146,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14059
14146
|
query?: Record<string, unknown> | undefined;
|
14060
14147
|
fetch?: RequestInit | undefined;
|
14061
14148
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14062
|
-
|
14063
|
-
|
14149
|
+
200: {
|
14150
|
+
name: string;
|
14151
|
+
id: number;
|
14152
|
+
icon: string;
|
14153
|
+
};
|
14064
14154
|
}>>;
|
14065
14155
|
}) & {
|
14066
14156
|
index: {
|
@@ -14071,8 +14161,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14071
14161
|
};
|
14072
14162
|
fetch?: RequestInit | undefined;
|
14073
14163
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14074
|
-
|
14075
|
-
|
14164
|
+
200: {
|
14165
|
+
name: string;
|
14166
|
+
id: number;
|
14167
|
+
icon: string;
|
14168
|
+
explorers: {
|
14169
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
14170
|
+
url: string;
|
14171
|
+
id: string;
|
14172
|
+
chainId: number;
|
14173
|
+
}[];
|
14174
|
+
}[];
|
14076
14175
|
}>>;
|
14077
14176
|
post: (body: {
|
14078
14177
|
name: string;
|
@@ -14087,8 +14186,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14087
14186
|
query?: Record<string, unknown> | undefined;
|
14088
14187
|
fetch?: RequestInit | undefined;
|
14089
14188
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14090
|
-
|
14091
|
-
|
14189
|
+
200: {
|
14190
|
+
Explorer: {
|
14191
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
14192
|
+
url: string;
|
14193
|
+
id: string;
|
14194
|
+
chainId: number;
|
14195
|
+
}[];
|
14196
|
+
};
|
14092
14197
|
}>>;
|
14093
14198
|
};
|
14094
14199
|
count: {
|
@@ -14099,8 +14204,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
14099
14204
|
};
|
14100
14205
|
fetch?: RequestInit | undefined;
|
14101
14206
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
14102
|
-
|
14103
|
-
200: any;
|
14207
|
+
200: number;
|
14104
14208
|
}>>;
|
14105
14209
|
};
|
14106
14210
|
};
|
@@ -17353,8 +17457,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17353
17457
|
query?: Record<string, unknown> | undefined;
|
17354
17458
|
fetch?: RequestInit | undefined;
|
17355
17459
|
} | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17356
|
-
|
17357
|
-
|
17460
|
+
200: {
|
17461
|
+
name: string;
|
17462
|
+
id: number;
|
17463
|
+
icon: string;
|
17464
|
+
explorers: {
|
17465
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
17466
|
+
url: string;
|
17467
|
+
id: string;
|
17468
|
+
chainId: number;
|
17469
|
+
}[];
|
17470
|
+
} | null;
|
17358
17471
|
}>>;
|
17359
17472
|
patch: (body: {
|
17360
17473
|
icon?: string | undefined;
|
@@ -17367,8 +17480,11 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17367
17480
|
query?: Record<string, unknown> | undefined;
|
17368
17481
|
fetch?: RequestInit | undefined;
|
17369
17482
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17370
|
-
|
17371
|
-
|
17483
|
+
200: {
|
17484
|
+
name: string;
|
17485
|
+
id: number;
|
17486
|
+
icon: string;
|
17487
|
+
};
|
17372
17488
|
}>>;
|
17373
17489
|
}) & {
|
17374
17490
|
index: {
|
@@ -17379,8 +17495,17 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17379
17495
|
};
|
17380
17496
|
fetch?: RequestInit | undefined;
|
17381
17497
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17382
|
-
|
17383
|
-
|
17498
|
+
200: {
|
17499
|
+
name: string;
|
17500
|
+
id: number;
|
17501
|
+
icon: string;
|
17502
|
+
explorers: {
|
17503
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
17504
|
+
url: string;
|
17505
|
+
id: string;
|
17506
|
+
chainId: number;
|
17507
|
+
}[];
|
17508
|
+
}[];
|
17384
17509
|
}>>;
|
17385
17510
|
post: (body: {
|
17386
17511
|
name: string;
|
@@ -17395,8 +17520,14 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17395
17520
|
query?: Record<string, unknown> | undefined;
|
17396
17521
|
fetch?: RequestInit | undefined;
|
17397
17522
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17398
|
-
|
17399
|
-
|
17523
|
+
200: {
|
17524
|
+
Explorer: {
|
17525
|
+
type: import("../../database/api/.generated").$Enums.ExplorerType;
|
17526
|
+
url: string;
|
17527
|
+
id: string;
|
17528
|
+
chainId: number;
|
17529
|
+
}[];
|
17530
|
+
};
|
17400
17531
|
}>>;
|
17401
17532
|
};
|
17402
17533
|
count: {
|
@@ -17407,8 +17538,7 @@ export declare const MerklApi: (domain: string | import("elysia").default<"", fa
|
|
17407
17538
|
};
|
17408
17539
|
fetch?: RequestInit | undefined;
|
17409
17540
|
}) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
|
17410
|
-
|
17411
|
-
200: any;
|
17541
|
+
200: number;
|
17412
17542
|
}>>;
|
17413
17543
|
};
|
17414
17544
|
};
|
package/dist/src/index.d.ts
CHANGED
@@ -2166,8 +2166,17 @@ declare const app: Elysia<"", false, {
|
|
2166
2166
|
query: unknown;
|
2167
2167
|
headers: unknown;
|
2168
2168
|
response: {
|
2169
|
-
|
2170
|
-
|
2169
|
+
200: {
|
2170
|
+
name: string;
|
2171
|
+
id: number;
|
2172
|
+
icon: string;
|
2173
|
+
explorers: {
|
2174
|
+
type: import("../database/api/.generated").$Enums.ExplorerType;
|
2175
|
+
url: string;
|
2176
|
+
id: string;
|
2177
|
+
chainId: number;
|
2178
|
+
}[];
|
2179
|
+
} | null;
|
2171
2180
|
};
|
2172
2181
|
};
|
2173
2182
|
};
|
@@ -2183,8 +2192,17 @@ declare const app: Elysia<"", false, {
|
|
2183
2192
|
};
|
2184
2193
|
headers: unknown;
|
2185
2194
|
response: {
|
2186
|
-
|
2187
|
-
|
2195
|
+
200: {
|
2196
|
+
name: string;
|
2197
|
+
id: number;
|
2198
|
+
icon: string;
|
2199
|
+
explorers: {
|
2200
|
+
type: import("../database/api/.generated").$Enums.ExplorerType;
|
2201
|
+
url: string;
|
2202
|
+
id: string;
|
2203
|
+
chainId: number;
|
2204
|
+
}[];
|
2205
|
+
}[];
|
2188
2206
|
};
|
2189
2207
|
};
|
2190
2208
|
};
|
@@ -2200,8 +2218,7 @@ declare const app: Elysia<"", false, {
|
|
2200
2218
|
};
|
2201
2219
|
headers: unknown;
|
2202
2220
|
response: {
|
2203
|
-
|
2204
|
-
200: any;
|
2221
|
+
200: number;
|
2205
2222
|
};
|
2206
2223
|
};
|
2207
2224
|
};
|
@@ -2223,8 +2240,11 @@ declare const app: Elysia<"", false, {
|
|
2223
2240
|
authorization: string;
|
2224
2241
|
};
|
2225
2242
|
response: {
|
2226
|
-
|
2227
|
-
|
2243
|
+
200: {
|
2244
|
+
name: string;
|
2245
|
+
id: number;
|
2246
|
+
icon: string;
|
2247
|
+
};
|
2228
2248
|
};
|
2229
2249
|
};
|
2230
2250
|
};
|
@@ -2246,8 +2266,14 @@ declare const app: Elysia<"", false, {
|
|
2246
2266
|
authorization: string;
|
2247
2267
|
};
|
2248
2268
|
response: {
|
2249
|
-
|
2250
|
-
|
2269
|
+
200: {
|
2270
|
+
Explorer: {
|
2271
|
+
type: import("../database/api/.generated").$Enums.ExplorerType;
|
2272
|
+
url: string;
|
2273
|
+
id: string;
|
2274
|
+
chainId: number;
|
2275
|
+
}[];
|
2276
|
+
};
|
2251
2277
|
};
|
2252
2278
|
};
|
2253
2279
|
};
|
@@ -15,6 +15,18 @@ if (!chainId)
|
|
15
15
|
// ─── Update Dynamic Data (APR / TVL / Daily Rewards) ─────────────────────────
|
16
16
|
async function updateDynamicData(liveCampaigns, campaignType) {
|
17
17
|
try {
|
18
|
+
// Input: list of campaigns of same type
|
19
|
+
// Output: for each campaign, APR, TVL, Daily Rewards
|
20
|
+
// Constraint: needs to use multicalls to reduce RPC calls and speed
|
21
|
+
// - Needs to be robust to a single campaign's call failing
|
22
|
+
// - Needs to be quite easy for the engine team to setup new campaign types
|
23
|
+
// abstract GenericDynamicDataComputer
|
24
|
+
// compute(chainId, type, campaigns) => { apr, tvl, dailyRewards } with breakdowns
|
25
|
+
// UNISWAP V4
|
26
|
+
// Round 1 - (chainId, type, campaigns) -> tokens of the pools
|
27
|
+
// Round 2 - (chainId, type, campaigns, output of previous round) -> balance in tokens of forwarders
|
28
|
+
// Round 3 - ...
|
29
|
+
// Round Final - (chainId, type, campaigns, output of previous round) -> { apr, tvl, dailyRewards }
|
18
30
|
const dynamicData = await executeSimple(chainId, campaignsDynamicData(chainId, liveCampaigns, campaignType));
|
19
31
|
const oppMap = {};
|
20
32
|
for (const data of dynamicData) {
|
@@ -22,8 +22,17 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
22
22
|
query: unknown;
|
23
23
|
headers: unknown;
|
24
24
|
response: {
|
25
|
-
|
26
|
-
|
25
|
+
200: {
|
26
|
+
name: string;
|
27
|
+
id: number;
|
28
|
+
icon: string;
|
29
|
+
explorers: {
|
30
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
31
|
+
url: string;
|
32
|
+
id: string;
|
33
|
+
chainId: number;
|
34
|
+
}[];
|
35
|
+
} | null;
|
27
36
|
};
|
28
37
|
};
|
29
38
|
};
|
@@ -39,8 +48,17 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
39
48
|
};
|
40
49
|
headers: unknown;
|
41
50
|
response: {
|
42
|
-
|
43
|
-
|
51
|
+
200: {
|
52
|
+
name: string;
|
53
|
+
id: number;
|
54
|
+
icon: string;
|
55
|
+
explorers: {
|
56
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
57
|
+
url: string;
|
58
|
+
id: string;
|
59
|
+
chainId: number;
|
60
|
+
}[];
|
61
|
+
}[];
|
44
62
|
};
|
45
63
|
};
|
46
64
|
};
|
@@ -56,8 +74,7 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
56
74
|
};
|
57
75
|
headers: unknown;
|
58
76
|
response: {
|
59
|
-
|
60
|
-
200: any;
|
77
|
+
200: number;
|
61
78
|
};
|
62
79
|
};
|
63
80
|
};
|
@@ -79,8 +96,11 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
79
96
|
authorization: string;
|
80
97
|
};
|
81
98
|
response: {
|
82
|
-
|
83
|
-
|
99
|
+
200: {
|
100
|
+
name: string;
|
101
|
+
id: number;
|
102
|
+
icon: string;
|
103
|
+
};
|
84
104
|
};
|
85
105
|
};
|
86
106
|
};
|
@@ -102,8 +122,14 @@ export declare const ChainController: Elysia<"/chains", false, {
|
|
102
122
|
authorization: string;
|
103
123
|
};
|
104
124
|
response: {
|
105
|
-
|
106
|
-
|
125
|
+
200: {
|
126
|
+
Explorer: {
|
127
|
+
type: import("../../../../database/api/.generated").$Enums.ExplorerType;
|
128
|
+
url: string;
|
129
|
+
id: string;
|
130
|
+
chainId: number;
|
131
|
+
}[];
|
132
|
+
};
|
107
133
|
};
|
108
134
|
};
|
109
135
|
};
|
@@ -1,14 +1,12 @@
|
|
1
1
|
import { AuthorizationHeadersDto, BackOfficeGuard } from "../../../guards/BackOffice.guard";
|
2
|
-
import { apiDbClient } from "../../../utils/prisma";
|
3
2
|
import Elysia, { t } from "elysia";
|
4
|
-
import { initChainService } from ".";
|
5
3
|
import { ChainResourceDto, ChainUniqueDto, CreateChainDto, GetChainQueryDto, UpdateChainDto, } from "./chain.model";
|
6
|
-
|
4
|
+
import { ChainService } from "./chain.service";
|
7
5
|
// ─── Chains Controller ───────────────────────────────────────────────────────
|
8
6
|
export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: ["Chains"] } })
|
9
7
|
// ─── Get A Chain By Id ───────────────────────────────────────────────
|
10
8
|
.get("/:chainId", async ({ params: { chainId } }) => {
|
11
|
-
const chain = await
|
9
|
+
const chain = await ChainService.get(chainId);
|
12
10
|
if (!chain)
|
13
11
|
return null;
|
14
12
|
const { Explorer, ...rest } = chain;
|
@@ -19,7 +17,7 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
|
|
19
17
|
})
|
20
18
|
// ─── Get All Supported Chains ────────────────────────────────────────
|
21
19
|
.get("/", async ({ query }) => {
|
22
|
-
const chains = await
|
20
|
+
const chains = await ChainService.findMany(query);
|
23
21
|
return chains.map(({ Explorer, ...chain }) => ({ explorers: Explorer, ...chain }));
|
24
22
|
}, {
|
25
23
|
query: GetChainQueryDto,
|
@@ -27,18 +25,18 @@ export const ChainController = new Elysia({ prefix: "/chains", detail: { tags: [
|
|
27
25
|
detail: { description: "List chains supported and integrated by Merkl." },
|
28
26
|
})
|
29
27
|
// ─── Count Chains ────────────────────────────────────────
|
30
|
-
.get("/count", async ({ query }) => await
|
28
|
+
.get("/count", async ({ query }) => await ChainService.countMany(query), {
|
31
29
|
query: GetChainQueryDto,
|
32
30
|
detail: { hide: true },
|
33
31
|
})
|
34
|
-
.patch("/:chainId", async ({ params, body }) => await
|
32
|
+
.patch("/:chainId", async ({ params, body }) => await ChainService.update(params.chainId, body), {
|
35
33
|
params: ChainUniqueDto,
|
36
34
|
body: UpdateChainDto,
|
37
35
|
headers: AuthorizationHeadersDto,
|
38
36
|
beforeHandle: BackOfficeGuard,
|
39
37
|
detail: { hide: true },
|
40
38
|
})
|
41
|
-
.post("/", async ({ body }) => await
|
39
|
+
.post("/", async ({ body }) => await ChainService.create(body), {
|
42
40
|
body: CreateChainDto,
|
43
41
|
headers: AuthorizationHeadersDto,
|
44
42
|
beforeHandle: BackOfficeGuard,
|
@@ -2,7 +2,7 @@ import { type CampaignParameters, type Opportunity as OpportunityV3, type ValidC
|
|
2
2
|
import { OpportunityService } from "./opportunity.service";
|
3
3
|
export declare abstract class OpportunityConvertorService {
|
4
4
|
#private;
|
5
|
-
static convertV4CampaignToV3<C extends ValidCampaign>(campaignType: C, campaign: Awaited<ReturnType<(typeof OpportunityService)["findMany"]>>[number]["campaigns"][number], opportunity: Awaited<ReturnType<(typeof OpportunityService)["findMany"]>>[number]): CampaignParameters<C>;
|
5
|
+
static convertV4CampaignToV3<C extends ValidCampaign>(campaignType: C, campaign: Exclude<Awaited<ReturnType<(typeof OpportunityService)["findMany"]>>[number]["campaigns"], undefined>[number], opportunity: Awaited<ReturnType<(typeof OpportunityService)["findMany"]>>[number]): CampaignParameters<C>;
|
6
6
|
static convertV4toV3(opportunity: Awaited<ReturnType<(typeof OpportunityService)["findMany"]>>[number], withCampaigns?: boolean): OpportunityV3;
|
7
7
|
static setV3Opportunities(showCampaigns: boolean, test: boolean | undefined, identifier: string | undefined, chainId: string | undefined): Promise<{}>;
|
8
8
|
static logKeyAndTTLV3Opportunities(showCampaigns: boolean, test: boolean | undefined, identifier: string | undefined, chainId: string | undefined): Promise<void>;
|