705a2f6ea0
- PairType 定义移至 types/kline.ts (spot/um/cm) - Kline 接口新增 type 字段,全链路透传 - klines 5列复合主键 (exchange, symbol, type, interval, time) - 拆出 BinanceFuturesRestClient (USDMClient) - exchanges/index.ts 注册 binance_futures - trading_pairs 唯一约束加 type,种子数据加合约对 - 12个连续聚合视图 SELECT/GROUP BY/INDEX 加 type - 清理 bnkline.ts 废弃代码和 pair.ts 空函数
27 lines
629 B
TypeScript
27 lines
629 B
TypeScript
import { MainClient, type Kline as BinanceRestKline, CoinMClient, USDMClient } from "binance";
|
|
|
|
const usdMClient = new USDMClient();
|
|
const coinMClient = new CoinMClient();
|
|
|
|
console.log(await usdMClient.getKlines({
|
|
symbol: 'BTCUSDT',
|
|
interval: "1m",
|
|
startTime: 0,
|
|
limit: 2,
|
|
}));
|
|
|
|
// console.log(await coinMClient.getKlines({
|
|
// symbol: 'BTCUSD_PERP',
|
|
// interval: "1d",
|
|
// startTime: 0,
|
|
// limit: 2,
|
|
// }));
|
|
|
|
// const data = await coinMClient.getExchangeInfo();
|
|
|
|
// for (const item of data.symbols) {
|
|
// if (item.pair !== 'BTCUSD') {
|
|
// continue;
|
|
// }
|
|
// console.log(item);
|
|
// }
|