hvip-mcp-server 0.1.6 → 0.1.7
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 +148 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21169,6 +21169,10 @@ var publicApi = {
|
|
|
21169
21169
|
getTopTraderLongShortRatio: (instId, begin, end) => request("GET", "/api/v5/rubik/stat/contracts/long-short-account-ratio-contract-top-trader", { params: { instId, begin, end } }),
|
|
21170
21170
|
getOptionPutCallRatio: (ccy, begin, end) => request("GET", "/api/v5/rubik/stat/option/open-interest-volume-ratio", { params: { ccy, begin, end } }),
|
|
21171
21171
|
getLendingRateSummary: (ccy) => request("GET", "/api/v5/finance/savings/lending-rate-summary", { params: { ccy } }),
|
|
21172
|
+
// ── 跟单(公共,需带单员uniqueCode) ─────────────────────────────────────────
|
|
21173
|
+
getLeadTraderPositions: (uniqueCode, instType) => request("GET", "/api/v5/copytrading/public-current-subpositions", { params: { uniqueCode, instType } }),
|
|
21174
|
+
getLeadTraderHistory: (uniqueCode, instType, limit) => request("GET", "/api/v5/copytrading/public-subpositions-history", { params: { uniqueCode, instType, limit } }),
|
|
21175
|
+
getLeadTraderStats: (uniqueCode, instType, lastDays) => request("GET", "/api/v5/copytrading/public-stats", { params: { uniqueCode, instType, lastDays } }),
|
|
21172
21176
|
// ── 网格交易机器人(公共) ────────────────────────────────────────────────────
|
|
21173
21177
|
getGridAiParam: (instId, algoOrdType, direction) => request("GET", "/api/v5/tradingBot/grid/ai-param", { params: { instId, algoOrdType, direction } }),
|
|
21174
21178
|
// ── 大宗交易行情(公共) ─────────────────────────────────────────────────────
|
|
@@ -21208,6 +21212,12 @@ var privateApi = {
|
|
|
21208
21212
|
getEthStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/eth/balance", { auth }),
|
|
21209
21213
|
getEthStakingHistory: (auth, limit) => request("GET", "/api/v5/finance/staking-defi/eth/purchase-redeem-history", { params: { limit }, auth }),
|
|
21210
21214
|
getSolStakingBalance: (auth) => request("GET", "/api/v5/finance/staking-defi/sol/balance", { auth }),
|
|
21215
|
+
// ── 跟单(私有) ─────────────────────────────────────────────────────────────
|
|
21216
|
+
getMyLeadPositions: (auth, instType) => request("GET", "/api/v5/copytrading/current-subpositions", { params: { instType }, auth }),
|
|
21217
|
+
getMyLeadHistory: (auth, instType, limit) => request("GET", "/api/v5/copytrading/subpositions-history", { params: { instType, limit }, auth }),
|
|
21218
|
+
getCopyInstruments: (auth, instType) => request("GET", "/api/v5/copytrading/instruments", { params: { instType }, auth }),
|
|
21219
|
+
getProfitSharingTotal: (auth, instType) => request("GET", "/api/v5/copytrading/total-profit-sharing", { params: { instType }, auth }),
|
|
21220
|
+
getProfitSharingDetails: (auth, instType, limit) => request("GET", "/api/v5/copytrading/profit-sharing-details", { params: { instType, limit }, auth }),
|
|
21211
21221
|
// ── 网格交易机器人(私有) ────────────────────────────────────────────────────
|
|
21212
21222
|
getGridOrdersPending: (auth, algoOrdType, instId, instType) => request("GET", "/api/v5/tradingBot/grid/orders-algo-pending", { params: { algoOrdType, instId, instType }, auth }),
|
|
21213
21223
|
getGridOrdersHistory: (auth, algoOrdType, instId, instType) => request("GET", "/api/v5/tradingBot/grid/orders-algo-history", { params: { algoOrdType, instId, instType }, auth }),
|
|
@@ -22618,9 +22628,145 @@ function registerSpreadTools(server) {
|
|
|
22618
22628
|
);
|
|
22619
22629
|
}
|
|
22620
22630
|
|
|
22631
|
+
// src/tools/copy.ts
|
|
22632
|
+
function registerCopyTools(server, auth) {
|
|
22633
|
+
server.tool(
|
|
22634
|
+
"okx_get_lead_trader_positions",
|
|
22635
|
+
"\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u5F53\u524D\u6301\u4ED3\u5217\u8868\uFF0C\u542B\u54C1\u79CD\u3001\u65B9\u5411\u3001\u6301\u4ED3\u91CF\u548C\u5F00\u4ED3\u5747\u4EF7\u3002\u65E0\u9700API Key\u3002uniqueCode \u53EF\u4ECEOKX\u8DDF\u5355\u5E7F\u573A\u83B7\u53D6\u3002",
|
|
22636
|
+
{
|
|
22637
|
+
uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801\uFF0C\u4ECEOKX App\u300C\u8DDF\u5355\u300D\u9875\u9762\u83B7\u53D6"),
|
|
22638
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8")
|
|
22639
|
+
},
|
|
22640
|
+
async ({ uniqueCode, instType }) => {
|
|
22641
|
+
try {
|
|
22642
|
+
const data = await publicApi.getLeadTraderPositions(uniqueCode, instType);
|
|
22643
|
+
return toResult(data);
|
|
22644
|
+
} catch (e) {
|
|
22645
|
+
return toError(e);
|
|
22646
|
+
}
|
|
22647
|
+
}
|
|
22648
|
+
);
|
|
22649
|
+
server.tool(
|
|
22650
|
+
"okx_get_lead_trader_history",
|
|
22651
|
+
"\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u5386\u53F2\u6301\u4ED3\u8BB0\u5F55\uFF0C\u542B\u6BCF\u7B14\u4EA4\u6613\u7684\u76C8\u4E8F\u548C\u6301\u4ED3\u65F6\u957F\u3002\u65E0\u9700API Key\u3002\u9002\u5408\u8BC4\u4F30\u5E26\u5355\u5458\u5386\u53F2\u8868\u73B0\u540E\u518D\u51B3\u5B9A\u662F\u5426\u8DDF\u5355\u3002",
|
|
22652
|
+
{
|
|
22653
|
+
uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801"),
|
|
22654
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8"),
|
|
22655
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
|
|
22656
|
+
},
|
|
22657
|
+
async ({ uniqueCode, instType, limit }) => {
|
|
22658
|
+
try {
|
|
22659
|
+
const data = await publicApi.getLeadTraderHistory(uniqueCode, instType, limit);
|
|
22660
|
+
return toResult(data);
|
|
22661
|
+
} catch (e) {
|
|
22662
|
+
return toError(e);
|
|
22663
|
+
}
|
|
22664
|
+
}
|
|
22665
|
+
);
|
|
22666
|
+
server.tool(
|
|
22667
|
+
"okx_get_lead_trader_stats",
|
|
22668
|
+
"\u67E5\u8BE2\u6307\u5B9A\u5E26\u5355\u5458\u7684\u7EE9\u6548\u7EDF\u8BA1\uFF0C\u542B\u603B\u6536\u76CA\u7387\u3001\u6700\u5927\u56DE\u64A4\u3001\u8DDF\u5355\u4EBA\u6570\u548C\u80DC\u7387\u3002\u65E0\u9700API Key\u3002\u662F\u8BC4\u4F30\u5E26\u5355\u5458\u6700\u6838\u5FC3\u7684\u6307\u6807\u3002",
|
|
22669
|
+
{
|
|
22670
|
+
uniqueCode: external_exports.string().describe("\u5E26\u5355\u5458\u552F\u4E00\u6807\u8BC6\u7801"),
|
|
22671
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
22672
|
+
lastDays: external_exports.enum(["7", "30", "90", "180"]).describe("\u7EDF\u8BA1\u5468\u671F\uFF08\u5929\uFF09\uFF1A7/30/90/180")
|
|
22673
|
+
},
|
|
22674
|
+
async ({ uniqueCode, instType, lastDays }) => {
|
|
22675
|
+
try {
|
|
22676
|
+
const data = await publicApi.getLeadTraderStats(uniqueCode, instType, lastDays);
|
|
22677
|
+
return toResult(data);
|
|
22678
|
+
} catch (e) {
|
|
22679
|
+
return toError(e);
|
|
22680
|
+
}
|
|
22681
|
+
}
|
|
22682
|
+
);
|
|
22683
|
+
server.tool(
|
|
22684
|
+
"okx_get_my_lead_positions",
|
|
22685
|
+
"\u67E5\u8BE2\u6211\u5F53\u524D\u4F5C\u4E3A\u5E26\u5355\u5458\u7684\u6301\u4ED3\u5217\u8868\uFF08\u4EC5\u5E26\u5355\u5458\u8D26\u6237\u6709\u6570\u636E\uFF09\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22686
|
+
{
|
|
22687
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B\uFF0C\u4E0D\u586B\u8FD4\u56DE\u5168\u90E8")
|
|
22688
|
+
},
|
|
22689
|
+
async ({ instType }) => {
|
|
22690
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22691
|
+
try {
|
|
22692
|
+
const data = await privateApi.getMyLeadPositions(auth, instType);
|
|
22693
|
+
return toResult(data);
|
|
22694
|
+
} catch (e) {
|
|
22695
|
+
return toError(e);
|
|
22696
|
+
}
|
|
22697
|
+
}
|
|
22698
|
+
);
|
|
22699
|
+
server.tool(
|
|
22700
|
+
"okx_get_my_lead_history",
|
|
22701
|
+
"\u67E5\u8BE2\u6211\u7684\u5386\u53F2\u5E26\u5355\u8BB0\u5F55\uFF0C\u542B\u6BCF\u7B14\u7684\u76C8\u4E8F\u548C\u8DDF\u5355\u91CF\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22702
|
+
{
|
|
22703
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
22704
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
|
|
22705
|
+
},
|
|
22706
|
+
async ({ instType, limit }) => {
|
|
22707
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22708
|
+
try {
|
|
22709
|
+
const data = await privateApi.getMyLeadHistory(auth, instType, limit);
|
|
22710
|
+
return toResult(data);
|
|
22711
|
+
} catch (e) {
|
|
22712
|
+
return toError(e);
|
|
22713
|
+
}
|
|
22714
|
+
}
|
|
22715
|
+
);
|
|
22716
|
+
server.tool(
|
|
22717
|
+
"okx_get_copy_instruments",
|
|
22718
|
+
"\u67E5\u8BE2\u6211\u5F53\u524D\u4F5C\u4E3A\u5E26\u5355\u5458\u5141\u8BB8\u8DDF\u5355\u7684\u54C1\u79CD\u5217\u8868\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22719
|
+
{
|
|
22720
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B")
|
|
22721
|
+
},
|
|
22722
|
+
async ({ instType }) => {
|
|
22723
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22724
|
+
try {
|
|
22725
|
+
const data = await privateApi.getCopyInstruments(auth, instType);
|
|
22726
|
+
return toResult(data);
|
|
22727
|
+
} catch (e) {
|
|
22728
|
+
return toError(e);
|
|
22729
|
+
}
|
|
22730
|
+
}
|
|
22731
|
+
);
|
|
22732
|
+
server.tool(
|
|
22733
|
+
"okx_get_profit_sharing_total",
|
|
22734
|
+
"\u67E5\u8BE2\u6211\u7684\u5E26\u5355\u7D2F\u8BA1\u6536\u53D6\u7684\u5206\u6210\u91D1\u989D\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22735
|
+
{
|
|
22736
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B")
|
|
22737
|
+
},
|
|
22738
|
+
async ({ instType }) => {
|
|
22739
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22740
|
+
try {
|
|
22741
|
+
const data = await privateApi.getProfitSharingTotal(auth, instType);
|
|
22742
|
+
return toResult(data);
|
|
22743
|
+
} catch (e) {
|
|
22744
|
+
return toError(e);
|
|
22745
|
+
}
|
|
22746
|
+
}
|
|
22747
|
+
);
|
|
22748
|
+
server.tool(
|
|
22749
|
+
"okx_get_profit_sharing_details",
|
|
22750
|
+
"\u67E5\u8BE2\u5E26\u5355\u76C8\u5229\u5206\u6210\u7684\u9010\u7B14\u660E\u7EC6\uFF0C\u542B\u6BCF\u6B21\u5206\u6210\u7684\u91D1\u989D\u3001\u6765\u6E90\u8DDF\u5355\u8005\u548C\u65F6\u95F4\u3002\u26A0\uFE0F \u9700\u8981API Key\u9274\u6743\u3002",
|
|
22751
|
+
{
|
|
22752
|
+
instType: external_exports.enum(["SWAP", "FUTURES"]).optional().describe("\u4EA7\u54C1\u7C7B\u578B"),
|
|
22753
|
+
limit: external_exports.number().int().min(1).max(100).optional().describe("\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA420")
|
|
22754
|
+
},
|
|
22755
|
+
async ({ instType, limit }) => {
|
|
22756
|
+
if (!auth) return toError(AUTH_REQUIRED);
|
|
22757
|
+
try {
|
|
22758
|
+
const data = await privateApi.getProfitSharingDetails(auth, instType, limit);
|
|
22759
|
+
return toResult(data);
|
|
22760
|
+
} catch (e) {
|
|
22761
|
+
return toError(e);
|
|
22762
|
+
}
|
|
22763
|
+
}
|
|
22764
|
+
);
|
|
22765
|
+
}
|
|
22766
|
+
|
|
22621
22767
|
// src/index.ts
|
|
22622
22768
|
async function main() {
|
|
22623
|
-
const server = new McpServer({ name: "hvip", version: "0.1.
|
|
22769
|
+
const server = new McpServer({ name: "hvip", version: "0.1.7" });
|
|
22624
22770
|
const auth = getAuth();
|
|
22625
22771
|
registerMarketTools(server);
|
|
22626
22772
|
registerPublicTools(server);
|
|
@@ -22631,6 +22777,7 @@ async function main() {
|
|
|
22631
22777
|
registerTradingTools(server, auth);
|
|
22632
22778
|
registerAlgoTools(server, auth);
|
|
22633
22779
|
registerBotTools(server, auth);
|
|
22780
|
+
registerCopyTools(server, auth);
|
|
22634
22781
|
registerFundingTools(server, auth);
|
|
22635
22782
|
registerSubAccountTools(server, auth);
|
|
22636
22783
|
registerFinanceTools(server, auth);
|