From 26ad68f764d44f0454d6b68b1aed80788ca9fc6f Mon Sep 17 00:00:00 2001 From: lin <465382251@qq.com> Date: Fri, 31 May 2019 14:46:23 +0800 Subject: [PATCH] add path --- src/Api/Futures/Accounts.php | 18 +++++++----------- tests/future/accounts.php | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Api/Futures/Accounts.php b/src/Api/Futures/Accounts.php index 0af09cf..3c61f74 100644 --- a/src/Api/Futures/Accounts.php +++ b/src/Api/Futures/Accounts.php @@ -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; @@ -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; @@ -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=''; diff --git a/tests/future/accounts.php b/tests/future/accounts.php index 921fb5f..5515617 100644 --- a/tests/future/accounts.php +++ b/tests/future/accounts.php @@ -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 {