@dshtrading/api 0.2.1 → 0.4.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/lib/index.d.ts +83 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -616,6 +616,10 @@ declare module '@deepseek-ai/cordis' {
|
|
|
616
616
|
tradingCnMarketData: MarketDataService;
|
|
617
617
|
/** hk 市场行情服务(由腾讯连接器同包双实例提供,config.market 分流;cn+hk 切片 2026-08-31 补齐)。 */
|
|
618
618
|
tradingHkMarketData: MarketDataService;
|
|
619
|
+
/** futures 市场行情服务(由同花顺期货连接器提供,issue #97;日K + 当日分时聚合)。 */
|
|
620
|
+
tradingFuturesMarketData: MarketDataService;
|
|
621
|
+
/** 全球品种行情(global 市场:大宗/外汇/海外指数;@dshtrading/connector-jin10 dataplane 行提供)。 */
|
|
622
|
+
tradingGlobalMarketData: MarketDataService;
|
|
619
623
|
/**
|
|
620
624
|
* crypto 市场交易服务(R3 2026-08-29 补齐,crypto 市场第一个真实 TradeService):
|
|
621
625
|
* 由 connector-okx 实现(签名 demo/live 下单),与 connector-binance 经
|
|
@@ -646,6 +650,10 @@ declare module '@deepseek-ai/cordis' {
|
|
|
646
650
|
* 各市场 Kit apply 时注册 aggregateNews 纯函数,GUI 行情桥按市场获取。
|
|
647
651
|
*/
|
|
648
652
|
tradingNewsRegistry: TradingNewsRegistry;
|
|
653
|
+
/** 跨市场快讯源(@dshtrading/connector-jin10 提供;缺席 = 未安装快讯连接器)。 */
|
|
654
|
+
tradingFlashFeed: FlashFeedService;
|
|
655
|
+
/** 宏观/利率源(@dshtrading/connector-jin10 提供;缺席 = 未安装金十连接器)。 */
|
|
656
|
+
tradingMacroFeed: MacroFeedService;
|
|
649
657
|
}
|
|
650
658
|
}
|
|
651
659
|
/**
|
|
@@ -721,6 +729,8 @@ interface NewsItem {
|
|
|
721
729
|
readonly publishedAt: string;
|
|
722
730
|
/** 关联标的代码(可选,格式随源不同)。 */
|
|
723
731
|
readonly relatedCodes?: readonly string[];
|
|
732
|
+
/** 热度等级(可选;金十快讯网页版 火/热/沸/爆,其他源不填)。 */
|
|
733
|
+
readonly hot?: string;
|
|
724
734
|
}
|
|
725
735
|
/** 新闻聚合请求选项。 */
|
|
726
736
|
interface AggregateNewsOptions {
|
|
@@ -732,6 +742,11 @@ interface AggregateNewsOptions {
|
|
|
732
742
|
symbol?: string | undefined;
|
|
733
743
|
/** CryptoPanic API token(仅 crypto 市场使用,可选)。 */
|
|
734
744
|
cryptoPanicKey?: string | undefined;
|
|
745
|
+
/**
|
|
746
|
+
* 启用的新闻/公告源 id 列表(issue #96 源配置化;各 kit 的 NewsSource 词汇)。
|
|
747
|
+
* 缺省 = 该市场全部默认源;空数组 = 显式关闭(返回空结果)。
|
|
748
|
+
*/
|
|
749
|
+
sources?: readonly string[] | undefined;
|
|
735
750
|
}
|
|
736
751
|
/** 新闻聚合结果。 */
|
|
737
752
|
interface AggregateNewsResult {
|
|
@@ -742,6 +757,73 @@ interface AggregateNewsResult {
|
|
|
742
757
|
}
|
|
743
758
|
/** 新闻聚合器函数签名(各 Kit 导出的 aggregateNews 符合此形状)。 */
|
|
744
759
|
type NewsAggregator = (options?: AggregateNewsOptions) => Promise<AggregateNewsResult>;
|
|
760
|
+
/**
|
|
761
|
+
* 跨市场快讯源契约(2026-09-13 金十接入):host 平面由快讯连接器 provide
|
|
762
|
+
* tradingFlashFeed,GUI 快讯面板(桥 /dshtrading/api/flash)与 agent 快讯工具
|
|
763
|
+
* 共用同一取数实现;服务缺席 = 未安装/未启用该数据源 → 消费方报
|
|
764
|
+
* TRADING_NOT_IMPLEMENTED,绝不把「没有数据源」伪装成「没有快讯」。
|
|
765
|
+
*/
|
|
766
|
+
interface FlashFeedService {
|
|
767
|
+
/**
|
|
768
|
+
* 最新快讯流(cursor 翻页);条目只含元数据(标题/时间/链接)。
|
|
769
|
+
* `hot` 非空时按热度等级服务端过滤(金十网页版 火/热/沸/爆)。
|
|
770
|
+
*/
|
|
771
|
+
listFlash(options?: {
|
|
772
|
+
cursor?: string | undefined;
|
|
773
|
+
limit?: number | undefined;
|
|
774
|
+
hot?: readonly string[] | undefined;
|
|
775
|
+
}): Promise<{
|
|
776
|
+
readonly items: readonly NewsItem[];
|
|
777
|
+
readonly nextCursor?: string | undefined;
|
|
778
|
+
readonly hasMore: boolean;
|
|
779
|
+
}>;
|
|
780
|
+
/** 关键词搜快讯(上游一次性返回、不支持翻页)。 */
|
|
781
|
+
searchFlash(keyword: string, limit?: number | undefined): Promise<readonly NewsItem[]>;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* 宏观经济日历条目(金十当周经济数据,2026-09-15):数值均为上游快照原样字符串,
|
|
785
|
+
* `actual` 缺省 = 未公布。
|
|
786
|
+
*/
|
|
787
|
+
interface MacroCalendarEntry {
|
|
788
|
+
/** ISO 8601 公布时间(东八区解释,同 NewsItem 口径)。 */
|
|
789
|
+
readonly publishedAt: string;
|
|
790
|
+
/** 重要度(上游 star,0–5)。 */
|
|
791
|
+
readonly star: number;
|
|
792
|
+
/** 地区(标题前缀推断,如 美国/日本/中国;未识别 = 空串)。 */
|
|
793
|
+
readonly region: string;
|
|
794
|
+
readonly title: string;
|
|
795
|
+
readonly previous?: string;
|
|
796
|
+
readonly consensus?: string;
|
|
797
|
+
readonly actual?: string;
|
|
798
|
+
readonly revised?: string;
|
|
799
|
+
/** 上游公布影响词(利多/利空/影响较小…;原样透传)。 */
|
|
800
|
+
readonly affect?: string;
|
|
801
|
+
}
|
|
802
|
+
/** 央行最新利率条目(金十网页版,2026-09-15)。 */
|
|
803
|
+
interface MacroRateEntry {
|
|
804
|
+
/** 地区(flag 名推断,如 美国/日本/中国;未识别 = 空串)。 */
|
|
805
|
+
readonly region: string;
|
|
806
|
+
readonly bankName: string;
|
|
807
|
+
/** 最新利率(上游原样字符串,如 "3.75"/"0")。 */
|
|
808
|
+
readonly rate: string;
|
|
809
|
+
/** 公布日(上游原样 YYYY-MM-DD)。 */
|
|
810
|
+
readonly publishedAt: string;
|
|
811
|
+
/** 所属指标名(如「美联储利率决定(上限)」;部分央行缺省)。 */
|
|
812
|
+
readonly indicatorName?: string;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* 宏观/利率源契约(2026-09-15 金十接入):host 平面由金十连接器 provide
|
|
816
|
+
* tradingMacroFeed,GUI 宏观面板(桥 /dshtrading/api/macro/*)消费;服务缺席 =
|
|
817
|
+
* 未安装/未启用该数据源 → 消费方报 TRADING_NOT_IMPLEMENTED,绝不把「没有数据源」
|
|
818
|
+
* 伪装成「没有数据」。日历走官方 MCP(list_calendar),利率走网页版公开接口
|
|
819
|
+
* (spikes/impl-jin10-macro-rates/EVIDENCE.md)。
|
|
820
|
+
*/
|
|
821
|
+
interface MacroFeedService {
|
|
822
|
+
/** 当周经济日历(周一~周日,北京时间;limit 截尾,缺省全周)。 */
|
|
823
|
+
listCalendar(limit?: number | undefined): Promise<readonly MacroCalendarEntry[]>;
|
|
824
|
+
/** 央行最新利率(全量,客户端按地区过滤)。 */
|
|
825
|
+
listRates(): Promise<readonly MacroRateEntry[]>;
|
|
826
|
+
}
|
|
745
827
|
/** 新闻聚合器注册表契约(Issue #37,router 插件提供)。 */
|
|
746
828
|
interface TradingNewsRegistry {
|
|
747
829
|
register(market: string, aggregator: NewsAggregator): () => void;
|
|
@@ -749,4 +831,4 @@ interface TradingNewsRegistry {
|
|
|
749
831
|
markets(): string[];
|
|
750
832
|
}
|
|
751
833
|
//#endregion
|
|
752
|
-
export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, AuctionSnapshot, BuybackItem, CompanyProfile, CryptoFundamentals, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, DividendItem, DragonTigerItem, FinancialCell, FinancialIndicatorRow, FinancialReportGroup, FinancialReportMatrix, ForecastSummary, FundamentalsPackage, HolderNumSummary, IAccount, InsiderTradeItem, InstitutionalHoldingItem, Interval, Kline, LimitUpPoolItem, MainOperationSegment, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, OperatingEfficiency, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, ResearchReportItem, ShareholderItem, SplitItem, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingError, TradingErrorCode, TradingNewsRegistry };
|
|
834
|
+
export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, AuctionSnapshot, BuybackItem, CompanyProfile, CryptoFundamentals, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, DividendItem, DragonTigerItem, FinancialCell, FinancialIndicatorRow, FinancialReportGroup, FinancialReportMatrix, FlashFeedService, ForecastSummary, FundamentalsPackage, HolderNumSummary, IAccount, InsiderTradeItem, InstitutionalHoldingItem, Interval, Kline, LimitUpPoolItem, MacroCalendarEntry, MacroFeedService, MacroRateEntry, MainOperationSegment, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, OperatingEfficiency, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, ResearchReportItem, ShareholderItem, SplitItem, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingError, TradingErrorCode, TradingNewsRegistry };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dshtrading/api",
|
|
3
3
|
"description": "Pure TypeScript contracts for dsh-trading: market-data/trade service interfaces, domain types, and the shared error vocabulary",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|