add decodeRawTransaction, kevaNamespace methods

This commit is contained in:
ghost 2023-12-09 20:55:04 +02:00
parent fdb02908c2
commit 44608e688f

View File

@ -242,6 +242,35 @@ class Client
return null;
}
public function decodeRawTransaction(
string $txid
): mixed
{
$this->_id++;
$this->_prepare(
'',
'POST',
[
'method' => 'decoderawtransaction',
'params' =>
[
$txid
],
'id' => $this->_id
]
);
$response = $this->_execute();
if (!empty($response['result']))
{
return $response['result'];
}
return null;
}
public function kevaFilter(
string $namespace,
?string $regexp = '',
@ -374,4 +403,32 @@ class Client
return null;
}
public function kevaNamespace(
string $name
): ?array
{
$this->_id++;
$this->_prepare(
'',
'POST',
[
'method' => 'keva_namespace',
'params' => [
$name
],
'id' => $this->_id
]
);
$response = $this->_execute();
if (!empty($response['result']) && !empty($response['result']['txid']) && !empty($response['result']['namespaceId']))
{
return $response['result'];
}
return null;
}
}