From 4dc1b735515e30302c76196da4c4e3ff49569fa5 Mon Sep 17 00:00:00 2001 From: lin <465382251@qq.com> Date: Sat, 23 Nov 2024 19:43:25 +0800 Subject: [PATCH] Update Base.php update binance spot --- src/Map/Base.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Map/Base.php b/src/Map/Base.php index c63ba6c..eeb7fa0 100644 --- a/src/Map/Base.php +++ b/src/Map/Base.php @@ -81,12 +81,20 @@ protected function checkType(string $symbol=''){ } case 'binance':{ // 现货与期货区分可以用 positionSide 账户必须开启持仓双向模式 - if(!empty($symbol)){ - return 'future'; + if(empty($this->platform)) { + return 'spot'; } - if(empty($this->platform)) { - return $this->platform; + if(!empty($symbol)){ + $temp=explode('_',$symbol); + + //通过币安币对分隔符来区分币本位 还是U本位 + if(count($temp)>1){ + //币本位 + return 'delivery'; + } + //uU本位 + return 'future'; } /*if(empty($this->platform)) { @@ -127,5 +135,3 @@ public function checkOrderType(string $type=''){ } } } - -