@aicoin/opendata-mcp 1.0.14 → 1.0.16
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/build/index.js +75 -53
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -317,20 +317,22 @@ function registerCoinTools(server2) {
|
|
|
317
317
|
cycle: z2.string().describe("Cycle: 24h or 7d"),
|
|
318
318
|
leverage: z2.string().optional().describe(
|
|
319
319
|
"Leverage filter: 10,25,50,100 (empty=all)"
|
|
320
|
-
)
|
|
320
|
+
),
|
|
321
|
+
...maxItemsParam
|
|
321
322
|
},
|
|
322
|
-
async ({ dbkey, cycle, leverage }) => {
|
|
323
|
+
async ({ dbkey, cycle, leverage, _max_items }) => {
|
|
323
324
|
try {
|
|
324
325
|
const params = {
|
|
325
326
|
dbkey,
|
|
326
327
|
cycle
|
|
327
328
|
};
|
|
328
329
|
if (leverage) params.leverage = leverage;
|
|
329
|
-
return
|
|
330
|
+
return okList(
|
|
330
331
|
await apiGet(
|
|
331
332
|
"/api/upgrade/v2/futures/liquidation/map",
|
|
332
333
|
params
|
|
333
|
-
)
|
|
334
|
+
),
|
|
335
|
+
parseMax(_max_items, 50)
|
|
334
336
|
);
|
|
335
337
|
} catch (e) {
|
|
336
338
|
return err(e);
|
|
@@ -472,9 +474,10 @@ function registerCoinTools(server2) {
|
|
|
472
474
|
),
|
|
473
475
|
limit: z2.string().optional().describe("Number of records, default 100"),
|
|
474
476
|
start_time: z2.string().optional().describe("Start time in ms"),
|
|
475
|
-
end_time: z2.string().optional().describe("End time in ms")
|
|
477
|
+
end_time: z2.string().optional().describe("End time in ms"),
|
|
478
|
+
...maxItemsParam
|
|
476
479
|
},
|
|
477
|
-
async ({ dbkey, cycle, leverage, limit, start_time, end_time }) => {
|
|
480
|
+
async ({ dbkey, cycle, leverage, limit, start_time, end_time, _max_items }) => {
|
|
478
481
|
try {
|
|
479
482
|
const params = {
|
|
480
483
|
dbkey,
|
|
@@ -484,11 +487,12 @@ function registerCoinTools(server2) {
|
|
|
484
487
|
params.limit = limit ?? "100";
|
|
485
488
|
if (start_time) params.start_time = start_time;
|
|
486
489
|
if (end_time) params.end_time = end_time;
|
|
487
|
-
return
|
|
490
|
+
return okList(
|
|
488
491
|
await apiGet(
|
|
489
492
|
"/api/upgrade/v2/futures/estimated-liquidation/history",
|
|
490
493
|
params
|
|
491
|
-
)
|
|
494
|
+
),
|
|
495
|
+
parseMax(_max_items, 100)
|
|
492
496
|
);
|
|
493
497
|
} catch (e) {
|
|
494
498
|
return err(e);
|
|
@@ -588,16 +592,14 @@ import { z as z3 } from "zod";
|
|
|
588
592
|
function registerContentTools(server2) {
|
|
589
593
|
server2.tool(
|
|
590
594
|
"get_newsflash",
|
|
591
|
-
"Get latest crypto flash news
|
|
595
|
+
"Get latest crypto flash news by AiCoin only",
|
|
592
596
|
{
|
|
593
|
-
|
|
594
|
-
limit: z3.string().optional().describe("Items per page, default 20")
|
|
597
|
+
language: z3.string().optional().describe("Language: cn, tc, en")
|
|
595
598
|
},
|
|
596
|
-
async ({
|
|
599
|
+
async ({ language }) => {
|
|
597
600
|
try {
|
|
598
601
|
const params = {};
|
|
599
|
-
if (
|
|
600
|
-
params.limit = limit ?? "20";
|
|
602
|
+
if (language) params.language = language;
|
|
601
603
|
return ok(
|
|
602
604
|
await apiGet("/api/v2/content/newsflash", params)
|
|
603
605
|
);
|
|
@@ -610,14 +612,14 @@ function registerContentTools(server2) {
|
|
|
610
612
|
"get_news_list",
|
|
611
613
|
"Get news article list",
|
|
612
614
|
{
|
|
613
|
-
page: z3.string().optional().describe("Page number"),
|
|
614
|
-
|
|
615
|
+
page: z3.string().optional().describe("Page number, default 1"),
|
|
616
|
+
pageSize: z3.string().optional().describe("Page size, max 20")
|
|
615
617
|
},
|
|
616
|
-
async ({ page,
|
|
618
|
+
async ({ page, pageSize }) => {
|
|
617
619
|
try {
|
|
618
620
|
const params = {};
|
|
619
621
|
if (page) params.page = page;
|
|
620
|
-
params.
|
|
622
|
+
params.pageSize = pageSize ?? "20";
|
|
621
623
|
return ok(
|
|
622
624
|
await apiGet("/api/v2/content/news-list", params)
|
|
623
625
|
);
|
|
@@ -694,14 +696,18 @@ function registerContentTools(server2) {
|
|
|
694
696
|
"get_exchange_listing_flash",
|
|
695
697
|
"Get exchange coin listing/delisting news",
|
|
696
698
|
{
|
|
697
|
-
|
|
698
|
-
|
|
699
|
+
language: z3.string().optional().describe("Language: cn, tc, en"),
|
|
700
|
+
memberIds: z3.string().optional().describe(
|
|
701
|
+
"Exchange member IDs, comma-separated. 477=Binance, 1509=Bitget. Default: 477,1509"
|
|
702
|
+
),
|
|
703
|
+
pageSize: z3.string().optional().describe("Page size, default 20")
|
|
699
704
|
},
|
|
700
|
-
async ({
|
|
705
|
+
async ({ language, memberIds, pageSize }) => {
|
|
701
706
|
try {
|
|
702
707
|
const params = {};
|
|
703
|
-
if (
|
|
704
|
-
params.
|
|
708
|
+
if (language) params.language = language;
|
|
709
|
+
if (memberIds) params.memberIds = memberIds;
|
|
710
|
+
if (pageSize) params.pageSize = pageSize;
|
|
705
711
|
return ok(
|
|
706
712
|
await apiGet(
|
|
707
713
|
"/api/v2/content/exchange-listing-flash",
|
|
@@ -788,12 +794,14 @@ function registerMarketTools(server2) {
|
|
|
788
794
|
"get_futures_interest",
|
|
789
795
|
"Get futures open interest data",
|
|
790
796
|
{
|
|
791
|
-
coin: z4.string().describe("Coin ticker, e.g. BTC, ETH")
|
|
797
|
+
coin: z4.string().describe("Coin ticker, e.g. BTC, ETH"),
|
|
798
|
+
...maxItemsParam
|
|
792
799
|
},
|
|
793
|
-
async ({ coin }) => {
|
|
800
|
+
async ({ coin, _max_items }) => {
|
|
794
801
|
try {
|
|
795
|
-
return
|
|
796
|
-
await apiGet("/api/v2/futures/interest", { coin })
|
|
802
|
+
return okList(
|
|
803
|
+
await apiGet("/api/v2/futures/interest", { coin }),
|
|
804
|
+
parseMax(_max_items, 50)
|
|
797
805
|
);
|
|
798
806
|
} catch (e) {
|
|
799
807
|
return err(e);
|
|
@@ -1278,14 +1286,16 @@ function registerFeatureTools(server2) {
|
|
|
1278
1286
|
{
|
|
1279
1287
|
symbol: z5.string().describe(
|
|
1280
1288
|
"Trading pair, e.g. btcusdt:okex"
|
|
1281
|
-
)
|
|
1289
|
+
),
|
|
1290
|
+
...maxItemsParam
|
|
1282
1291
|
},
|
|
1283
|
-
async ({ symbol }) => {
|
|
1292
|
+
async ({ symbol, _max_items }) => {
|
|
1284
1293
|
try {
|
|
1285
|
-
return
|
|
1294
|
+
return okList(
|
|
1286
1295
|
await apiGet("/api/v2/order/bigOrder", {
|
|
1287
1296
|
symbol
|
|
1288
|
-
})
|
|
1297
|
+
}),
|
|
1298
|
+
parseMax(_max_items, 50)
|
|
1289
1299
|
);
|
|
1290
1300
|
} catch (e) {
|
|
1291
1301
|
return err(e);
|
|
@@ -1298,14 +1308,16 @@ function registerFeatureTools(server2) {
|
|
|
1298
1308
|
{
|
|
1299
1309
|
symbol: z5.string().describe(
|
|
1300
1310
|
"Trading pair, e.g. btcusdt:okex"
|
|
1301
|
-
)
|
|
1311
|
+
),
|
|
1312
|
+
...maxItemsParam
|
|
1302
1313
|
},
|
|
1303
|
-
async ({ symbol }) => {
|
|
1314
|
+
async ({ symbol, _max_items }) => {
|
|
1304
1315
|
try {
|
|
1305
|
-
return
|
|
1316
|
+
return okList(
|
|
1306
1317
|
await apiGet("/api/v2/order/aggTrade", {
|
|
1307
1318
|
symbol
|
|
1308
|
-
})
|
|
1319
|
+
}),
|
|
1320
|
+
parseMax(_max_items, 50)
|
|
1309
1321
|
);
|
|
1310
1322
|
} catch (e) {
|
|
1311
1323
|
return err(e);
|
|
@@ -1340,20 +1352,22 @@ function registerFeatureTools(server2) {
|
|
|
1340
1352
|
signal_key: z5.string().optional().describe(
|
|
1341
1353
|
"Signal key: depth_win_one,depth_win_two,depth_buy_one,order_buy_one,td_buy_one,lsur_one"
|
|
1342
1354
|
),
|
|
1343
|
-
latest_time: z5.string().optional().describe("Latest time in ms timestamp")
|
|
1355
|
+
latest_time: z5.string().optional().describe("Latest time in ms timestamp"),
|
|
1356
|
+
...maxItemsParam
|
|
1344
1357
|
},
|
|
1345
|
-
async ({ coin_type, signal_key, latest_time }) => {
|
|
1358
|
+
async ({ coin_type, signal_key, latest_time, _max_items }) => {
|
|
1346
1359
|
try {
|
|
1347
1360
|
const params = {};
|
|
1348
1361
|
if (coin_type) params.coin_type = coin_type;
|
|
1349
1362
|
if (signal_key) params.signal_key = signal_key;
|
|
1350
1363
|
if (latest_time)
|
|
1351
1364
|
params.latest_time = latest_time;
|
|
1352
|
-
return
|
|
1365
|
+
return okList(
|
|
1353
1366
|
await apiGet(
|
|
1354
1367
|
"/api/v2/signal/strategySignal",
|
|
1355
1368
|
params
|
|
1356
|
-
)
|
|
1369
|
+
),
|
|
1370
|
+
parseMax(_max_items, 50)
|
|
1357
1371
|
);
|
|
1358
1372
|
} catch (e) {
|
|
1359
1373
|
return err(e);
|
|
@@ -1419,17 +1433,19 @@ function registerFeatureTools(server2) {
|
|
|
1419
1433
|
"get_signal_alert",
|
|
1420
1434
|
"Get signal alert data",
|
|
1421
1435
|
{
|
|
1422
|
-
coin: z5.string().optional().describe("Coin key filter")
|
|
1436
|
+
coin: z5.string().optional().describe("Coin key filter"),
|
|
1437
|
+
...maxItemsParam
|
|
1423
1438
|
},
|
|
1424
|
-
async ({ coin }) => {
|
|
1439
|
+
async ({ coin, _max_items }) => {
|
|
1425
1440
|
try {
|
|
1426
1441
|
const params = {};
|
|
1427
1442
|
if (coin) params.coin = coin;
|
|
1428
|
-
return
|
|
1443
|
+
return okList(
|
|
1429
1444
|
await apiGet(
|
|
1430
1445
|
"/api/v2/signal/signalAlert",
|
|
1431
1446
|
params
|
|
1432
|
-
)
|
|
1447
|
+
),
|
|
1448
|
+
parseMax(_max_items, 50)
|
|
1433
1449
|
);
|
|
1434
1450
|
} catch (e) {
|
|
1435
1451
|
return err(e);
|
|
@@ -1903,14 +1919,16 @@ function registerHyperliquidTools(server2) {
|
|
|
1903
1919
|
address: z6.string().describe("Wallet address"),
|
|
1904
1920
|
window: z6.string().describe(
|
|
1905
1921
|
"Time window: day, week, month, allTime"
|
|
1906
|
-
)
|
|
1922
|
+
),
|
|
1923
|
+
...maxItemsParam
|
|
1907
1924
|
},
|
|
1908
|
-
async ({ address, window: win }) => {
|
|
1925
|
+
async ({ address, window: win, _max_items }) => {
|
|
1909
1926
|
try {
|
|
1910
|
-
return
|
|
1927
|
+
return okList(
|
|
1911
1928
|
await apiGet(
|
|
1912
1929
|
`/api/upgrade/v2/hl/portfolio/${address}/${win}`
|
|
1913
|
-
)
|
|
1930
|
+
),
|
|
1931
|
+
parseMax(_max_items, 100)
|
|
1914
1932
|
);
|
|
1915
1933
|
} catch (e) {
|
|
1916
1934
|
return err(e);
|
|
@@ -2341,13 +2359,15 @@ function registerHyperliquidTools(server2) {
|
|
|
2341
2359
|
"hl_get_max_drawdown",
|
|
2342
2360
|
"Get max drawdown data by address",
|
|
2343
2361
|
{
|
|
2344
|
-
address: z6.string().describe("Wallet address")
|
|
2362
|
+
address: z6.string().describe("Wallet address"),
|
|
2363
|
+
days: z6.string().describe("Number of days, e.g. 7, 30, 90")
|
|
2345
2364
|
},
|
|
2346
|
-
async ({ address }) => {
|
|
2365
|
+
async ({ address, days }) => {
|
|
2347
2366
|
try {
|
|
2348
2367
|
return ok(
|
|
2349
2368
|
await apiGet(
|
|
2350
|
-
`/api/upgrade/v2/hl/max-drawdown/${address}
|
|
2369
|
+
`/api/upgrade/v2/hl/max-drawdown/${address}`,
|
|
2370
|
+
{ days }
|
|
2351
2371
|
)
|
|
2352
2372
|
);
|
|
2353
2373
|
} catch (e) {
|
|
@@ -2359,13 +2379,15 @@ function registerHyperliquidTools(server2) {
|
|
|
2359
2379
|
"hl_get_net_flow",
|
|
2360
2380
|
"Get ledger net flow by address",
|
|
2361
2381
|
{
|
|
2362
|
-
address: z6.string().describe("Wallet address")
|
|
2382
|
+
address: z6.string().describe("Wallet address"),
|
|
2383
|
+
days: z6.string().describe("Number of days, e.g. 7, 30, 90")
|
|
2363
2384
|
},
|
|
2364
|
-
async ({ address }) => {
|
|
2385
|
+
async ({ address, days }) => {
|
|
2365
2386
|
try {
|
|
2366
2387
|
return ok(
|
|
2367
2388
|
await apiGet(
|
|
2368
|
-
`/api/upgrade/v2/hl/ledger-updates/net-flow/${address}
|
|
2389
|
+
`/api/upgrade/v2/hl/ledger-updates/net-flow/${address}`,
|
|
2390
|
+
{ days }
|
|
2369
2391
|
)
|
|
2370
2392
|
);
|
|
2371
2393
|
} catch (e) {
|