Skip to content

Commit

Permalink
add capital/withdraw/apply and authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Feb 22, 2024
1 parent 9e733bc commit 2da4a2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions src/Api/SpotV3/Privates.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
14 changes: 7 additions & 7 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 2da4a2e

Please sign in to comment.