Skip to content

Commit

Permalink
binance add delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Dec 16, 2021
1 parent 49268de commit 534176c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Exchanges/Binance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Lin\Exchange\Exchanges;

use Lin\Binance\Binance as BinanceApi;
use Lin\Binance\BinanceDelivery;
use Lin\Binance\BinanceFuture;

use Lin\Exchange\Interfaces\AccountInterface;
Expand All @@ -16,6 +17,7 @@ class BaseBinance
{
protected $platform_future=null;
protected $platform_spot=null;
protected $platform_delivery=null;

protected $platform='';
protected $version='';
Expand Down Expand Up @@ -78,6 +80,13 @@ function getPlatform(string $type=''){
$this->platform_future->setOptions($this->options);
return $this->platform_future;
}
case 'delivery':{
if(empty($this->host)) $this->host='https://dapi.binance.com';
if($this->platform_delivery == null) $this->platform_delivery=new BinanceDelivery($this->key,$this->secret,$this->host);
$this->platform_delivery->setOptions($this->options);
return $this->platform_delivery;
return null;
}
case 'swap':{
return null;
}
Expand Down Expand Up @@ -105,6 +114,9 @@ function get(array $data){
$this->platform_spot=$this->getPlatform('spot');
return $this->platform_spot->user()->getAccount($data);
}
case 'delivery':{
return;
}
}
}
}
Expand Down Expand Up @@ -134,6 +146,9 @@ function sell(array $data){
$this->platform_spot=$this->getPlatform('spot');
return $this->platform_spot->trade()->postOrder($data);
}
case 'delivery':{
return;
}
}
}

Expand All @@ -150,6 +165,9 @@ function buy(array $data){
$this->platform_spot=$this->getPlatform('spot');
return $this->platform_spot->trade()->postOrder($data);
}
case 'delivery':{
return;
}
}
}

Expand All @@ -166,6 +184,9 @@ function cancel(array $data){
$this->platform_spot=$this->getPlatform('spot');
return $this->platform_spot->trade()->deleteOrder($data);
}
case 'delivery':{
return;
}
}
}

Expand All @@ -189,6 +210,9 @@ function show(array $data){
$this->platform_spot=$this->getPlatform('spot');
return $this->platform_spot->user()->getOrder($data);
}
case 'delivery':{
return;
}
}
}

Expand Down

0 comments on commit 534176c

Please sign in to comment.