From 852d92cd4f26b9e762c45551a09b503aa0accd09 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 18 Feb 2024 00:52:04 +0200 Subject: [PATCH] implement getAccount method --- src/Client.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Client.php b/src/Client.php index 4e28b6a..638fc0f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -600,6 +600,33 @@ class Client return null; } + public function getAccount(string $address): ?string + { + $this->_id++; + + $this->_prepare( + '', + 'POST', + [ + 'method' => 'getaccount', + 'params' => + [ + $address + ], + 'id' => $this->_id + ] + ); + + $response = $this->_execute(); + + if (isset($response['result']) && is_string($response['result'])) + { + return $response['result']; + } + + return null; + } + public function listAccounts(): ?array { $this->_id++;