|
|
|
@ -127,6 +127,30 @@ class Client
@@ -127,6 +127,30 @@ class Client
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getBalance(): ?float |
|
|
|
|
{ |
|
|
|
|
$this->_id++; |
|
|
|
|
|
|
|
|
|
$this->_prepare( |
|
|
|
|
'', |
|
|
|
|
'POST', |
|
|
|
|
[ |
|
|
|
|
'method' => 'getbalance', |
|
|
|
|
'params' => [], |
|
|
|
|
'id' => $this->_id |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$response = $this->_execute(); |
|
|
|
|
|
|
|
|
|
if (isset($response['result']) && is_float($response['result'])) |
|
|
|
|
{ |
|
|
|
|
return $response['result']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getBlockHash( |
|
|
|
|
int $block |
|
|
|
|
): ?string |
|
|
|
|