@merkl/api 0.20.51 → 0.20.53
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/backgroundJobs/index.js +5 -3
- package/dist/src/eden/index.d.ts +1169 -976
- package/dist/src/engine/dynamicData/factory.js +6 -0
- package/dist/src/engine/dynamicData/implementations/Erc20.d.ts +2 -2
- package/dist/src/engine/dynamicData/implementations/Erc20.js +16 -2
- package/dist/src/engine/dynamicData/implementations/UniswapV4.js +1 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.d.ts +2 -1
- package/dist/src/engine/erc20SubTypeProcessors/helpers/tokenType.js +5 -0
- package/dist/src/engine/erc20SubTypeProcessors/implementations/processorMapping.js +1 -0
- package/dist/src/engine/erc20SubTypeProcessors/subtypesRound1.js +2 -0
- package/dist/src/engine/opportunityMetadata/factory.js +6 -0
- package/dist/src/engine/opportunityMetadata/implementations/Erc20.js +1 -1
- package/dist/src/index.d.ts +246 -185
- package/dist/src/jobs/update-uniswap-v4-pools.js +3 -2
- package/dist/src/modules/v4/accounting/accounting.repository.js +72 -18
- package/dist/src/modules/v4/campaign/campaign.controller.d.ts +0 -169
- package/dist/src/modules/v4/campaign/campaign.controller.js +1 -65
- package/dist/src/modules/v4/campaign/campaign.test.controller.d.ts +193 -0
- package/dist/src/modules/v4/campaign/campaign.test.controller.js +71 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +67 -2
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +67 -0
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +1 -1
- package/dist/src/modules/v4/protocol/protocol.controller.js +2 -2
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +1 -9
- package/dist/src/modules/v4/protocol/protocol.repository.js +1 -4
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +1 -2
- package/dist/src/modules/v4/protocol/protocol.service.js +2 -6
- package/dist/src/modules/v4/router.d.ts +246 -185
- package/dist/src/modules/v4/router.js +2 -0
- package/dist/src/modules/v4/uniswap/uniswap.controller.d.ts +72 -15
- package/dist/src/modules/v4/uniswap/uniswap.controller.js +49 -6
- package/dist/src/modules/v4/uniswap/uniswap.model.d.ts +35 -16
- package/dist/src/modules/v4/uniswap/uniswap.model.js +22 -8
- package/dist/src/modules/v4/uniswap/uniswap.repository.d.ts +2 -2
- package/dist/src/modules/v4/uniswap/uniswap.repository.js +2 -2
- package/dist/src/modules/v4/uniswap/uniswap.service.d.ts +4 -19
- package/dist/src/modules/v4/uniswap/uniswap.service.js +20 -80
- package/dist/src/routes/v3/uniswapv4.js +5 -5
- package/dist/src/utils/decodeCalls.js +10 -1
- package/dist/src/utils/encodeCalls.js +3 -0
- package/dist/src/utils/generateCardName.js +5 -0
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/dist/src/engine/dynamicData/utils/getUniswapV4Pools.d.ts +0 -10
- package/dist/src/engine/dynamicData/utils/getUniswapV4Pools.js +0 -188
@@ -1217,175 +1217,6 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1217
1217
|
};
|
1218
1218
|
};
|
1219
1219
|
};
|
1220
|
-
} & {
|
1221
|
-
"dry-run": {
|
1222
|
-
":campaignId": {
|
1223
|
-
"dynamic-data": {
|
1224
|
-
get: {
|
1225
|
-
body: unknown;
|
1226
|
-
params: {
|
1227
|
-
campaignId: string;
|
1228
|
-
};
|
1229
|
-
query: unknown;
|
1230
|
-
headers: {
|
1231
|
-
authorization: string;
|
1232
|
-
};
|
1233
|
-
response: {
|
1234
|
-
200: unknown[];
|
1235
|
-
};
|
1236
|
-
};
|
1237
|
-
};
|
1238
|
-
};
|
1239
|
-
};
|
1240
|
-
} & {
|
1241
|
-
"dry-run": {
|
1242
|
-
"dynamic-data": {
|
1243
|
-
list: {
|
1244
|
-
post: {
|
1245
|
-
body: string[];
|
1246
|
-
params: {};
|
1247
|
-
query: unknown;
|
1248
|
-
headers: {
|
1249
|
-
authorization: string;
|
1250
|
-
};
|
1251
|
-
response: {
|
1252
|
-
200: unknown[];
|
1253
|
-
};
|
1254
|
-
};
|
1255
|
-
};
|
1256
|
-
};
|
1257
|
-
};
|
1258
|
-
} & {
|
1259
|
-
"dry-run": {
|
1260
|
-
"dynamic-data": {
|
1261
|
-
post: {
|
1262
|
-
body: {
|
1263
|
-
id?: string | undefined;
|
1264
|
-
subType?: number | undefined;
|
1265
|
-
campaignId?: string | undefined;
|
1266
|
-
amount?: string | undefined;
|
1267
|
-
creatorAddress?: string | undefined;
|
1268
|
-
type: string;
|
1269
|
-
params: any;
|
1270
|
-
computeChainId: number;
|
1271
|
-
distributionChainId: number;
|
1272
|
-
startTimestamp: number;
|
1273
|
-
endTimestamp: number;
|
1274
|
-
rewardToken: string;
|
1275
|
-
};
|
1276
|
-
params: {};
|
1277
|
-
query: unknown;
|
1278
|
-
headers: {
|
1279
|
-
authorization: string;
|
1280
|
-
};
|
1281
|
-
response: {
|
1282
|
-
200: unknown[];
|
1283
|
-
};
|
1284
|
-
};
|
1285
|
-
};
|
1286
|
-
};
|
1287
|
-
} & {
|
1288
|
-
"dry-run": {
|
1289
|
-
metadata: {
|
1290
|
-
post: {
|
1291
|
-
body: {
|
1292
|
-
id?: string | undefined;
|
1293
|
-
subType?: number | undefined;
|
1294
|
-
campaignId?: string | undefined;
|
1295
|
-
amount?: string | undefined;
|
1296
|
-
creatorAddress?: string | undefined;
|
1297
|
-
type: string;
|
1298
|
-
params: any;
|
1299
|
-
computeChainId: number;
|
1300
|
-
distributionChainId: number;
|
1301
|
-
startTimestamp: number;
|
1302
|
-
endTimestamp: number;
|
1303
|
-
rewardToken: string;
|
1304
|
-
};
|
1305
|
-
params: {};
|
1306
|
-
query: unknown;
|
1307
|
-
headers: {
|
1308
|
-
authorization: string;
|
1309
|
-
};
|
1310
|
-
response: {
|
1311
|
-
200: {
|
1312
|
-
id: string;
|
1313
|
-
chainId: number;
|
1314
|
-
type: string;
|
1315
|
-
identifier: string;
|
1316
|
-
name: string;
|
1317
|
-
status: "PAST" | "LIVE" | "SOON";
|
1318
|
-
action: any;
|
1319
|
-
tokens: ({
|
1320
|
-
symbol: string;
|
1321
|
-
id: string;
|
1322
|
-
name: string | null;
|
1323
|
-
icon: string;
|
1324
|
-
address: string;
|
1325
|
-
chainId: number;
|
1326
|
-
decimals: number;
|
1327
|
-
verified: boolean;
|
1328
|
-
isTest: boolean;
|
1329
|
-
isPoint: boolean;
|
1330
|
-
isNative: boolean;
|
1331
|
-
} & {
|
1332
|
-
price?: number | null | undefined;
|
1333
|
-
})[];
|
1334
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
1335
|
-
depositUrl: any;
|
1336
|
-
explorerAddress: string | undefined;
|
1337
|
-
tags: string[];
|
1338
|
-
};
|
1339
|
-
};
|
1340
|
-
};
|
1341
|
-
};
|
1342
|
-
};
|
1343
|
-
} & {
|
1344
|
-
"dry-run": {
|
1345
|
-
metadata: {
|
1346
|
-
get: {
|
1347
|
-
body: unknown;
|
1348
|
-
params: {};
|
1349
|
-
query: {
|
1350
|
-
campaignId: string;
|
1351
|
-
distributionChain: number;
|
1352
|
-
};
|
1353
|
-
headers: {
|
1354
|
-
authorization: string;
|
1355
|
-
};
|
1356
|
-
response: {
|
1357
|
-
200: {
|
1358
|
-
id: string;
|
1359
|
-
chainId: number;
|
1360
|
-
type: string;
|
1361
|
-
identifier: string;
|
1362
|
-
name: string;
|
1363
|
-
status: "PAST" | "LIVE" | "SOON";
|
1364
|
-
action: any;
|
1365
|
-
tokens: ({
|
1366
|
-
symbol: string;
|
1367
|
-
id: string;
|
1368
|
-
name: string | null;
|
1369
|
-
icon: string;
|
1370
|
-
address: string;
|
1371
|
-
chainId: number;
|
1372
|
-
decimals: number;
|
1373
|
-
verified: boolean;
|
1374
|
-
isTest: boolean;
|
1375
|
-
isPoint: boolean;
|
1376
|
-
isNative: boolean;
|
1377
|
-
} & {
|
1378
|
-
price?: number | null | undefined;
|
1379
|
-
})[];
|
1380
|
-
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
1381
|
-
depositUrl: any;
|
1382
|
-
explorerAddress: string | undefined;
|
1383
|
-
tags: string[];
|
1384
|
-
};
|
1385
|
-
};
|
1386
|
-
};
|
1387
|
-
};
|
1388
|
-
};
|
1389
1220
|
} & {
|
1390
1221
|
index: {
|
1391
1222
|
get: {
|
@@ -1929,6 +1760,179 @@ export declare const v4: Elysia<"/v4", false, {
|
|
1929
1760
|
};
|
1930
1761
|
};
|
1931
1762
|
};
|
1763
|
+
} & {
|
1764
|
+
v4: {
|
1765
|
+
campaigns: {
|
1766
|
+
"dry-run": {
|
1767
|
+
":campaignId": {
|
1768
|
+
"dynamic-data": {
|
1769
|
+
get: {
|
1770
|
+
body: unknown;
|
1771
|
+
params: {
|
1772
|
+
campaignId: string;
|
1773
|
+
};
|
1774
|
+
query: unknown;
|
1775
|
+
headers: {
|
1776
|
+
authorization: string;
|
1777
|
+
};
|
1778
|
+
response: {
|
1779
|
+
200: unknown[];
|
1780
|
+
};
|
1781
|
+
};
|
1782
|
+
};
|
1783
|
+
};
|
1784
|
+
};
|
1785
|
+
} & {
|
1786
|
+
"dry-run": {
|
1787
|
+
"dynamic-data": {
|
1788
|
+
list: {
|
1789
|
+
post: {
|
1790
|
+
body: string[];
|
1791
|
+
params: {};
|
1792
|
+
query: unknown;
|
1793
|
+
headers: {
|
1794
|
+
authorization: string;
|
1795
|
+
};
|
1796
|
+
response: {
|
1797
|
+
200: unknown[];
|
1798
|
+
};
|
1799
|
+
};
|
1800
|
+
};
|
1801
|
+
};
|
1802
|
+
};
|
1803
|
+
} & {
|
1804
|
+
"dry-run": {
|
1805
|
+
"dynamic-data": {
|
1806
|
+
post: {
|
1807
|
+
body: {
|
1808
|
+
id?: string | undefined;
|
1809
|
+
subType?: number | undefined;
|
1810
|
+
campaignId?: string | undefined;
|
1811
|
+
amount?: string | undefined;
|
1812
|
+
creatorAddress?: string | undefined;
|
1813
|
+
type: string;
|
1814
|
+
params: any;
|
1815
|
+
computeChainId: number;
|
1816
|
+
distributionChainId: number;
|
1817
|
+
startTimestamp: number;
|
1818
|
+
endTimestamp: number;
|
1819
|
+
rewardToken: string;
|
1820
|
+
};
|
1821
|
+
params: {};
|
1822
|
+
query: unknown;
|
1823
|
+
headers: {
|
1824
|
+
authorization: string;
|
1825
|
+
};
|
1826
|
+
response: {
|
1827
|
+
200: unknown[];
|
1828
|
+
};
|
1829
|
+
};
|
1830
|
+
};
|
1831
|
+
};
|
1832
|
+
} & {
|
1833
|
+
"dry-run": {
|
1834
|
+
metadata: {
|
1835
|
+
post: {
|
1836
|
+
body: {
|
1837
|
+
id?: string | undefined;
|
1838
|
+
subType?: number | undefined;
|
1839
|
+
campaignId?: string | undefined;
|
1840
|
+
amount?: string | undefined;
|
1841
|
+
creatorAddress?: string | undefined;
|
1842
|
+
type: string;
|
1843
|
+
params: any;
|
1844
|
+
computeChainId: number;
|
1845
|
+
distributionChainId: number;
|
1846
|
+
startTimestamp: number;
|
1847
|
+
endTimestamp: number;
|
1848
|
+
rewardToken: string;
|
1849
|
+
};
|
1850
|
+
params: {};
|
1851
|
+
query: unknown;
|
1852
|
+
headers: {
|
1853
|
+
authorization: string;
|
1854
|
+
};
|
1855
|
+
response: {
|
1856
|
+
200: {
|
1857
|
+
id: string;
|
1858
|
+
chainId: number;
|
1859
|
+
type: string;
|
1860
|
+
identifier: string;
|
1861
|
+
name: string;
|
1862
|
+
status: "PAST" | "LIVE" | "SOON";
|
1863
|
+
action: any;
|
1864
|
+
tokens: ({
|
1865
|
+
symbol: string;
|
1866
|
+
id: string;
|
1867
|
+
name: string | null;
|
1868
|
+
icon: string;
|
1869
|
+
address: string;
|
1870
|
+
chainId: number;
|
1871
|
+
decimals: number;
|
1872
|
+
verified: boolean;
|
1873
|
+
isTest: boolean;
|
1874
|
+
isPoint: boolean;
|
1875
|
+
isNative: boolean;
|
1876
|
+
} & {
|
1877
|
+
price?: number | null | undefined;
|
1878
|
+
})[];
|
1879
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
1880
|
+
depositUrl: any;
|
1881
|
+
explorerAddress: string | undefined;
|
1882
|
+
tags: string[];
|
1883
|
+
};
|
1884
|
+
};
|
1885
|
+
};
|
1886
|
+
};
|
1887
|
+
};
|
1888
|
+
} & {
|
1889
|
+
"dry-run": {
|
1890
|
+
metadata: {
|
1891
|
+
get: {
|
1892
|
+
body: unknown;
|
1893
|
+
params: {};
|
1894
|
+
query: {
|
1895
|
+
campaignId: string;
|
1896
|
+
distributionChain: number;
|
1897
|
+
};
|
1898
|
+
headers: {
|
1899
|
+
authorization: string;
|
1900
|
+
};
|
1901
|
+
response: {
|
1902
|
+
200: {
|
1903
|
+
id: string;
|
1904
|
+
chainId: number;
|
1905
|
+
type: string;
|
1906
|
+
identifier: string;
|
1907
|
+
name: string;
|
1908
|
+
status: "PAST" | "LIVE" | "SOON";
|
1909
|
+
action: any;
|
1910
|
+
tokens: ({
|
1911
|
+
symbol: string;
|
1912
|
+
id: string;
|
1913
|
+
name: string | null;
|
1914
|
+
icon: string;
|
1915
|
+
address: string;
|
1916
|
+
chainId: number;
|
1917
|
+
decimals: number;
|
1918
|
+
verified: boolean;
|
1919
|
+
isTest: boolean;
|
1920
|
+
isPoint: boolean;
|
1921
|
+
isNative: boolean;
|
1922
|
+
} & {
|
1923
|
+
price?: number | null | undefined;
|
1924
|
+
})[];
|
1925
|
+
mainProtocol: "splice" | "morpho" | "quickswap" | "euler" | "ambient" | "uniswap" | "arthswap" | "base-swap" | "camelot" | "crust" | "fenix" | "horiza" | "izumi" | "kim" | "pancake-swap" | "ramses" | "retro" | "stryke" | "sushi-swap" | "swapr" | "thruster" | "voltage" | "zero" | "koi" | "supswap" | "zk-swap" | "thirdtrade" | "swap-x" | "velodrome" | "aerodrome" | "balancer" | "curve" | "cross_curve" | "curveNPool" | "aura" | "akron" | "beefy" | "dragonswap" | "poolside" | "syncswap" | "neptune" | "zkSwapThreePool" | "rfx" | "ra" | "maverick" | "trader-joe" | "hanji" | "radiant" | "aave" | "fraxlend" | "ironclad" | "gearbox" | "compound" | "sturdy" | "frax" | "ionic" | "moonwell" | "fluid" | "silo" | "dolomite" | "badger" | "ajna" | "layerbank" | "ion" | "venus" | "woofi" | "reactor_fusion" | "eigenlayer" | "vest" | "zerolend" | "hyperdrive" | "gamma" | "oku" | "hourglass" | "veda" | "kyo" | "sonex" | "lendle" | "tako-tako" | "equalizer" | "spectra" | "beraborrow" | "superlend" | "avalon" | "iguana" | "xlend" | "angles" | "enzyme" | "toros" | "vicuna" | "bunni" | "beratrax" | "concrete" | "cian" | "pendle" | "yei" | "filament" | "gammaswap" | "maha" | "tempest" | "uranium" | "holdstation" | "katana" | "satlayer" | undefined;
|
1926
|
+
depositUrl: any;
|
1927
|
+
explorerAddress: string | undefined;
|
1928
|
+
tags: string[];
|
1929
|
+
};
|
1930
|
+
};
|
1931
|
+
};
|
1932
|
+
};
|
1933
|
+
};
|
1934
|
+
};
|
1935
|
+
};
|
1932
1936
|
} & {
|
1933
1937
|
v4: {
|
1934
1938
|
protocols: {
|
@@ -2008,7 +2012,7 @@ export declare const v4: Elysia<"/v4", false, {
|
|
2008
2012
|
dailyRewards?: number | undefined;
|
2009
2013
|
numberOfLiveCampaigns?: number | undefined;
|
2010
2014
|
opportunityLiveTags?: string[] | undefined;
|
2011
|
-
}
|
2015
|
+
};
|
2012
2016
|
};
|
2013
2017
|
};
|
2014
2018
|
};
|
@@ -4896,26 +4900,83 @@ export declare const v4: Elysia<"/v4", false, {
|
|
4896
4900
|
get: {
|
4897
4901
|
body: unknown;
|
4898
4902
|
params: {};
|
4899
|
-
query:
|
4903
|
+
query: unknown;
|
4904
|
+
headers: unknown;
|
4905
|
+
response: {
|
4906
|
+
200: {
|
4907
|
+
[x: string]: {
|
4908
|
+
[poolId: string]: UniswapV4PoolType;
|
4909
|
+
} | undefined;
|
4910
|
+
};
|
4911
|
+
};
|
4912
|
+
};
|
4913
|
+
};
|
4914
|
+
};
|
4915
|
+
} & {
|
4916
|
+
v4pools: {
|
4917
|
+
":chainId": {
|
4918
|
+
get: {
|
4919
|
+
body: unknown;
|
4920
|
+
params: {
|
4900
4921
|
chainId: number;
|
4901
4922
|
};
|
4923
|
+
query: unknown;
|
4902
4924
|
headers: unknown;
|
4903
4925
|
response: {
|
4904
4926
|
200: {
|
4905
|
-
[x: string]:
|
4906
|
-
|
4907
|
-
|
4908
|
-
|
4909
|
-
|
4910
|
-
|
4911
|
-
|
4912
|
-
|
4913
|
-
|
4914
|
-
|
4915
|
-
|
4916
|
-
|
4917
|
-
|
4918
|
-
|
4927
|
+
[x: string]: any;
|
4928
|
+
};
|
4929
|
+
};
|
4930
|
+
};
|
4931
|
+
};
|
4932
|
+
};
|
4933
|
+
} & {
|
4934
|
+
v4: {
|
4935
|
+
":poolId": {
|
4936
|
+
get: {
|
4937
|
+
body: unknown;
|
4938
|
+
params: {
|
4939
|
+
poolId: string;
|
4940
|
+
};
|
4941
|
+
query: unknown;
|
4942
|
+
headers: unknown;
|
4943
|
+
response: {
|
4944
|
+
200: UniswapV4PoolType[];
|
4945
|
+
};
|
4946
|
+
};
|
4947
|
+
};
|
4948
|
+
};
|
4949
|
+
} & {
|
4950
|
+
v4: {
|
4951
|
+
update: {
|
4952
|
+
post: {
|
4953
|
+
body: unknown;
|
4954
|
+
params: {};
|
4955
|
+
query: unknown;
|
4956
|
+
headers: {
|
4957
|
+
authorization: string;
|
4958
|
+
};
|
4959
|
+
response: {
|
4960
|
+
200: void;
|
4961
|
+
};
|
4962
|
+
};
|
4963
|
+
};
|
4964
|
+
};
|
4965
|
+
} & {
|
4966
|
+
v4: {
|
4967
|
+
update: {
|
4968
|
+
":chainId": {
|
4969
|
+
post: {
|
4970
|
+
body: unknown;
|
4971
|
+
params: {
|
4972
|
+
chainId: number;
|
4973
|
+
};
|
4974
|
+
query: unknown;
|
4975
|
+
headers: {
|
4976
|
+
authorization: string;
|
4977
|
+
};
|
4978
|
+
response: {
|
4979
|
+
200: void;
|
4919
4980
|
};
|
4920
4981
|
};
|
4921
4982
|
};
|
@@ -2,6 +2,7 @@ import { AccountingController } from "@/modules/v4/accounting/accounting.control
|
|
2
2
|
import { BlacklistController } from "@/modules/v4/blacklist/blacklist.controller";
|
3
3
|
import { BoostController } from "@/modules/v4/boost/boost.controller";
|
4
4
|
import { CampaignController } from "@/modules/v4/campaign/campaign.controller";
|
5
|
+
import { CampaignTestController } from "@/modules/v4/campaign/campaign.test.controller";
|
5
6
|
import { ChainController } from "@/modules/v4/chain/chain.controller";
|
6
7
|
import { ClaimController } from "@/modules/v4/claims/claims.controller";
|
7
8
|
import { ComputedValueController } from "@/modules/v4/computedValue/computedValue.controller";
|
@@ -55,6 +56,7 @@ export const v4 = new Elysia({ tags: ["v4"], prefix: "/v4" })
|
|
55
56
|
// ─── Route Controllers ───────────────────────────────────────────────
|
56
57
|
.use(OpportunityController)
|
57
58
|
.use(CampaignController)
|
59
|
+
.use(CampaignTestController)
|
58
60
|
.use(ProtocolController)
|
59
61
|
.use(ExplorerController)
|
60
62
|
.use(TokenController)
|
@@ -36,26 +36,83 @@ export declare const UniswapController: Elysia<"uniswap", false, {
|
|
36
36
|
get: {
|
37
37
|
body: unknown;
|
38
38
|
params: {};
|
39
|
-
query:
|
39
|
+
query: unknown;
|
40
|
+
headers: unknown;
|
41
|
+
response: {
|
42
|
+
200: {
|
43
|
+
[x: string]: {
|
44
|
+
[poolId: string]: UniswapV4PoolType;
|
45
|
+
} | undefined;
|
46
|
+
};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
};
|
50
|
+
};
|
51
|
+
} & {
|
52
|
+
v4pools: {
|
53
|
+
":chainId": {
|
54
|
+
get: {
|
55
|
+
body: unknown;
|
56
|
+
params: {
|
40
57
|
chainId: number;
|
41
58
|
};
|
59
|
+
query: unknown;
|
42
60
|
headers: unknown;
|
43
61
|
response: {
|
44
62
|
200: {
|
45
|
-
[x: string]:
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
63
|
+
[x: string]: any;
|
64
|
+
};
|
65
|
+
};
|
66
|
+
};
|
67
|
+
};
|
68
|
+
};
|
69
|
+
} & {
|
70
|
+
v4: {
|
71
|
+
":poolId": {
|
72
|
+
get: {
|
73
|
+
body: unknown;
|
74
|
+
params: {
|
75
|
+
poolId: string;
|
76
|
+
};
|
77
|
+
query: unknown;
|
78
|
+
headers: unknown;
|
79
|
+
response: {
|
80
|
+
200: UniswapV4PoolType[];
|
81
|
+
};
|
82
|
+
};
|
83
|
+
};
|
84
|
+
};
|
85
|
+
} & {
|
86
|
+
v4: {
|
87
|
+
update: {
|
88
|
+
post: {
|
89
|
+
body: unknown;
|
90
|
+
params: {};
|
91
|
+
query: unknown;
|
92
|
+
headers: {
|
93
|
+
authorization: string;
|
94
|
+
};
|
95
|
+
response: {
|
96
|
+
200: void;
|
97
|
+
};
|
98
|
+
};
|
99
|
+
};
|
100
|
+
};
|
101
|
+
} & {
|
102
|
+
v4: {
|
103
|
+
update: {
|
104
|
+
":chainId": {
|
105
|
+
post: {
|
106
|
+
body: unknown;
|
107
|
+
params: {
|
108
|
+
chainId: number;
|
109
|
+
};
|
110
|
+
query: unknown;
|
111
|
+
headers: {
|
112
|
+
authorization: string;
|
113
|
+
};
|
114
|
+
response: {
|
115
|
+
200: void;
|
59
116
|
};
|
60
117
|
};
|
61
118
|
};
|
@@ -1,6 +1,11 @@
|
|
1
|
+
import { AuthorizationHeadersDto, BackOfficeGuard } from "@/guards/BackOffice.guard";
|
2
|
+
import { UnsupportedNetwork } from "@/utils/error";
|
1
3
|
import { throwOnInvalidAddress, throwOnInvalidRequiredAddress } from "@/utils/throw";
|
2
4
|
import Elysia, { t } from "elysia";
|
3
|
-
import {
|
5
|
+
import { CacheService } from "../cache";
|
6
|
+
import { TTLPresets } from "../cache/cache.model";
|
7
|
+
import { ChainUniqueDto } from "../chain/chain.model";
|
8
|
+
import { Bytes32Dto, RewardsPerV3PositionDto, UniV4ChainIdArray, UniswapV4PoolDto, } from "./uniswap.model";
|
4
9
|
import { UniswapService } from "./uniswap.service";
|
5
10
|
export const UniswapController = new Elysia({
|
6
11
|
prefix: "uniswap",
|
@@ -21,14 +26,52 @@ export const UniswapController = new Elysia({
|
|
21
26
|
});
|
22
27
|
})
|
23
28
|
.group("/v4", app => {
|
24
|
-
return app
|
25
|
-
|
29
|
+
return app
|
30
|
+
.get(
|
31
|
+
// TODO: add pagination
|
32
|
+
"/pools", async () => {
|
33
|
+
return await CacheService.wrap(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools);
|
26
34
|
}, {
|
27
|
-
query: t.Object({
|
28
|
-
chainId: t.Numeric(),
|
29
|
-
}),
|
30
35
|
detail: {
|
31
36
|
description: "Get Uniswap V4 pools by chain",
|
32
37
|
},
|
38
|
+
})
|
39
|
+
.get("pools/:chainId", async ({ params }) => {
|
40
|
+
return ((await CacheService.wrap(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools))[params.chainId] ?? {});
|
41
|
+
}, {
|
42
|
+
params: ChainUniqueDto,
|
43
|
+
beforeHandle: ({ params }) => {
|
44
|
+
if (!UniV4ChainIdArray.includes(params.chainId))
|
45
|
+
throw new UnsupportedNetwork(params.chainId);
|
46
|
+
},
|
47
|
+
response: t.Record(t.String(), // poolId
|
48
|
+
UniswapV4PoolDto),
|
49
|
+
})
|
50
|
+
.get("/:poolId", async ({ params }) => {
|
51
|
+
return Object.values(await CacheService.wrap(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools))
|
52
|
+
.flatMap(x => (x ? Object.values(x) : []))
|
53
|
+
.filter(p => p.poolId === params.poolId);
|
54
|
+
}, {
|
55
|
+
params: Bytes32Dto,
|
56
|
+
response: t.Array(UniswapV4PoolDto),
|
57
|
+
})
|
58
|
+
.post("/update", async () => {
|
59
|
+
await CacheService.set(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools);
|
60
|
+
}, {
|
61
|
+
headers: AuthorizationHeadersDto,
|
62
|
+
beforeHandle: BackOfficeGuard,
|
63
|
+
detail: { hide: true },
|
64
|
+
})
|
65
|
+
.post("/update/:chainId", async ({ params }) => {
|
66
|
+
await CacheService.set(TTLPresets.DAY_1, UniswapService.getUniswapV4Pools, params.chainId);
|
67
|
+
}, {
|
68
|
+
params: ChainUniqueDto,
|
69
|
+
headers: AuthorizationHeadersDto,
|
70
|
+
beforeHandle: async ({ params, headers }) => {
|
71
|
+
await BackOfficeGuard({ headers });
|
72
|
+
if (!UniV4ChainIdArray.includes(params.chainId))
|
73
|
+
throw new UnsupportedNetwork(params.chainId);
|
74
|
+
},
|
75
|
+
detail: { hide: true },
|
33
76
|
});
|
34
77
|
});
|