From 2da4a2e008a39d141e8350dcb34f79814b1a425e Mon Sep 17 00:00:00 2001 From: zhouaini528 <465382251@qq.com> Date: Thu, 22 Feb 2024 14:27:05 +0800 Subject: [PATCH] add capital/withdraw/apply and authentication --- src/Api/SpotV3/Privates.php | 10 ++++++++++ src/Request.php | 14 +++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Api/SpotV3/Privates.php b/src/Api/SpotV3/Privates.php index d32cd30..c36672c 100644 --- a/src/Api/SpotV3/Privates.php +++ b/src/Api/SpotV3/Privates.php @@ -100,4 +100,14 @@ public function getMyTrades(array $data=[]){ $this->data=$data; return $this->exec(); } + + /* + *POST /api/v3/capital/withdraw/apply + * */ + public function postCapitalWithdrawApply(array $data=[]){ + $this->type='POST'; + $this->path='/api/v3/capital/withdraw/apply'; + $this->data=$data; + return $this->exec(); + } } diff --git a/src/Request.php b/src/Request.php index 40ed504..22cfef6 100644 --- a/src/Request.php +++ b/src/Request.php @@ -139,9 +139,10 @@ protected function send(){ switch ($this->version) { case 'v3':{ - if($this->authentication==false) break; - $this->data['timestamp']=$this->nonce; - $this->data['signature']=$this->signature; + if($this->authentication==true) { + $this->data['timestamp']=$this->nonce; + $this->data['signature']=$this->signature; + } if(in_array($this->type,['GET','DELETE'])) $url.= empty($this->data) ? '' : '?'.http_build_query($this->data); else $this->options['form_params']=$this->data; @@ -154,10 +155,9 @@ protected function send(){ } } - - -// echo $url.PHP_EOL; -// print_r($this->options); + /*print_r($this->data); + echo $url.PHP_EOL; + print_r($this->options);*/ // die; $response = $client->request($this->type, $url, $this->options);