stock-sdk 1.8.3 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -989,6 +989,15 @@ interface SearchResult {
989
989
  */
990
990
  category?: SearchResultType;
991
991
  }
992
+ /**
993
+ * 外部财经站点链接
994
+ */
995
+ interface ExternalLink {
996
+ /** 站点名称 */
997
+ name: string;
998
+ /** 可直接打开的 URL */
999
+ url: string;
1000
+ }
992
1001
  /**
993
1002
  * 分红派送详情
994
1003
  */
@@ -1017,6 +1026,646 @@ interface DividendDetail {
1017
1026
  noticeDate: string | null;
1018
1027
  }
1019
1028
 
1029
+ /**
1030
+ * 资金流向相关数据类型
1031
+ */
1032
+ /**
1033
+ * 个股资金流(日/周/月线)
1034
+ */
1035
+ interface StockFundFlowDaily {
1036
+ /** 日期 YYYY-MM-DD */
1037
+ date: string;
1038
+ /** 收盘价 */
1039
+ close: number | null;
1040
+ /** 涨跌幅(%) */
1041
+ changePercent: number | null;
1042
+ /** 主力净流入-净额(元) */
1043
+ mainNetInflow: number | null;
1044
+ /** 主力净流入-净占比(%) */
1045
+ mainNetInflowPercent: number | null;
1046
+ /** 超大单净流入-净额(元) */
1047
+ superLargeNetInflow: number | null;
1048
+ /** 超大单净流入-净占比(%) */
1049
+ superLargeNetInflowPercent: number | null;
1050
+ /** 大单净流入-净额(元) */
1051
+ largeNetInflow: number | null;
1052
+ /** 大单净流入-净占比(%) */
1053
+ largeNetInflowPercent: number | null;
1054
+ /** 中单净流入-净额(元) */
1055
+ mediumNetInflow: number | null;
1056
+ /** 中单净流入-净占比(%) */
1057
+ mediumNetInflowPercent: number | null;
1058
+ /** 小单净流入-净额(元) */
1059
+ smallNetInflow: number | null;
1060
+ /** 小单净流入-净占比(%) */
1061
+ smallNetInflowPercent: number | null;
1062
+ }
1063
+ /**
1064
+ * 个股资金流排名项(多维度统一结构,按排序周期返回相应周期数据)
1065
+ */
1066
+ interface FundFlowRankItem {
1067
+ /** 股票代码 */
1068
+ code: string;
1069
+ /** 股票名称 */
1070
+ name: string;
1071
+ /** 最新价 */
1072
+ price: number | null;
1073
+ /** 涨跌幅(%)(对应排序周期,例如 5 日则为 5 日涨跌幅) */
1074
+ changePercent: number | null;
1075
+ /** 主力净流入-净额(元) */
1076
+ mainNetInflow: number | null;
1077
+ /** 主力净流入-净占比(%) */
1078
+ mainNetInflowPercent: number | null;
1079
+ /** 超大单净流入-净额(元) */
1080
+ superLargeNetInflow: number | null;
1081
+ /** 超大单净流入-净占比(%) */
1082
+ superLargeNetInflowPercent: number | null;
1083
+ /** 大单净流入-净额(元) */
1084
+ largeNetInflow: number | null;
1085
+ /** 大单净流入-净占比(%) */
1086
+ largeNetInflowPercent: number | null;
1087
+ /** 中单净流入-净额(元) */
1088
+ mediumNetInflow: number | null;
1089
+ /** 中单净流入-净占比(%) */
1090
+ mediumNetInflowPercent: number | null;
1091
+ /** 小单净流入-净额(元) */
1092
+ smallNetInflow: number | null;
1093
+ /** 小单净流入-净占比(%) */
1094
+ smallNetInflowPercent: number | null;
1095
+ }
1096
+ /**
1097
+ * 板块资金流排名项
1098
+ */
1099
+ interface SectorFundFlowItem {
1100
+ /** 板块代码(东方财富 BK 编号) */
1101
+ code: string;
1102
+ /** 板块名称 */
1103
+ name: string;
1104
+ /** 涨跌幅(%) */
1105
+ changePercent: number | null;
1106
+ /** 主力净流入-净额(元) */
1107
+ mainNetInflow: number | null;
1108
+ /** 主力净流入-净占比(%) */
1109
+ mainNetInflowPercent: number | null;
1110
+ /** 超大单净流入-净额(元) */
1111
+ superLargeNetInflow: number | null;
1112
+ /** 大单净流入-净额(元) */
1113
+ largeNetInflow: number | null;
1114
+ /** 中单净流入-净额(元) */
1115
+ mediumNetInflow: number | null;
1116
+ /** 小单净流入-净额(元) */
1117
+ smallNetInflow: number | null;
1118
+ /** 主力净流入最大股名称 */
1119
+ topStockName?: string;
1120
+ /** 主力净流入最大股代码 */
1121
+ topStockCode?: string;
1122
+ }
1123
+ /**
1124
+ * 大盘资金流(按日)
1125
+ */
1126
+ interface MarketFundFlow {
1127
+ /** 日期 YYYY-MM-DD */
1128
+ date: string;
1129
+ /** 上证指数收盘价 */
1130
+ shClose: number | null;
1131
+ /** 上证指数涨跌幅(%) */
1132
+ shChangePercent: number | null;
1133
+ /** 深证指数收盘价 */
1134
+ szClose: number | null;
1135
+ /** 深证指数涨跌幅(%) */
1136
+ szChangePercent: number | null;
1137
+ /** 主力净流入-净额(元) */
1138
+ mainNetInflow: number | null;
1139
+ /** 主力净流入-净占比(%) */
1140
+ mainNetInflowPercent: number | null;
1141
+ /** 超大单净流入-净额(元) */
1142
+ superLargeNetInflow: number | null;
1143
+ /** 超大单净流入-净占比(%) */
1144
+ superLargeNetInflowPercent: number | null;
1145
+ /** 大单净流入-净额(元) */
1146
+ largeNetInflow: number | null;
1147
+ /** 大单净流入-净占比(%) */
1148
+ largeNetInflowPercent: number | null;
1149
+ /** 中单净流入-净额(元) */
1150
+ mediumNetInflow: number | null;
1151
+ /** 中单净流入-净占比(%) */
1152
+ mediumNetInflowPercent: number | null;
1153
+ /** 小单净流入-净额(元) */
1154
+ smallNetInflow: number | null;
1155
+ /** 小单净流入-净占比(%) */
1156
+ smallNetInflowPercent: number | null;
1157
+ }
1158
+
1159
+ /**
1160
+ * 沪深港通 / 北向资金 数据类型
1161
+ */
1162
+ /** 资金方向 */
1163
+ type NorthboundDirection = 'north' | 'south';
1164
+ /** 北向持股市场 */
1165
+ type NorthboundMarket = 'all' | 'shanghai' | 'shenzhen';
1166
+ /** 北向持股排行查询周期 */
1167
+ type NorthboundRankPeriod = 'today' | '3day' | '5day' | '10day' | 'month' | 'quarter' | 'year';
1168
+ /**
1169
+ * 北向 / 南向资金分时数据
1170
+ */
1171
+ interface NorthboundMinuteItem {
1172
+ /** 日期 YYYY-MM-DD */
1173
+ date: string;
1174
+ /** 时间 HH:MM */
1175
+ time: string;
1176
+ /** 沪股通 / 港股通(沪) 净流入(万元) */
1177
+ shanghaiNetInflow: number | null;
1178
+ /** 深股通 / 港股通(深) 净流入(万元) */
1179
+ shenzhenNetInflow: number | null;
1180
+ /** 合计净流入(万元) */
1181
+ totalNetInflow: number | null;
1182
+ }
1183
+ /**
1184
+ * 沪深港通市场资金流向汇总(datacenter RPT_MUTUAL_QUOTA)
1185
+ */
1186
+ interface NorthboundFlowSummary {
1187
+ /** 交易日 YYYY-MM-DD */
1188
+ date: string;
1189
+ /** 类型编号 */
1190
+ type: string;
1191
+ /** 板块名称(如「沪股通」「港股通(沪)」) */
1192
+ boardName: string;
1193
+ /** 资金方向(如「北向资金」「南向资金」) */
1194
+ direction: string;
1195
+ /** 交易状态 */
1196
+ status: string;
1197
+ /** 成交净买额(元,原始接口单位) */
1198
+ netBuyAmount: number | null;
1199
+ /** 资金净流入(元) */
1200
+ netInflow: number | null;
1201
+ /** 当日资金余额(元) */
1202
+ remainAmount: number | null;
1203
+ /** 上涨数 */
1204
+ upCount: number | null;
1205
+ /** 持平数 */
1206
+ flatCount: number | null;
1207
+ /** 下跌数 */
1208
+ downCount: number | null;
1209
+ /** 相关指数代码 */
1210
+ indexCode: string;
1211
+ /** 相关指数名称 */
1212
+ indexName: string;
1213
+ /** 指数涨跌幅(%) */
1214
+ indexChangePercent: number | null;
1215
+ }
1216
+ /**
1217
+ * 北向 / 沪股通 / 深股通持股个股排行项
1218
+ */
1219
+ interface NorthboundHoldingRankItem {
1220
+ /** 日期 YYYY-MM-DD */
1221
+ date: string;
1222
+ /** 股票代码 */
1223
+ code: string;
1224
+ /** 股票名称 */
1225
+ name: string;
1226
+ /** 今日收盘价 */
1227
+ close: number | null;
1228
+ /** 今日涨跌幅(%) */
1229
+ changePercent: number | null;
1230
+ /** 今日持股股数 */
1231
+ holdShares: number | null;
1232
+ /** 今日持股市值(元) */
1233
+ holdMarketValue: number | null;
1234
+ /** 持股占流通股比(%) */
1235
+ holdRatioFloat: number | null;
1236
+ /** 持股占总股本比(%) */
1237
+ holdRatioTotal: number | null;
1238
+ /** 区间增持估计股数 */
1239
+ addShares: number | null;
1240
+ /** 区间增持估计市值(元) */
1241
+ addMarketValue: number | null;
1242
+ /** 区间增持估计市值增幅(%) */
1243
+ addMarketValuePercent: number | null;
1244
+ /** 所属板块 */
1245
+ sector: string;
1246
+ }
1247
+ /**
1248
+ * 北向资金历史项(按日)
1249
+ */
1250
+ interface NorthboundHistoryItem {
1251
+ /** 日期 YYYY-MM-DD */
1252
+ date: string;
1253
+ /** 成交净买额(元) */
1254
+ netBuyAmount: number | null;
1255
+ /** 买入成交额(元) */
1256
+ buyAmount: number | null;
1257
+ /** 卖出成交额(元) */
1258
+ sellAmount: number | null;
1259
+ /** 历史累计净买额(元) */
1260
+ accNetBuyAmount: number | null;
1261
+ /** 当日资金流入(元) */
1262
+ netInflow: number | null;
1263
+ /** 当日资金余额(元) */
1264
+ remainAmount: number | null;
1265
+ /** 领涨股代码 */
1266
+ topStockCode: string | null;
1267
+ /** 领涨股名称 */
1268
+ topStockName: string | null;
1269
+ /** 领涨股涨跌幅(%) */
1270
+ topStockChangePercent: number | null;
1271
+ }
1272
+ /**
1273
+ * 个股北向持仓历史项
1274
+ */
1275
+ interface NorthboundIndividualItem {
1276
+ /** 日期 YYYY-MM-DD */
1277
+ date: string;
1278
+ /** 持股数量 */
1279
+ holdShares: number | null;
1280
+ /** 持股市值(元) */
1281
+ holdMarketValue: number | null;
1282
+ /** 持股占流通股比(%) */
1283
+ holdRatioFloat: number | null;
1284
+ /** 持股占总股本比(%) */
1285
+ holdRatioTotal: number | null;
1286
+ /** 收盘价 */
1287
+ close: number | null;
1288
+ /** 涨跌幅(%) */
1289
+ changePercent: number | null;
1290
+ }
1291
+
1292
+ /**
1293
+ * 涨停板 / 盘口异动 数据类型
1294
+ */
1295
+ /** 涨停股池类型 */
1296
+ type ZTPoolType = 'zt' | 'yesterday' | 'strong' | 'sub_new' | 'broken' | 'dt';
1297
+ /**
1298
+ * 涨停股池项(统一字段,部分类型某些字段为空)
1299
+ */
1300
+ interface ZTPoolItem {
1301
+ /** 股票代码 */
1302
+ code: string;
1303
+ /** 股票名称 */
1304
+ name: string;
1305
+ /** 最新价(元) */
1306
+ price: number | null;
1307
+ /** 涨跌幅(%) */
1308
+ changePercent: number | null;
1309
+ /** 涨停价(元) - 仅部分池子返回 */
1310
+ limitPrice: number | null;
1311
+ /** 成交额(元) */
1312
+ amount: number | null;
1313
+ /** 流通市值(元) */
1314
+ floatMarketValue: number | null;
1315
+ /** 总市值(元) */
1316
+ totalMarketValue: number | null;
1317
+ /** 换手率(%) */
1318
+ turnoverRate: number | null;
1319
+ /** 连板数 - 仅涨停股池返回 */
1320
+ continuousBoardCount: number | null;
1321
+ /** 首次封板时间 HHMMSS - 涨停/炸板池 */
1322
+ firstBoardTime: string | null;
1323
+ /** 最后封板时间 HHMMSS - 涨停池 */
1324
+ lastBoardTime: string | null;
1325
+ /** 封板资金(元) - 涨停池 */
1326
+ boardAmount: number | null;
1327
+ /** 封单资金(元) - 跌停池 */
1328
+ sealAmount: number | null;
1329
+ /** 炸板次数 */
1330
+ failedCount: number | null;
1331
+ /** 所属行业 */
1332
+ industry: string;
1333
+ /** 涨停统计(如 '3/5' 表示 5 天内涨停 3 次) */
1334
+ ztStatistics: string;
1335
+ /** 振幅(%) - 部分池子返回 */
1336
+ amplitude: number | null;
1337
+ /** 涨速 - 部分池子返回 */
1338
+ speed: number | null;
1339
+ }
1340
+ /** 盘口异动类型 */
1341
+ type StockChangeType = 'rocket_launch' | 'quick_rebound' | 'large_buy' | 'limit_up_seal' | 'limit_down_open' | 'big_buy_order' | 'auction_up' | 'high_open_5d' | 'gap_up' | 'high_60d' | 'surge_60d' | 'accelerate_down' | 'high_dive' | 'large_sell' | 'limit_down_seal' | 'limit_up_open' | 'big_sell_order' | 'auction_down' | 'low_open_5d' | 'gap_down' | 'low_60d' | 'drop_60d';
1342
+ /**
1343
+ * 盘口异动项
1344
+ */
1345
+ interface StockChangeItem {
1346
+ /** 发生时间 HH:MM:SS */
1347
+ time: string;
1348
+ /** 股票代码 */
1349
+ code: string;
1350
+ /** 股票名称 */
1351
+ name: string;
1352
+ /** 异动类型 */
1353
+ changeType: StockChangeType;
1354
+ /** 异动类型对应的中文标签 */
1355
+ changeTypeLabel: string;
1356
+ /** 相关信息(来自原始接口) */
1357
+ info: string;
1358
+ }
1359
+ /**
1360
+ * 板块异动项
1361
+ */
1362
+ interface BoardChangeItem {
1363
+ /** 板块名称 */
1364
+ name: string;
1365
+ /** 涨跌幅(%) */
1366
+ changePercent: number | null;
1367
+ /** 主力净流入(元) */
1368
+ mainNetInflow: number | null;
1369
+ /** 异动总次数 */
1370
+ totalChangeCount: number | null;
1371
+ /** 异动最频繁个股代码 */
1372
+ topStockCode: string;
1373
+ /** 异动最频繁个股名称 */
1374
+ topStockName: string;
1375
+ /** 异动最频繁个股方向:'大笔买入' | '大笔卖出' */
1376
+ topStockDirection: string;
1377
+ /** 异动类型分布(key 为类型代码,value 为出现次数) */
1378
+ changeTypeDistribution: Record<string, number>;
1379
+ }
1380
+
1381
+ /**
1382
+ * 龙虎榜数据类型
1383
+ */
1384
+ /** 龙虎榜统计周期 */
1385
+ type DragonTigerPeriod = '1month' | '3month' | '6month' | '1year';
1386
+ /**
1387
+ * 龙虎榜详情项
1388
+ */
1389
+ interface DragonTigerDetailItem {
1390
+ /** 股票代码 */
1391
+ code: string;
1392
+ /** 股票名称 */
1393
+ name: string;
1394
+ /** 上榜日期 YYYY-MM-DD */
1395
+ date: string;
1396
+ /** 收盘价 */
1397
+ close: number | null;
1398
+ /** 涨跌幅(%) */
1399
+ changePercent: number | null;
1400
+ /** 龙虎榜净买额(元) */
1401
+ netBuyAmount: number | null;
1402
+ /** 龙虎榜买入额(元) */
1403
+ buyAmount: number | null;
1404
+ /** 龙虎榜卖出额(元) */
1405
+ sellAmount: number | null;
1406
+ /** 龙虎榜成交额(元) */
1407
+ dealAmount: number | null;
1408
+ /** 市场总成交额(元) */
1409
+ totalAmount: number | null;
1410
+ /** 净买额占总成交比(%) */
1411
+ netBuyRatio: number | null;
1412
+ /** 成交额占总成交比(%) */
1413
+ dealAmountRatio: number | null;
1414
+ /** 换手率(%) */
1415
+ turnoverRate: number | null;
1416
+ /** 流通市值(元) */
1417
+ floatMarketValue: number | null;
1418
+ /** 上榜原因 */
1419
+ reason: string;
1420
+ /** 上榜后 1 日涨跌幅(%) */
1421
+ afterChange1d: number | null;
1422
+ /** 上榜后 2 日涨跌幅(%) */
1423
+ afterChange2d: number | null;
1424
+ /** 上榜后 5 日涨跌幅(%) */
1425
+ afterChange5d: number | null;
1426
+ /** 上榜后 10 日涨跌幅(%) */
1427
+ afterChange10d: number | null;
1428
+ }
1429
+ /**
1430
+ * 龙虎榜个股上榜统计项
1431
+ */
1432
+ interface DragonTigerStockStatItem {
1433
+ /** 股票代码 */
1434
+ code: string;
1435
+ /** 股票名称 */
1436
+ name: string;
1437
+ /** 最近上榜日 YYYY-MM-DD */
1438
+ latestDate: string;
1439
+ /** 收盘价 */
1440
+ close: number | null;
1441
+ /** 涨跌幅(%) */
1442
+ changePercent: number | null;
1443
+ /** 上榜次数 */
1444
+ count: number | null;
1445
+ /** 龙虎榜累计买入额(元) */
1446
+ totalBuyAmount: number | null;
1447
+ /** 龙虎榜累计卖出额(元) */
1448
+ totalSellAmount: number | null;
1449
+ /** 龙虎榜累计净额(元) */
1450
+ totalNetAmount: number | null;
1451
+ /** 龙虎榜累计成交额(元) */
1452
+ totalDealAmount: number | null;
1453
+ /** 累计买方机构次数 */
1454
+ buyOrgCount: number | null;
1455
+ /** 累计卖方机构次数 */
1456
+ sellOrgCount: number | null;
1457
+ }
1458
+ /**
1459
+ * 龙虎榜机构买卖项
1460
+ */
1461
+ interface DragonTigerInstitutionItem {
1462
+ /** 股票代码 */
1463
+ code: string;
1464
+ /** 股票名称 */
1465
+ name: string;
1466
+ /** 上榜日期 YYYY-MM-DD */
1467
+ date: string;
1468
+ /** 收盘价 */
1469
+ close: number | null;
1470
+ /** 涨跌幅(%) */
1471
+ changePercent: number | null;
1472
+ /** 买方机构数 */
1473
+ buyOrgCount: number | null;
1474
+ /** 卖方机构数 */
1475
+ sellOrgCount: number | null;
1476
+ /** 机构买入额(元) */
1477
+ orgBuyAmount: number | null;
1478
+ /** 机构卖出额(元) */
1479
+ orgSellAmount: number | null;
1480
+ /** 机构净额(元) */
1481
+ orgNetAmount: number | null;
1482
+ }
1483
+ /**
1484
+ * 龙虎榜营业部排行项
1485
+ */
1486
+ interface DragonTigerBranchItem {
1487
+ /** 营业部代码 */
1488
+ code: string;
1489
+ /** 营业部名称 */
1490
+ name: string;
1491
+ /** 买入总额(元) */
1492
+ totalBuyAmount: number | null;
1493
+ /** 卖出总额(元) */
1494
+ totalSellAmount: number | null;
1495
+ /** 买入次数 */
1496
+ buyCount: number | null;
1497
+ /** 卖出次数 */
1498
+ sellCount: number | null;
1499
+ /** 上榜次数 */
1500
+ totalCount: number | null;
1501
+ }
1502
+ /**
1503
+ * 龙虎榜个股席位明细项
1504
+ */
1505
+ interface DragonTigerSeatItem {
1506
+ /** 排名 */
1507
+ rank: number | null;
1508
+ /** 营业部名称 */
1509
+ branchName: string;
1510
+ /** 买入额(元) */
1511
+ buyAmount: number | null;
1512
+ /** 买入占总成交比(%) */
1513
+ buyAmountRatio: number | null;
1514
+ /** 卖出额(元) */
1515
+ sellAmount: number | null;
1516
+ /** 卖出占总成交比(%) */
1517
+ sellAmountRatio: number | null;
1518
+ /** 净额(元) */
1519
+ netAmount: number | null;
1520
+ /** 类型标识: 'buy' | 'sell' */
1521
+ side: 'buy' | 'sell';
1522
+ }
1523
+ /**
1524
+ * 龙虎榜日期范围参数
1525
+ */
1526
+ interface DragonTigerDateOptions {
1527
+ /** 开始日期 YYYYMMDD */
1528
+ startDate: string;
1529
+ /** 结束日期 YYYYMMDD */
1530
+ endDate: string;
1531
+ }
1532
+
1533
+ /**
1534
+ * 大宗交易数据类型
1535
+ */
1536
+ /**
1537
+ * 大宗交易市场统计项(按日)
1538
+ */
1539
+ interface BlockTradeMarketStatItem {
1540
+ /** 交易日期 YYYY-MM-DD */
1541
+ date: string;
1542
+ /** 上证指数 */
1543
+ shClose: number | null;
1544
+ /** 上证指数涨跌幅(%) */
1545
+ shChangePercent: number | null;
1546
+ /** 大宗交易成交总额(元) */
1547
+ totalAmount: number | null;
1548
+ /** 溢价成交总额(元) */
1549
+ premiumAmount: number | null;
1550
+ /** 溢价成交占比(%) */
1551
+ premiumRatio: number | null;
1552
+ /** 折价成交总额(元) */
1553
+ discountAmount: number | null;
1554
+ /** 折价成交占比(%) */
1555
+ discountRatio: number | null;
1556
+ }
1557
+ /**
1558
+ * 大宗交易明细项
1559
+ */
1560
+ interface BlockTradeDetailItem {
1561
+ /** 股票代码 */
1562
+ code: string;
1563
+ /** 股票名称 */
1564
+ name: string;
1565
+ /** 交易日期 YYYY-MM-DD */
1566
+ date: string;
1567
+ /** 收盘价 */
1568
+ close: number | null;
1569
+ /** 涨跌幅(%) */
1570
+ changePercent: number | null;
1571
+ /** 成交价(元) */
1572
+ dealPrice: number | null;
1573
+ /** 成交量(股) */
1574
+ dealVolume: number | null;
1575
+ /** 成交额(元) */
1576
+ dealAmount: number | null;
1577
+ /** 溢价率(%) */
1578
+ premiumRate: number | null;
1579
+ /** 买方营业部 */
1580
+ buyBranch: string;
1581
+ /** 卖方营业部 */
1582
+ sellBranch: string;
1583
+ }
1584
+ /**
1585
+ * 大宗交易每日统计项(按股票汇总)
1586
+ */
1587
+ interface BlockTradeDailyStatItem {
1588
+ /** 股票代码 */
1589
+ code: string;
1590
+ /** 股票名称 */
1591
+ name: string;
1592
+ /** 交易日期 YYYY-MM-DD */
1593
+ date: string;
1594
+ /** 涨跌幅(%) */
1595
+ changePercent: number | null;
1596
+ /** 收盘价 */
1597
+ close: number | null;
1598
+ /** 成交笔数 */
1599
+ dealCount: number | null;
1600
+ /** 成交总额(元) */
1601
+ dealTotalAmount: number | null;
1602
+ /** 成交总量(股) */
1603
+ dealTotalVolume: number | null;
1604
+ /** 溢价成交额(元) */
1605
+ premiumAmount: number | null;
1606
+ /** 折价成交额(元) */
1607
+ discountAmount: number | null;
1608
+ }
1609
+ /**
1610
+ * 大宗交易日期范围参数
1611
+ */
1612
+ interface BlockTradeDateOptions {
1613
+ /** 开始日期 YYYYMMDD 或 YYYY-MM-DD */
1614
+ startDate?: string;
1615
+ /** 结束日期 YYYYMMDD 或 YYYY-MM-DD */
1616
+ endDate?: string;
1617
+ }
1618
+
1619
+ /**
1620
+ * 融资融券数据类型
1621
+ */
1622
+ /**
1623
+ * 融资融券账户统计项(按日)
1624
+ */
1625
+ interface MarginAccountItem {
1626
+ /** 日期 YYYY-MM-DD */
1627
+ date: string;
1628
+ /** 融资余额(元) */
1629
+ finBalance: number | null;
1630
+ /** 融券余额(元) */
1631
+ loanBalance: number | null;
1632
+ /** 融资买入额(元) */
1633
+ finBuyAmount: number | null;
1634
+ /** 融券卖出额(元) */
1635
+ loanSellAmount: number | null;
1636
+ /** 参与交易的投资者数量 */
1637
+ investorCount: number | null;
1638
+ /** 有融资融券负债的投资者数量 */
1639
+ liabilityInvestorCount: number | null;
1640
+ /** 担保物总价值(元) */
1641
+ totalGuarantee: number | null;
1642
+ /** 平均维持担保比例(%) */
1643
+ avgGuaranteeRatio: number | null;
1644
+ }
1645
+ /**
1646
+ * 融资融券标的证券项
1647
+ */
1648
+ interface MarginTargetItem {
1649
+ /** 证券代码 */
1650
+ code: string;
1651
+ /** 证券名称 */
1652
+ name: string;
1653
+ /** 日期 YYYY-MM-DD */
1654
+ date: string;
1655
+ /** 融资余额(元) */
1656
+ finBalance: number | null;
1657
+ /** 融资买入额(元) */
1658
+ finBuyAmount: number | null;
1659
+ /** 融资偿还额(元) */
1660
+ finRepayAmount: number | null;
1661
+ /** 融券余量(股) */
1662
+ loanBalance: number | null;
1663
+ /** 融券卖出量(股) */
1664
+ loanSellVolume: number | null;
1665
+ /** 融券偿还量(股) */
1666
+ loanRepayVolume: number | null;
1667
+ }
1668
+
1020
1669
  /**
1021
1670
  * 腾讯财经 - 批量操作
1022
1671
  */
@@ -1254,6 +1903,110 @@ interface ComexInventoryOptions {
1254
1903
  pageSize?: number;
1255
1904
  }
1256
1905
 
1906
+ /**
1907
+ * 东方财富 datacenter-web 通用请求器
1908
+ * 统一封装分页拉取、参数构建、响应解析。
1909
+ *
1910
+ * 覆盖场景:北向资金、龙虎榜、融资融券、大宗交易、股东分析等所有
1911
+ * 走 `https://datacenter-web.eastmoney.com/api/data/v1/get` 的接口。
1912
+ */
1913
+
1914
+ /**
1915
+ * datacenter 查询参数
1916
+ */
1917
+ interface DatacenterQuery {
1918
+ /** 报表名称(如 RPT_MUTUAL_STOCK_NORTHSTA) */
1919
+ reportName: string;
1920
+ /** 返回字段,默认 'ALL' */
1921
+ columns?: string;
1922
+ /** 过滤表达式,如 (TRADE_DATE='2024-01-15') */
1923
+ filter?: string;
1924
+ /** 排序字段(多个用逗号分隔) */
1925
+ sortColumns?: string;
1926
+ /** 排序方向:'-1' 降序, '1' 升序(多个用逗号分隔) */
1927
+ sortTypes?: string;
1928
+ /** 每页大小,默认 500 */
1929
+ pageSize?: number;
1930
+ /** 起始页码,默认 1 */
1931
+ startPage?: number;
1932
+ /** 是否自动拉取全部分页,默认 true */
1933
+ fetchAllPages?: boolean;
1934
+ /**
1935
+ * 最大拉取页数(仅作为死循环安全阀,默认 1000)。
1936
+ *
1937
+ * 取较大默认值是为了恢复原 dividend / futuresInventory 等接口"拉完所有页"的语义;
1938
+ * 大多数 datacenter 接口分页远低于此上限。如果确实希望限制拉取页数,
1939
+ * 调用方应显式传入较小的 `maxPages` 值。
1940
+ *
1941
+ * 命中此上限时会在 console 输出 warning 提示,避免数据被静默截断。
1942
+ */
1943
+ maxPages?: number;
1944
+ /** 额外的 quoteColumns 参数(用于行情字段聚合) */
1945
+ quoteColumns?: string;
1946
+ /** 额外的 quoteType 参数 */
1947
+ quoteType?: string;
1948
+ /** 额外补充的查询参数(覆盖默认值,用于个别接口的特殊字段) */
1949
+ extraParams?: Record<string, string>;
1950
+ }
1951
+ /**
1952
+ * datacenter 分页响应
1953
+ */
1954
+ interface DatacenterResult<T> {
1955
+ /** 解析后的数据列表 */
1956
+ data: T[];
1957
+ /** 总记录数(来自首页) */
1958
+ total: number;
1959
+ /** 总页数(来自首页) */
1960
+ pages: number;
1961
+ }
1962
+
1963
+ /**
1964
+ * 东方财富 - 资金流向
1965
+ * 数据来源:
1966
+ * - 个股/板块资金流历史: https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get
1967
+ * - 资金流排名: https://push2.eastmoney.com/api/qt/clist/get
1968
+ */
1969
+
1970
+ /** 资金流周期 */
1971
+ interface FundFlowOptions {
1972
+ /** 周期: 'daily' | 'weekly' | 'monthly',默认 'daily' */
1973
+ period?: 'daily' | 'weekly' | 'monthly';
1974
+ }
1975
+ /** 资金流排名维度 */
1976
+ interface FundFlowRankOptions {
1977
+ /** 排名周期: 'today' | '3day' | '5day' | '10day',默认 'today' */
1978
+ indicator?: 'today' | '3day' | '5day' | '10day';
1979
+ /** 板块类型(仅 getSectorFundFlowRank 使用): 'industry' | 'concept' | 'region' */
1980
+ sectorType?: 'industry' | 'concept' | 'region';
1981
+ }
1982
+
1983
+ /**
1984
+ * 东方财富 - 沪深港通 / 北向资金
1985
+ * 数据来源:
1986
+ * - 分时数据: https://push2.eastmoney.com/api/qt/kamtbs.rtmin/get
1987
+ * - 资金流向汇总/排行/历史: datacenter-web RPT_MUTUAL_*
1988
+ */
1989
+
1990
+ /** 北向持股排行选项 */
1991
+ interface NorthboundHoldingRankOptions {
1992
+ /** 市场: 'all' | 'shanghai' | 'shenzhen',默认 'all' */
1993
+ market?: NorthboundMarket;
1994
+ /** 排名周期,默认 '5day' */
1995
+ period?: NorthboundRankPeriod;
1996
+ /**
1997
+ * 指定交易日 YYYY-MM-DD(默认服务端最新交易日)。
1998
+ * 注意:必须是有数据的交易日,否则返回空数组。
1999
+ */
2000
+ date?: string;
2001
+ }
2002
+ /** 北向资金历史/个股持仓选项 */
2003
+ interface NorthboundHistoryOptions {
2004
+ /** 起始日期 YYYY-MM-DD */
2005
+ startDate?: string;
2006
+ /** 结束日期 YYYY-MM-DD */
2007
+ endDate?: string;
2008
+ }
2009
+
1257
2010
  interface OHLCV {
1258
2011
  open: number | null;
1259
2012
  high: number | null;
@@ -1865,6 +2618,11 @@ declare class StockSDK {
1865
2618
  private readonly futuresService;
1866
2619
  private readonly optionsService;
1867
2620
  private readonly indicatorService;
2621
+ private readonly fundFlowService;
2622
+ private readonly northboundService;
2623
+ private readonly marketEventService;
2624
+ private readonly dragonTigerService;
2625
+ private readonly dataService;
1868
2626
  /**
1869
2627
  * 创建 Stock SDK 实例。
1870
2628
  * 旧的全局 `timeout` / `retry` / `rateLimit` / `circuitBreaker` 配置继续有效,
@@ -2147,6 +2905,119 @@ declare class StockSDK {
2147
2905
  * @see {@link KlineWithIndicatorsOptions}
2148
2906
  */
2149
2907
  getKlineWithIndicators(symbol: string, options?: KlineWithIndicatorsOptions): Promise<KlineWithIndicators<HistoryKline | HKUSHistoryKline>[]>;
2908
+ /**
2909
+ * 获取个股资金流历史(日 / 周 / 月)
2910
+ * @param symbol 股票代码(支持带或不带 sh/sz/bj 前缀)
2911
+ * @param options 周期选项
2912
+ */
2913
+ getIndividualFundFlow(symbol: string, options?: FundFlowOptions): Promise<StockFundFlowDaily[]>;
2914
+ /** 获取大盘资金流(上证 + 深证综合) */
2915
+ getMarketFundFlow(): Promise<MarketFundFlow[]>;
2916
+ /**
2917
+ * 获取个股资金流排名(沪深北 A 股全市场)
2918
+ * @param options 排名周期:'today' | '3day' | '5day' | '10day'
2919
+ */
2920
+ getFundFlowRank(options?: FundFlowRankOptions): Promise<FundFlowRankItem[]>;
2921
+ /**
2922
+ * 获取板块资金流排名(行业 / 概念 / 地域)
2923
+ * @param options 排名周期 + 板块类型
2924
+ */
2925
+ getSectorFundFlowRank(options?: FundFlowRankOptions): Promise<SectorFundFlowItem[]>;
2926
+ /**
2927
+ * 获取单个板块的历史资金流
2928
+ * @param symbol 板块编号(如 'BK0438' 或全前缀 '90.BK0438')
2929
+ * @param options 周期选项
2930
+ */
2931
+ getSectorFundFlowHistory(symbol: string, options?: FundFlowOptions): Promise<StockFundFlowDaily[]>;
2932
+ /**
2933
+ * 获取北向 / 南向资金分时数据
2934
+ * @param direction 方向:'north' (北向,默认) 或 'south' (南向)
2935
+ */
2936
+ getNorthboundMinute(direction?: NorthboundDirection): Promise<NorthboundMinuteItem[]>;
2937
+ /** 获取沪深港通市场资金流向汇总(北向 + 南向 + 港股通拆分) */
2938
+ getNorthboundFlowSummary(): Promise<NorthboundFlowSummary[]>;
2939
+ /**
2940
+ * 获取北向 / 沪股通 / 深股通持股个股排行
2941
+ * @param options 市场(沪/深/全部) + 周期
2942
+ */
2943
+ getNorthboundHoldingRank(options?: NorthboundHoldingRankOptions): Promise<NorthboundHoldingRankItem[]>;
2944
+ /**
2945
+ * 获取北向 / 南向资金历史
2946
+ * @param direction 方向
2947
+ * @param options 起止日期
2948
+ */
2949
+ getNorthboundHistory(direction?: NorthboundDirection, options?: NorthboundHistoryOptions): Promise<NorthboundHistoryItem[]>;
2950
+ /**
2951
+ * 获取个股的北向持仓历史
2952
+ * @param symbol 股票代码
2953
+ * @param options 起止日期
2954
+ */
2955
+ getNorthboundIndividual(symbol: string, options?: NorthboundHistoryOptions): Promise<NorthboundIndividualItem[]>;
2956
+ /**
2957
+ * 获取涨停股池(涨停 / 昨日涨停 / 强势 / 次新 / 炸板 / 跌停)
2958
+ * @param type 池子类型,默认 'zt'
2959
+ * @param date 交易日 YYYYMMDD 或 YYYY-MM-DD(默认今天)
2960
+ */
2961
+ getZTPool(type?: ZTPoolType, date?: string): Promise<ZTPoolItem[]>;
2962
+ /**
2963
+ * 获取个股盘口异动(共 22 种异动类型)
2964
+ * @param type 异动类型,默认 'large_buy'
2965
+ */
2966
+ getStockChanges(type?: StockChangeType): Promise<StockChangeItem[]>;
2967
+ /** 获取板块异动详情(当日板块异动汇总) */
2968
+ getBoardChanges(): Promise<BoardChangeItem[]>;
2969
+ /**
2970
+ * 获取龙虎榜详情
2971
+ * @param options 起止日期 YYYYMMDD
2972
+ */
2973
+ getDragonTigerDetail(options: DragonTigerDateOptions): Promise<DragonTigerDetailItem[]>;
2974
+ /**
2975
+ * 获取个股上榜统计
2976
+ * @param period 统计周期(默认近一月)
2977
+ */
2978
+ getDragonTigerStockStats(period?: DragonTigerPeriod): Promise<DragonTigerStockStatItem[]>;
2979
+ /**
2980
+ * 获取机构买卖统计
2981
+ * @param options 起止日期 YYYYMMDD
2982
+ */
2983
+ getDragonTigerInstitution(options: DragonTigerDateOptions): Promise<DragonTigerInstitutionItem[]>;
2984
+ /**
2985
+ * 获取营业部排行
2986
+ * @param period 统计周期
2987
+ */
2988
+ getDragonTigerBranchRank(period?: DragonTigerPeriod): Promise<DragonTigerBranchItem[]>;
2989
+ /**
2990
+ * 获取个股某日上榜席位明细(买入榜 + 卖出榜合并)
2991
+ * @param symbol 股票代码
2992
+ * @param date 上榜日期 YYYYMMDD 或 YYYY-MM-DD
2993
+ */
2994
+ getDragonTigerStockSeatDetail(symbol: string, date: string): Promise<DragonTigerSeatItem[]>;
2995
+ /** 获取大宗交易市场每日统计 */
2996
+ getBlockTradeMarketStat(): Promise<BlockTradeMarketStatItem[]>;
2997
+ /**
2998
+ * 获取大宗交易明细
2999
+ * @param options 起止日期
3000
+ */
3001
+ getBlockTradeDetail(options?: BlockTradeDateOptions): Promise<BlockTradeDetailItem[]>;
3002
+ /**
3003
+ * 获取大宗交易每日统计(按股票汇总)
3004
+ * @param options 起止日期
3005
+ */
3006
+ getBlockTradeDailyStat(options?: BlockTradeDateOptions): Promise<BlockTradeDailyStatItem[]>;
3007
+ /** 获取融资融券账户统计 */
3008
+ getMarginAccountInfo(): Promise<MarginAccountItem[]>;
3009
+ /**
3010
+ * 获取融资融券标的明细
3011
+ * @param date 指定交易日 YYYY-MM-DD(默认服务端最新交易日)
3012
+ */
3013
+ getMarginTargetList(date?: string): Promise<MarginTargetItem[]>;
2150
3014
  }
2151
3015
 
2152
- export { type AShareMarket, type ATROptions, type BIASOptions, type BOLLOptions, type CCIOptions, type CFFEXOptionQuote, type CFFEXOptionQuotesOptions, type ComexInventory, type ComexInventoryOptions, type ConceptBoard, type ConceptBoardConstituent, type ConceptBoardKline, type ConceptBoardKlineOptions, type ConceptBoardMinuteKline, type ConceptBoardMinuteKlineOptions, type ConceptBoardMinuteTimeline, type ConceptBoardSpot, type DMIOptions$1 as DMIOptions, type DMIResult$1 as DMIResult, type DividendDetail, type ETFOptionCate, type ETFOptionExpireDay, type ETFOptionMonth, type FullQuote, type FundFlow, type FundQuote, type FuturesExchange, type FuturesInventory, type FuturesInventoryOptions, type FuturesInventorySymbol, type FuturesKline, type FuturesKlineOptions, type GetAShareCodeListOptions, type GetAllAShareQuotesOptions, type GlobalFuturesKlineOptions, type GlobalFuturesQuote, type GlobalFuturesSpotOptions, type HKQuote, type HKUSHistoryKline, type HistoryKline, HttpError, INDICATOR_REGISTRY, type IndexOptionProduct, type IndicatorKey, type IndicatorOptions, type IndustryBoard, type IndustryBoardConstituent, type IndustryBoardKline, type IndustryBoardKlineOptions, type IndustryBoardMinuteKline, type IndustryBoardMinuteKlineOptions, type IndustryBoardMinuteTimeline, type IndustryBoardSpot, type JsonpOptions, type KCOptions$1 as KCOptions, type KCResult$1 as KCResult, type KDJOptions, type KlineWithIndicators, type MACDOptions, type MAOptions, type MarketType, type MinuteKline, type MinuteTimeline, type OBVOptions$1 as OBVOptions, type OBVResult$1 as OBVResult, type OptionKline, type OptionLHBItem, type OptionMinute, type OptionTQuote, type OptionTQuoteResult, type PanelLargeOrder, type ProviderName, type ProviderRequestPolicy, type ROCOptions$1 as ROCOptions, type ROCResult$1 as ROCResult, type RSIOptions, type RequestClientOptions, type RequestError, type RetryOptions, type SAROptions$1 as SAROptions, type SARResult$1 as SARResult, SdkError, type SearchResult, type SearchResultType, type SimpleQuote, StockSDK, type TodayTimeline, type TodayTimelineResponse, type USQuote, type WROptions, addIndicators, asyncPool, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, chunkArray, decodeGBK, StockSDK as default, estimateIndicatorLookback, extractJsonFromJsonp, getEnabledIndicatorKeys, getSdkErrorCode, jsonpRequest, parseResponse, safeNumber, safeNumberOrNull };
3016
+ /**
3017
+ * 根据搜索结果生成外部财经站点链接。
3018
+ * @param result 搜索结果
3019
+ * @returns 东方财富、雪球链接列表;未知市场退回站内搜索链接
3020
+ */
3021
+ declare function generateSearchExternalLinks(result: SearchResult): ExternalLink[];
3022
+
3023
+ export { type AShareMarket, type ATROptions, type BIASOptions, type BOLLOptions, type BlockTradeDailyStatItem, type BlockTradeDateOptions, type BlockTradeDetailItem, type BlockTradeMarketStatItem, type BoardChangeItem, type CCIOptions, type CFFEXOptionQuote, type CFFEXOptionQuotesOptions, type ComexInventory, type ComexInventoryOptions, type ConceptBoard, type ConceptBoardConstituent, type ConceptBoardKline, type ConceptBoardKlineOptions, type ConceptBoardMinuteKline, type ConceptBoardMinuteKlineOptions, type ConceptBoardMinuteTimeline, type ConceptBoardSpot, type DMIOptions$1 as DMIOptions, type DMIResult$1 as DMIResult, type DatacenterQuery, type DatacenterResult, type DividendDetail, type DragonTigerBranchItem, type DragonTigerDateOptions, type DragonTigerDetailItem, type DragonTigerInstitutionItem, type DragonTigerPeriod, type DragonTigerSeatItem, type DragonTigerStockStatItem, type ETFOptionCate, type ETFOptionExpireDay, type ETFOptionMonth, type ExternalLink, type FullQuote, type FundFlow, type FundFlowOptions, type FundFlowRankItem, type FundFlowRankOptions, type FundQuote, type FuturesExchange, type FuturesInventory, type FuturesInventoryOptions, type FuturesInventorySymbol, type FuturesKline, type FuturesKlineOptions, type GetAShareCodeListOptions, type GetAllAShareQuotesOptions, type GlobalFuturesKlineOptions, type GlobalFuturesQuote, type GlobalFuturesSpotOptions, type HKQuote, type HKUSHistoryKline, type HistoryKline, HttpError, INDICATOR_REGISTRY, type IndexOptionProduct, type IndicatorKey, type IndicatorOptions, type IndustryBoard, type IndustryBoardConstituent, type IndustryBoardKline, type IndustryBoardKlineOptions, type IndustryBoardMinuteKline, type IndustryBoardMinuteKlineOptions, type IndustryBoardMinuteTimeline, type IndustryBoardSpot, type JsonpOptions, type KCOptions$1 as KCOptions, type KCResult$1 as KCResult, type KDJOptions, type KlineWithIndicators, type MACDOptions, type MAOptions, type MarginAccountItem, type MarginTargetItem, type MarketFundFlow, type MarketType, type MinuteKline, type MinuteTimeline, type NorthboundDirection, type NorthboundFlowSummary, type NorthboundHistoryItem, type NorthboundHistoryOptions, type NorthboundHoldingRankItem, type NorthboundHoldingRankOptions, type NorthboundIndividualItem, type NorthboundMarket, type NorthboundMinuteItem, type NorthboundRankPeriod, type OBVOptions$1 as OBVOptions, type OBVResult$1 as OBVResult, type OptionKline, type OptionLHBItem, type OptionMinute, type OptionTQuote, type OptionTQuoteResult, type PanelLargeOrder, type ProviderName, type ProviderRequestPolicy, type ROCOptions$1 as ROCOptions, type ROCResult$1 as ROCResult, type RSIOptions, type RequestClientOptions, type RequestError, type RetryOptions, type SAROptions$1 as SAROptions, type SARResult$1 as SARResult, SdkError, type SearchResult, type SearchResultType, type SectorFundFlowItem, type SimpleQuote, type StockChangeItem, type StockChangeType, type StockFundFlowDaily, StockSDK, type TodayTimeline, type TodayTimelineResponse, type USQuote, type WROptions, type ZTPoolItem, type ZTPoolType, addIndicators, asyncPool, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, chunkArray, decodeGBK, StockSDK as default, estimateIndicatorLookback, extractJsonFromJsonp, generateSearchExternalLinks, getEnabledIndicatorKeys, getSdkErrorCode, jsonpRequest, parseResponse, safeNumber, safeNumberOrNull };