From 1aed6f73d7385586451709a450f45c0db3e3d01a Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 18 Feb 2024 00:49:07 +0200 Subject: [PATCH] implement getReceivedByAccount method --- src/Client.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Client.php b/src/Client.php index ebbd9f9..4e28b6a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -529,6 +529,34 @@ class Client return null; } + public function getReceivedByAccount(string $account, ?int $minconf = 0): ?float + { + $this->_id++; + + $this->_prepare( + '', + 'POST', + [ + 'method' => 'getreceivedbyaccount', + 'params' => + [ + $account, + $minconf + ], + 'id' => $this->_id + ] + ); + + $response = $this->_execute(); + + if (isset($response['result']) && is_float($response['result'])) + { + return $response['result']; + } + + return null; + } + public function sendToAddress( string $address, float $amount,