mirror of
https://github.com/YGGverse/next.git
synced 2026-03-31 17:55:34 +00:00
init kevacoin model
This commit is contained in:
parent
cf9d255eb5
commit
90a7325623
1 changed files with 38 additions and 0 deletions
38
src/Model/Kevacoin.php
Normal file
38
src/Model/Kevacoin.php
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Yggverse\Next\Model;
|
||||||
|
|
||||||
|
class Kevacoin
|
||||||
|
{
|
||||||
|
private \Kevachat\Kevacoin\Client $_client;
|
||||||
|
|
||||||
|
private string $_namespace;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
string $scheme,
|
||||||
|
string $user,
|
||||||
|
string $password,
|
||||||
|
string $host,
|
||||||
|
int $port,
|
||||||
|
string $namespace
|
||||||
|
) {
|
||||||
|
// Connect wallet
|
||||||
|
$this->_client = new \Kevachat\Kevacoin\Client(
|
||||||
|
$scheme,
|
||||||
|
$host,
|
||||||
|
$port,
|
||||||
|
$username,
|
||||||
|
$password
|
||||||
|
);
|
||||||
|
|
||||||
|
// Check namespace given exists
|
||||||
|
if (!$this->_namespace = $this->_client->kevaFilter($namespace))
|
||||||
|
{
|
||||||
|
throw new \Exception(
|
||||||
|
_('could not find requested namespace!')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue