|
@@ -4,12 +4,11 @@ use std::result::Result;
|
|
|
use tokio::sync::mpsc::Sender;
|
|
use tokio::sync::mpsc::Sender;
|
|
|
use async_trait::async_trait;
|
|
use async_trait::async_trait;
|
|
|
use rust_decimal::Decimal;
|
|
use rust_decimal::Decimal;
|
|
|
-use crate::{Platform, ExchangeEnum, Account, binance_handle, Position, Ticker, Market, Order, OrderCommand};
|
|
|
|
|
|
|
+use crate::{Platform, ExchangeEnum, Account, Position, Ticker, Market, Order, OrderCommand};
|
|
|
use exchanges::binance_spot_rest::BinanceSpotRest;
|
|
use exchanges::binance_spot_rest::BinanceSpotRest;
|
|
|
-use exchanges::response_base::ResponseData;
|
|
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
#[allow(dead_code)]
|
|
|
-#[derive( Clone)]
|
|
|
|
|
|
|
+#[derive(Clone)]
|
|
|
pub struct BinanceSpot {
|
|
pub struct BinanceSpot {
|
|
|
exchange: ExchangeEnum,
|
|
exchange: ExchangeEnum,
|
|
|
symbol: String,
|
|
symbol: String,
|
|
@@ -52,15 +51,7 @@ impl Platform for BinanceSpot {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取账号信息
|
|
// 获取账号信息
|
|
|
- async fn get_account(&self) -> Result<Account, Error> {
|
|
|
|
|
- let res_data = ResponseData {
|
|
|
|
|
- code: "200".to_string(),
|
|
|
|
|
- message: "你猜猜这是什么错误".to_string(),
|
|
|
|
|
- data: "[]".to_string(),
|
|
|
|
|
- channel: "".to_string(),
|
|
|
|
|
- };
|
|
|
|
|
- binance_handle::handle_account_info(res_data, self.symbol.clone())
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn get_account(&self) -> Result<Account, Error> { todo!() }
|
|
|
// 获取仓位信息
|
|
// 获取仓位信息
|
|
|
async fn get_position(&self) -> Result<Vec<Position>, Error> {
|
|
async fn get_position(&self) -> Result<Vec<Position>, Error> {
|
|
|
todo!()
|
|
todo!()
|
|
@@ -79,39 +70,27 @@ impl Platform for BinanceSpot {
|
|
|
todo!()
|
|
todo!()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async fn get_order_detail(&self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn get_order_detail(&self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> { todo!() }
|
|
|
|
|
|
|
|
async fn get_orders_list(&self, _status: &str) -> Result<Vec<Order>, Error> {
|
|
async fn get_orders_list(&self, _status: &str) -> Result<Vec<Order>, Error> {
|
|
|
todo!()
|
|
todo!()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async fn set_dual_mode(&self, _coin: &str, _is_dual_mode: bool) -> Result<String, Error> {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn set_dual_mode(&self, _coin: &str, _is_dual_mode: bool) -> Result<String, Error> { todo!() }
|
|
|
|
|
|
|
|
async fn set_dual_leverage(&self, _leverage: &str) -> Result<String, Error> {
|
|
async fn set_dual_leverage(&self, _leverage: &str) -> Result<String, Error> {
|
|
|
todo!()
|
|
todo!()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async fn wallet_transfers(&self, _coin: &str, _from: &str, _to: &str, _amount: Decimal) -> Result<String, Error> {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn wallet_transfers(&self, _coin: &str, _from: &str, _to: &str, _amount: Decimal) -> Result<String, Error> { todo!() }
|
|
|
|
|
|
|
|
- async fn take_order(&self, _custom_id: &str, _origin_side: &str, _price: Decimal, _amount: Decimal) -> Result<Order, Error> {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn take_order(&self, _custom_id: &str, _origin_side: &str, _price: Decimal, _amount: Decimal) -> Result<Order, Error> { todo!() }
|
|
|
|
|
|
|
|
- async fn cancel_order(&self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn cancel_order(&self, _order_id: &str, _custom_id: &str) -> Result<Order, Error> { todo!() }
|
|
|
|
|
|
|
|
async fn cancel_orders(&self) -> Result<Vec<Order>, Error> {
|
|
async fn cancel_orders(&self) -> Result<Vec<Order>, Error> {
|
|
|
todo!()
|
|
todo!()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async fn command_order(&self, _order_command: OrderCommand, _order_sender: Sender<Order>, _error_sender: Sender<Error>) {
|
|
|
|
|
- todo!()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ async fn command_order(&self, _order_command: OrderCommand, _order_sender: Sender<Order>, _error_sender: Sender<Error>) { todo!() }
|
|
|
}
|
|
}
|