hvip-mcp-server 0.1.3 → 0.1.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/index.js +392 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -21157,7 +21157,18 @@ var publicApi = {
|
|
|
21157
21157
|
getLongShortRatio: (ccy, begin, end) => request("GET", "/api/v5/rubik/stat/contracts/long-short-account-ratio", { params: { ccy, begin, end } }),
|
|
21158
21158
|
getTakerVolume: (ccy, instType, begin, end) => request("GET", "/api/v5/rubik/stat/taker-volume", { params: { ccy, instType, begin, end } }),
|
|
21159
21159
|
getOpenInterestVolume: (ccy, begin, end) => request("GET", "/api/v5/rubik/stat/contracts/open-interest-volume", { params: { ccy, begin, end } }),
|
|
21160
|
-
getLendingRateHistory: (ccy) => request("GET", "/api/v5/rubik/stat/margin/loan-ratio", { params: { ccy } })
|
|
21160
|
+
getLendingRateHistory: (ccy) => request("GET", "/api/v5/rubik/stat/margin/loan-ratio", { params: { ccy } }),
|
|
21161
|
+
getHistoryCandles: (instId, bar, after, before, limit) => request("GET", "/api/v5/market/history-candles", { params: { instId, bar, after, before, limit } }),
|
|
21162
|
+
getHistoryTrades: (instId, limit) => request("GET", "/api/v5/market/history-trades", { params: { instId, limit } }),
|
|
21163
|
+
getSystemStatus: () => request("GET", "/api/v5/system/status"),
|
|
21164
|
+
getPriceLimitBatch: (instType, uly, instId) => request("GET", "/api/v5/public/price-limit", { params: { instType, uly, instId } }),
|
|
21165
|
+
getOptSummary: (uly, expTime) => request("GET", "/api/v5/public/opt-summary", { params: { uly, expTime } }),
|
|
21166
|
+
getInsuranceFund: (instType, uly) => request("GET", "/api/v5/public/insurance-fund", { params: { instType, uly } }),
|
|
21167
|
+
convertContractCoin: (instId, sz, unit, opType) => request("GET", "/api/v5/public/convert-contract-coin", { params: { instId, sz, unit, opType } }),
|
|
21168
|
+
getSupportCoin: () => request("GET", "/api/v5/rubik/stat/trading-data/support-coin"),
|
|
21169
|
+
getTopTraderLongShortRatio: (instId, begin, end) => request("GET", "/api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader", { params: { instId, begin, end } }),
|
|
21170
|
+
getOptionPutCallRatio: (ccy, begin, end) => request("GET", "/api/v5/rubik/stat/option/open-interest-volume-ratio", { params: { ccy, begin, end } }),
|
|
21171
|
+
getLendingRateSummary: (ccy) => request("GET", "/api/v5/finance/savings/lending-rate-summary", { params: { ccy } })
|
|
21161
21172
|
};
|
|
21162
21173
|
var privateApi = {
|
|
21163
21174
|
getBalance: (auth, ccy) => request("GET", "/api/v5/account/balance", { params: { ccy }, auth }),
|
|
@@ -21171,6 +21182,19 @@ var privateApi = {
|
|
|
21171
21182
|
transfer: (auth, body) => request("POST", "/api/v5/asset/transfer", { body, auth }),
|
|
21172
21183
|
withdrawal: (auth, body) => request("POST", "/api/v5/asset/withdrawal", { body, auth }),
|
|
21173
21184
|
// ── 策略交易 ────────────────────────────────────────────────────────────────
|
|
21185
|
+
getAccountBills: (auth, instType, ccy, limit) => request("GET", "/api/v5/account/bills", { params: { instType, ccy, limit }, auth }),
|
|
21186
|
+
getAccountConfig: (auth) => request("GET", "/api/v5/account/config", { auth }),
|
|
21187
|
+
getLeverageInfo: (auth, instId, mgnMode) => request("GET", "/api/v5/account/leverage-info", { params: { instId, mgnMode }, auth }),
|
|
21188
|
+
getOrdersPending: (auth, instType, instId, ordType) => request("GET", "/api/v5/trade/orders-pending", { params: { instType, instId, ordType }, auth }),
|
|
21189
|
+
getFills: (auth, instType, instId, limit) => request("GET", "/api/v5/trade/fills", { params: { instType, instId, limit }, auth }),
|
|
21190
|
+
getOrdersHistoryArchive: (auth, instType, limit) => request("GET", "/api/v5/trade/orders-history-archive", { params: { instType, limit }, auth }),
|
|
21191
|
+
getCurrencies: (auth, ccy) => request("GET", "/api/v5/asset/currencies", { params: { ccy }, auth }),
|
|
21192
|
+
getDepositAddress: (auth, ccy) => request("GET", "/api/v5/asset/deposit-address", { params: { ccy }, auth }),
|
|
21193
|
+
getDepositHistory: (auth, ccy, limit) => request("GET", "/api/v5/asset/deposit-history", { params: { ccy, limit }, auth }),
|
|
21194
|
+
getWithdrawalHistory: (auth, ccy, limit) => request("GET", "/api/v5/asset/withdrawal-history", { params: { ccy, limit }, auth }),
|
|
21195
|
+
getEthStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/eth/balance", { auth }),
|
|
21196
|
+
getEthStakingHistory: (auth, limit) => request("GET", "/api/v5/finance/staking-defi/eth/purchase-redeem-history", { params: { limit }, auth }),
|
|
21197
|
+
getSolStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/sol/balance", { auth }),
|
|
21174
21198
|
getAlgoOrders: (auth, ordType, instType) => request("GET", "/api/v5/trade/orders-algo-pending", { params: { ordType, instType }, auth }),
|
|
21175
21199
|
getAlgoOrdersHistory: (auth, ordType, state, instType) => request("GET", "/api/v5/trade/orders-algo-history", { params: { ordType, state, instType }, auth }),
|
|
21176
21200
|
placeAlgoOrder: (auth, body) => request("POST", "/api/v5/trade/order-algo", { body, auth }),
|
|
@@ -21348,6 +21372,54 @@ function registerMarketTools(server) {
|
|
|
21348
21372
|
}
|
|
21349
21373
|
}
|
|
21350
21374
|
);
|
|
21375
|
+
server.tool(
|
|
21376
|
+
"okx_get_history_candles",
|
|
21377
|
+
"\u83B7\u53D6\u4EA7\u54C1\u5386\u53F2K\u7EBF\u6570\u636E\uFF08\u6700\u8FD13\u4E2A\u6708\u4EE5\u524D\u7684\u6570\u636E\uFF09\u3002\u7528\u4E8E\u56DE\u6D4B\u3001\u957F\u5468\u671F\u6280\u672F\u5206\u6790\u3002\u4E0Eokx_get_candles\u4E92\u8865\uFF0Ccandles\u53EA\u63D0\u4F9B\u6700\u8FD1\u6570\u636E\u3002",
|
|
21378
|
+
{
|
|
21379
|
+
instId: external_exports.string().describe("\u4EA7\u54C1ID\uFF0C\u5982 BTC-USDT"),
|
|
21380
|
+
bar: external_exports.enum(["1m", "3m", "5m", "15m", "30m", "1H", "4H", "1D", "1W"]).optional().describe("K\u7EBF\u5468\u671F\uFF0C\u9ED8\u8BA41H"),
|
|
21381
|
+
after: external_exports.string().optional().describe("\u67E5\u8BE2\u6B64\u65F6\u95F4\u6233\u4E4B\u524D\u7684\u6570\u636E\uFF08\u6BEB\u79D2Unix\u65F6\u95F4\u6233\uFF0C\u7528\u4E8E\u7FFB\u9875\uFF09"),
|
|
21382
|
+
before: external_exports.string().optional().describe("\u67E5\u8BE2\u6B64\u65F6\u95F4\u6233\u4E4B\u540E\u7684\u6570\u636E\uFF08\u6BEB\u79D2Unix\u65F6\u95F4\u6233\uFF09"),
|
|
21383
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21384
|
+
},
|
|
21385
|
+
async ({ instId, bar, after, before, limit }) => {
|
|
21386
|
+
try {
|
|
21387
|
+
const data = await publicApi.getHistoryCandles(instId, bar, after, before, limit);
|
|
21388
|
+
return toResult(data);
|
|
21389
|
+
} catch (e) {
|
|
21390
|
+
return toError(e);
|
|
21391
|
+
}
|
|
21392
|
+
}
|
|
21393
|
+
);
|
|
21394
|
+
server.tool(
|
|
21395
|
+
"okx_get_history_trades",
|
|
21396
|
+
"\u83B7\u53D6\u4EA7\u54C1\u5386\u53F2\u6210\u4EA4\u8BB0\u5F55\uFF08\u6700\u8FD13\u4E2A\u6708\uFF09\u3002\u7528\u4E8E\u5206\u6790\u5386\u53F2\u6210\u4EA4\u4EF7\u683C\u5206\u5E03\u3001\u7814\u7A76\u6D41\u52A8\u6027\u6A21\u5F0F\u3002",
|
|
21397
|
+
{
|
|
21398
|
+
instId: external_exports.string().describe("\u4EA7\u54C1ID"),
|
|
21399
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21400
|
+
},
|
|
21401
|
+
async ({ instId, limit }) => {
|
|
21402
|
+
try {
|
|
21403
|
+
const data = await publicApi.getHistoryTrades(instId, limit);
|
|
21404
|
+
return toResult(data);
|
|
21405
|
+
} catch (e) {
|
|
21406
|
+
return toError(e);
|
|
21407
|
+
}
|
|
21408
|
+
}
|
|
21409
|
+
);
|
|
21410
|
+
server.tool(
|
|
21411
|
+
"okx_get_system_status",
|
|
21412
|
+
"\u83B7\u53D6OKX\u7CFB\u7EDF\u7EF4\u62A4\u72B6\u6001\u3002\u5728\u4E0B\u5355\u524D\u5EFA\u8BAE\u67E5\u8BE2\uFF0C\u786E\u8BA4\u7CFB\u7EDF\u6B63\u5E38\u8FD0\u884C\u4E2D\uFF0C\u907F\u514D\u7EF4\u62A4\u671F\u8BEF\u64CD\u4F5C\u3002",
|
|
21413
|
+
{},
|
|
21414
|
+
async () => {
|
|
21415
|
+
try {
|
|
21416
|
+
const data = await publicApi.getSystemStatus();
|
|
21417
|
+
return toResult(data);
|
|
21418
|
+
} catch (e) {
|
|
21419
|
+
return toError(e);
|
|
21420
|
+
}
|
|
21421
|
+
}
|
|
21422
|
+
);
|
|
21351
21423
|
}
|
|
21352
21424
|
|
|
21353
21425
|
// src/tools/public.ts
|
|
@@ -21439,6 +21511,56 @@ function registerPublicTools(server) {
|
|
|
21439
21511
|
}
|
|
21440
21512
|
}
|
|
21441
21513
|
);
|
|
21514
|
+
server.tool(
|
|
21515
|
+
"okx_get_opt_summary",
|
|
21516
|
+
"\u83B7\u53D6\u671F\u6743\u5E02\u573A\u6458\u8981\u6570\u636E\uFF0C\u542B\u5404\u5230\u671F\u65E5\u7684\u9690\u542B\u6CE2\u52A8\u7387\uFF08IV\uFF09\u3001\u672A\u5E73\u4ED3\u91CF\u548C\u6210\u4EA4\u91CF\u5206\u5E03\u3002\u7528\u4E8E\u671F\u6743\u4EA4\u6613\u524D\u7684\u6574\u4F53\u5E02\u573A\u626B\u63CF\u3002",
|
|
21517
|
+
{
|
|
21518
|
+
uly: external_exports.string().describe("\u6807\u7684\u6307\u6570\uFF0C\u5982 BTC-USD\u3001ETH-USD"),
|
|
21519
|
+
expTime: external_exports.string().optional().describe("\u5230\u671F\u65E5\u7B5B\u9009\uFF0C\u683C\u5F0F YYYYMMDD\uFF0C\u5982 20250101")
|
|
21520
|
+
},
|
|
21521
|
+
async ({ uly, expTime }) => {
|
|
21522
|
+
try {
|
|
21523
|
+
const data = await publicApi.getOptSummary(uly, expTime);
|
|
21524
|
+
return toResult(data);
|
|
21525
|
+
} catch (e) {
|
|
21526
|
+
return toError(e);
|
|
21527
|
+
}
|
|
21528
|
+
}
|
|
21529
|
+
);
|
|
21530
|
+
server.tool(
|
|
21531
|
+
"okx_get_insurance_fund",
|
|
21532
|
+
"\u83B7\u53D6OKX\u4FDD\u9669\u57FA\u91D1\u4F59\u989D\u53D8\u52A8\u5386\u53F2\u3002\u4FDD\u9669\u57FA\u91D1\u89C4\u6A21\u53CD\u6620\u4EA4\u6613\u6240\u62B5\u5FA1\u6781\u7AEF\u884C\u60C5\u7684\u80FD\u529B\uFF0C\u4E5F\u662F\u8861\u91CF\u5E73\u53F0\u98CE\u9669\u7684\u6307\u6807\u3002",
|
|
21533
|
+
{
|
|
21534
|
+
instType: external_exports.enum(["SWAP", "FUTURES", "OPTION", "MARGIN"]).describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
21535
|
+
uly: external_exports.string().optional().describe("\u6807\u7684\u6307\u6570\uFF0C\u5982 BTC-USD\uFF08SWAP/FUTURES/OPTION\u5FC5\u586B\uFF09")
|
|
21536
|
+
},
|
|
21537
|
+
async ({ instType, uly }) => {
|
|
21538
|
+
try {
|
|
21539
|
+
const data = await publicApi.getInsuranceFund(instType, uly);
|
|
21540
|
+
return toResult(data);
|
|
21541
|
+
} catch (e) {
|
|
21542
|
+
return toError(e);
|
|
21543
|
+
}
|
|
21544
|
+
}
|
|
21545
|
+
);
|
|
21546
|
+
server.tool(
|
|
21547
|
+
"okx_convert_contract_coin",
|
|
21548
|
+
"\u5408\u7EA6\u5F20\u6570\u4E0E\u5E01\u6570\u4E92\u6362\u8BA1\u7B97\u3002\u4E0B\u5408\u7EA6\u5355\u65F6\u5148\u7528\u6B64\u63A5\u53E3\u6362\u7B97\u5F20\u6570\uFF0C\u907F\u514D\u6570\u91CF\u586B\u9519\u3002",
|
|
21549
|
+
{
|
|
21550
|
+
instId: external_exports.string().describe("\u4EA7\u54C1ID\uFF0C\u5982 BTC-USDT-SWAP"),
|
|
21551
|
+
sz: external_exports.string().describe("\u6570\u91CF\uFF08\u5F20\u6570\u6216\u5E01\u6570\uFF0C\u53D6\u51B3\u4E8Eunit\uFF09"),
|
|
21552
|
+
unit: external_exports.enum(["coin", "usds", "contracts"]).describe("sz\u7684\u5355\u4F4D\uFF1Acoin=\u5E01\uFF0Ccontracts=\u5F20"),
|
|
21553
|
+
opType: external_exports.enum(["open", "close"]).describe("\u5F00\u4ED3\u6216\u5E73\u4ED3")
|
|
21554
|
+
},
|
|
21555
|
+
async ({ instId, sz, unit, opType }) => {
|
|
21556
|
+
try {
|
|
21557
|
+
const data = await publicApi.convertContractCoin(instId, sz, unit, opType);
|
|
21558
|
+
return toResult(data);
|
|
21559
|
+
} catch (e) {
|
|
21560
|
+
return toError(e);
|
|
21561
|
+
}
|
|
21562
|
+
}
|
|
21563
|
+
);
|
|
21442
21564
|
}
|
|
21443
21565
|
|
|
21444
21566
|
// src/tools/account.ts
|
|
@@ -21490,7 +21612,7 @@ function registerAccountTools(server, auth) {
|
|
|
21490
21612
|
);
|
|
21491
21613
|
server.tool(
|
|
21492
21614
|
"okx_get_orders_history",
|
|
21493
|
-
"\u67E5\u8BE2\u6700\u8FD1\u7684\u5386\u53F2\u6210\u4EA4\u8BA2\u5355\u5217\u8868\u3002\u7528\u4E8E\u590D\u76D8\u4EA4\u6613\u8868\u73B0\u3001\u7EDF\u8BA1\u76C8\u4E8F\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21615
|
+
"\u67E5\u8BE2\u6700\u8FD1\u7684\u5386\u53F2\u6210\u4EA4\u8BA2\u5355\u5217\u8868\uFF08\u6700\u8FD13\u4E2A\u6708\uFF09\u3002\u7528\u4E8E\u590D\u76D8\u4EA4\u6613\u8868\u73B0\u3001\u7EDF\u8BA1\u76C8\u4E8F\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21494
21616
|
{
|
|
21495
21617
|
instType: external_exports.enum(["SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"]).describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
21496
21618
|
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA450")
|
|
@@ -21505,6 +21627,55 @@ function registerAccountTools(server, auth) {
|
|
|
21505
21627
|
}
|
|
21506
21628
|
}
|
|
21507
21629
|
);
|
|
21630
|
+
server.tool(
|
|
21631
|
+
"okx_get_account_bills",
|
|
21632
|
+
"\u67E5\u8BE2\u4EA4\u6613\u8D26\u6237\u8D44\u91D1\u6D41\u6C34\uFF08\u8D26\u5355\uFF09\uFF0C\u542B\u6BCF\u7B14\u51FA\u5165\u91D1\u3001\u624B\u7EED\u8D39\u3001\u8D44\u91D1\u8D39\u7387\u3001\u7ED3\u7B97\u76C8\u4E8F\u7B49\u3002\u662F\u6700\u5B8C\u6574\u7684\u8D44\u91D1\u53D8\u52A8\u8BB0\u5F55\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21633
|
+
{
|
|
21634
|
+
instType: external_exports.enum(["SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
|
|
21635
|
+
ccy: external_exports.string().optional().describe("\u5E01\u79CD\uFF0C\u5982 USDT"),
|
|
21636
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21637
|
+
},
|
|
21638
|
+
async ({ instType, ccy, limit }) => {
|
|
21639
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21640
|
+
try {
|
|
21641
|
+
const data = await privateApi.getAccountBills(auth, instType, ccy, limit);
|
|
21642
|
+
return toResult(data);
|
|
21643
|
+
} catch (e) {
|
|
21644
|
+
return toError(e);
|
|
21645
|
+
}
|
|
21646
|
+
}
|
|
21647
|
+
);
|
|
21648
|
+
server.tool(
|
|
21649
|
+
"okx_get_account_config",
|
|
21650
|
+
"\u67E5\u8BE2\u8D26\u6237\u5F53\u524D\u914D\u7F6E\uFF0C\u542B\u8D26\u6237\u6A21\u5F0F\uFF08\u5355\u5E01\u79CD/\u591A\u5E01\u79CD/\u7EC4\u5408\u4FDD\u8BC1\u91D1\uFF09\u3001\u6301\u4ED3\u6A21\u5F0F\uFF08\u5355\u5411/\u53CC\u5411\uFF09\u548C\u4E3B\u8D26\u6237UID\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21651
|
+
{},
|
|
21652
|
+
async () => {
|
|
21653
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21654
|
+
try {
|
|
21655
|
+
const data = await privateApi.getAccountConfig(auth);
|
|
21656
|
+
return toResult(data);
|
|
21657
|
+
} catch (e) {
|
|
21658
|
+
return toError(e);
|
|
21659
|
+
}
|
|
21660
|
+
}
|
|
21661
|
+
);
|
|
21662
|
+
server.tool(
|
|
21663
|
+
"okx_get_leverage_info",
|
|
21664
|
+
"\u67E5\u8BE2\u6307\u5B9A\u4EA7\u54C1\u7684\u5F53\u524D\u6760\u6746\u500D\u6570\u8BBE\u7F6E\u3002\u4EA4\u6613\u524D\u5EFA\u8BAE\u5148\u67E5\u8BE2\uFF0C\u786E\u8BA4\u98CE\u9669\u655E\u53E3\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21665
|
+
{
|
|
21666
|
+
instId: external_exports.string().describe("\u4EA7\u54C1ID\uFF0C\u5982 BTC-USDT-SWAP"),
|
|
21667
|
+
mgnMode: external_exports.enum(["isolated", "cross"]).describe("\u4FDD\u8BC1\u91D1\u6A21\u5F0F\uFF1Aisolated=\u9010\u4ED3\uFF0Ccross=\u5168\u4ED3")
|
|
21668
|
+
},
|
|
21669
|
+
async ({ instId, mgnMode }) => {
|
|
21670
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21671
|
+
try {
|
|
21672
|
+
const data = await privateApi.getLeverageInfo(auth, instId, mgnMode);
|
|
21673
|
+
return toResult(data);
|
|
21674
|
+
} catch (e) {
|
|
21675
|
+
return toError(e);
|
|
21676
|
+
}
|
|
21677
|
+
}
|
|
21678
|
+
);
|
|
21508
21679
|
}
|
|
21509
21680
|
|
|
21510
21681
|
// src/tools/trading.ts
|
|
@@ -21571,6 +21742,59 @@ function registerTradingTools(server, auth) {
|
|
|
21571
21742
|
}
|
|
21572
21743
|
}
|
|
21573
21744
|
);
|
|
21745
|
+
server.tool(
|
|
21746
|
+
"okx_get_orders_pending",
|
|
21747
|
+
"\u67E5\u8BE2\u5F53\u524D\u6240\u6709\u672A\u6210\u4EA4\u6302\u5355\u5217\u8868\u3002\u7528\u4E8E\u76D1\u63A7\u672A\u6210\u4EA4\u8BA2\u5355\u3001\u68C0\u67E5\u9650\u4EF7\u5355\u662F\u5426\u4ECD\u5728\u961F\u5217\u4E2D\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21748
|
+
{
|
|
21749
|
+
instType: external_exports.enum(["SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
|
|
21750
|
+
instId: external_exports.string().optional().describe("\u4EA7\u54C1ID\uFF0C\u7CBE\u786E\u7B5B\u9009"),
|
|
21751
|
+
ordType: external_exports.enum(["market", "limit", "post_only", "fok", "ioc"]).optional().describe("\u8BA2\u5355\u7C7B\u578B\u7B5B\u9009")
|
|
21752
|
+
},
|
|
21753
|
+
async ({ instType, instId, ordType }) => {
|
|
21754
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21755
|
+
try {
|
|
21756
|
+
const data = await privateApi.getOrdersPending(auth, instType, instId, ordType);
|
|
21757
|
+
return toResult(data);
|
|
21758
|
+
} catch (e) {
|
|
21759
|
+
return toError(e);
|
|
21760
|
+
}
|
|
21761
|
+
}
|
|
21762
|
+
);
|
|
21763
|
+
server.tool(
|
|
21764
|
+
"okx_get_fills",
|
|
21765
|
+
"\u67E5\u8BE2\u6700\u8FD1\u7684\u6210\u4EA4\u660E\u7EC6\uFF08\u9010\u7B14\u6210\u4EA4\uFF09\uFF0C\u542B\u6210\u4EA4\u4EF7\u3001\u6210\u4EA4\u91CF\u548C\u624B\u7EED\u8D39\u3002\u6BD4\u8BA2\u5355\u5386\u53F2\u66F4\u7EC6\u7C92\u5EA6\uFF0C\u53EF\u7528\u4E8E\u7CBE\u786E\u8BA1\u7B97\u5747\u4EF7\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21766
|
+
{
|
|
21767
|
+
instType: external_exports.enum(["SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
21768
|
+
instId: external_exports.string().optional().describe("\u4EA7\u54C1ID"),
|
|
21769
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21770
|
+
},
|
|
21771
|
+
async ({ instType, instId, limit }) => {
|
|
21772
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21773
|
+
try {
|
|
21774
|
+
const data = await privateApi.getFills(auth, instType, instId, limit);
|
|
21775
|
+
return toResult(data);
|
|
21776
|
+
} catch (e) {
|
|
21777
|
+
return toError(e);
|
|
21778
|
+
}
|
|
21779
|
+
}
|
|
21780
|
+
);
|
|
21781
|
+
server.tool(
|
|
21782
|
+
"okx_get_orders_history_archive",
|
|
21783
|
+
"\u67E5\u8BE23\u4E2A\u6708\u4EE5\u524D\u7684\u5B8C\u6574\u5386\u53F2\u8BA2\u5355\uFF08\u5F52\u6863\u6570\u636E\uFF09\u3002\u7528\u4E8E\u957F\u671F\u4EA4\u6613\u8BB0\u5F55\u5206\u6790\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21784
|
+
{
|
|
21785
|
+
instType: external_exports.enum(["SPOT", "MARGIN", "SWAP", "FUTURES", "OPTION"]).describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
21786
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA450")
|
|
21787
|
+
},
|
|
21788
|
+
async ({ instType, limit }) => {
|
|
21789
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21790
|
+
try {
|
|
21791
|
+
const data = await privateApi.getOrdersHistoryArchive(auth, instType, limit);
|
|
21792
|
+
return toResult(data);
|
|
21793
|
+
} catch (e) {
|
|
21794
|
+
return toError(e);
|
|
21795
|
+
}
|
|
21796
|
+
}
|
|
21797
|
+
);
|
|
21574
21798
|
}
|
|
21575
21799
|
|
|
21576
21800
|
// src/tools/algo.ts
|
|
@@ -21678,6 +21902,68 @@ function registerFundingTools(server, auth) {
|
|
|
21678
21902
|
}
|
|
21679
21903
|
}
|
|
21680
21904
|
);
|
|
21905
|
+
server.tool(
|
|
21906
|
+
"okx_get_currencies",
|
|
21907
|
+
"\u83B7\u53D6OKX\u652F\u6301\u7684\u6240\u6709\u5E01\u79CD\u5217\u8868\uFF0C\u542B\u5145\u503C/\u63D0\u73B0\u662F\u5426\u5F00\u653E\u3001\u6700\u5C0F\u63D0\u73B0\u91CF\u3001\u624B\u7EED\u8D39\u7B49\u4FE1\u606F\u3002\u5145\u503C\u524D\u5EFA\u8BAE\u5148\u67E5\u8BE2\u786E\u8BA4\u7F51\u7EDC\u72B6\u6001\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21908
|
+
{ ccy: external_exports.string().optional().describe("\u6307\u5B9A\u5E01\u79CD\uFF0C\u5982 BTC\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8") },
|
|
21909
|
+
async ({ ccy }) => {
|
|
21910
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21911
|
+
try {
|
|
21912
|
+
const data = await privateApi.getCurrencies(auth, ccy);
|
|
21913
|
+
return toResult(data);
|
|
21914
|
+
} catch (e) {
|
|
21915
|
+
return toError(e);
|
|
21916
|
+
}
|
|
21917
|
+
}
|
|
21918
|
+
);
|
|
21919
|
+
server.tool(
|
|
21920
|
+
"okx_get_deposit_address",
|
|
21921
|
+
"\u83B7\u53D6\u6307\u5B9A\u5E01\u79CD\u7684\u5145\u503C\u5730\u5740\uFF08\u542B\u7F51\u7EDC/\u94FE\u4FE1\u606F\uFF09\u3002\u26A0\uFE0F \u8BF7\u5411\u7528\u6237\u5C55\u793A\u5B8C\u6574\u5730\u5740\u548C\u94FE\u540D\u79F0\u540E\u518D\u64CD\u4F5C\uFF0C\u5145\u9519\u94FE\u4E0D\u53EF\u9006\u3002\u9700\u8981API Key\u9274\u6743\u3002",
|
|
21922
|
+
{ ccy: external_exports.string().describe("\u5E01\u79CD\uFF0C\u5982 USDT\u3001BTC\u3001ETH") },
|
|
21923
|
+
async ({ ccy }) => {
|
|
21924
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21925
|
+
try {
|
|
21926
|
+
const data = await privateApi.getDepositAddress(auth, ccy);
|
|
21927
|
+
return toResult(data);
|
|
21928
|
+
} catch (e) {
|
|
21929
|
+
return toError(e);
|
|
21930
|
+
}
|
|
21931
|
+
}
|
|
21932
|
+
);
|
|
21933
|
+
server.tool(
|
|
21934
|
+
"okx_get_deposit_history",
|
|
21935
|
+
"\u67E5\u8BE2\u5145\u503C\u8BB0\u5F55\uFF0C\u542B\u72B6\u6001\uFF08\u5F85\u786E\u8BA4/\u6210\u529F/\u5931\u8D25\uFF09\u3001\u5230\u8D26\u6570\u91CF\u548C\u4EA4\u6613\u54C8\u5E0C\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21936
|
+
{
|
|
21937
|
+
ccy: external_exports.string().optional().describe("\u5E01\u79CD\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
|
|
21938
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21939
|
+
},
|
|
21940
|
+
async ({ ccy, limit }) => {
|
|
21941
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21942
|
+
try {
|
|
21943
|
+
const data = await privateApi.getDepositHistory(auth, ccy, limit);
|
|
21944
|
+
return toResult(data);
|
|
21945
|
+
} catch (e) {
|
|
21946
|
+
return toError(e);
|
|
21947
|
+
}
|
|
21948
|
+
}
|
|
21949
|
+
);
|
|
21950
|
+
server.tool(
|
|
21951
|
+
"okx_get_withdrawal_history",
|
|
21952
|
+
"\u67E5\u8BE2\u63D0\u73B0\u8BB0\u5F55\uFF0C\u542B\u63D0\u73B0\u72B6\u6001\u3001\u624B\u7EED\u8D39\u548C\u94FE\u4E0A\u4EA4\u6613\u54C8\u5E0C\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
21953
|
+
{
|
|
21954
|
+
ccy: external_exports.string().optional().describe("\u5E01\u79CD\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
|
|
21955
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
21956
|
+
},
|
|
21957
|
+
async ({ ccy, limit }) => {
|
|
21958
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
21959
|
+
try {
|
|
21960
|
+
const data = await privateApi.getWithdrawalHistory(auth, ccy, limit);
|
|
21961
|
+
return toResult(data);
|
|
21962
|
+
} catch (e) {
|
|
21963
|
+
return toError(e);
|
|
21964
|
+
}
|
|
21965
|
+
}
|
|
21966
|
+
);
|
|
21681
21967
|
}
|
|
21682
21968
|
|
|
21683
21969
|
// src/tools/stats.ts
|
|
@@ -21747,6 +22033,66 @@ function registerStatsTools(server) {
|
|
|
21747
22033
|
}
|
|
21748
22034
|
}
|
|
21749
22035
|
);
|
|
22036
|
+
server.tool(
|
|
22037
|
+
"okx_get_stats_support_coin",
|
|
22038
|
+
"\u83B7\u53D6\u4EA4\u6613\u5927\u6570\u636E\u6A21\u5757\u652F\u6301\u67E5\u8BE2\u7684\u6240\u6709\u5E01\u79CD\u5217\u8868\u3002\u5728\u8C03\u7528\u5176\u4ED6\u4EA4\u6613\u5927\u6570\u636E\u63A5\u53E3\u524D\uFF0C\u53EF\u5148\u67E5\u8BE2\u6B64\u63A5\u53E3\u786E\u8BA4\u5E01\u79CD\u53EF\u7528\u3002",
|
|
22039
|
+
{},
|
|
22040
|
+
async () => {
|
|
22041
|
+
try {
|
|
22042
|
+
const data = await publicApi.getSupportCoin();
|
|
22043
|
+
return toResult(data);
|
|
22044
|
+
} catch (e) {
|
|
22045
|
+
return toError(e);
|
|
22046
|
+
}
|
|
22047
|
+
}
|
|
22048
|
+
);
|
|
22049
|
+
server.tool(
|
|
22050
|
+
"okx_get_top_trader_long_short_ratio",
|
|
22051
|
+
"\u83B7\u53D6\u7CBE\u82F1\u4EA4\u6613\u5458\u591A\u7A7A\u6301\u4ED3\u6BD4\u4F8B\uFF08\u4EC5\u7EDF\u8BA1\u524D5%\u5927\u6237\uFF09\u3002\u5927\u6237\u7684\u4ED3\u4F4D\u6BD4\u6563\u6237\u66F4\u5177\u9884\u6D4B\u4EF7\u503C\uFF0C\u80CC\u79BB\u65F6\u5F80\u5F80\u662F\u9006\u52BF\u4FE1\u53F7\u3002",
|
|
22052
|
+
{
|
|
22053
|
+
instId: external_exports.string().describe("\u5408\u7EA6\u4EA7\u54C1ID\uFF0C\u5982 BTC-USDT-SWAP\u3001ETH-USDT-SWAP"),
|
|
22054
|
+
begin: external_exports.string().optional().describe("\u5F00\u59CB\u65F6\u95F4\u6233\uFF08\u6BEB\u79D2\uFF09"),
|
|
22055
|
+
end: external_exports.string().optional().describe("\u7ED3\u675F\u65F6\u95F4\u6233\uFF08\u6BEB\u79D2\uFF09")
|
|
22056
|
+
},
|
|
22057
|
+
async ({ instId, begin, end }) => {
|
|
22058
|
+
try {
|
|
22059
|
+
const data = await publicApi.getTopTraderLongShortRatio(instId, begin, end);
|
|
22060
|
+
return toResult(data);
|
|
22061
|
+
} catch (e) {
|
|
22062
|
+
return toError(e);
|
|
22063
|
+
}
|
|
22064
|
+
}
|
|
22065
|
+
);
|
|
22066
|
+
server.tool(
|
|
22067
|
+
"okx_get_put_call_ratio",
|
|
22068
|
+
"\u83B7\u53D6\u671F\u6743Put/Call\u6BD4\uFF08\u672A\u5E73\u4ED3\u91CF\u548C\u6210\u4EA4\u91CF\uFF09\u3002Put/Call > 1 \u8868\u793A\u5E02\u573A\u504F\u5411\u770B\u8DCC\uFF0C\u662F\u8861\u91CF\u671F\u6743\u5E02\u573A\u60C5\u7EEA\u7684\u7ECF\u5178\u6307\u6807\u3002",
|
|
22069
|
+
{
|
|
22070
|
+
ccy: external_exports.string().describe("\u5E01\u79CD\uFF0C\u5982 BTC\u3001ETH"),
|
|
22071
|
+
begin: external_exports.string().optional().describe("\u5F00\u59CB\u65F6\u95F4\u6233\uFF08\u6BEB\u79D2\uFF09"),
|
|
22072
|
+
end: external_exports.string().optional().describe("\u7ED3\u675F\u65F6\u95F4\u6233\uFF08\u6BEB\u79D2\uFF09")
|
|
22073
|
+
},
|
|
22074
|
+
async ({ ccy, begin, end }) => {
|
|
22075
|
+
try {
|
|
22076
|
+
const data = await publicApi.getOptionPutCallRatio(ccy, begin, end);
|
|
22077
|
+
return toResult(data);
|
|
22078
|
+
} catch (e) {
|
|
22079
|
+
return toError(e);
|
|
22080
|
+
}
|
|
22081
|
+
}
|
|
22082
|
+
);
|
|
22083
|
+
server.tool(
|
|
22084
|
+
"okx_get_lending_rate_summary",
|
|
22085
|
+
"\u83B7\u53D6\u6D3B\u671F\u501F\u5E01\u5F53\u524D\u5E02\u573A\u5229\u7387\u6C47\u603B\uFF08\u516C\u5F00\u6570\u636E\uFF0C\u65E0\u9700API Key\uFF09\u3002\u7528\u4E8E\u5224\u65AD\u501F\u8D37\u6210\u672C\uFF0C\u6216\u5BFB\u627E\u95F2\u7F6E\u8D44\u91D1\u7684\u6700\u4F18\u51FA\u501F\u5229\u7387\u3002",
|
|
22086
|
+
{ ccy: external_exports.string().optional().describe("\u5E01\u79CD\uFF0C\u5982 BTC\u3001USDT\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8") },
|
|
22087
|
+
async ({ ccy }) => {
|
|
22088
|
+
try {
|
|
22089
|
+
const data = await publicApi.getLendingRateSummary(ccy);
|
|
22090
|
+
return toResult(data);
|
|
22091
|
+
} catch (e) {
|
|
22092
|
+
return toError(e);
|
|
22093
|
+
}
|
|
22094
|
+
}
|
|
22095
|
+
);
|
|
21750
22096
|
}
|
|
21751
22097
|
|
|
21752
22098
|
// src/tools/subaccount.ts
|
|
@@ -21859,6 +22205,50 @@ function registerFinanceTools(server, auth) {
|
|
|
21859
22205
|
}
|
|
21860
22206
|
}
|
|
21861
22207
|
);
|
|
22208
|
+
server.tool(
|
|
22209
|
+
"okx_get_eth_staking_balance",
|
|
22210
|
+
"\u67E5\u8BE2ETH\u8D28\u62BC\uFF08BETH\uFF09\u6301\u4ED3\u4F59\u989D\uFF0C\u542B\u8D28\u62BC\u603B\u91CF\u3001BETH\u6570\u91CF\u548C\u5F53\u524D\u5E74\u5316\u6536\u76CA\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22211
|
+
{},
|
|
22212
|
+
async () => {
|
|
22213
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22214
|
+
try {
|
|
22215
|
+
const data = await privateApi.getEthStakingBalance(auth);
|
|
22216
|
+
return toResult(data);
|
|
22217
|
+
} catch (e) {
|
|
22218
|
+
return toError(e);
|
|
22219
|
+
}
|
|
22220
|
+
}
|
|
22221
|
+
);
|
|
22222
|
+
server.tool(
|
|
22223
|
+
"okx_get_eth_staking_history",
|
|
22224
|
+
"\u67E5\u8BE2ETH\u8D28\u62BC/\u8D4E\u56DE\u5386\u53F2\u8BB0\u5F55\uFF0C\u542B\u64CD\u4F5C\u65F6\u95F4\u3001\u6570\u91CF\u548C\u72B6\u6001\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22225
|
+
{
|
|
22226
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4100")
|
|
22227
|
+
},
|
|
22228
|
+
async ({ limit }) => {
|
|
22229
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22230
|
+
try {
|
|
22231
|
+
const data = await privateApi.getEthStakingHistory(auth, limit);
|
|
22232
|
+
return toResult(data);
|
|
22233
|
+
} catch (e) {
|
|
22234
|
+
return toError(e);
|
|
22235
|
+
}
|
|
22236
|
+
}
|
|
22237
|
+
);
|
|
22238
|
+
server.tool(
|
|
22239
|
+
"okx_get_sol_staking_balance",
|
|
22240
|
+
"\u67E5\u8BE2SOL\u8D28\u62BC\u6301\u4ED3\u4F59\u989D\uFF0C\u542B\u8D28\u62BC\u603B\u91CF\u548C\u5F53\u524D\u5E74\u5316\u6536\u76CA\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22241
|
+
{},
|
|
22242
|
+
async () => {
|
|
22243
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22244
|
+
try {
|
|
22245
|
+
const data = await privateApi.getSolStakingBalance(auth);
|
|
22246
|
+
return toResult(data);
|
|
22247
|
+
} catch (e) {
|
|
22248
|
+
return toError(e);
|
|
22249
|
+
}
|
|
22250
|
+
}
|
|
22251
|
+
);
|
|
21862
22252
|
}
|
|
21863
22253
|
|
|
21864
22254
|
// src/tools/outcomes.ts
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hvip-mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "OKX ecosystem MCP server — full API coverage for AI agents",
|
|
5
5
|
"homepage": "https://hvip.one",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"hvip-mcp": "
|
|
8
|
+
"hvip-mcp": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/index.js"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build": "node build.mjs",
|
|
15
15
|
"dev": "tsx watch src/index.ts",
|
|
16
16
|
"start": "node dist/index.js",
|
|
17
|
-
"verify": "tsx tests/verify.
|
|
17
|
+
"verify": "tsx tests/verify.mts",
|
|
18
18
|
"test": "vitest run",
|
|
19
19
|
"test:watch": "vitest",
|
|
20
20
|
"lint": "eslint src",
|