Skip to content

Commit

Permalink
add portfolio websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Nov 7, 2024
1 parent 94416ea commit 2dfccd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Api/WebSocket/SocketFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public function getListenKey(array $key_secret){
//'baseurl'=>'ws://stream.binance.com:9443',//default
//'baseurl'=>'ws://fstream.binance.com',
//'baseurl'=>'ws://dstream.binance.com',
//'baseurl'=>'ws://fstream.binance.com/pm',

switch ($this->config['baseurl']){
case 'ws://fstream.binance.com':{
Expand All @@ -31,6 +32,11 @@ public function getListenKey(array $key_secret){
$listen_key=$binance->user()->postListenKey();
break;
}
case 'ws://fstream.binance.com/pm':{
$binance=new \Lin\Binance\BinancePortfolio($key_secret['key'],$key_secret['secret']);
$listen_key=$binance->websocket()->postListenKey();
break;
}
//ws://stream.binance.com:9443
default:{
$binance=new \Lin\Binance\Binance($key_secret['key'],$key_secret['secret']);
Expand Down
3 changes: 3 additions & 0 deletions src/Api/WebSocket/SocketGlobal.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ private function port(){
case 'ws://dstream.binance.com':{
return '2209';
}
case 'ws://fstream.binance.com/pm':{
return '2213';
}
//ws://stream.binance.com:9443
default:{
return '2208';
Expand Down

0 comments on commit 2dfccd6

Please sign in to comment.