Skip to content

Commit

Permalink
add path
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed May 31, 2019
1 parent be655da commit 26ad68f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 7 additions & 11 deletions src/Api/Futures/Accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ class Accounts extends Request
* */
public function getAll(){
$this->type='GET';
$this->path='/api/futures/v3/order';

$data['leverage']=$data['leverage']??10;

$this->data=$data;
$this->path='/api/futures/v3/accounts';

return $this->exec();
}

public function get(array $data){
public function get(array $data=[]){
$this->type='GET';
$this->path='';
$this->path='/api/futures/v3/accounts/'.$data['currency'];

$this->data=$data;

Expand All @@ -37,7 +33,7 @@ public function get(array $data){

public function getLeverage(array $data){
$this->type='GET';
$this->path='';
$this->path='/api/futures/v3/accounts/'.$data['currency'].'/leverage';

$this->data=$data;

Expand All @@ -46,19 +42,19 @@ public function getLeverage(array $data){

public function postLeverage(array $data){
$this->type='POST';
$this->path='';
$this->path='/api/futures/v3/accounts/'.$data['currency'].'/leverage';
$this->data=$data;
return $this->exec();
}

public function getLedger(array $data){
$this->type='GET';
$this->path='';
$this->path='/api/futures/v3/accounts/'.$data['currency'].'/ledger';
$this->data=$data;
return $this->exec();
}

public function getHolds(array $data){
public function getHolds(array $data=[]){
$this->type='GET';
$this->path='';

Expand Down
4 changes: 2 additions & 2 deletions tests/future/accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
* Most of them are unfinished and need your help
* https://github.com/zhouaini528/okex-php.git
* */
use Lin\Okex\OkexSpot;
use Lin\Okex\OkexFuture;

require __DIR__ .'../../../vendor/autoload.php';

include 'key_secret.php';

$okex=new OkexSpot($key,$secret,$passphrase);
$okex=new OkexFuture($key,$secret,$passphrase);

//This endpoint supports getting the list of assets(only show pairs with balance larger than 0), the balances, amount available/on hold in spot accounts.
try {
Expand Down

0 comments on commit 26ad68f

Please sign in to comment.