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/dist/mcp.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StockSDK, R as RequestClientOptions } from './sdk-Cg_jTmTk.cjs';
1
+ import { S as StockSDK, R as RequestClientOptions } from './sdk-CA1tOtb2.cjs';
2
2
  import './addIndicators-DwEr9RKK.cjs';
3
3
  import './index-mlzPfoON.cjs';
4
4
 
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StockSDK, R as RequestClientOptions } from './sdk-DOz03n_v.js';
1
+ import { S as StockSDK, R as RequestClientOptions } from './sdk-B-hkKcZs.js';
2
2
  import './addIndicators-DwEr9RKK.js';
3
3
  import './index-mlzPfoON.js';
4
4
 
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-GBHWMR2O.js";import{t as M}from"./chunk-4PVVFEOQ.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.0.0-beta.1"},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(" ")+`
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 IndustryBoardConstituent as $, type AShareMarket as A, BaseService as B, type ConceptBoardKlineOptions as C, type NorthboundHistoryOptions as D, type ExternalLink as E, type FundDividendListOptions as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type BlockTradeDateOptions as J, type DragonTigerDateOptions as K, type FullQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type SimpleQuote as O, type FundFlow as P, type PanelLargeOrder as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type HKQuote as V, type USQuote as W, type FundQuote as X, type Quote as Y, type IndustryBoard as Z, type IndustryBoardSpot as _, RequestClient as a, type IndustryBoardKline as a0, type IndustryBoardMinuteTimeline as a1, type IndustryBoardMinuteKline as a2, type ConceptBoard as a3, type ConceptBoardSpot as a4, type ConceptBoardConstituent as a5, type ConceptBoardKline as a6, type ConceptBoardMinuteTimeline as a7, type ConceptBoardMinuteKline as a8, type FuturesExchange as a9, type NorthboundHoldingRankItem as aA, type NorthboundHistoryItem as aB, type NorthboundIndividualItem as aC, type ZTPoolType as aD, type ZTPoolItem as aE, type StockChangeType as aF, type StockChangeItem as aG, type BoardChangeItem as aH, type DragonTigerPeriod as aI, type DragonTigerDetailItem as aJ, type DragonTigerStockStatItem as aK, type DragonTigerInstitutionItem as aL, type DragonTigerBranchItem as aM, type DragonTigerSeatItem as aN, type BlockTradeMarketStatItem as aO, type BlockTradeDetailItem as aP, type BlockTradeDailyStatItem as aQ, type MarginAccountItem as aR, type MarginTargetItem as aS, type FundDividendRank as aT, type FundSortDirection as aU, type FundDividend as aV, type FundNavPoint as aW, type FundRankPoint as aX, type FuturesKline as aa, type GlobalFuturesQuote as ab, type FuturesInventorySymbol as ac, type FuturesInventory as ad, type ComexInventory as ae, type IndexOptionProduct as af, type OptionTQuote as ag, type OptionTQuoteResult as ah, type OptionKline as ai, type OptionMinute as aj, type ETFOptionMonth as ak, type ETFOptionExpireDay as al, type ETFOptionCate as am, type CFFEXOptionQuote as an, type OptionLHBItem as ao, type SearchResultType as ap, type DividendDetail as aq, type StockFundFlowDaily as ar, type FundFlowRankItem as as, type SectorFundFlowItem as at, type MarketFundFlow as au, type NorthboundDirection as av, type NorthboundMarket as aw, type NorthboundRankPeriod as ax, type NorthboundMinuteItem as ay, type NorthboundFlowSummary as az, type FundDividendListResult as b, type FundNavHistory as c, type FundEstimate as d, type FundRankHistory as e, type SearchResult as f, type GetAShareCodeListOptions as g, type GetUSCodeListOptions as h, type GetAllUSQuotesOptions as i, type MarketStatus as j, type SupportedMarket as k, type MinuteKlineOptions as l, type HKKlineOptions as m, type HKMinuteKlineOptions as n, type USKlineOptions as o, type USMinuteKlineOptions as p, type IndustryBoardMinuteKlineOptions as q, type ConceptBoardMinuteKlineOptions as r, type FuturesKlineOptions as s, type GlobalFuturesSpotOptions as t, type GlobalFuturesKlineOptions as u, type FuturesInventoryOptions as v, type ComexInventoryOptions as w, type CFFEXOptionQuotesOptions as x, type FundFlowOptions as y, type FundFlowRankOptions as z };
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 IndustryBoardConstituent as $, type AShareMarket as A, BaseService as B, type ConceptBoardKlineOptions as C, type NorthboundHistoryOptions as D, type ExternalLink as E, type FundDividendListOptions as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type BlockTradeDateOptions as J, type DragonTigerDateOptions as K, type FullQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type SimpleQuote as O, type FundFlow as P, type PanelLargeOrder as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type HKQuote as V, type USQuote as W, type FundQuote as X, type Quote as Y, type IndustryBoard as Z, type IndustryBoardSpot as _, RequestClient as a, type IndustryBoardKline as a0, type IndustryBoardMinuteTimeline as a1, type IndustryBoardMinuteKline as a2, type ConceptBoard as a3, type ConceptBoardSpot as a4, type ConceptBoardConstituent as a5, type ConceptBoardKline as a6, type ConceptBoardMinuteTimeline as a7, type ConceptBoardMinuteKline as a8, type FuturesExchange as a9, type NorthboundHoldingRankItem as aA, type NorthboundHistoryItem as aB, type NorthboundIndividualItem as aC, type ZTPoolType as aD, type ZTPoolItem as aE, type StockChangeType as aF, type StockChangeItem as aG, type BoardChangeItem as aH, type DragonTigerPeriod as aI, type DragonTigerDetailItem as aJ, type DragonTigerStockStatItem as aK, type DragonTigerInstitutionItem as aL, type DragonTigerBranchItem as aM, type DragonTigerSeatItem as aN, type BlockTradeMarketStatItem as aO, type BlockTradeDetailItem as aP, type BlockTradeDailyStatItem as aQ, type MarginAccountItem as aR, type MarginTargetItem as aS, type FundDividendRank as aT, type FundSortDirection as aU, type FundDividend as aV, type FundNavPoint as aW, type FundRankPoint as aX, type FuturesKline as aa, type GlobalFuturesQuote as ab, type FuturesInventorySymbol as ac, type FuturesInventory as ad, type ComexInventory as ae, type IndexOptionProduct as af, type OptionTQuote as ag, type OptionTQuoteResult as ah, type OptionKline as ai, type OptionMinute as aj, type ETFOptionMonth as ak, type ETFOptionExpireDay as al, type ETFOptionCate as am, type CFFEXOptionQuote as an, type OptionLHBItem as ao, type SearchResultType as ap, type DividendDetail as aq, type StockFundFlowDaily as ar, type FundFlowRankItem as as, type SectorFundFlowItem as at, type MarketFundFlow as au, type NorthboundDirection as av, type NorthboundMarket as aw, type NorthboundRankPeriod as ax, type NorthboundMinuteItem as ay, type NorthboundFlowSummary as az, type FundDividendListResult as b, type FundNavHistory as c, type FundEstimate as d, type FundRankHistory as e, type SearchResult as f, type GetAShareCodeListOptions as g, type GetUSCodeListOptions as h, type GetAllUSQuotesOptions as i, type MarketStatus as j, type SupportedMarket as k, type MinuteKlineOptions as l, type HKKlineOptions as m, type HKMinuteKlineOptions as n, type USKlineOptions as o, type USMinuteKlineOptions as p, type IndustryBoardMinuteKlineOptions as q, type ConceptBoardMinuteKlineOptions as r, type FuturesKlineOptions as s, type GlobalFuturesSpotOptions as t, type GlobalFuturesKlineOptions as u, type FuturesInventoryOptions as v, type ComexInventoryOptions as w, type CFFEXOptionQuotesOptions as x, type FundFlowOptions as y, type FundFlowRankOptions as z };
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.0.0-beta.1",
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": "yarn build && node ./scripts/generate-doc-meta.js",
20
- "docs:check": "DOCS_DIR=site-v2 yarn docs:meta && DOCS_DIR=site-v2 node ./scripts/check-doc-consistency.js",
21
- "dev:v2": "vitepress dev site-v2",
22
- "preview:v2": "vitepress preview site-v2",
23
- "build:v2": "DOCS_DIR=site-v2 yarn docs:meta && DOCS_BASE=/ vitepress build site-v2",
24
- "build:v2:pages": "DOCS_DIR=site-v2 yarn docs:meta && DOCS_BASE=/stock-sdk/ vitepress build site-v2",
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": { "types": "./dist/indicators.d.ts", "default": "./dist/indicators.js" },
40
- "require": { "types": "./dist/indicators.d.cts", "default": "./dist/indicators.cjs" }
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": { "types": "./dist/symbols.d.ts", "default": "./dist/symbols.js" },
44
- "require": { "types": "./dist/symbols.d.cts", "default": "./dist/symbols.cjs" }
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": { "types": "./dist/signals.d.ts", "default": "./dist/signals.js" },
48
- "require": { "types": "./dist/signals.d.cts", "default": "./dist/signals.cjs" }
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": { "types": "./dist/screener.d.ts", "default": "./dist/screener.js" },
52
- "require": { "types": "./dist/screener.d.cts", "default": "./dist/screener.cjs" }
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": { "types": "./dist/cache.d.ts", "default": "./dist/cache.js" },
56
- "require": { "types": "./dist/cache.d.cts", "default": "./dist/cache.cjs" }
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": { "types": "./dist/errors.d.ts", "default": "./dist/errors.js" },
60
- "require": { "types": "./dist/errors.d.cts", "default": "./dist/errors.cjs" }
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": { "types": "./dist/mcp.d.ts", "default": "./dist/mcp.js" },
64
- "require": { "types": "./dist/mcp.d.cts", "default": "./dist/mcp.cjs" }
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": "yarn@1.22.22"
168
+ "packageManager": "pnpm@10.34.4"
124
169
  }