Browse Source

add decodeRawTransaction, kevaNamespace methods

main 1.5.0
ghost 12 months ago
parent
commit
44608e688f
  1. 57
      src/Client.php

57
src/Client.php

@ -242,6 +242,35 @@ class Client
return null; 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( public function kevaFilter(
string $namespace, string $namespace,
?string $regexp = '', ?string $regexp = '',
@ -374,4 +403,32 @@ class Client
return null; 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…
Cancel
Save