refactor(exchanges): fetchKlines 改为 params 对象签名,新增 type/exchange 参数

- 新增 FetchKlinesParams 接口统一 fetchKlines 参数(exchange/type/symbol/startTime/limit/endTime)
- BaseRestClient 抽象方法 + MarketDataFeed 接口改为 params 对象签名
- BinanceRestClient / BinanceFuturesRestClient 由调用方传入 type,不再硬编码 spot/um
- index.ts 新增静态 fetchKlines(params) 便捷函数,按 exchange+type 自动路由
- exchange.ts / bnkline.ts 调用方适配新签名
- 初始化 SQL 补充 BNBUSDT/SOLUSDT 合约交易对
This commit is contained in:
Rekey
2026-06-16 19:02:16 +08:00
parent 705a2f6ea0
commit ebaef5042e
7 changed files with 87 additions and 56 deletions
+3 -1
View File
@@ -335,7 +335,9 @@ CROSS JOIN (
('BNBUSDT', 'spot', 'BNB', 'USDT'),
('SOLUSDT', 'spot', 'SOL', 'USDT'),
('BTCUSDT', 'um', 'BTC', 'USDT'),
('ETHUSDT', 'um', 'ETH', 'USDT')
('ETHUSDT', 'um', 'ETH', 'USDT'),
('BNBUSDT', 'um', 'BNB', 'USDT'),
('SOLUSDT', 'um', 'SOL', 'USDT')
) AS sym(symbol, type, base, quote)
WHERE e.name = 'binance'
ON CONFLICT (exchange_id, symbol, type) DO NOTHING;