| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- [package]
- name = "pin_trading_tool"
- version = "0.1.0"
- edition = "2021"
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
- [dependencies]
- # 异步运行时,选择 tokio,并启用完整特性集(包含多线程运行时、net, time, fs, process, signal 等)
- # "full" 特性非常方便开发,生产环境可以根据实际需求裁剪
- tokio = { version = "1", features = ["full"] }
- # HTTP 客户端,用于 REST API 请求(获取交易对、下单等)
- # - "json": 启用 JSON 支持,方便发送和接收 JSON 数据
- # - "tokio-native-tls": 与 tokio 集成,支持 HTTPS (SSL/TLS),使用系统的 TLS 实现
- reqwest = { version = "0.11", features = ["json", "tokio-native-tls"] }
- ring = "0.16.20"
- base64 = "0.13"
- futures-channel = "0.3.28"
- # 解压缩
- flate2 = "1.0"
- # WebSocket 客户端,基于 tokio 构建,用于订阅 K 线和深度
- tokio-tungstenite= { git = "https://github.com/HonestHouLiang/tokio-tungstenite.git",rev = "208fc9b09bcc2e2c8cb52e1cde5087446464fc91" }
- # futures 工具库,提供一些异步编程中常用的 trait 和工具
- # 包含了 Stream 的一些方法,例如 split 用于分离 WebSocket stream 的读写端
- futures-util = "0.3"
- # URL 解析和构建库,在处理交易所端点或配置代理时可能会用到
- url = "2"
- # 序列化和反序列化框架,用于将 Rust 结构体与各种数据格式相互转换
- # - "derive": 启用 derive 宏,方便自动实现 Serialize 和 Deserialize trait
- serde = { version = "1", features = ["derive"] }
- # serde 的 JSON 实现,用于处理交易所 API 的 JSON 数据和应用配置(如果使用 JSON 格式)
- serde_json = "1"
- # 日志和诊断框架,推荐使用 tracing,功能强大且适合异步应用
- tracing = "0.1"
- # tracing 的 subscriber 实现,用于配置日志输出格式、目的地等
- # - "env-filter": 允许通过 RUST_LOG 环境变量控制日志级别
- # - "fmt": 提供格式化输出到控制台
- # - "json": 可选,如果需要结构化 JSON 日志
- tracing-subscriber = { version = "0.3", features = ["json", "fmt", "env-filter", "registry", "time"] }
- # 用于日志文件按日期滚动
- tracing-appender = "0.2"
- # 日期和时间处理
- chrono = "0.4"
- # 时区数据库,用于获取 Asia/Shanghai 时区
- chrono-tz = "0.8"
- # 确保 time crate 的特性被启用
- time = { version = "0.3", features = ["macros", "formatting", "parsing", "local-offset"] }
- # 简化错误处理的库,方便快速构建可链式调用的错误
- anyhow = "1"
- # 用于定义自定义错误类型的库,与 anyhow 配合使用,让错误更具语义
- thiserror = "1"
- # 异步 SQL 数据库客户端,选择支持 tokio 和 SQLite 的版本,用于存储配置等
- # - "runtime-tokio": 使用 tokio 作为异步运行时
- # - "sqlite": 启用 SQLite 驱动
- # - "macros": 启用宏支持,用于 compile-time query checking (强烈推荐)
- # - "offline": 用于离线模式下的宏检查 (与 "macros" 配合使用)
- sqlx = { version = "0.7", features = ["runtime-tokio", "sqlite", "macros"] }
- backtrace = "0.3.74"
- prost = "0.11"
- # =======================================================
- # 以下是一些在开发过程中可能会用到的devDependencies,只用于开发和测试,不包含在最终发布版本中
- [dev-dependencies]
- [build-dependencies]
- prost-build = "0.11" # 或者最新版本
|