Skip to content

Commit

Permalink
binance set host default
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Oct 18, 2021
1 parent cce75c5 commit cb3041f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Exchanges/Binance.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ function setOptions(array $options=[]){
function getPlatform(string $type=''){
switch (strtolower($type)){
case 'spot':{
$this->host='https://api.binance.com';
if($this->platform_spot == null) $this->platform_spot=new BinanceApi($this->key,$this->secret,$this->host);;
$this->platform_spot->setOptions($this->options);
return $this->platform_spot;
}
case 'future':{
$this->host='https://fapi.binance.com';
if($this->platform_future == null) $this->platform_future=new BinanceFuture($this->key,$this->secret,$this->host);
$this->platform_future->setOptions($this->options);
return $this->platform_future;
Expand Down Expand Up @@ -235,7 +237,11 @@ function trader(){
}

function getPlatform(string $type=''){
if($this->exchange==null) $this->exchange=$this->trader();
if($this->exchange==null) {
$this->setPlatform($type);

$this->exchange=$this->trader();
}
return $this->exchange->getPlatform($type);
}

Expand Down

0 comments on commit cb3041f

Please sign in to comment.