Browse Source

添加Bitget划转

gepangpang 2 years ago
parent
commit
3d45a79777
1 changed files with 10 additions and 2 deletions
  1. 10 2
      standard/src/bitget_spot.rs

+ 10 - 2
standard/src/bitget_spot.rs

@@ -430,8 +430,16 @@ impl Platform for BitgetSpot {
         Err(Error::new(ErrorKind::NotFound, "bitget_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, "bitget_spot:该交易所方法未实现".to_string()))
+    async fn wallet_transfers(&mut self, coin: &str, from: &str, to: &str, amount: Decimal) -> Result<String, Error> {
+        let coin_format = coin.to_string().to_uppercase();
+        let res_data = self.request.wallet_transfer(from.to_string(), to.to_string(), amount.to_string(), coin_format.clone(), "".to_string(), "".to_string()).await;
+        if res_data.code == "200" {
+            let res_data_str = &res_data.data;
+            let result = res_data_str.clone();
+            Ok(result)
+        } else {
+            Err(Error::new(ErrorKind::Other, res_data.to_string()))
+        }
     }
 
     async fn command_order(&mut self, order_command: OrderCommand, trace_stack: TraceStack) {