mirror of
https://github.com/kevachat/kevacoin-php.git
synced 2025-02-02 01:44:36 +00:00
add decodeRawTransaction, kevaNamespace methods
This commit is contained in:
parent
fdb02908c2
commit
44608e688f
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user