From 7f01ecb14102d3d19108077349d40756da9c36b7 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 18 Feb 2024 00:46:32 +0200 Subject: [PATCH] add listAccounts method --- src/Client.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Client.php b/src/Client.php index 2fb314a..ebbd9f9 100644 --- a/src/Client.php +++ b/src/Client.php @@ -571,4 +571,28 @@ class Client return null; } + + public function listAccounts(): ?array + { + $this->_id++; + + $this->_prepare( + '', + 'POST', + [ + 'method' => 'listaccounts', + 'params' => [], + 'id' => $this->_id + ] + ); + + $response = $this->_execute(); + + if (isset($response['result']) && is_array($response['result'])) + { + return $response['result']; + } + + return null; + } }