mirror of
https://github.com/kevachat/kevacoin-php.git
synced 2025-02-02 01:44:36 +00:00
add getBalance method
This commit is contained in:
parent
a87af9f6df
commit
1266ce29bf
@ -127,6 +127,30 @@ class Client
|
|||||||
return null;
|
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(
|
public function getBlockHash(
|
||||||
int $block
|
int $block
|
||||||
): ?string
|
): ?string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user