stock-sdk 2.1.0 → 2.2.0
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/README.md +2 -2
- package/dist/{chunk-KKBFAS5P.cjs → chunk-2CVXBRZU.cjs} +1 -1
- package/dist/chunk-EQMJ7CCE.cjs +1 -0
- package/dist/chunk-FLLXT6AW.js +1 -0
- package/dist/{chunk-WP37ZK2F.js → chunk-HRY6A22L.js} +1 -1
- package/dist/cli.cjs +6 -6
- package/dist/cli.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -25
- package/dist/index.d.ts +4 -25
- package/dist/index.js +1 -1
- package/dist/indicators.d.cts +2 -2
- package/dist/indicators.d.ts +2 -2
- package/dist/mcp.cjs +2 -2
- package/dist/mcp.d.cts +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/{sdk-CA1tOtb2.d.cts → sdk-C1spOI0V.d.cts} +116 -7
- package/dist/{sdk-B-hkKcZs.d.ts → sdk-tyHVl5Ki.d.ts} +116 -7
- package/dist/signals.d.cts +1 -1
- package/dist/signals.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-3X645BZO.js +0 -1
- package/dist/chunk-ANBQABED.cjs +0 -1
- package/dist/{addIndicators-DwEr9RKK.d.cts → addIndicators-DQNysyLs.d.cts} +192 -192
- package/dist/{addIndicators-DwEr9RKK.d.ts → addIndicators-DQNysyLs.d.ts} +192 -192
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as RequestClient,
|
|
2
|
-
export { A as AShareMarket,
|
|
1
|
+
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-C1spOI0V.cjs';
|
|
2
|
+
export { A as AShareMarket, aM as BlockTradeDailyStatItem, B as BlockTradeDateOptions, aL as BlockTradeDetailItem, aK as BlockTradeMarketStatItem, aD as BoardChangeItem, aj as CFFEXOptionQuote, u as CFFEXOptionQuotesOptions, aa as ComexInventory, t as ComexInventoryOptions, $ as ConceptBoard, a1 as ConceptBoardConstituent, a2 as ConceptBoardKline, C as ConceptBoardKlineOptions, a4 as ConceptBoardMinuteKline, o as ConceptBoardMinuteKlineOptions, a3 as ConceptBoardMinuteTimeline, a0 as ConceptBoardSpot, am as DividendDetail, aI as DragonTigerBranchItem, D as DragonTigerDateOptions, aF as DragonTigerDetailItem, aH as DragonTigerInstitutionItem, aE as DragonTigerPeriod, aJ as DragonTigerSeatItem, aG as DragonTigerStockStatItem, ai as ETFOptionCate, ah as ETFOptionExpireDay, ag as ETFOptionMonth, y as FullQuote, a$ as FundAssetAllocation, a_ as FundBondHolding, b5 as FundBuySedemption, aS as FundDividend, aR as FundDividendListOptions, aT as FundDividendListResult, aP as FundDividendRank, aW as FundEstimate, J as FundFlow, v as FundFlowOptions, ao as FundFlowRankItem, w as FundFlowRankOptions, b3 as FundHolderStructure, aZ as FundHolding, b1 as FundManager, aV as FundNavHistory, aU as FundNavPoint, b2 as FundPerformanceEvaluation, b0 as FundPositionPoint, h as FundProfile, O as FundQuote, aY as FundRankHistory, aX as FundRankPoint, b8 as FundSameType, b7 as FundSameTypePeer, b4 as FundScaleChange, F as FundService, aQ as FundSortDirection, b6 as FundStageReturns, a5 as FuturesExchange, a9 as FuturesInventory, s as FuturesInventoryOptions, a8 as FuturesInventorySymbol, a6 as FuturesKline, p as FuturesKlineOptions, c as GetAShareCodeListOptions, G as GetAllAShareQuotesOptions, e as GetAllUSQuotesOptions, bd as GetHotThemesOptions, bf as GetThemeFundsOptions, bc as GetThemeListOptions, d as GetUSCodeListOptions, r as GlobalFuturesKlineOptions, a7 as GlobalFuturesQuote, q as GlobalFuturesSpotOptions, j as HKKlineOptions, k as HKMinuteKlineOptions, K as HKQuote, H as HistoryKlineOptions, bi as HotThemesResult, ab as IndexOptionProduct, V as IndustryBoard, X as IndustryBoardConstituent, Y as IndustryBoardKline, I as IndustryBoardKlineOptions, _ as IndustryBoardMinuteKline, n as IndustryBoardMinuteKlineOptions, Z as IndustryBoardMinuteTimeline, W as IndustryBoardSpot, aN as MarginAccountItem, aO as MarginTargetItem, aq as MarketFundFlow, f as MarketStatus, M as MarketType, i as MinuteKlineOptions, ar as NorthboundDirection, av as NorthboundFlowSummary, ax as NorthboundHistoryItem, x as NorthboundHistoryOptions, aw as NorthboundHoldingRankItem, N as NorthboundHoldingRankOptions, ay as NorthboundIndividualItem, as as NorthboundMarket, au as NorthboundMinuteItem, at as NorthboundRankPeriod, ae as OptionKline, ak as OptionLHBItem, af as OptionMinute, ac as OptionTQuote, ad as OptionTQuoteResult, P as PanelLargeOrder, Q as Quote, R as RequestClientOptions, al as SearchResultType, ap as SectorFundFlowItem, z as SimpleQuote, aC as StockChangeItem, aB as StockChangeType, an as StockFundFlowDaily, S as StockSDK, g as SupportedMarket, bb as ThemeCategory, bg as ThemeFund, bj as ThemeFundItem, bk as ThemeFundItemList, bh as ThemeFundListResult, ba as ThemeFundOrder, be as ThemeFundRankSort, b9 as ThemeFundSort, T as TradingCalendarService, l as USKlineOptions, U as USMarket, m as USMinuteKlineOptions, L as USQuote, aA as ZTPoolItem, az as ZTPoolType, S as default } from './sdk-C1spOI0V.cjs';
|
|
3
3
|
export { H as HttpError, P as ProviderName, a as ProviderRequestPolicy, b as RequestError, R as RetryOptions, S as SdkError, g as getSdkErrorCode } from './index-mlzPfoON.cjs';
|
|
4
4
|
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, createCacheKey, getSharedCache } from './cache.cjs';
|
|
5
|
-
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-
|
|
5
|
+
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-DQNysyLs.cjs';
|
|
6
6
|
export { INDICATOR_REGISTRY, IndicatorKey, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, estimateIndicatorLookback, getEnabledIndicatorKeys } from './indicators.cjs';
|
|
7
7
|
export { A as AssetType, E as Exchange, M as Market, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, n as normalizeSymbol, b as toEastmoneySecid, t as toTencentSymbol } from './adapters-BvE63CMd.cjs';
|
|
8
8
|
export { Signal, SignalOptions, SignalType, calcSignals } from './signals.cjs';
|
|
@@ -217,27 +217,6 @@ interface DatacenterResult<T> {
|
|
|
217
217
|
pages: number;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
declare class FundService extends BaseService {
|
|
221
|
-
constructor(client: RequestClient);
|
|
222
|
-
/** 获取基金分红明细(全市场,按年份分页) */
|
|
223
|
-
getFundDividendList(options?: FundDividendListOptions): Promise<FundDividendListResult>;
|
|
224
|
-
/** 获取基金历史净值(单位 + 累计,全历史一次返回) */
|
|
225
|
-
getFundNavHistory(code: string): Promise<FundNavHistory>;
|
|
226
|
-
/** 获取基金当日实时估值(含 T-1 单位净值 + 盘中估算) */
|
|
227
|
-
getFundEstimate(code: string): Promise<FundEstimate>;
|
|
228
|
-
/** 获取基金同类排名走势(每日近三月排名 + 百分位) */
|
|
229
|
-
getFundRankHistory(code: string): Promise<FundRankHistory>;
|
|
230
|
-
/**
|
|
231
|
-
* 获取基金深度资料(一次请求返回全量字段)。
|
|
232
|
-
*
|
|
233
|
-
* 包含:前十大重仓股、资产配置、仓位测算、基金经理、业绩评价、
|
|
234
|
-
* 持有人结构、规模变动、申购赎回、阶段收益率、同类基金等。
|
|
235
|
-
*
|
|
236
|
-
* @param code 基金代码(纯数字,如 `'000001'`)
|
|
237
|
-
*/
|
|
238
|
-
getFundProfile(code: string): Promise<FundProfile>;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
220
|
/**
|
|
242
221
|
* 根据搜索结果生成外部财经站点链接。
|
|
243
222
|
* @param result 搜索结果
|
|
@@ -245,4 +224,4 @@ declare class FundService extends BaseService {
|
|
|
245
224
|
*/
|
|
246
225
|
declare function generateSearchExternalLinks(result: SearchResult): ExternalLink[];
|
|
247
226
|
|
|
248
|
-
export { BROWSER_JSVARS_MUTEX_KEY, type DatacenterQuery, type DatacenterResult, ExternalLink, type FetchJsVarsOptions,
|
|
227
|
+
export { BROWSER_JSVARS_MUTEX_KEY, type DatacenterQuery, type DatacenterResult, ExternalLink, type FetchJsVarsOptions, type JsonpOptions, SearchResult, asyncPool, chunkArray, decodeGBK, extractJsonFromJsonp, fetchJsVars, generateSearchExternalLinks, jsonpRequest, parseJsVars, parseResponse, safeNumber, safeNumberOrNull, withScriptMutex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as RequestClient,
|
|
2
|
-
export { A as AShareMarket,
|
|
1
|
+
import { a as RequestClient, b as SearchResult, E as ExternalLink } from './sdk-tyHVl5Ki.js';
|
|
2
|
+
export { A as AShareMarket, aM as BlockTradeDailyStatItem, B as BlockTradeDateOptions, aL as BlockTradeDetailItem, aK as BlockTradeMarketStatItem, aD as BoardChangeItem, aj as CFFEXOptionQuote, u as CFFEXOptionQuotesOptions, aa as ComexInventory, t as ComexInventoryOptions, $ as ConceptBoard, a1 as ConceptBoardConstituent, a2 as ConceptBoardKline, C as ConceptBoardKlineOptions, a4 as ConceptBoardMinuteKline, o as ConceptBoardMinuteKlineOptions, a3 as ConceptBoardMinuteTimeline, a0 as ConceptBoardSpot, am as DividendDetail, aI as DragonTigerBranchItem, D as DragonTigerDateOptions, aF as DragonTigerDetailItem, aH as DragonTigerInstitutionItem, aE as DragonTigerPeriod, aJ as DragonTigerSeatItem, aG as DragonTigerStockStatItem, ai as ETFOptionCate, ah as ETFOptionExpireDay, ag as ETFOptionMonth, y as FullQuote, a$ as FundAssetAllocation, a_ as FundBondHolding, b5 as FundBuySedemption, aS as FundDividend, aR as FundDividendListOptions, aT as FundDividendListResult, aP as FundDividendRank, aW as FundEstimate, J as FundFlow, v as FundFlowOptions, ao as FundFlowRankItem, w as FundFlowRankOptions, b3 as FundHolderStructure, aZ as FundHolding, b1 as FundManager, aV as FundNavHistory, aU as FundNavPoint, b2 as FundPerformanceEvaluation, b0 as FundPositionPoint, h as FundProfile, O as FundQuote, aY as FundRankHistory, aX as FundRankPoint, b8 as FundSameType, b7 as FundSameTypePeer, b4 as FundScaleChange, F as FundService, aQ as FundSortDirection, b6 as FundStageReturns, a5 as FuturesExchange, a9 as FuturesInventory, s as FuturesInventoryOptions, a8 as FuturesInventorySymbol, a6 as FuturesKline, p as FuturesKlineOptions, c as GetAShareCodeListOptions, G as GetAllAShareQuotesOptions, e as GetAllUSQuotesOptions, bd as GetHotThemesOptions, bf as GetThemeFundsOptions, bc as GetThemeListOptions, d as GetUSCodeListOptions, r as GlobalFuturesKlineOptions, a7 as GlobalFuturesQuote, q as GlobalFuturesSpotOptions, j as HKKlineOptions, k as HKMinuteKlineOptions, K as HKQuote, H as HistoryKlineOptions, bi as HotThemesResult, ab as IndexOptionProduct, V as IndustryBoard, X as IndustryBoardConstituent, Y as IndustryBoardKline, I as IndustryBoardKlineOptions, _ as IndustryBoardMinuteKline, n as IndustryBoardMinuteKlineOptions, Z as IndustryBoardMinuteTimeline, W as IndustryBoardSpot, aN as MarginAccountItem, aO as MarginTargetItem, aq as MarketFundFlow, f as MarketStatus, M as MarketType, i as MinuteKlineOptions, ar as NorthboundDirection, av as NorthboundFlowSummary, ax as NorthboundHistoryItem, x as NorthboundHistoryOptions, aw as NorthboundHoldingRankItem, N as NorthboundHoldingRankOptions, ay as NorthboundIndividualItem, as as NorthboundMarket, au as NorthboundMinuteItem, at as NorthboundRankPeriod, ae as OptionKline, ak as OptionLHBItem, af as OptionMinute, ac as OptionTQuote, ad as OptionTQuoteResult, P as PanelLargeOrder, Q as Quote, R as RequestClientOptions, al as SearchResultType, ap as SectorFundFlowItem, z as SimpleQuote, aC as StockChangeItem, aB as StockChangeType, an as StockFundFlowDaily, S as StockSDK, g as SupportedMarket, bb as ThemeCategory, bg as ThemeFund, bj as ThemeFundItem, bk as ThemeFundItemList, bh as ThemeFundListResult, ba as ThemeFundOrder, be as ThemeFundRankSort, b9 as ThemeFundSort, T as TradingCalendarService, l as USKlineOptions, U as USMarket, m as USMinuteKlineOptions, L as USQuote, aA as ZTPoolItem, az as ZTPoolType, S as default } from './sdk-tyHVl5Ki.js';
|
|
3
3
|
export { H as HttpError, P as ProviderName, a as ProviderRequestPolicy, b as RequestError, R as RetryOptions, S as SdkError, g as getSdkErrorCode } from './index-mlzPfoON.js';
|
|
4
4
|
export { CacheOptions, CacheStore, MaybePromise, MemoryCache, MemoryCacheStore, cacheThrough, createCacheKey, getSharedCache } from './cache.js';
|
|
5
|
-
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-
|
|
5
|
+
export { e as ATROptions, A as AnyHistoryKline, d as BIASOptions, B as BOLLOptions, C as CCIOptions, D as DMIOptions, i as DMIResult, w as HKHistoryKline, x as HKMinuteKline, y as HKMinuteTimeline, H as HistoryKline, I as IndicatorOptions, k as KCOptions, l as KCResult, c as KDJOptions, K as KlineWithIndicators, b as MACDOptions, M as MAOptions, m as MARKET_TZ, n as MarketTz, t as MinuteKline, s as MinuteTimeline, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, R as RSIOptions, S as SAROptions, j as SARResult, T as TimeMeta, u as TodayTimeline, v as TodayTimelineResponse, U as USHistoryKline, z as USMinuteKline, E as USMinuteTimeline, W as WROptions, a as addIndicators, o as buildTimeMeta, q as buildTimeMetaFromDateAndTime, r as formatInTz, p as parseMarketTime } from './addIndicators-DQNysyLs.js';
|
|
6
6
|
export { INDICATOR_REGISTRY, IndicatorKey, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, estimateIndicatorLookback, getEnabledIndicatorKeys } from './indicators.js';
|
|
7
7
|
export { A as AssetType, E as Exchange, M as Market, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, n as normalizeSymbol, b as toEastmoneySecid, t as toTencentSymbol } from './adapters-BvE63CMd.js';
|
|
8
8
|
export { Signal, SignalOptions, SignalType, calcSignals } from './signals.js';
|
|
@@ -217,27 +217,6 @@ interface DatacenterResult<T> {
|
|
|
217
217
|
pages: number;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
declare class FundService extends BaseService {
|
|
221
|
-
constructor(client: RequestClient);
|
|
222
|
-
/** 获取基金分红明细(全市场,按年份分页) */
|
|
223
|
-
getFundDividendList(options?: FundDividendListOptions): Promise<FundDividendListResult>;
|
|
224
|
-
/** 获取基金历史净值(单位 + 累计,全历史一次返回) */
|
|
225
|
-
getFundNavHistory(code: string): Promise<FundNavHistory>;
|
|
226
|
-
/** 获取基金当日实时估值(含 T-1 单位净值 + 盘中估算) */
|
|
227
|
-
getFundEstimate(code: string): Promise<FundEstimate>;
|
|
228
|
-
/** 获取基金同类排名走势(每日近三月排名 + 百分位) */
|
|
229
|
-
getFundRankHistory(code: string): Promise<FundRankHistory>;
|
|
230
|
-
/**
|
|
231
|
-
* 获取基金深度资料(一次请求返回全量字段)。
|
|
232
|
-
*
|
|
233
|
-
* 包含:前十大重仓股、资产配置、仓位测算、基金经理、业绩评价、
|
|
234
|
-
* 持有人结构、规模变动、申购赎回、阶段收益率、同类基金等。
|
|
235
|
-
*
|
|
236
|
-
* @param code 基金代码(纯数字,如 `'000001'`)
|
|
237
|
-
*/
|
|
238
|
-
getFundProfile(code: string): Promise<FundProfile>;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
220
|
/**
|
|
242
221
|
* 根据搜索结果生成外部财经站点链接。
|
|
243
222
|
* @param result 搜索结果
|
|
@@ -245,4 +224,4 @@ declare class FundService extends BaseService {
|
|
|
245
224
|
*/
|
|
246
225
|
declare function generateSearchExternalLinks(result: SearchResult): ExternalLink[];
|
|
247
226
|
|
|
248
|
-
export { BROWSER_JSVARS_MUTEX_KEY, type DatacenterQuery, type DatacenterResult, ExternalLink, type FetchJsVarsOptions,
|
|
227
|
+
export { BROWSER_JSVARS_MUTEX_KEY, type DatacenterQuery, type DatacenterResult, ExternalLink, type FetchJsVarsOptions, type JsonpOptions, SearchResult, asyncPool, chunkArray, decodeGBK, extractJsonFromJsonp, fetchJsVars, generateSearchExternalLinks, jsonpRequest, parseJsVars, parseResponse, safeNumber, safeNumberOrNull, withScriptMutex };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-LAT6L2TO.js";import{a as ie,b as ce}from"./chunk-LCX5Q36O.js";import{a as pe,b as ue}from"./chunk-F3KZXCVO.js";import{a as p,b as u,c as l,d as m,e as S,f as y,g as C,h as g,i as R,j as x,k as I,l as b,m as A,n as T,o as N,p as K,q as E,r as oe,s as re,t as ne,u as se}from"./chunk-
|
|
1
|
+
import{a as ae}from"./chunk-LAT6L2TO.js";import{a as ie,b as ce}from"./chunk-LCX5Q36O.js";import{a as pe,b as ue}from"./chunk-F3KZXCVO.js";import{a as p,b as u,c as l,d as m,e as S,f as y,g as C,h as g,i as R,j as x,k as I,l as b,m as A,n as T,o as N,p as K,q as E,r as oe,s as re,t as ne,u as se}from"./chunk-FLLXT6AW.js";import{a as z,b as B,c as q,d as U,e as X,f as w,g as F,h as _,i as $,j as G,k as H,l as J,m as P,n as V,o as W,p as Q,q as v,r as Y,s as Z,u as j,v as ee,w as te}from"./chunk-G5KF73BW.js";import{d as a,g as L,h as D}from"./chunk-D2MGPO3R.js";import{a as O,b as f,d as M}from"./chunk-DU7MCVLJ.js";import{a as d,b as k,k as h}from"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";var le={0:"sz",1:"sh",100:"global",105:"us",116:"hk"},me={sh:"CN",sz:"CN",hk:"HK",us:"US"},de={IXIC:".IXIC",NDX:".NDX",NDX100:".NDX"},ke={IXIC:"NDX",NDX:"NDX",NDX100:"NDX"};function he(t){return t==="sh"||t==="sz"||t==="hk"||t==="us"||t==="global"}function Se(t){switch(t.market){case"CN":return t.exchange==="SSE"?"sh":t.exchange==="SZSE"?"sz":"unknown";case"HK":return"hk";case"US":return"us";case"GLOBAL":return"global";default:return"unknown"}}function ye(t){let e=t.code.trim(),o=t.market.trim().toLowerCase(),s=le[t.market]??o,r=he(s)?s:void 0;if(r==="global")return{code:e.replace(/^\d{3}\./,"").toUpperCase(),market:"global"};let c=r===void 0||r==="us"?e.replace(/^us(?=[A-Za-z.]+$)/i,""):e;try{let n=a(c,r?{market:me[r]}:void 0);if(n.assetType!=="stock")return{code:e,market:"unknown"};let i=r??Se(n);return i==="unknown"?{code:e,market:"unknown"}:{code:n.market==="US"?n.code.toUpperCase():n.code,market:i}}catch{return{code:e,market:"unknown"}}}function Oe(t,e){return e==="sh"&&t.startsWith("000")||e==="sz"&&t.startsWith("399")}function fe(t){let{code:e,market:o}=t;return(o==="sh"||o==="sz")&&Oe(e,o)?`https://quote.eastmoney.com/zs${e}.html`:o==="sh"||o==="sz"?`https://quote.eastmoney.com/${o}${e}.html`:o==="hk"?`https://quote.eastmoney.com/hk/${e}.html`:o==="us"?`https://quote.eastmoney.com/us/${e}.html`:o==="global"?`https://quote.eastmoney.com/gb/zs${ke[e]??e}.html`:`https://so.eastmoney.com/web/s?keyword=${encodeURIComponent(e)}`}function Me(t){let{code:e,market:o}=t;return o==="sh"||o==="sz"?`https://xueqiu.com/S/${o.toUpperCase()}${e}`:o==="hk"?`https://xueqiu.com/S/${e}`:o==="us"?`https://xueqiu.com/S/${e}`:o==="global"?`https://xueqiu.com/S/${de[e]??e}`:`https://xueqiu.com/k?q=${encodeURIComponent(e)}`}function Ce(t){let e=ye(t);return[{name:"\u4E1C\u65B9\u8D22\u5BCC",url:fe(e)},{name:"\u96EA\u7403",url:Me(e)}]}export{x as BROWSER_JSVARS_MUTEX_KEY,re as FundService,k as HttpError,Z as INDICATOR_REGISTRY,A as MARKET_TZ,O as MemoryCache,pe as MemoryCacheStore,d as SdkError,ne as StockSDK,oe as TradingCalendarService,te as addIndicators,y as asyncPool,ce as backtest,Y as buildIndicatorContext,N as buildTimeMeta,K as buildTimeMetaFromDateAndTime,ue as cacheThrough,J as calcATR,G as calcBIAS,w as calcBOLL,H as calcCCI,W as calcDMI,B as calcEMA,v as calcKC,F as calcKDJ,U as calcMA,X as calcMACD,P as calcOBV,V as calcROC,_ as calcRSI,Q as calcSAR,z as calcSMA,ae as calcSignals,q as calcWMA,$ as calcWR,S as chunkArray,M as createCacheKey,p as decodeGBK,se as default,ee as estimateIndicatorLookback,C as extractJsonFromJsonp,I as fetchJsVars,E as formatInTz,Ce as generateSearchExternalLinks,j as getEnabledIndicatorKeys,h as getSdkErrorCode,f as getSharedCache,g as jsonpRequest,a as normalizeSymbol,b as parseJsVars,T as parseMarketTime,u as parseResponse,l as safeNumber,m as safeNumberOrNull,ie as screen,D as toEastmoneySecid,L as toTencentSymbol,R as withScriptMutex};
|
package/dist/indicators.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-
|
|
2
|
-
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-
|
|
1
|
+
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-DQNysyLs.cjs';
|
|
2
|
+
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-DQNysyLs.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 计算简单移动平均线 SMA
|
package/dist/indicators.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-
|
|
2
|
-
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-
|
|
1
|
+
import { M as MAOptions, F as MAResult, b as MACDOptions, G as MACDResult, B as BOLLOptions, J as BOLLResult, L as OHLCV, c as KDJOptions, N as KDJResult, R as RSIOptions, P as RSIResult, W as WROptions, Q as WRResult, d as BIASOptions, V as BIASResult, C as CCIOptions, X as CCIResult, e as ATROptions, Y as ATRResult, I as IndicatorOptions, Z as PeriodsShorthand, A as AnyHistoryKline } from './addIndicators-DQNysyLs.js';
|
|
2
|
+
export { D as DMIOptions, i as DMIResult, k as KCOptions, l as KCResult, K as KlineWithIndicators, O as OBVOptions, f as OBVResult, g as ROCOptions, h as ROCResult, S as SAROptions, j as SARResult, a as addIndicators } from './addIndicators-DQNysyLs.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 计算简单移动平均线 SMA
|
package/dist/mcp.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk2CVXBRZUcjs = require('./chunk-2CVXBRZU.cjs');var _chunkEQMJ7CCEcjs = require('./chunk-EQMJ7CCE.cjs');require('./chunk-PMERLSCU.cjs');require('./chunk-3NSUE34F.cjs');require('./chunk-TVIEKKDQ.cjs');var _chunk4Q7UQ5Q3cjs = require('./chunk-4Q7UQ5Q3.cjs');require('./chunk-4VDLQK6F.cjs');var v=["2025-11-25","2025-06-18"],X=v[0],R={name:"stock-sdk",version:"2.2.0"},K=-32700,S=-32600,$=-32601,d=-32602,Y=-32603;function L(e){return typeof e=="string"&&v.includes(e)?e:X}function p(...e){process.stderr.write(e.map(o=>typeof o=="string"?o:JSON.stringify(o)).join(" ")+`
|
|
2
2
|
`)}function l(e){process.stdout.write(JSON.stringify(e)+`
|
|
3
3
|
`)}var k=1e6;function q(e){let o="",t=!1;process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{o+=r;let n=o.indexOf(`
|
|
4
4
|
`);for(;n>=0;){let i=o.slice(0,n);o=o.slice(n+1),t?(t=!1,l({jsonrpc:"2.0",id:null,error:{code:S,message:`Message too large (limit ${k} bytes)`}})):i.trim()&&e(i),n=o.indexOf(`
|
|
5
|
-
`)}!t&&o.length>k?(p(`[stock-sdk mcp] \u8F93\u5165\u8D85\u957F\uFF08${o.length} bytes \u65E0\u6362\u884C\uFF0C\u8D85 ${k} \u4E0A\u9650\uFF09\uFF0C\u4E22\u5F03\u81F3\u4E0B\u4E00\u6362\u884C`),t=!0,o=""):t&&(o="")}),process.stdin.on("error",r=>p("[stock-sdk mcp] stdin error:",r.message)),process.stdout.on("error",r=>{r.code==="EPIPE"?(p("[stock-sdk mcp] stdout EPIPE\uFF08client \u65AD\u5F00\uFF09\uFF0C\u9000\u51FA"),process.exit(0)):p("[stock-sdk mcp] stdout error:",r.message)})}var H={string:"string",enum:"string",number:"integer",boolean:"boolean"};function _(e){return _nullishCoalesce(_nullishCoalesce(e.jsonKey, () => (e.field)), () => (e.flag))}function z(e){return _optionalChain([e, 'access', _2 => _2.enum, 'optionalAccess', _3 => _3.map, 'call', _4 => _4(o=>_nullishCoalesce(_optionalChain([e, 'access', _5 => _5.map, 'optionalAccess', _6 => _6[o]]), () => (o)))])}function u(e){let o=H[e.type];if(!o)throw new Error(`\u53C2\u6570 --${e.flag} \u7684\u7C7B\u578B ${e.type} \u4E0D\u80FD\u6D3E\u751F MCP schema\uFF08\u8BF7\u6807\u8BB0 mcp:false\uFF09`);let t={type:o},r=z(e);r&&(t.enum=r),e.default!==void 0&&(t.default=e.default);let n=_nullishCoalesce(e.mcpDesc, () => (e.desc));return n&&(t.description=n),t}function Q(e){let o={type:"string"};return e.enum&&(o.enum=e.enum),e.default!==void 0&&(o.default=e.default),e.desc&&(o.description=e.desc),o}var G={type:"array",items:{type:"string"},description:"\u4EE3\u7801\u6570\u7EC4\uFF0C\u5E26\u4E0D\u5E26\u4EA4\u6613\u6240\u524D\u7F00\u5747\u53EF\uFF0C\u5982 ['sh600519','000001','600036']"};function V(e){return(_nullishCoalesce(e.params, () => ([]))).filter(o=>o.mcp!==!1)}function Z(e){let o={},t=[];(e.argShape==="codes[]"||e.argShape==="codes+options")&&(o.codes=G,t.push("codes"));for(let r of _nullishCoalesce(e.positional, () => ([])))o[r.name]=Q(r),r.required&&t.push(r.name);for(let r of V(e))o[_(r)]=u(r),r.required&&t.push(_(r));return{type:"object",properties:o,required:t.length>0?t:void 0,additionalProperties:!1}}function ee(e,o){let t=_chunkKKBFAS5Pcjs.a.call(void 0, e,o);if(!t)throw new Error(`SDK \u4E0A\u4E0D\u5B58\u5728\u65B9\u6CD5: ${o.join(".")}`);return r=>t.fn.apply(t.parent,r)}function oe(e){let o=_nullishCoalesce(e.positional, () => ([])),t=V(e);return(r,n)=>{let i=ee(r,e.path),c=o.map(a=>n[a.name]),s={};for(let a of t)s[_nullishCoalesce(a.field, () => (a.flag))]=n[_(a)];switch(e.argShape){case"none":return i([]);case"codes[]":return i([n.codes]);case"codes+options":return i([n.codes,s]);case"symbol+options":return i([...c,s]);case"options":return i([s]);case"positional":return i(c);default:throw new Error(`\u4E0D\u652F\u6301\u7684 argShape: ${e.argShape}`)}}}function U(e){if(e.mcp===!1||!e.toolName)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u672A\u58F0\u660E MCP \u5DE5\u5177\uFF0C\u4E0D\u80FD\u6D3E\u751F ToolDef`);if(e.mcpCustom)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u7684 MCP \u5DE5\u5177\u4E3A\u624B\u5199\u5B9E\u73B0\uFF0C\u4E0D\u80FD\u81EA\u52A8\u6D3E\u751F`);return{name:e.toolName,description:_nullishCoalesce(e.mcpDesc, () => (e.summary)),inputSchema:Z(e),tier:_nullishCoalesce(e.tier, () => ("full")),invoke:oe(e)}}var te=["ma","macd","boll","kdj","rsi","wr","bias","cci","atr","obv","roc","dmi","sar","kc"],g=_chunkKKBFAS5Pcjs.n.call(void 0, "kline.withIndicators"),W={name:g.toolName,tier:_nullishCoalesce(g.tier, () => ("full")),description:_nullishCoalesce(g.mcpDesc, () => (g.summary)),inputSchema:{type:"object",properties:{symbol:{type:"string",description:"\u80A1\u7968\u4EE3\u7801\uFF08A \u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF09"},market:u(_chunkKKBFAS5Pcjs.j),period:u(_chunkKKBFAS5Pcjs.e),adjust:u(_chunkKKBFAS5Pcjs.d),startDate:{...u(_chunkKKBFAS5Pcjs.g),description:"\u8D77\u59CB\u65E5\u671F YYYYMMDD \u6216 YYYY-MM-DD"},endDate:{...u(_chunkKKBFAS5Pcjs.h),description:"\u7ED3\u675F\u65E5\u671F YYYYMMDD \u6216 YYYY-MM-DD"},indicators:{type:"object",description:"\u6307\u6807\u914D\u7F6E\u5BF9\u8C61\uFF0C\u952E\u53D6\u81EA "+te.join(" / ")+"\uFF1B\u503C\u4E3A true\uFF08\u9ED8\u8BA4\u53C2\u6570\uFF09\u6216\u914D\u7F6E\u5BF9\u8C61",properties:{ma:{description:"MA \u5747\u7EBF\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods: [5,10,20], type: sma|ema|wma }"},macd:{description:"MACD\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { short, long, signal }"},boll:{description:"\u5E03\u6797\u5E26\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, stdDev }"},kdj:{description:"KDJ\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, kPeriod, dPeriod }"},rsi:{description:"RSI\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},wr:{description:"\u5A01\u5EC9\u6307\u6807 WR\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},bias:{description:"BIAS \u4E56\u79BB\u7387\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},cci:{description:"CCI\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period }"},atr:{description:"ATR \u771F\u5B9E\u6CE2\u5E45\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period }"},obv:{description:"OBV\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { maPeriod }"},roc:{description:"ROC\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, signalPeriod }"},dmi:{description:"DMI / ADX\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, adxPeriod }"},sar:{description:"SAR \u629B\u7269\u7EBF\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { afStart, afIncrement, afMax }"},kc:{description:"Keltner \u901A\u9053 KC\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { emaPeriod, atrPeriod, multiplier }"}}}},required:["symbol"],additionalProperties:!1},invoke:(e,o)=>e.kline.withIndicators(o.symbol,{market:o.market,period:o.period,adjust:o.adjust,startDate:o.startDate,endDate:o.endDate,indicators:o.indicators})};var re={"kline.withIndicators":W},h=_chunkKKBFAS5Pcjs.m.filter(e=>e.mcp!==!1).map(e=>{if(e.mcpCustom){let o=re[e.path.join(".")];if(!o)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u6807\u8BB0\u4E86 mcpCustom \u4F46\u672A\u6CE8\u518C\u624B\u5199\u5DE5\u5177`);return o}return U(e)}),_e=new Map(h.map(e=>[e.name,e]));function B(e){if(Array.isArray(e)){let o=new Set(e);return h.filter(t=>o.has(t.name))}return e==="full"?h:h.filter(o=>o.tier==="core")}var O=200,ne=8e4;function se(e){return Array.isArray(e)&&e.length>O?{total:e.length,truncated:!0,note:`\u7ED3\u679C\u8FC7\u5927\uFF0C\u4EC5\u8FD4\u56DE\u524D ${O} \u6761\uFF1B\u8BF7\u7528\u65E5\u671F / \u5206\u9875 / \u5E02\u573A\u7B49\u53C2\u6570\u7F29\u5C0F\u8303\u56F4`,sample:e.slice(0,O)}:e}function F(e){let o=_nullishCoalesce(JSON.stringify(se(e)), () => ("null"));return o.length>ne?{content:[{type:"text",text:JSON.stringify({truncated:!0,reason:"oversized",approxKB:Math.round(o.length/1024),note:"\u7ED3\u679C\u4F53\u79EF\u8FC7\u5927\uFF0C\u5DF2\u7701\u7565\u6570\u636E\u4F53\uFF1B\u8BF7\u7528\u66F4\u5C0F\u7684\u65E5\u671F / \u5206\u9875 / \u8303\u56F4\u53C2\u6570\uFF0C\u6216\u76F4\u63A5\u7528 SDK \u83B7\u53D6\u5B8C\u6574\u6570\u636E"})}],_meta:{truncated:!0,approxChars:o.length}}:{content:[{type:"text",text:o}]}}function E(e){let o=_chunk4Q7UQ5Q3cjs.i.call(void 0, e)?e.code:"UNKNOWN",t=e instanceof Error?e.message:String(e),r=_chunk4Q7UQ5Q3cjs.i.call(void 0, e)?{code:e.code,provider:e.provider,url:e.url,status:e.status,details:e.details}:{code:o};return{content:[{type:"text",text:`Error[${o}]: ${t}`}],isError:!0,_meta:r}}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e,o){switch(o){case"array":return Array.isArray(e);case"string":return typeof e=="string";case"integer":return Number.isInteger(e);case"number":return typeof e=="number";case"boolean":return typeof e=="boolean";case"object":return f(e);default:return!0}}function ce(e,o){if(e.additionalProperties===!1){let t=new Set(Object.keys(e.properties));for(let r of Object.keys(o))if(!t.has(r))return`\u672A\u77E5\u53C2\u6570 "${r}"`}for(let t of _nullishCoalesce(e.required, () => ([])))if(o[t]===void 0||o[t]===null)return`\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 "${t}"`;for(let[t,r]of Object.entries(e.properties)){let n=o[t];if(n!==void 0){if(r.type&&!ie(n,r.type))return`\u53C2\u6570 "${t}" \u7C7B\u578B\u5E94\u4E3A ${r.type}`;if(r.enum&&!r.enum.includes(n))return`\u53C2\u6570 "${t}" \u53D6\u503C\u975E\u6CD5\u300C${String(n)}\u300D\uFF0C\u53EF\u9009: ${r.enum.join(" / ")}`}}return null}async function ae(e,o){let t=_nullishCoalesce(e.id, () => (null)),r=e.id!==void 0&&e.id!==null,n=s=>({jsonrpc:"2.0",id:t,result:s}),i=(s,a)=>({jsonrpc:"2.0",id:t,error:{code:s,message:a}});if(e.jsonrpc!=="2.0"||typeof e.method!="string"||e.method.length===0)return r?i(S,"Invalid Request"):null;let c=e.params;switch(e.method){case"initialize":{let s=f(c)?c.protocolVersion:void 0;return n({protocolVersion:L(s),capabilities:{tools:{}},serverInfo:R})}case"notifications/initialized":case"notifications/cancelled":return null;case"ping":return n({});case"tools/list":return n({tools:o.tools.map(s=>({name:s.name,description:s.description,inputSchema:s.inputSchema}))});case"tools/call":{if(!f(c))return i(d,"params must be an object");let s=c.name;if(typeof s!="string")return i(d,"params.name must be a string");let a=o.toolMap.get(s);if(!a)return i(d,`Unknown tool: ${s}`);let m=c.arguments;if(m!==void 0&&!f(m))return i(d,"params.arguments must be an object");let D=f(m)?m:{},P=ce(a.inputSchema,D);if(P)return n(E(new (0, _chunk4Q7UQ5Q3cjs.e)(P)));try{let y=await a.invoke(o.sdk,D);return n(F(y))}catch(y){return n(E(y))}}default:return r?i($,`Unknown method: ${e.method}`):null}}function pe(e){if(e)return e;let o=process.env.STOCK_SDK_MCP_TOOLS;if(!o)return"core";if(o==="core"||o==="full")return o;let t=o.split(",").map(r=>r.trim()).filter(Boolean);return t.length>0?t:"core"}function ue(e){if(e)return e;let o=process.env.STOCK_SDK_MCP_TIMEOUT,t=o?Number(o):void 0;return t&&!Number.isNaN(t)&&t>0?{timeout:t}:{}}function be(e={}){let o=new (0, _chunkANBQABEDcjs.t)(ue(e.sdk)),t=B(pe(e.tools)),r={sdk:o,tools:t,toolMap:new Map(t.map(i=>[i.name,i]))};p(`[stock-sdk mcp] ready \xB7 ${t.length} tools \xB7 ${R.name}@${R.version}`),q(i=>{n(i)}),process.stdin.on("end",()=>p("[stock-sdk mcp] stdin closed, exiting"));async function n(i){let c;try{c=JSON.parse(i)}catch (e2){l({jsonrpc:"2.0",id:null,error:{code:K,message:"Parse error"}});return}try{let s=await ae(c,r);s&&l(s)}catch(s){p("[stock-sdk mcp] internal error:",_nullishCoalesce(_optionalChain([s, 'optionalAccess', _7 => _7.message]), () => (String(s)))),c.id!==void 0&&c.id!==null&&l({jsonrpc:"2.0",id:c.id,error:{code:Y,message:String(_nullishCoalesce(_optionalChain([s, 'optionalAccess', _8 => _8.message]), () => (s)))}})}}}exports.dispatchMessage = ae; exports.startMcpServer = be;
|
|
5
|
+
`)}!t&&o.length>k?(p(`[stock-sdk mcp] \u8F93\u5165\u8D85\u957F\uFF08${o.length} bytes \u65E0\u6362\u884C\uFF0C\u8D85 ${k} \u4E0A\u9650\uFF09\uFF0C\u4E22\u5F03\u81F3\u4E0B\u4E00\u6362\u884C`),t=!0,o=""):t&&(o="")}),process.stdin.on("error",r=>p("[stock-sdk mcp] stdin error:",r.message)),process.stdout.on("error",r=>{r.code==="EPIPE"?(p("[stock-sdk mcp] stdout EPIPE\uFF08client \u65AD\u5F00\uFF09\uFF0C\u9000\u51FA"),process.exit(0)):p("[stock-sdk mcp] stdout error:",r.message)})}var H={string:"string",enum:"string",number:"integer",boolean:"boolean"};function _(e){return _nullishCoalesce(_nullishCoalesce(e.jsonKey, () => (e.field)), () => (e.flag))}function z(e){return _optionalChain([e, 'access', _2 => _2.enum, 'optionalAccess', _3 => _3.map, 'call', _4 => _4(o=>_nullishCoalesce(_optionalChain([e, 'access', _5 => _5.map, 'optionalAccess', _6 => _6[o]]), () => (o)))])}function u(e){let o=H[e.type];if(!o)throw new Error(`\u53C2\u6570 --${e.flag} \u7684\u7C7B\u578B ${e.type} \u4E0D\u80FD\u6D3E\u751F MCP schema\uFF08\u8BF7\u6807\u8BB0 mcp:false\uFF09`);let t={type:o},r=z(e);r&&(t.enum=r),e.default!==void 0&&(t.default=e.default);let n=_nullishCoalesce(e.mcpDesc, () => (e.desc));return n&&(t.description=n),t}function Q(e){let o={type:"string"};return e.enum&&(o.enum=e.enum),e.default!==void 0&&(o.default=e.default),e.desc&&(o.description=e.desc),o}var G={type:"array",items:{type:"string"},description:"\u4EE3\u7801\u6570\u7EC4\uFF0C\u5E26\u4E0D\u5E26\u4EA4\u6613\u6240\u524D\u7F00\u5747\u53EF\uFF0C\u5982 ['sh600519','000001','600036']"};function V(e){return(_nullishCoalesce(e.params, () => ([]))).filter(o=>o.mcp!==!1)}function Z(e){let o={},t=[];(e.argShape==="codes[]"||e.argShape==="codes+options")&&(o.codes=G,t.push("codes"));for(let r of _nullishCoalesce(e.positional, () => ([])))o[r.name]=Q(r),r.required&&t.push(r.name);for(let r of V(e))o[_(r)]=u(r),r.required&&t.push(_(r));return{type:"object",properties:o,required:t.length>0?t:void 0,additionalProperties:!1}}function ee(e,o){let t=_chunk2CVXBRZUcjs.a.call(void 0, e,o);if(!t)throw new Error(`SDK \u4E0A\u4E0D\u5B58\u5728\u65B9\u6CD5: ${o.join(".")}`);return r=>t.fn.apply(t.parent,r)}function oe(e){let o=_nullishCoalesce(e.positional, () => ([])),t=V(e);return(r,n)=>{let i=ee(r,e.path),c=o.map(a=>n[a.name]),s={};for(let a of t)s[_nullishCoalesce(a.field, () => (a.flag))]=n[_(a)];switch(e.argShape){case"none":return i([]);case"codes[]":return i([n.codes]);case"codes+options":return i([n.codes,s]);case"symbol+options":return i([...c,s]);case"options":return i([s]);case"positional":return i(c);default:throw new Error(`\u4E0D\u652F\u6301\u7684 argShape: ${e.argShape}`)}}}function U(e){if(e.mcp===!1||!e.toolName)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u672A\u58F0\u660E MCP \u5DE5\u5177\uFF0C\u4E0D\u80FD\u6D3E\u751F ToolDef`);if(e.mcpCustom)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u7684 MCP \u5DE5\u5177\u4E3A\u624B\u5199\u5B9E\u73B0\uFF0C\u4E0D\u80FD\u81EA\u52A8\u6D3E\u751F`);return{name:e.toolName,description:_nullishCoalesce(e.mcpDesc, () => (e.summary)),inputSchema:Z(e),tier:_nullishCoalesce(e.tier, () => ("full")),invoke:oe(e)}}var te=["ma","macd","boll","kdj","rsi","wr","bias","cci","atr","obv","roc","dmi","sar","kc"],g=_chunk2CVXBRZUcjs.n.call(void 0, "kline.withIndicators"),W={name:g.toolName,tier:_nullishCoalesce(g.tier, () => ("full")),description:_nullishCoalesce(g.mcpDesc, () => (g.summary)),inputSchema:{type:"object",properties:{symbol:{type:"string",description:"\u80A1\u7968\u4EE3\u7801\uFF08A \u80A1 / \u6E2F\u80A1 / \u7F8E\u80A1\uFF09"},market:u(_chunk2CVXBRZUcjs.j),period:u(_chunk2CVXBRZUcjs.e),adjust:u(_chunk2CVXBRZUcjs.d),startDate:{...u(_chunk2CVXBRZUcjs.g),description:"\u8D77\u59CB\u65E5\u671F YYYYMMDD \u6216 YYYY-MM-DD"},endDate:{...u(_chunk2CVXBRZUcjs.h),description:"\u7ED3\u675F\u65E5\u671F YYYYMMDD \u6216 YYYY-MM-DD"},indicators:{type:"object",description:"\u6307\u6807\u914D\u7F6E\u5BF9\u8C61\uFF0C\u952E\u53D6\u81EA "+te.join(" / ")+"\uFF1B\u503C\u4E3A true\uFF08\u9ED8\u8BA4\u53C2\u6570\uFF09\u6216\u914D\u7F6E\u5BF9\u8C61",properties:{ma:{description:"MA \u5747\u7EBF\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods: [5,10,20], type: sma|ema|wma }"},macd:{description:"MACD\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { short, long, signal }"},boll:{description:"\u5E03\u6797\u5E26\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, stdDev }"},kdj:{description:"KDJ\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, kPeriod, dPeriod }"},rsi:{description:"RSI\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},wr:{description:"\u5A01\u5EC9\u6307\u6807 WR\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},bias:{description:"BIAS \u4E56\u79BB\u7387\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { periods }"},cci:{description:"CCI\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period }"},atr:{description:"ATR \u771F\u5B9E\u6CE2\u5E45\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period }"},obv:{description:"OBV\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { maPeriod }"},roc:{description:"ROC\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, signalPeriod }"},dmi:{description:"DMI / ADX\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { period, adxPeriod }"},sar:{description:"SAR \u629B\u7269\u7EBF\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { afStart, afIncrement, afMax }"},kc:{description:"Keltner \u901A\u9053 KC\uFF0Ctrue \u6216\u914D\u7F6E\u5BF9\u8C61 { emaPeriod, atrPeriod, multiplier }"}}}},required:["symbol"],additionalProperties:!1},invoke:(e,o)=>e.kline.withIndicators(o.symbol,{market:o.market,period:o.period,adjust:o.adjust,startDate:o.startDate,endDate:o.endDate,indicators:o.indicators})};var re={"kline.withIndicators":W},h=_chunk2CVXBRZUcjs.m.filter(e=>e.mcp!==!1).map(e=>{if(e.mcpCustom){let o=re[e.path.join(".")];if(!o)throw new Error(`\u65B9\u6CD5 ${e.path.join(".")} \u6807\u8BB0\u4E86 mcpCustom \u4F46\u672A\u6CE8\u518C\u624B\u5199\u5DE5\u5177`);return o}return U(e)}),_e=new Map(h.map(e=>[e.name,e]));function B(e){if(Array.isArray(e)){let o=new Set(e);return h.filter(t=>o.has(t.name))}return e==="full"?h:h.filter(o=>o.tier==="core")}var O=200,ne=8e4;function se(e){return Array.isArray(e)&&e.length>O?{total:e.length,truncated:!0,note:`\u7ED3\u679C\u8FC7\u5927\uFF0C\u4EC5\u8FD4\u56DE\u524D ${O} \u6761\uFF1B\u8BF7\u7528\u65E5\u671F / \u5206\u9875 / \u5E02\u573A\u7B49\u53C2\u6570\u7F29\u5C0F\u8303\u56F4`,sample:e.slice(0,O)}:e}function F(e){let o=_nullishCoalesce(JSON.stringify(se(e)), () => ("null"));return o.length>ne?{content:[{type:"text",text:JSON.stringify({truncated:!0,reason:"oversized",approxKB:Math.round(o.length/1024),note:"\u7ED3\u679C\u4F53\u79EF\u8FC7\u5927\uFF0C\u5DF2\u7701\u7565\u6570\u636E\u4F53\uFF1B\u8BF7\u7528\u66F4\u5C0F\u7684\u65E5\u671F / \u5206\u9875 / \u8303\u56F4\u53C2\u6570\uFF0C\u6216\u76F4\u63A5\u7528 SDK \u83B7\u53D6\u5B8C\u6574\u6570\u636E"})}],_meta:{truncated:!0,approxChars:o.length}}:{content:[{type:"text",text:o}]}}function E(e){let o=_chunk4Q7UQ5Q3cjs.i.call(void 0, e)?e.code:"UNKNOWN",t=e instanceof Error?e.message:String(e),r=_chunk4Q7UQ5Q3cjs.i.call(void 0, e)?{code:e.code,provider:e.provider,url:e.url,status:e.status,details:e.details}:{code:o};return{content:[{type:"text",text:`Error[${o}]: ${t}`}],isError:!0,_meta:r}}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ie(e,o){switch(o){case"array":return Array.isArray(e);case"string":return typeof e=="string";case"integer":return Number.isInteger(e);case"number":return typeof e=="number";case"boolean":return typeof e=="boolean";case"object":return f(e);default:return!0}}function ce(e,o){if(e.additionalProperties===!1){let t=new Set(Object.keys(e.properties));for(let r of Object.keys(o))if(!t.has(r))return`\u672A\u77E5\u53C2\u6570 "${r}"`}for(let t of _nullishCoalesce(e.required, () => ([])))if(o[t]===void 0||o[t]===null)return`\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 "${t}"`;for(let[t,r]of Object.entries(e.properties)){let n=o[t];if(n!==void 0){if(r.type&&!ie(n,r.type))return`\u53C2\u6570 "${t}" \u7C7B\u578B\u5E94\u4E3A ${r.type}`;if(r.enum&&!r.enum.includes(n))return`\u53C2\u6570 "${t}" \u53D6\u503C\u975E\u6CD5\u300C${String(n)}\u300D\uFF0C\u53EF\u9009: ${r.enum.join(" / ")}`}}return null}async function ae(e,o){let t=_nullishCoalesce(e.id, () => (null)),r=e.id!==void 0&&e.id!==null,n=s=>({jsonrpc:"2.0",id:t,result:s}),i=(s,a)=>({jsonrpc:"2.0",id:t,error:{code:s,message:a}});if(e.jsonrpc!=="2.0"||typeof e.method!="string"||e.method.length===0)return r?i(S,"Invalid Request"):null;let c=e.params;switch(e.method){case"initialize":{let s=f(c)?c.protocolVersion:void 0;return n({protocolVersion:L(s),capabilities:{tools:{}},serverInfo:R})}case"notifications/initialized":case"notifications/cancelled":return null;case"ping":return n({});case"tools/list":return n({tools:o.tools.map(s=>({name:s.name,description:s.description,inputSchema:s.inputSchema}))});case"tools/call":{if(!f(c))return i(d,"params must be an object");let s=c.name;if(typeof s!="string")return i(d,"params.name must be a string");let a=o.toolMap.get(s);if(!a)return i(d,`Unknown tool: ${s}`);let m=c.arguments;if(m!==void 0&&!f(m))return i(d,"params.arguments must be an object");let D=f(m)?m:{},P=ce(a.inputSchema,D);if(P)return n(E(new (0, _chunk4Q7UQ5Q3cjs.e)(P)));try{let y=await a.invoke(o.sdk,D);return n(F(y))}catch(y){return n(E(y))}}default:return r?i($,`Unknown method: ${e.method}`):null}}function pe(e){if(e)return e;let o=process.env.STOCK_SDK_MCP_TOOLS;if(!o)return"core";if(o==="core"||o==="full")return o;let t=o.split(",").map(r=>r.trim()).filter(Boolean);return t.length>0?t:"core"}function ue(e){if(e)return e;let o=process.env.STOCK_SDK_MCP_TIMEOUT,t=o?Number(o):void 0;return t&&!Number.isNaN(t)&&t>0?{timeout:t}:{}}function be(e={}){let o=new (0, _chunkEQMJ7CCEcjs.t)(ue(e.sdk)),t=B(pe(e.tools)),r={sdk:o,tools:t,toolMap:new Map(t.map(i=>[i.name,i]))};p(`[stock-sdk mcp] ready \xB7 ${t.length} tools \xB7 ${R.name}@${R.version}`),q(i=>{n(i)}),process.stdin.on("end",()=>p("[stock-sdk mcp] stdin closed, exiting"));async function n(i){let c;try{c=JSON.parse(i)}catch (e2){l({jsonrpc:"2.0",id:null,error:{code:K,message:"Parse error"}});return}try{let s=await ae(c,r);s&&l(s)}catch(s){p("[stock-sdk mcp] internal error:",_nullishCoalesce(_optionalChain([s, 'optionalAccess', _7 => _7.message]), () => (String(s)))),c.id!==void 0&&c.id!==null&&l({jsonrpc:"2.0",id:c.id,error:{code:Y,message:String(_nullishCoalesce(_optionalChain([s, 'optionalAccess', _8 => _8.message]), () => (s)))}})}}}exports.dispatchMessage = ae; exports.startMcpServer = be;
|
package/dist/mcp.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as StockSDK, R as RequestClientOptions } from './sdk-
|
|
2
|
-
import './addIndicators-DwEr9RKK.cjs';
|
|
1
|
+
import { S as StockSDK, R as RequestClientOptions } from './sdk-C1spOI0V.cjs';
|
|
3
2
|
import './index-mlzPfoON.cjs';
|
|
3
|
+
import './addIndicators-DQNysyLs.cjs';
|
|
4
4
|
|
|
5
5
|
type JsonRpcId = string | number | null;
|
|
6
6
|
interface JsonRpcRequest {
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as StockSDK, R as RequestClientOptions } from './sdk-
|
|
2
|
-
import './addIndicators-DwEr9RKK.js';
|
|
1
|
+
import { S as StockSDK, R as RequestClientOptions } from './sdk-tyHVl5Ki.js';
|
|
3
2
|
import './index-mlzPfoON.js';
|
|
3
|
+
import './addIndicators-DQNysyLs.js';
|
|
4
4
|
|
|
5
5
|
type JsonRpcId = string | number | null;
|
|
6
6
|
interface JsonRpcRequest {
|
package/dist/mcp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as x,d as I,e as C,g as b,h as A,j as N,m as J,n as j}from"./chunk-
|
|
1
|
+
import{a as x,d as I,e as C,g as b,h as A,j as N,m as J,n as j}from"./chunk-HRY6A22L.js";import{t as M}from"./chunk-FLLXT6AW.js";import"./chunk-G5KF73BW.js";import"./chunk-D2MGPO3R.js";import"./chunk-DU7MCVLJ.js";import{e as w,i as T}from"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";var v=["2025-11-25","2025-06-18"],X=v[0],R={name:"stock-sdk",version:"2.2.0"},K=-32700,S=-32600,$=-32601,d=-32602,Y=-32603;function L(e){return typeof e=="string"&&v.includes(e)?e:X}function p(...e){process.stderr.write(e.map(o=>typeof o=="string"?o:JSON.stringify(o)).join(" ")+`
|
|
2
2
|
`)}function l(e){process.stdout.write(JSON.stringify(e)+`
|
|
3
3
|
`)}var k=1e6;function q(e){let o="",t=!1;process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{o+=r;let n=o.indexOf(`
|
|
4
4
|
`);for(;n>=0;){let i=o.slice(0,n);o=o.slice(n+1),t?(t=!1,l({jsonrpc:"2.0",id:null,error:{code:S,message:`Message too large (limit ${k} bytes)`}})):i.trim()&&e(i),n=o.indexOf(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as MarketTz, v as TodayTimelineResponse, I as IndicatorOptions, H as HistoryKline, s as MinuteTimeline, t as MinuteKline, w as HKHistoryKline, y as HKMinuteTimeline, x as HKMinuteKline, U as USHistoryKline, E as USMinuteTimeline, z as USMinuteKline, K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-DwEr9RKK.cjs';
|
|
2
1
|
import { c as SdkErrorCode, R as RetryOptions, d as RateLimiterOptions, C as CircuitBreakerOptions, P as ProviderName, a as ProviderRequestPolicy, S as SdkError } from './index-mlzPfoON.cjs';
|
|
2
|
+
import { n as MarketTz, v as TodayTimelineResponse, I as IndicatorOptions, H as HistoryKline, s as MinuteTimeline, t as MinuteKline, w as HKHistoryKline, y as HKMinuteTimeline, x as HKMinuteKline, U as USHistoryKline, E as USMinuteTimeline, z as USMinuteKline, K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-DQNysyLs.cjs';
|
|
3
3
|
|
|
4
4
|
interface HostHealthState {
|
|
5
5
|
host: string;
|
|
@@ -1739,6 +1739,119 @@ interface FundProfile {
|
|
|
1739
1739
|
/** 同类基金 */
|
|
1740
1740
|
sameType: FundSameType | null;
|
|
1741
1741
|
}
|
|
1742
|
+
/** 主题基金排序字段(对应 FundMNSubjectList / FundThemeList 的 RankItems) */
|
|
1743
|
+
type ThemeFundSort = 'ZDF' | 'SYL_W' | 'SYL_M' | 'SYL_3M' | 'SYL_6M' | 'SYL_Y' | 'SYL_3Y' | 'SYL_5Y';
|
|
1744
|
+
/** 主题基金排序方向 */
|
|
1745
|
+
type ThemeFundOrder = 'desc' | 'asc';
|
|
1746
|
+
/** 主题基金类型筛选 */
|
|
1747
|
+
type ThemeCategory = '0' | '1' | '2';
|
|
1748
|
+
/** 获取主题列表选项 */
|
|
1749
|
+
interface GetThemeListOptions {
|
|
1750
|
+
sort?: ThemeFundSort;
|
|
1751
|
+
order?: ThemeFundOrder;
|
|
1752
|
+
category?: ThemeCategory;
|
|
1753
|
+
pageSize?: number;
|
|
1754
|
+
page?: number;
|
|
1755
|
+
}
|
|
1756
|
+
/** 获取热门主题选项 */
|
|
1757
|
+
interface GetHotThemesOptions {
|
|
1758
|
+
sort?: ThemeFundSort;
|
|
1759
|
+
order?: ThemeFundOrder;
|
|
1760
|
+
category?: ThemeCategory;
|
|
1761
|
+
limit?: number;
|
|
1762
|
+
}
|
|
1763
|
+
/** 主题基金排行排序字段(对应 FundMNRank 的 SortColumn) */
|
|
1764
|
+
type ThemeFundRankSort = 'SYL_Z' | 'SYL_Y' | 'SYL_3Y' | 'SYL_1N' | 'RZDF';
|
|
1765
|
+
/** 获取主题下基金选项 */
|
|
1766
|
+
interface GetThemeFundsOptions {
|
|
1767
|
+
sortColumn?: ThemeFundRankSort;
|
|
1768
|
+
sort?: ThemeFundOrder;
|
|
1769
|
+
page?: number;
|
|
1770
|
+
pageSize?: number;
|
|
1771
|
+
fundType?: string;
|
|
1772
|
+
}
|
|
1773
|
+
/** 主题基金条目(主题列表) */
|
|
1774
|
+
interface ThemeFund {
|
|
1775
|
+
code: string;
|
|
1776
|
+
name: string;
|
|
1777
|
+
dailyChange: number | null;
|
|
1778
|
+
weeklyReturn: number | null;
|
|
1779
|
+
monthlyReturn: number | null;
|
|
1780
|
+
quarterlyReturn: number | null;
|
|
1781
|
+
halfYearReturn: number | null;
|
|
1782
|
+
yearlyReturn: number | null;
|
|
1783
|
+
threeYearReturn: number | null;
|
|
1784
|
+
fiveYearReturn: number | null;
|
|
1785
|
+
type: '行业' | '概念';
|
|
1786
|
+
}
|
|
1787
|
+
/** 主题基金列表结果 */
|
|
1788
|
+
interface ThemeFundListResult {
|
|
1789
|
+
items: ThemeFund[];
|
|
1790
|
+
totalPages: number;
|
|
1791
|
+
pageSize: number;
|
|
1792
|
+
currentPage: number;
|
|
1793
|
+
}
|
|
1794
|
+
/** 热门主题结果(直接返回数组) */
|
|
1795
|
+
type HotThemesResult = ThemeFund[];
|
|
1796
|
+
/** 主题下基金条目 */
|
|
1797
|
+
interface ThemeFundItem {
|
|
1798
|
+
code: string;
|
|
1799
|
+
name: string;
|
|
1800
|
+
fundType: string;
|
|
1801
|
+
dailyChange: number | null;
|
|
1802
|
+
weeklyReturn: number | null;
|
|
1803
|
+
monthlyReturn: number | null;
|
|
1804
|
+
quarterlyReturn: number | null;
|
|
1805
|
+
yearlyReturn: number | null;
|
|
1806
|
+
nav: number | null;
|
|
1807
|
+
themeCode: string;
|
|
1808
|
+
/** 主题名称:上游 FundMNRank 不返回,通常缺省,调用方可用 themeCode 自行映射 */
|
|
1809
|
+
themeName?: string;
|
|
1810
|
+
}
|
|
1811
|
+
/** 主题下基金列表结果 */
|
|
1812
|
+
interface ThemeFundItemList {
|
|
1813
|
+
items: ThemeFundItem[];
|
|
1814
|
+
total: number;
|
|
1815
|
+
pageIndex: number;
|
|
1816
|
+
pageSize: number;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
declare abstract class BaseService {
|
|
1820
|
+
protected readonly client: RequestClient;
|
|
1821
|
+
constructor(client: RequestClient);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
declare class FundService extends BaseService {
|
|
1825
|
+
constructor(client: RequestClient);
|
|
1826
|
+
/** 获取基金分红明细(全市场,按年份分页) */
|
|
1827
|
+
getFundDividendList(options?: FundDividendListOptions): Promise<FundDividendListResult>;
|
|
1828
|
+
/** 获取基金历史净值(单位 + 累计,全历史一次返回) */
|
|
1829
|
+
getFundNavHistory(code: string): Promise<FundNavHistory>;
|
|
1830
|
+
/** 获取基金当日实时估值(含 T-1 单位净值 + 盘中估算) */
|
|
1831
|
+
getFundEstimate(code: string): Promise<FundEstimate>;
|
|
1832
|
+
/** 获取基金同类排名走势(每日近三月排名 + 百分位) */
|
|
1833
|
+
getFundRankHistory(code: string): Promise<FundRankHistory>;
|
|
1834
|
+
/**
|
|
1835
|
+
* 获取基金深度资料(一次请求返回全量字段)。
|
|
1836
|
+
*
|
|
1837
|
+
* 包含:前十大重仓股、资产配置、仓位测算、基金经理、业绩评价、
|
|
1838
|
+
* 持有人结构、规模变动、申购赎回、阶段收益率、同类基金等。
|
|
1839
|
+
*
|
|
1840
|
+
* @param code 基金代码(纯数字,如 `'000001'`)
|
|
1841
|
+
*/
|
|
1842
|
+
getFundProfile(code: string): Promise<FundProfile>;
|
|
1843
|
+
/** 主题基金子命名空间 */
|
|
1844
|
+
readonly theme: FundThemeService;
|
|
1845
|
+
}
|
|
1846
|
+
/** 主题基金子命名空间 */
|
|
1847
|
+
declare class FundThemeService {
|
|
1848
|
+
readonly client: RequestClient;
|
|
1849
|
+
constructor(client: RequestClient);
|
|
1850
|
+
/** 获取全部主题基金列表 */
|
|
1851
|
+
getThemeList(options?: GetThemeListOptions): Promise<ThemeFundListResult>;
|
|
1852
|
+
/** 获取主题下基金列表 */
|
|
1853
|
+
getThemeFunds(themeCode: string, options?: GetThemeFundsOptions): Promise<ThemeFundItemList>;
|
|
1854
|
+
}
|
|
1742
1855
|
|
|
1743
1856
|
/**
|
|
1744
1857
|
* 腾讯财经 - 批量操作
|
|
@@ -2106,11 +2219,6 @@ interface NorthboundHistoryOptions {
|
|
|
2106
2219
|
endDate?: string;
|
|
2107
2220
|
}
|
|
2108
2221
|
|
|
2109
|
-
declare abstract class BaseService {
|
|
2110
|
-
protected readonly client: RequestClient;
|
|
2111
|
-
constructor(client: RequestClient);
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
2222
|
declare class QuoteService extends BaseService {
|
|
2115
2223
|
constructor(client: RequestClient);
|
|
2116
2224
|
getFullQuotes(codes: string[]): Promise<FullQuote[]>;
|
|
@@ -2398,6 +2506,7 @@ declare class StockSDK {
|
|
|
2398
2506
|
estimate: (code: string) => Promise<FundEstimate>;
|
|
2399
2507
|
rankHistory: (code: string) => Promise<FundRankHistory>;
|
|
2400
2508
|
profile: (code: string) => Promise<FundProfile>;
|
|
2509
|
+
theme: FundThemeService;
|
|
2401
2510
|
};
|
|
2402
2511
|
/** 交易日历 / 市场状态 */
|
|
2403
2512
|
get calendar(): {
|
|
@@ -2418,4 +2527,4 @@ declare class StockSDK {
|
|
|
2418
2527
|
search(keyword: string): Promise<SearchResult[]>;
|
|
2419
2528
|
}
|
|
2420
2529
|
|
|
2421
|
-
export { type
|
|
2530
|
+
export { type ConceptBoard as $, type AShareMarket as A, type BlockTradeDateOptions as B, type ConceptBoardKlineOptions as C, type DragonTigerDateOptions as D, type ExternalLink as E, FundService as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type FundFlow as J, type HKQuote as K, type USQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FundQuote as O, type PanelLargeOrder as P, type Quote as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type IndustryBoard as V, type IndustryBoardSpot as W, type IndustryBoardConstituent as X, type IndustryBoardKline as Y, type IndustryBoardMinuteTimeline as Z, type IndustryBoardMinuteKline as _, RequestClient as a, type FundAssetAllocation as a$, type ConceptBoardSpot as a0, type ConceptBoardConstituent as a1, type ConceptBoardKline as a2, type ConceptBoardMinuteTimeline as a3, type ConceptBoardMinuteKline as a4, type FuturesExchange as a5, type FuturesKline as a6, type GlobalFuturesQuote as a7, type FuturesInventorySymbol as a8, type FuturesInventory as a9, type ZTPoolItem as aA, type StockChangeType as aB, type StockChangeItem as aC, type BoardChangeItem as aD, type DragonTigerPeriod as aE, type DragonTigerDetailItem as aF, type DragonTigerStockStatItem as aG, type DragonTigerInstitutionItem as aH, type DragonTigerBranchItem as aI, type DragonTigerSeatItem as aJ, type BlockTradeMarketStatItem as aK, type BlockTradeDetailItem as aL, type BlockTradeDailyStatItem as aM, type MarginAccountItem as aN, type MarginTargetItem as aO, type FundDividendRank as aP, type FundSortDirection as aQ, type FundDividendListOptions as aR, type FundDividend as aS, type FundDividendListResult as aT, type FundNavPoint as aU, type FundNavHistory as aV, type FundEstimate as aW, type FundRankPoint as aX, type FundRankHistory as aY, type FundHolding as aZ, type FundBondHolding as a_, type ComexInventory as aa, type IndexOptionProduct as ab, type OptionTQuote as ac, type OptionTQuoteResult as ad, type OptionKline as ae, type OptionMinute as af, type ETFOptionMonth as ag, type ETFOptionExpireDay as ah, type ETFOptionCate as ai, type CFFEXOptionQuote as aj, type OptionLHBItem as ak, type SearchResultType as al, type DividendDetail as am, type StockFundFlowDaily as an, type FundFlowRankItem as ao, type SectorFundFlowItem as ap, type MarketFundFlow as aq, type NorthboundDirection as ar, type NorthboundMarket as as, type NorthboundRankPeriod as at, type NorthboundMinuteItem as au, type NorthboundFlowSummary as av, type NorthboundHoldingRankItem as aw, type NorthboundHistoryItem as ax, type NorthboundIndividualItem as ay, type ZTPoolType as az, type SearchResult as b, type FundPositionPoint as b0, type FundManager as b1, type FundPerformanceEvaluation as b2, type FundHolderStructure as b3, type FundScaleChange as b4, type FundBuySedemption as b5, type FundStageReturns as b6, type FundSameTypePeer as b7, type FundSameType as b8, type ThemeFundSort as b9, type ThemeFundOrder as ba, type ThemeCategory as bb, type GetThemeListOptions as bc, type GetHotThemesOptions as bd, type ThemeFundRankSort as be, type GetThemeFundsOptions as bf, type ThemeFund as bg, type ThemeFundListResult as bh, type HotThemesResult as bi, type ThemeFundItem as bj, type ThemeFundItemList as bk, type GetAShareCodeListOptions as c, type GetUSCodeListOptions as d, type GetAllUSQuotesOptions as e, type MarketStatus as f, type SupportedMarket as g, type FundProfile as h, type MinuteKlineOptions as i, type HKKlineOptions as j, type HKMinuteKlineOptions as k, type USKlineOptions as l, type USMinuteKlineOptions as m, type IndustryBoardMinuteKlineOptions as n, type ConceptBoardMinuteKlineOptions as o, type FuturesKlineOptions as p, type GlobalFuturesSpotOptions as q, type GlobalFuturesKlineOptions as r, type FuturesInventoryOptions as s, type ComexInventoryOptions as t, type CFFEXOptionQuotesOptions as u, type FundFlowOptions as v, type FundFlowRankOptions as w, type NorthboundHistoryOptions as x, type FullQuote as y, type SimpleQuote as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as MarketTz, v as TodayTimelineResponse, I as IndicatorOptions, H as HistoryKline, s as MinuteTimeline, t as MinuteKline, w as HKHistoryKline, y as HKMinuteTimeline, x as HKMinuteKline, U as USHistoryKline, E as USMinuteTimeline, z as USMinuteKline, K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-DwEr9RKK.js';
|
|
2
1
|
import { c as SdkErrorCode, R as RetryOptions, d as RateLimiterOptions, C as CircuitBreakerOptions, P as ProviderName, a as ProviderRequestPolicy, S as SdkError } from './index-mlzPfoON.js';
|
|
2
|
+
import { n as MarketTz, v as TodayTimelineResponse, I as IndicatorOptions, H as HistoryKline, s as MinuteTimeline, t as MinuteKline, w as HKHistoryKline, y as HKMinuteTimeline, x as HKMinuteKline, U as USHistoryKline, E as USMinuteTimeline, z as USMinuteKline, K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-DQNysyLs.js';
|
|
3
3
|
|
|
4
4
|
interface HostHealthState {
|
|
5
5
|
host: string;
|
|
@@ -1739,6 +1739,119 @@ interface FundProfile {
|
|
|
1739
1739
|
/** 同类基金 */
|
|
1740
1740
|
sameType: FundSameType | null;
|
|
1741
1741
|
}
|
|
1742
|
+
/** 主题基金排序字段(对应 FundMNSubjectList / FundThemeList 的 RankItems) */
|
|
1743
|
+
type ThemeFundSort = 'ZDF' | 'SYL_W' | 'SYL_M' | 'SYL_3M' | 'SYL_6M' | 'SYL_Y' | 'SYL_3Y' | 'SYL_5Y';
|
|
1744
|
+
/** 主题基金排序方向 */
|
|
1745
|
+
type ThemeFundOrder = 'desc' | 'asc';
|
|
1746
|
+
/** 主题基金类型筛选 */
|
|
1747
|
+
type ThemeCategory = '0' | '1' | '2';
|
|
1748
|
+
/** 获取主题列表选项 */
|
|
1749
|
+
interface GetThemeListOptions {
|
|
1750
|
+
sort?: ThemeFundSort;
|
|
1751
|
+
order?: ThemeFundOrder;
|
|
1752
|
+
category?: ThemeCategory;
|
|
1753
|
+
pageSize?: number;
|
|
1754
|
+
page?: number;
|
|
1755
|
+
}
|
|
1756
|
+
/** 获取热门主题选项 */
|
|
1757
|
+
interface GetHotThemesOptions {
|
|
1758
|
+
sort?: ThemeFundSort;
|
|
1759
|
+
order?: ThemeFundOrder;
|
|
1760
|
+
category?: ThemeCategory;
|
|
1761
|
+
limit?: number;
|
|
1762
|
+
}
|
|
1763
|
+
/** 主题基金排行排序字段(对应 FundMNRank 的 SortColumn) */
|
|
1764
|
+
type ThemeFundRankSort = 'SYL_Z' | 'SYL_Y' | 'SYL_3Y' | 'SYL_1N' | 'RZDF';
|
|
1765
|
+
/** 获取主题下基金选项 */
|
|
1766
|
+
interface GetThemeFundsOptions {
|
|
1767
|
+
sortColumn?: ThemeFundRankSort;
|
|
1768
|
+
sort?: ThemeFundOrder;
|
|
1769
|
+
page?: number;
|
|
1770
|
+
pageSize?: number;
|
|
1771
|
+
fundType?: string;
|
|
1772
|
+
}
|
|
1773
|
+
/** 主题基金条目(主题列表) */
|
|
1774
|
+
interface ThemeFund {
|
|
1775
|
+
code: string;
|
|
1776
|
+
name: string;
|
|
1777
|
+
dailyChange: number | null;
|
|
1778
|
+
weeklyReturn: number | null;
|
|
1779
|
+
monthlyReturn: number | null;
|
|
1780
|
+
quarterlyReturn: number | null;
|
|
1781
|
+
halfYearReturn: number | null;
|
|
1782
|
+
yearlyReturn: number | null;
|
|
1783
|
+
threeYearReturn: number | null;
|
|
1784
|
+
fiveYearReturn: number | null;
|
|
1785
|
+
type: '行业' | '概念';
|
|
1786
|
+
}
|
|
1787
|
+
/** 主题基金列表结果 */
|
|
1788
|
+
interface ThemeFundListResult {
|
|
1789
|
+
items: ThemeFund[];
|
|
1790
|
+
totalPages: number;
|
|
1791
|
+
pageSize: number;
|
|
1792
|
+
currentPage: number;
|
|
1793
|
+
}
|
|
1794
|
+
/** 热门主题结果(直接返回数组) */
|
|
1795
|
+
type HotThemesResult = ThemeFund[];
|
|
1796
|
+
/** 主题下基金条目 */
|
|
1797
|
+
interface ThemeFundItem {
|
|
1798
|
+
code: string;
|
|
1799
|
+
name: string;
|
|
1800
|
+
fundType: string;
|
|
1801
|
+
dailyChange: number | null;
|
|
1802
|
+
weeklyReturn: number | null;
|
|
1803
|
+
monthlyReturn: number | null;
|
|
1804
|
+
quarterlyReturn: number | null;
|
|
1805
|
+
yearlyReturn: number | null;
|
|
1806
|
+
nav: number | null;
|
|
1807
|
+
themeCode: string;
|
|
1808
|
+
/** 主题名称:上游 FundMNRank 不返回,通常缺省,调用方可用 themeCode 自行映射 */
|
|
1809
|
+
themeName?: string;
|
|
1810
|
+
}
|
|
1811
|
+
/** 主题下基金列表结果 */
|
|
1812
|
+
interface ThemeFundItemList {
|
|
1813
|
+
items: ThemeFundItem[];
|
|
1814
|
+
total: number;
|
|
1815
|
+
pageIndex: number;
|
|
1816
|
+
pageSize: number;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
declare abstract class BaseService {
|
|
1820
|
+
protected readonly client: RequestClient;
|
|
1821
|
+
constructor(client: RequestClient);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
declare class FundService extends BaseService {
|
|
1825
|
+
constructor(client: RequestClient);
|
|
1826
|
+
/** 获取基金分红明细(全市场,按年份分页) */
|
|
1827
|
+
getFundDividendList(options?: FundDividendListOptions): Promise<FundDividendListResult>;
|
|
1828
|
+
/** 获取基金历史净值(单位 + 累计,全历史一次返回) */
|
|
1829
|
+
getFundNavHistory(code: string): Promise<FundNavHistory>;
|
|
1830
|
+
/** 获取基金当日实时估值(含 T-1 单位净值 + 盘中估算) */
|
|
1831
|
+
getFundEstimate(code: string): Promise<FundEstimate>;
|
|
1832
|
+
/** 获取基金同类排名走势(每日近三月排名 + 百分位) */
|
|
1833
|
+
getFundRankHistory(code: string): Promise<FundRankHistory>;
|
|
1834
|
+
/**
|
|
1835
|
+
* 获取基金深度资料(一次请求返回全量字段)。
|
|
1836
|
+
*
|
|
1837
|
+
* 包含:前十大重仓股、资产配置、仓位测算、基金经理、业绩评价、
|
|
1838
|
+
* 持有人结构、规模变动、申购赎回、阶段收益率、同类基金等。
|
|
1839
|
+
*
|
|
1840
|
+
* @param code 基金代码(纯数字,如 `'000001'`)
|
|
1841
|
+
*/
|
|
1842
|
+
getFundProfile(code: string): Promise<FundProfile>;
|
|
1843
|
+
/** 主题基金子命名空间 */
|
|
1844
|
+
readonly theme: FundThemeService;
|
|
1845
|
+
}
|
|
1846
|
+
/** 主题基金子命名空间 */
|
|
1847
|
+
declare class FundThemeService {
|
|
1848
|
+
readonly client: RequestClient;
|
|
1849
|
+
constructor(client: RequestClient);
|
|
1850
|
+
/** 获取全部主题基金列表 */
|
|
1851
|
+
getThemeList(options?: GetThemeListOptions): Promise<ThemeFundListResult>;
|
|
1852
|
+
/** 获取主题下基金列表 */
|
|
1853
|
+
getThemeFunds(themeCode: string, options?: GetThemeFundsOptions): Promise<ThemeFundItemList>;
|
|
1854
|
+
}
|
|
1742
1855
|
|
|
1743
1856
|
/**
|
|
1744
1857
|
* 腾讯财经 - 批量操作
|
|
@@ -2106,11 +2219,6 @@ interface NorthboundHistoryOptions {
|
|
|
2106
2219
|
endDate?: string;
|
|
2107
2220
|
}
|
|
2108
2221
|
|
|
2109
|
-
declare abstract class BaseService {
|
|
2110
|
-
protected readonly client: RequestClient;
|
|
2111
|
-
constructor(client: RequestClient);
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
2222
|
declare class QuoteService extends BaseService {
|
|
2115
2223
|
constructor(client: RequestClient);
|
|
2116
2224
|
getFullQuotes(codes: string[]): Promise<FullQuote[]>;
|
|
@@ -2398,6 +2506,7 @@ declare class StockSDK {
|
|
|
2398
2506
|
estimate: (code: string) => Promise<FundEstimate>;
|
|
2399
2507
|
rankHistory: (code: string) => Promise<FundRankHistory>;
|
|
2400
2508
|
profile: (code: string) => Promise<FundProfile>;
|
|
2509
|
+
theme: FundThemeService;
|
|
2401
2510
|
};
|
|
2402
2511
|
/** 交易日历 / 市场状态 */
|
|
2403
2512
|
get calendar(): {
|
|
@@ -2418,4 +2527,4 @@ declare class StockSDK {
|
|
|
2418
2527
|
search(keyword: string): Promise<SearchResult[]>;
|
|
2419
2528
|
}
|
|
2420
2529
|
|
|
2421
|
-
export { type
|
|
2530
|
+
export { type ConceptBoard as $, type AShareMarket as A, type BlockTradeDateOptions as B, type ConceptBoardKlineOptions as C, type DragonTigerDateOptions as D, type ExternalLink as E, FundService as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type FundFlow as J, type HKQuote as K, type USQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FundQuote as O, type PanelLargeOrder as P, type Quote as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type IndustryBoard as V, type IndustryBoardSpot as W, type IndustryBoardConstituent as X, type IndustryBoardKline as Y, type IndustryBoardMinuteTimeline as Z, type IndustryBoardMinuteKline as _, RequestClient as a, type FundAssetAllocation as a$, type ConceptBoardSpot as a0, type ConceptBoardConstituent as a1, type ConceptBoardKline as a2, type ConceptBoardMinuteTimeline as a3, type ConceptBoardMinuteKline as a4, type FuturesExchange as a5, type FuturesKline as a6, type GlobalFuturesQuote as a7, type FuturesInventorySymbol as a8, type FuturesInventory as a9, type ZTPoolItem as aA, type StockChangeType as aB, type StockChangeItem as aC, type BoardChangeItem as aD, type DragonTigerPeriod as aE, type DragonTigerDetailItem as aF, type DragonTigerStockStatItem as aG, type DragonTigerInstitutionItem as aH, type DragonTigerBranchItem as aI, type DragonTigerSeatItem as aJ, type BlockTradeMarketStatItem as aK, type BlockTradeDetailItem as aL, type BlockTradeDailyStatItem as aM, type MarginAccountItem as aN, type MarginTargetItem as aO, type FundDividendRank as aP, type FundSortDirection as aQ, type FundDividendListOptions as aR, type FundDividend as aS, type FundDividendListResult as aT, type FundNavPoint as aU, type FundNavHistory as aV, type FundEstimate as aW, type FundRankPoint as aX, type FundRankHistory as aY, type FundHolding as aZ, type FundBondHolding as a_, type ComexInventory as aa, type IndexOptionProduct as ab, type OptionTQuote as ac, type OptionTQuoteResult as ad, type OptionKline as ae, type OptionMinute as af, type ETFOptionMonth as ag, type ETFOptionExpireDay as ah, type ETFOptionCate as ai, type CFFEXOptionQuote as aj, type OptionLHBItem as ak, type SearchResultType as al, type DividendDetail as am, type StockFundFlowDaily as an, type FundFlowRankItem as ao, type SectorFundFlowItem as ap, type MarketFundFlow as aq, type NorthboundDirection as ar, type NorthboundMarket as as, type NorthboundRankPeriod as at, type NorthboundMinuteItem as au, type NorthboundFlowSummary as av, type NorthboundHoldingRankItem as aw, type NorthboundHistoryItem as ax, type NorthboundIndividualItem as ay, type ZTPoolType as az, type SearchResult as b, type FundPositionPoint as b0, type FundManager as b1, type FundPerformanceEvaluation as b2, type FundHolderStructure as b3, type FundScaleChange as b4, type FundBuySedemption as b5, type FundStageReturns as b6, type FundSameTypePeer as b7, type FundSameType as b8, type ThemeFundSort as b9, type ThemeFundOrder as ba, type ThemeCategory as bb, type GetThemeListOptions as bc, type GetHotThemesOptions as bd, type ThemeFundRankSort as be, type GetThemeFundsOptions as bf, type ThemeFund as bg, type ThemeFundListResult as bh, type HotThemesResult as bi, type ThemeFundItem as bj, type ThemeFundItemList as bk, type GetAShareCodeListOptions as c, type GetUSCodeListOptions as d, type GetAllUSQuotesOptions as e, type MarketStatus as f, type SupportedMarket as g, type FundProfile as h, type MinuteKlineOptions as i, type HKKlineOptions as j, type HKMinuteKlineOptions as k, type USKlineOptions as l, type USMinuteKlineOptions as m, type IndustryBoardMinuteKlineOptions as n, type ConceptBoardMinuteKlineOptions as o, type FuturesKlineOptions as p, type GlobalFuturesSpotOptions as q, type GlobalFuturesKlineOptions as r, type FuturesInventoryOptions as s, type ComexInventoryOptions as t, type CFFEXOptionQuotesOptions as u, type FundFlowOptions as v, type FundFlowRankOptions as w, type NorthboundHistoryOptions as x, type FullQuote as y, type SimpleQuote as z };
|