stock-sdk 2.0.0-beta.1 → 2.1.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 +23 -23
- package/dist/chunk-3X645BZO.js +1 -0
- package/dist/chunk-ANBQABED.cjs +1 -0
- package/dist/chunk-KKBFAS5P.cjs +1 -0
- package/dist/chunk-WP37ZK2F.js +1 -0
- package/dist/cli.cjs +6 -6
- package/dist/cli.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +2 -2
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{sdk-DOz03n_v.d.ts → sdk-B-hkKcZs.d.ts} +187 -1
- package/dist/{sdk-Cg_jTmTk.d.cts → sdk-CA1tOtb2.d.cts} +187 -1
- package/package.json +67 -22
- package/dist/chunk-2PYGJ5I5.cjs +0 -1
- package/dist/chunk-4PVVFEOQ.js +0 -1
- package/dist/chunk-GBHWMR2O.js +0 -1
- package/dist/chunk-YR2SVSXB.cjs +0 -1
package/dist/mcp.d.cts
CHANGED
package/dist/mcp.d.ts
CHANGED
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-WP37ZK2F.js";import{t as M}from"./chunk-3X645BZO.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.1.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(`
|
|
@@ -1554,6 +1554,191 @@ interface FundRankHistory {
|
|
|
1554
1554
|
/** 排名走势序列;按日期升序 */
|
|
1555
1555
|
items: FundRankPoint[];
|
|
1556
1556
|
}
|
|
1557
|
+
/** 前十大重仓股 */
|
|
1558
|
+
interface FundHolding {
|
|
1559
|
+
/** 股票代码(纯数字 6 位,如 `"600519"`) */
|
|
1560
|
+
code: string;
|
|
1561
|
+
/** 新市场号(`"0"`=深圳, `"1"`=上海),用于拼接东财 secid */
|
|
1562
|
+
marketId: string;
|
|
1563
|
+
}
|
|
1564
|
+
/** 前五大债券持仓 */
|
|
1565
|
+
interface FundBondHolding {
|
|
1566
|
+
/** 债券代码 */
|
|
1567
|
+
code: string;
|
|
1568
|
+
/** 新市场号 */
|
|
1569
|
+
marketId: string;
|
|
1570
|
+
}
|
|
1571
|
+
/** 资产配置项(单季度) */
|
|
1572
|
+
interface FundAssetAllocation {
|
|
1573
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1574
|
+
date: string;
|
|
1575
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1576
|
+
timestamp: number | null;
|
|
1577
|
+
/** 股票占净值比(%) */
|
|
1578
|
+
stockRatio: number;
|
|
1579
|
+
/** 债券占净值比(%) */
|
|
1580
|
+
bondRatio: number;
|
|
1581
|
+
/** 现金占净值比(%) */
|
|
1582
|
+
cashRatio: number;
|
|
1583
|
+
/** 其他资产占净值比(%);上游部分基金不提供该项,缺失时为 `0` */
|
|
1584
|
+
otherRatio: number;
|
|
1585
|
+
/** 净资产(亿元) */
|
|
1586
|
+
netAsset: number;
|
|
1587
|
+
}
|
|
1588
|
+
/** 股票仓位测算点(每日) */
|
|
1589
|
+
interface FundPositionPoint {
|
|
1590
|
+
/** 日期 `YYYY-MM-DD` */
|
|
1591
|
+
date: string;
|
|
1592
|
+
/** UTC 毫秒时间戳 */
|
|
1593
|
+
timestamp: number;
|
|
1594
|
+
/** 股票仓位占比(%) */
|
|
1595
|
+
position: number;
|
|
1596
|
+
}
|
|
1597
|
+
/** 基金经理信息 */
|
|
1598
|
+
interface FundManager {
|
|
1599
|
+
/** 基金经理 ID */
|
|
1600
|
+
id: string;
|
|
1601
|
+
/** 姓名 */
|
|
1602
|
+
name: string;
|
|
1603
|
+
/** 头像图片 URL;无则为 `null` */
|
|
1604
|
+
avatarUrl: string | null;
|
|
1605
|
+
/** 天天基金星级(0–5);无评级为 `null` */
|
|
1606
|
+
star: number | null;
|
|
1607
|
+
/**
|
|
1608
|
+
* 任职年限描述(东财原文,如 `"14年又192天"`);无则为 `null`。
|
|
1609
|
+
* 上游只提供这段中文描述,不提供可计算的天数/起始日,故原样透传。
|
|
1610
|
+
*/
|
|
1611
|
+
workTime: string | null;
|
|
1612
|
+
/**
|
|
1613
|
+
* 在管基金规模描述(东财原文,如 `"78.91亿(4只基金)"`);无则为 `null`。
|
|
1614
|
+
* 规模与只数被上游拼在同一段字符串里,原样透传不做拆解。
|
|
1615
|
+
*/
|
|
1616
|
+
fundSize: string | null;
|
|
1617
|
+
/**
|
|
1618
|
+
* 基金经理能力评分(综合分 + 各维度雷达),结构同 {@link FundPerformanceEvaluation};
|
|
1619
|
+
* 无评分为 `null`。
|
|
1620
|
+
*/
|
|
1621
|
+
power: FundPerformanceEvaluation | null;
|
|
1622
|
+
}
|
|
1623
|
+
/** 业绩评价 */
|
|
1624
|
+
interface FundPerformanceEvaluation {
|
|
1625
|
+
/** 综合评分 */
|
|
1626
|
+
overall: number;
|
|
1627
|
+
/** 评价维度 */
|
|
1628
|
+
categories: string[];
|
|
1629
|
+
/** 各维度得分 */
|
|
1630
|
+
scores: number[];
|
|
1631
|
+
/** 各维度描述 */
|
|
1632
|
+
descriptions: string[];
|
|
1633
|
+
}
|
|
1634
|
+
/** 持有人结构(单期) */
|
|
1635
|
+
interface FundHolderStructure {
|
|
1636
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1637
|
+
date: string;
|
|
1638
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1639
|
+
timestamp: number | null;
|
|
1640
|
+
/** 机构持有比例(%) */
|
|
1641
|
+
institutionRatio: number;
|
|
1642
|
+
/** 个人持有比例(%) */
|
|
1643
|
+
individualRatio: number;
|
|
1644
|
+
/** 内部持有比例(%) */
|
|
1645
|
+
internalRatio: number;
|
|
1646
|
+
}
|
|
1647
|
+
/** 规模变动(单季度) */
|
|
1648
|
+
interface FundScaleChange {
|
|
1649
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1650
|
+
date: string;
|
|
1651
|
+
/** 基金规模(亿元) */
|
|
1652
|
+
scale: number;
|
|
1653
|
+
/** 环比变动(东财原文,如 `"3.67%"` / `"-1.20%"`,不带前导 `+`) */
|
|
1654
|
+
mom: string;
|
|
1655
|
+
}
|
|
1656
|
+
/** 申购赎回(单季度) */
|
|
1657
|
+
interface FundBuySedemption {
|
|
1658
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1659
|
+
date: string;
|
|
1660
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1661
|
+
timestamp: number | null;
|
|
1662
|
+
/** 期间申购(亿份) */
|
|
1663
|
+
buy: number;
|
|
1664
|
+
/** 期间赎回(亿份) */
|
|
1665
|
+
sell: number;
|
|
1666
|
+
/** 期末总份额(亿份);上游 series 名为「总份额」 */
|
|
1667
|
+
total: number;
|
|
1668
|
+
}
|
|
1669
|
+
/** 阶段收益率 */
|
|
1670
|
+
interface FundStageReturns {
|
|
1671
|
+
/** 近一月收益率(%) */
|
|
1672
|
+
oneMonth: number | null;
|
|
1673
|
+
/** 近三月收益率(%) */
|
|
1674
|
+
threeMonth: number | null;
|
|
1675
|
+
/** 近六月收益率(%) */
|
|
1676
|
+
sixMonth: number | null;
|
|
1677
|
+
/** 近一年收益率(%) */
|
|
1678
|
+
oneYear: number | null;
|
|
1679
|
+
}
|
|
1680
|
+
/** 同类基金中的一只 */
|
|
1681
|
+
interface FundSameTypePeer {
|
|
1682
|
+
/** 基金代码(纯数字) */
|
|
1683
|
+
code: string;
|
|
1684
|
+
/** 基金简称 */
|
|
1685
|
+
name: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* 东财附带的排序数值(随分组维度而定,通常为某区间收益或净值);
|
|
1688
|
+
* 无法解析为 `null`。
|
|
1689
|
+
*/
|
|
1690
|
+
value: number | null;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* 同类基金(用于「切换同类基金」对比)。
|
|
1694
|
+
*
|
|
1695
|
+
* 上游 `swithSameType` 是一个二维数组:东财按多个维度各取一组同类基金,
|
|
1696
|
+
* 故这里用 `groups`(外层为分组、内层为该组下的基金)如实表达。
|
|
1697
|
+
* 只想要去重后的代码列表可自行 `groups.flat()`。
|
|
1698
|
+
*/
|
|
1699
|
+
interface FundSameType {
|
|
1700
|
+
/** 同类基金分组 */
|
|
1701
|
+
groups: FundSameTypePeer[][];
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* 基金深度资料(pingzhongdata 全量字段,一次请求返回)。
|
|
1705
|
+
*
|
|
1706
|
+
* 数据源:`https://fund.eastmoney.com/pingzhongdata/{code}.js`
|
|
1707
|
+
*/
|
|
1708
|
+
interface FundProfile {
|
|
1709
|
+
/** 基金代码 */
|
|
1710
|
+
code: string;
|
|
1711
|
+
/** 基金简称 */
|
|
1712
|
+
name: string | null;
|
|
1713
|
+
/** 原申购费率(%) */
|
|
1714
|
+
sourceRate: number | null;
|
|
1715
|
+
/** 现申购费率(%) */
|
|
1716
|
+
rate: number | null;
|
|
1717
|
+
/** 最小申购金额(元) */
|
|
1718
|
+
minSubscription: number | null;
|
|
1719
|
+
/** 前十大重仓股 */
|
|
1720
|
+
holdings: FundHolding[];
|
|
1721
|
+
/** 前五大债券持仓 */
|
|
1722
|
+
bondHoldings: FundBondHolding[];
|
|
1723
|
+
/** 资产配置(按季度,最近 4 期) */
|
|
1724
|
+
assetAllocation: FundAssetAllocation[];
|
|
1725
|
+
/** 股票仓位测算(每日,最近约 20 个交易日) */
|
|
1726
|
+
positions: FundPositionPoint[];
|
|
1727
|
+
/** 基金经理列表 */
|
|
1728
|
+
managers: FundManager[];
|
|
1729
|
+
/** 业绩评价 */
|
|
1730
|
+
performance: FundPerformanceEvaluation | null;
|
|
1731
|
+
/** 持有人结构(按报告期) */
|
|
1732
|
+
holderStructure: FundHolderStructure[];
|
|
1733
|
+
/** 规模变动(按季度) */
|
|
1734
|
+
scaleChanges: FundScaleChange[];
|
|
1735
|
+
/** 申购赎回(按季度) */
|
|
1736
|
+
buySedemption: FundBuySedemption[];
|
|
1737
|
+
/** 阶段收益率 */
|
|
1738
|
+
stageReturns: FundStageReturns;
|
|
1739
|
+
/** 同类基金 */
|
|
1740
|
+
sameType: FundSameType | null;
|
|
1741
|
+
}
|
|
1557
1742
|
|
|
1558
1743
|
/**
|
|
1559
1744
|
* 腾讯财经 - 批量操作
|
|
@@ -2212,6 +2397,7 @@ declare class StockSDK {
|
|
|
2212
2397
|
navHistory: (code: string) => Promise<FundNavHistory>;
|
|
2213
2398
|
estimate: (code: string) => Promise<FundEstimate>;
|
|
2214
2399
|
rankHistory: (code: string) => Promise<FundRankHistory>;
|
|
2400
|
+
profile: (code: string) => Promise<FundProfile>;
|
|
2215
2401
|
};
|
|
2216
2402
|
/** 交易日历 / 市场状态 */
|
|
2217
2403
|
get calendar(): {
|
|
@@ -2232,4 +2418,4 @@ declare class StockSDK {
|
|
|
2232
2418
|
search(keyword: string): Promise<SearchResult[]>;
|
|
2233
2419
|
}
|
|
2234
2420
|
|
|
2235
|
-
export { type
|
|
2421
|
+
export { type IndustryBoardSpot as $, type AShareMarket as A, BaseService as B, type ConceptBoardKlineOptions as C, type FundFlowRankOptions as D, type ExternalLink as E, type FundDividendListOptions as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type NorthboundHistoryOptions as J, type BlockTradeDateOptions as K, type DragonTigerDateOptions as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FullQuote as O, type SimpleQuote as P, type FundFlow as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type PanelLargeOrder as V, type HKQuote as W, type USQuote as X, type FundQuote as Y, type Quote as Z, type IndustryBoard as _, RequestClient as a, type FundAssetAllocation as a$, type IndustryBoardConstituent as a0, type IndustryBoardKline as a1, type IndustryBoardMinuteTimeline as a2, type IndustryBoardMinuteKline as a3, type ConceptBoard as a4, type ConceptBoardSpot as a5, type ConceptBoardConstituent as a6, type ConceptBoardKline as a7, type ConceptBoardMinuteTimeline as a8, type ConceptBoardMinuteKline as a9, type NorthboundFlowSummary as aA, type NorthboundHoldingRankItem as aB, type NorthboundHistoryItem as aC, type NorthboundIndividualItem as aD, type ZTPoolType as aE, type ZTPoolItem as aF, type StockChangeType as aG, type StockChangeItem as aH, type BoardChangeItem as aI, type DragonTigerPeriod as aJ, type DragonTigerDetailItem as aK, type DragonTigerStockStatItem as aL, type DragonTigerInstitutionItem as aM, type DragonTigerBranchItem as aN, type DragonTigerSeatItem as aO, type BlockTradeMarketStatItem as aP, type BlockTradeDetailItem as aQ, type BlockTradeDailyStatItem as aR, type MarginAccountItem as aS, type MarginTargetItem as aT, type FundDividendRank as aU, type FundSortDirection as aV, type FundDividend as aW, type FundNavPoint as aX, type FundRankPoint as aY, type FundHolding as aZ, type FundBondHolding as a_, type FuturesExchange as aa, type FuturesKline as ab, type GlobalFuturesQuote as ac, type FuturesInventorySymbol as ad, type FuturesInventory as ae, type ComexInventory as af, type IndexOptionProduct as ag, type OptionTQuote as ah, type OptionTQuoteResult as ai, type OptionKline as aj, type OptionMinute as ak, type ETFOptionMonth as al, type ETFOptionExpireDay as am, type ETFOptionCate as an, type CFFEXOptionQuote as ao, type OptionLHBItem as ap, type SearchResultType as aq, type DividendDetail as ar, type StockFundFlowDaily as as, type FundFlowRankItem as at, type SectorFundFlowItem as au, type MarketFundFlow as av, type NorthboundDirection as aw, type NorthboundMarket as ax, type NorthboundRankPeriod as ay, type NorthboundMinuteItem as az, type FundDividendListResult 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 FundNavHistory as c, type FundEstimate as d, type FundRankHistory as e, type FundProfile as f, type SearchResult as g, type GetAShareCodeListOptions as h, type GetUSCodeListOptions as i, type GetAllUSQuotesOptions as j, type MarketStatus as k, type SupportedMarket as l, type MinuteKlineOptions as m, type HKKlineOptions as n, type HKMinuteKlineOptions as o, type USKlineOptions as p, type USMinuteKlineOptions as q, type IndustryBoardMinuteKlineOptions as r, type ConceptBoardMinuteKlineOptions as s, type FuturesKlineOptions as t, type GlobalFuturesSpotOptions as u, type GlobalFuturesKlineOptions as v, type FuturesInventoryOptions as w, type ComexInventoryOptions as x, type CFFEXOptionQuotesOptions as y, type FundFlowOptions as z };
|
|
@@ -1554,6 +1554,191 @@ interface FundRankHistory {
|
|
|
1554
1554
|
/** 排名走势序列;按日期升序 */
|
|
1555
1555
|
items: FundRankPoint[];
|
|
1556
1556
|
}
|
|
1557
|
+
/** 前十大重仓股 */
|
|
1558
|
+
interface FundHolding {
|
|
1559
|
+
/** 股票代码(纯数字 6 位,如 `"600519"`) */
|
|
1560
|
+
code: string;
|
|
1561
|
+
/** 新市场号(`"0"`=深圳, `"1"`=上海),用于拼接东财 secid */
|
|
1562
|
+
marketId: string;
|
|
1563
|
+
}
|
|
1564
|
+
/** 前五大债券持仓 */
|
|
1565
|
+
interface FundBondHolding {
|
|
1566
|
+
/** 债券代码 */
|
|
1567
|
+
code: string;
|
|
1568
|
+
/** 新市场号 */
|
|
1569
|
+
marketId: string;
|
|
1570
|
+
}
|
|
1571
|
+
/** 资产配置项(单季度) */
|
|
1572
|
+
interface FundAssetAllocation {
|
|
1573
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1574
|
+
date: string;
|
|
1575
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1576
|
+
timestamp: number | null;
|
|
1577
|
+
/** 股票占净值比(%) */
|
|
1578
|
+
stockRatio: number;
|
|
1579
|
+
/** 债券占净值比(%) */
|
|
1580
|
+
bondRatio: number;
|
|
1581
|
+
/** 现金占净值比(%) */
|
|
1582
|
+
cashRatio: number;
|
|
1583
|
+
/** 其他资产占净值比(%);上游部分基金不提供该项,缺失时为 `0` */
|
|
1584
|
+
otherRatio: number;
|
|
1585
|
+
/** 净资产(亿元) */
|
|
1586
|
+
netAsset: number;
|
|
1587
|
+
}
|
|
1588
|
+
/** 股票仓位测算点(每日) */
|
|
1589
|
+
interface FundPositionPoint {
|
|
1590
|
+
/** 日期 `YYYY-MM-DD` */
|
|
1591
|
+
date: string;
|
|
1592
|
+
/** UTC 毫秒时间戳 */
|
|
1593
|
+
timestamp: number;
|
|
1594
|
+
/** 股票仓位占比(%) */
|
|
1595
|
+
position: number;
|
|
1596
|
+
}
|
|
1597
|
+
/** 基金经理信息 */
|
|
1598
|
+
interface FundManager {
|
|
1599
|
+
/** 基金经理 ID */
|
|
1600
|
+
id: string;
|
|
1601
|
+
/** 姓名 */
|
|
1602
|
+
name: string;
|
|
1603
|
+
/** 头像图片 URL;无则为 `null` */
|
|
1604
|
+
avatarUrl: string | null;
|
|
1605
|
+
/** 天天基金星级(0–5);无评级为 `null` */
|
|
1606
|
+
star: number | null;
|
|
1607
|
+
/**
|
|
1608
|
+
* 任职年限描述(东财原文,如 `"14年又192天"`);无则为 `null`。
|
|
1609
|
+
* 上游只提供这段中文描述,不提供可计算的天数/起始日,故原样透传。
|
|
1610
|
+
*/
|
|
1611
|
+
workTime: string | null;
|
|
1612
|
+
/**
|
|
1613
|
+
* 在管基金规模描述(东财原文,如 `"78.91亿(4只基金)"`);无则为 `null`。
|
|
1614
|
+
* 规模与只数被上游拼在同一段字符串里,原样透传不做拆解。
|
|
1615
|
+
*/
|
|
1616
|
+
fundSize: string | null;
|
|
1617
|
+
/**
|
|
1618
|
+
* 基金经理能力评分(综合分 + 各维度雷达),结构同 {@link FundPerformanceEvaluation};
|
|
1619
|
+
* 无评分为 `null`。
|
|
1620
|
+
*/
|
|
1621
|
+
power: FundPerformanceEvaluation | null;
|
|
1622
|
+
}
|
|
1623
|
+
/** 业绩评价 */
|
|
1624
|
+
interface FundPerformanceEvaluation {
|
|
1625
|
+
/** 综合评分 */
|
|
1626
|
+
overall: number;
|
|
1627
|
+
/** 评价维度 */
|
|
1628
|
+
categories: string[];
|
|
1629
|
+
/** 各维度得分 */
|
|
1630
|
+
scores: number[];
|
|
1631
|
+
/** 各维度描述 */
|
|
1632
|
+
descriptions: string[];
|
|
1633
|
+
}
|
|
1634
|
+
/** 持有人结构(单期) */
|
|
1635
|
+
interface FundHolderStructure {
|
|
1636
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1637
|
+
date: string;
|
|
1638
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1639
|
+
timestamp: number | null;
|
|
1640
|
+
/** 机构持有比例(%) */
|
|
1641
|
+
institutionRatio: number;
|
|
1642
|
+
/** 个人持有比例(%) */
|
|
1643
|
+
individualRatio: number;
|
|
1644
|
+
/** 内部持有比例(%) */
|
|
1645
|
+
internalRatio: number;
|
|
1646
|
+
}
|
|
1647
|
+
/** 规模变动(单季度) */
|
|
1648
|
+
interface FundScaleChange {
|
|
1649
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1650
|
+
date: string;
|
|
1651
|
+
/** 基金规模(亿元) */
|
|
1652
|
+
scale: number;
|
|
1653
|
+
/** 环比变动(东财原文,如 `"3.67%"` / `"-1.20%"`,不带前导 `+`) */
|
|
1654
|
+
mom: string;
|
|
1655
|
+
}
|
|
1656
|
+
/** 申购赎回(单季度) */
|
|
1657
|
+
interface FundBuySedemption {
|
|
1658
|
+
/** 报告期 `YYYY-MM-DD` */
|
|
1659
|
+
date: string;
|
|
1660
|
+
/** 报告期 UTC 毫秒时间戳;日期串无法解析时为 `null`(不产出 NaN) */
|
|
1661
|
+
timestamp: number | null;
|
|
1662
|
+
/** 期间申购(亿份) */
|
|
1663
|
+
buy: number;
|
|
1664
|
+
/** 期间赎回(亿份) */
|
|
1665
|
+
sell: number;
|
|
1666
|
+
/** 期末总份额(亿份);上游 series 名为「总份额」 */
|
|
1667
|
+
total: number;
|
|
1668
|
+
}
|
|
1669
|
+
/** 阶段收益率 */
|
|
1670
|
+
interface FundStageReturns {
|
|
1671
|
+
/** 近一月收益率(%) */
|
|
1672
|
+
oneMonth: number | null;
|
|
1673
|
+
/** 近三月收益率(%) */
|
|
1674
|
+
threeMonth: number | null;
|
|
1675
|
+
/** 近六月收益率(%) */
|
|
1676
|
+
sixMonth: number | null;
|
|
1677
|
+
/** 近一年收益率(%) */
|
|
1678
|
+
oneYear: number | null;
|
|
1679
|
+
}
|
|
1680
|
+
/** 同类基金中的一只 */
|
|
1681
|
+
interface FundSameTypePeer {
|
|
1682
|
+
/** 基金代码(纯数字) */
|
|
1683
|
+
code: string;
|
|
1684
|
+
/** 基金简称 */
|
|
1685
|
+
name: string;
|
|
1686
|
+
/**
|
|
1687
|
+
* 东财附带的排序数值(随分组维度而定,通常为某区间收益或净值);
|
|
1688
|
+
* 无法解析为 `null`。
|
|
1689
|
+
*/
|
|
1690
|
+
value: number | null;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* 同类基金(用于「切换同类基金」对比)。
|
|
1694
|
+
*
|
|
1695
|
+
* 上游 `swithSameType` 是一个二维数组:东财按多个维度各取一组同类基金,
|
|
1696
|
+
* 故这里用 `groups`(外层为分组、内层为该组下的基金)如实表达。
|
|
1697
|
+
* 只想要去重后的代码列表可自行 `groups.flat()`。
|
|
1698
|
+
*/
|
|
1699
|
+
interface FundSameType {
|
|
1700
|
+
/** 同类基金分组 */
|
|
1701
|
+
groups: FundSameTypePeer[][];
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* 基金深度资料(pingzhongdata 全量字段,一次请求返回)。
|
|
1705
|
+
*
|
|
1706
|
+
* 数据源:`https://fund.eastmoney.com/pingzhongdata/{code}.js`
|
|
1707
|
+
*/
|
|
1708
|
+
interface FundProfile {
|
|
1709
|
+
/** 基金代码 */
|
|
1710
|
+
code: string;
|
|
1711
|
+
/** 基金简称 */
|
|
1712
|
+
name: string | null;
|
|
1713
|
+
/** 原申购费率(%) */
|
|
1714
|
+
sourceRate: number | null;
|
|
1715
|
+
/** 现申购费率(%) */
|
|
1716
|
+
rate: number | null;
|
|
1717
|
+
/** 最小申购金额(元) */
|
|
1718
|
+
minSubscription: number | null;
|
|
1719
|
+
/** 前十大重仓股 */
|
|
1720
|
+
holdings: FundHolding[];
|
|
1721
|
+
/** 前五大债券持仓 */
|
|
1722
|
+
bondHoldings: FundBondHolding[];
|
|
1723
|
+
/** 资产配置(按季度,最近 4 期) */
|
|
1724
|
+
assetAllocation: FundAssetAllocation[];
|
|
1725
|
+
/** 股票仓位测算(每日,最近约 20 个交易日) */
|
|
1726
|
+
positions: FundPositionPoint[];
|
|
1727
|
+
/** 基金经理列表 */
|
|
1728
|
+
managers: FundManager[];
|
|
1729
|
+
/** 业绩评价 */
|
|
1730
|
+
performance: FundPerformanceEvaluation | null;
|
|
1731
|
+
/** 持有人结构(按报告期) */
|
|
1732
|
+
holderStructure: FundHolderStructure[];
|
|
1733
|
+
/** 规模变动(按季度) */
|
|
1734
|
+
scaleChanges: FundScaleChange[];
|
|
1735
|
+
/** 申购赎回(按季度) */
|
|
1736
|
+
buySedemption: FundBuySedemption[];
|
|
1737
|
+
/** 阶段收益率 */
|
|
1738
|
+
stageReturns: FundStageReturns;
|
|
1739
|
+
/** 同类基金 */
|
|
1740
|
+
sameType: FundSameType | null;
|
|
1741
|
+
}
|
|
1557
1742
|
|
|
1558
1743
|
/**
|
|
1559
1744
|
* 腾讯财经 - 批量操作
|
|
@@ -2212,6 +2397,7 @@ declare class StockSDK {
|
|
|
2212
2397
|
navHistory: (code: string) => Promise<FundNavHistory>;
|
|
2213
2398
|
estimate: (code: string) => Promise<FundEstimate>;
|
|
2214
2399
|
rankHistory: (code: string) => Promise<FundRankHistory>;
|
|
2400
|
+
profile: (code: string) => Promise<FundProfile>;
|
|
2215
2401
|
};
|
|
2216
2402
|
/** 交易日历 / 市场状态 */
|
|
2217
2403
|
get calendar(): {
|
|
@@ -2232,4 +2418,4 @@ declare class StockSDK {
|
|
|
2232
2418
|
search(keyword: string): Promise<SearchResult[]>;
|
|
2233
2419
|
}
|
|
2234
2420
|
|
|
2235
|
-
export { type
|
|
2421
|
+
export { type IndustryBoardSpot as $, type AShareMarket as A, BaseService as B, type ConceptBoardKlineOptions as C, type FundFlowRankOptions as D, type ExternalLink as E, type FundDividendListOptions as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type NorthboundHistoryOptions as J, type BlockTradeDateOptions as K, type DragonTigerDateOptions as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FullQuote as O, type SimpleQuote as P, type FundFlow as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type PanelLargeOrder as V, type HKQuote as W, type USQuote as X, type FundQuote as Y, type Quote as Z, type IndustryBoard as _, RequestClient as a, type FundAssetAllocation as a$, type IndustryBoardConstituent as a0, type IndustryBoardKline as a1, type IndustryBoardMinuteTimeline as a2, type IndustryBoardMinuteKline as a3, type ConceptBoard as a4, type ConceptBoardSpot as a5, type ConceptBoardConstituent as a6, type ConceptBoardKline as a7, type ConceptBoardMinuteTimeline as a8, type ConceptBoardMinuteKline as a9, type NorthboundFlowSummary as aA, type NorthboundHoldingRankItem as aB, type NorthboundHistoryItem as aC, type NorthboundIndividualItem as aD, type ZTPoolType as aE, type ZTPoolItem as aF, type StockChangeType as aG, type StockChangeItem as aH, type BoardChangeItem as aI, type DragonTigerPeriod as aJ, type DragonTigerDetailItem as aK, type DragonTigerStockStatItem as aL, type DragonTigerInstitutionItem as aM, type DragonTigerBranchItem as aN, type DragonTigerSeatItem as aO, type BlockTradeMarketStatItem as aP, type BlockTradeDetailItem as aQ, type BlockTradeDailyStatItem as aR, type MarginAccountItem as aS, type MarginTargetItem as aT, type FundDividendRank as aU, type FundSortDirection as aV, type FundDividend as aW, type FundNavPoint as aX, type FundRankPoint as aY, type FundHolding as aZ, type FundBondHolding as a_, type FuturesExchange as aa, type FuturesKline as ab, type GlobalFuturesQuote as ac, type FuturesInventorySymbol as ad, type FuturesInventory as ae, type ComexInventory as af, type IndexOptionProduct as ag, type OptionTQuote as ah, type OptionTQuoteResult as ai, type OptionKline as aj, type OptionMinute as ak, type ETFOptionMonth as al, type ETFOptionExpireDay as am, type ETFOptionCate as an, type CFFEXOptionQuote as ao, type OptionLHBItem as ap, type SearchResultType as aq, type DividendDetail as ar, type StockFundFlowDaily as as, type FundFlowRankItem as at, type SectorFundFlowItem as au, type MarketFundFlow as av, type NorthboundDirection as aw, type NorthboundMarket as ax, type NorthboundRankPeriod as ay, type NorthboundMinuteItem as az, type FundDividendListResult 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 FundNavHistory as c, type FundEstimate as d, type FundRankHistory as e, type FundProfile as f, type SearchResult as g, type GetAShareCodeListOptions as h, type GetUSCodeListOptions as i, type GetAllUSQuotesOptions as j, type MarketStatus as k, type SupportedMarket as l, type MinuteKlineOptions as m, type HKKlineOptions as n, type HKMinuteKlineOptions as o, type USKlineOptions as p, type USMinuteKlineOptions as q, type IndustryBoardMinuteKlineOptions as r, type ConceptBoardMinuteKlineOptions as s, type FuturesKlineOptions as t, type GlobalFuturesSpotOptions as u, type GlobalFuturesKlineOptions as v, type FuturesInventoryOptions as w, type ComexInventoryOptions as x, type CFFEXOptionQuotesOptions as y, type FundFlowOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stock-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
"test:integration": "RUN_INTEGRATION=1 vitest run",
|
|
17
17
|
"test:integration:smoke": "RUN_INTEGRATION=1 vitest run test/integration/providers/tencent/quote.int.test.ts test/integration/providers/tencent/batch.int.test.ts test/integration/providers/tencent/tradeCalendar.int.test.ts test/integration/sdk/timeout.int.test.ts",
|
|
18
18
|
"test:integration:full": "RUN_INTEGRATION=1 vitest run test/integration",
|
|
19
|
-
"docs:meta": "
|
|
20
|
-
"docs:check": "
|
|
21
|
-
"dev
|
|
22
|
-
"preview
|
|
23
|
-
"build:
|
|
24
|
-
"build:
|
|
19
|
+
"docs:meta": "pnpm build && node ./scripts/generate-doc-meta.js && pnpm gen:llms",
|
|
20
|
+
"docs:check": "pnpm docs:meta && node ./scripts/check-doc-consistency.js",
|
|
21
|
+
"dev": "vitepress dev website",
|
|
22
|
+
"preview": "vitepress preview website",
|
|
23
|
+
"build:docs": "pnpm docs:meta && DOCS_BASE=/ vitepress build website",
|
|
24
|
+
"build:pages": "pnpm docs:meta && DOCS_BASE=/stock-sdk/ vitepress build website",
|
|
25
|
+
"gen:llms": "tsx ./scripts/generate-llms.ts",
|
|
25
26
|
"prepare": "node ./scripts/install-git-hooks.js"
|
|
26
27
|
},
|
|
27
28
|
"exports": {
|
|
@@ -36,32 +37,74 @@
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
"./indicators": {
|
|
39
|
-
"import": {
|
|
40
|
-
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/indicators.d.ts",
|
|
42
|
+
"default": "./dist/indicators.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/indicators.d.cts",
|
|
46
|
+
"default": "./dist/indicators.cjs"
|
|
47
|
+
}
|
|
41
48
|
},
|
|
42
49
|
"./symbols": {
|
|
43
|
-
"import": {
|
|
44
|
-
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/symbols.d.ts",
|
|
52
|
+
"default": "./dist/symbols.js"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/symbols.d.cts",
|
|
56
|
+
"default": "./dist/symbols.cjs"
|
|
57
|
+
}
|
|
45
58
|
},
|
|
46
59
|
"./signals": {
|
|
47
|
-
"import": {
|
|
48
|
-
|
|
60
|
+
"import": {
|
|
61
|
+
"types": "./dist/signals.d.ts",
|
|
62
|
+
"default": "./dist/signals.js"
|
|
63
|
+
},
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./dist/signals.d.cts",
|
|
66
|
+
"default": "./dist/signals.cjs"
|
|
67
|
+
}
|
|
49
68
|
},
|
|
50
69
|
"./screener": {
|
|
51
|
-
"import": {
|
|
52
|
-
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/screener.d.ts",
|
|
72
|
+
"default": "./dist/screener.js"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/screener.d.cts",
|
|
76
|
+
"default": "./dist/screener.cjs"
|
|
77
|
+
}
|
|
53
78
|
},
|
|
54
79
|
"./cache": {
|
|
55
|
-
"import": {
|
|
56
|
-
|
|
80
|
+
"import": {
|
|
81
|
+
"types": "./dist/cache.d.ts",
|
|
82
|
+
"default": "./dist/cache.js"
|
|
83
|
+
},
|
|
84
|
+
"require": {
|
|
85
|
+
"types": "./dist/cache.d.cts",
|
|
86
|
+
"default": "./dist/cache.cjs"
|
|
87
|
+
}
|
|
57
88
|
},
|
|
58
89
|
"./errors": {
|
|
59
|
-
"import": {
|
|
60
|
-
|
|
90
|
+
"import": {
|
|
91
|
+
"types": "./dist/errors.d.ts",
|
|
92
|
+
"default": "./dist/errors.js"
|
|
93
|
+
},
|
|
94
|
+
"require": {
|
|
95
|
+
"types": "./dist/errors.d.cts",
|
|
96
|
+
"default": "./dist/errors.cjs"
|
|
97
|
+
}
|
|
61
98
|
},
|
|
62
99
|
"./mcp": {
|
|
63
|
-
"import": {
|
|
64
|
-
|
|
100
|
+
"import": {
|
|
101
|
+
"types": "./dist/mcp.d.ts",
|
|
102
|
+
"default": "./dist/mcp.js"
|
|
103
|
+
},
|
|
104
|
+
"require": {
|
|
105
|
+
"types": "./dist/mcp.d.cts",
|
|
106
|
+
"default": "./dist/mcp.cjs"
|
|
107
|
+
}
|
|
65
108
|
},
|
|
66
109
|
"./package.json": "./package.json"
|
|
67
110
|
},
|
|
@@ -110,7 +153,9 @@
|
|
|
110
153
|
"@vitest/coverage-v8": "^4.0.16",
|
|
111
154
|
"msw": "^2.10.4",
|
|
112
155
|
"playwright": "^1.58.2",
|
|
156
|
+
"shiki": "^2.5.0",
|
|
113
157
|
"tsup": "^8.3.5",
|
|
158
|
+
"tsx": "^4.22.4",
|
|
114
159
|
"typescript": "^5.9.3",
|
|
115
160
|
"vitepress": "^1.6.4",
|
|
116
161
|
"vitest": "^4.0.15",
|
|
@@ -120,5 +165,5 @@
|
|
|
120
165
|
"registry": "https://registry.npmjs.org/",
|
|
121
166
|
"provenance": true
|
|
122
167
|
},
|
|
123
|
-
"packageManager": "
|
|
168
|
+
"packageManager": "pnpm@10.34.4"
|
|
124
169
|
}
|