From 2b463b7c3af0e288cfde8f2d068cca383165c095 Mon Sep 17 00:00:00 2001 From: songsariya Date: Thu, 21 Oct 2021 14:47:55 +0900 Subject: [PATCH] Add a factor to the position method. (showAvgPrice) --- src/Api/Account.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Api/Account.php b/src/Api/Account.php index b2b965c..7000e9a 100644 --- a/src/Api/Account.php +++ b/src/Api/Account.php @@ -15,9 +15,13 @@ public function get() return $this->respond($this->http->get(self::ACCOUNTS_URI)); } - public function positions() + public function positions(?bool $showAvgPrice = null) { - return $this->respond($this->http->get(self::POSITIONS_URI)); + if($showAvgPrice == false) { + $showAvgPrice = null; + } + + return $this->respond($this->http->get(self::POSITIONS_URI, compact("showAvgPrice"))); } public function changeAccountLeverage(int $leverage)