Skip to content

Commit

Permalink
add kevaGet method
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost committed Dec 10, 2023
1 parent 44608e6 commit ad3aee5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,43 @@ public function kevaFilter(
return null;
}

public function kevaGet(
string $namespace,
string $key
): ?array
{
$this->_id++;

$this->_prepare(
'',
'POST',
[
'method' => 'keva_get',
'params' =>
[
$namespace,
$key
],
'id' => $this->_id
]
);

$response = $this->_execute();

if (
!empty($response['result']) &&
!empty($response['result']['key']) &&
!empty($response['result']['value']) &&
!empty($response['result']['height']) &&
isset($response['result']['vout'])
)
{
return $response['result'];
}

return null;
}

// Pay attention:
// for some reasons, wallet hide namespaces from list where pending transaction exist
// to get some data e.g. namespace name, use keva_get / _KEVA_NS_ with max height value instead of this method
Expand Down

0 comments on commit ad3aee5

Please sign in to comment.