From a961e5e90795e55a5cf8ad56ab804a92a46ee8df Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 6 Dec 2023 01:43:33 +0200 Subject: [PATCH] add kevaPut method --- src/Client.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Client.php b/src/Client.php index 547103c..eb95f22 100644 --- a/src/Client.php +++ b/src/Client.php @@ -315,4 +315,36 @@ class Client return null; } + + public function kevaPut( + string $namespace, + string $key, + string $value + ): ?string + { + $this->_id++; + + $this->_prepare( + '', + 'POST', + [ + 'method' => 'keva_put', + 'params' => [ + $namespace, + $key, + $value + ], + 'id' => $this->_id + ] + ); + + $response = $this->_execute(); + + if (!empty($response['txid']) && is_string($response['txid'])) + { + return $response['txid']; + } + + return null; + } }