| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- // use std::collections::BTreeMap;
- // use std::io::{Error, ErrorKind};
- // use std::result::Result;
- // use async_trait::async_trait;
- // use rust_decimal::Decimal;
- // use rust_decimal_macros::dec;
- // use tracing::{warn};
- // use crate::{Platform, ExchangeEnum, Account, Position, Ticker, Market, Order, OrderCommand};
- // use exchanges::binance_spot_rest::BinanceSpotRest;
- // use global::trace_stack::TraceStack;
- //
- // #[allow(dead_code)]
- // #[derive(Clone)]
- // pub struct BinanceSpot {
- // exchange: ExchangeEnum,
- // symbol: String,
- // is_colo: bool,
- // params: BTreeMap<String, String>,
- // request: BinanceSpotRest,
- // }
- //
- // impl BinanceSpot {
- // pub fn new(symbol: String, is_colo: bool, params: BTreeMap<String, String>) -> BinanceSpot {
- // BinanceSpot {
- // exchange: ExchangeEnum::BinanceSpot,
- // symbol: symbol.to_uppercase(),
- // is_colo,
- // params: params.clone(),
- // request: BinanceSpotRest::new(is_colo, params.clone()),
- // }
- // }
- // }
- //
- //
- // #[async_trait]
- // impl Platform for BinanceSpot {
- // // 克隆方法
- // fn clone_box(&self) -> Box<dyn Platform + Send + Sync> { Box::new(self.clone()) }
- // // 获取交易所模式
- // fn get_self_exchange(&self) -> ExchangeEnum {
- // ExchangeEnum::BinanceSpot
- // }
- // // 获取交易对
- // fn get_self_symbol(&self) -> String { self.symbol.clone() }
- // // 获取是否使用高速通道
- // fn get_self_is_colo(&self) -> bool {
- // self.is_colo
- // }
- // // 获取登录params信息
- // fn get_self_params(&self) -> BTreeMap<String, String> {
- // self.params.clone()
- // }
- //
- // fn get_self_market(&self) -> Market {
- // warn!("binance_spot:该交易所方法未实现");
- // return Market::new();
- // }
- //
- // fn get_request_delays(&self) -> Vec<i64> {
- // warn!("binance_spot:该交易所方法未实现");
- // return vec![];
- // }
- //
- // fn get_request_avg_delay(&self) -> Decimal {
- // warn!("binance_spot:该交易所方法未实现");
- // return dec!(0);
- // }
- //
- // fn get_request_max_delay(&self) -> i64 {
- // warn!("binance_spot:该交易所方法未实现");
- // return 0;
- // }
- //
- // async fn get_server_time(&mut self) -> Result<String, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // // 获取账号信息
- // async fn get_account(&mut self) -> Result<Account, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_spot_account(&mut self) -> Result<Vec<Account>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // // 获取仓位信息
- // async fn get_position(&mut self) -> Result<Vec<Position>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_positions(&mut self) -> Result<Vec<Position>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // // 获取市场行情
- // async fn get_ticker(&mut self) -> Result<Ticker, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_ticker_symbol(&mut self, _symbol: String) -> Result<Ticker, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_market(&mut self) -> Result<Market, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_market_symbol(&mut self, _symbol: String) -> Result<Market, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_order_detail(&mut self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn get_orders_list(&mut self, _status: &str) -> Result<Vec<Order>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn take_order(&mut self, _custom_id: &str, _origin_side: &str, _price: Decimal, _amount: Decimal) -> Result<Order, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn take_order_symbol(&mut self, _symbol: String, _ct_val: Decimal, _custom_id: &str, _origin_side: &str, _price: Decimal, _amount: Decimal) -> Result<Order, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn cancel_order(&mut self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn cancel_orders(&mut self) -> Result<Vec<Order>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn cancel_orders_all(&mut self) -> Result<Vec<Order>, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn set_dual_mode(&mut self, _coin: &str, _is_dual_mode: bool) -> Result<String, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn set_dual_leverage(&mut self, _leverage: &str) -> Result<String, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn set_auto_deposit_status(&mut self, _status: bool) -> Result<String, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn wallet_transfers(&mut self, _coin: &str, _from: &str, _to: &str, _amount: Decimal) -> Result<String, Error> { Err(Error::new(ErrorKind::NotFound, "binance_spot:该交易所方法未实现".to_string())) }
- //
- // async fn command_order(&mut self, _order_command: OrderCommand, _trace_stack: TraceStack) { warn!("binance_spot:该交易所方法未实现"); }
- // }
|