-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9e4448
commit 71ee60e
Showing
5 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author lin <[email protected]> | ||
* */ | ||
|
||
namespace Lin\Binance\Api; | ||
namespace Lin\Binance\Api\Spot; | ||
|
||
use Lin\Binance\Request; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author lin <[email protected]> | ||
* */ | ||
|
||
namespace Lin\Binance\Api; | ||
namespace Lin\Binance\Api\Spot; | ||
|
||
use Lin\Binance\Request; | ||
|
||
|
@@ -67,6 +67,7 @@ public function postOrder(array $data){ | |
public function postOrderTest(array $data){ | ||
$this->type='POST'; | ||
$this->path='/api/v3/order/test'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author lin <[email protected]> | ||
* */ | ||
|
||
namespace Lin\Binance\Api; | ||
namespace Lin\Binance\Api\Spot; | ||
|
||
use Lin\Binance\Request; | ||
|
||
|
@@ -19,6 +19,7 @@ class User extends Request | |
public function getOpenOrders(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/api/v3/openOrders'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -94,6 +95,7 @@ public function getAccount(array $data=[]){ | |
public function getMyTrades(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/api/v3/myTrades'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -105,6 +107,7 @@ public function getMyTrades(array $data=[]){ | |
public function getDepositHistory(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/depositHistory.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -116,6 +119,7 @@ public function getDepositHistory(array $data=[]){ | |
public function getWithdrawHistory(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/withdrawHistory.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -127,6 +131,7 @@ public function getWithdrawHistory(array $data=[]){ | |
public function getDepositAddress(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/depositAddress.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -140,6 +145,7 @@ public function getAccountStatus(array $data=[]){ | |
$this->signature=false; | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/accountStatus.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -151,6 +157,7 @@ public function getAccountStatus(array $data=[]){ | |
public function getAssetDribbletLog(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/userAssetDribbletLog.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -162,6 +169,7 @@ public function getAssetDribbletLog(array $data=[]){ | |
public function getTradeFee(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/tradeFee.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
@@ -173,13 +181,14 @@ public function getTradeFee(array $data=[]){ | |
public function getAssetDetail(array $data=[]){ | ||
$this->type='GET'; | ||
$this->path='/wapi/v3/assetDetail.html'; | ||
$data['timestamp']=time().'000'; | ||
$this->data=$data; | ||
return $this->exec(); | ||
} | ||
|
||
|
||
|
||
|
||
//Websocket Account Pull | ||
/** | ||
* POST /api/v3/userDataStream | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
|
||
/** | ||
* @author lin <[email protected]> | ||
* | ||
* | ||
* Fill in your key and secret and pass can be directly run | ||
* | ||
* | ||
* Most of them are unfinished and need your help | ||
* https://github.com/zhouaini528/huobi-php.git | ||
* */ | ||
|
@@ -20,7 +20,7 @@ | |
$binance->setOptions([ | ||
//Set the request timeout to 60 seconds by default | ||
'timeout'=>10, | ||
|
||
//If you are developing locally and need an agent, you can set this | ||
//'proxy'=>true, | ||
//More flexible Settings | ||
|
@@ -52,8 +52,8 @@ | |
try { | ||
$result=$binance->user()->getOrder([ | ||
'symbol'=>'LTCUSDT', | ||
'orderId'=>$result['orderId'], | ||
'origClientOrderId'=>$result['clientOrderId'], | ||
'orderId'=>'22222', | ||
'origClientOrderId'=>'22222', | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
|
@@ -64,8 +64,8 @@ | |
try { | ||
$result=$binance->trade()->deleteOrder([ | ||
'symbol'=>'LTCUSDT', | ||
'orderId'=>$result['orderId'], | ||
'origClientOrderId'=>$result['clientOrderId'], | ||
'orderId'=>'111111', | ||
'origClientOrderId'=>'1111111', | ||
]); | ||
print_r($result); | ||
}catch (\Exception $e){ | ||
|