作者 karlet

feat:公共request

@@ -105,6 +105,24 @@ class BinanceSpot @@ -105,6 +105,24 @@ class BinanceSpot
105 return json_decode($data, true); 105 return json_decode($data, true);
106 } 106 }
107 107
  108 + /**
  109 + * @param $path
  110 + * @param $method
  111 + * @param $param
  112 + * @param int $type (=1:行情等接口,不需要签名;=2:账户等接口需要签名)
  113 + * @return array|int|mixed
  114 + */
  115 + public function request($path, $method, $param, int $type=1)
  116 + {
  117 + if($type==2){
  118 + return self::requestAccount($method, $path, $param);
  119 + }else if($type==1){
  120 + return self::requestMarket($method, $path, $param);
  121 + }else{
  122 + return ['code'=>1000,'msg'=>'type参数错误'];
  123 + }
  124 + }
  125 +
108 //查询用户万向划转历史 126 //查询用户万向划转历史
109 public function getTransfer($param) 127 public function getTransfer($param)
110 { 128 {