src/Request/SubscribeStatus.php
<?php
declare(strict_types=1);
namespace Codenixsv\BitfinexWs\Request;
use Ratchet\RFC6455\Messaging\Frame;
/**
* Class SubscribeStatus
* @package Codenixsv\BitfinexWs\Request
*/
class SubscribeStatus implements Request
{
/** @var string */
private $key;
/**
* SubscribeStatus constructor.
* @param string $key
*/
public function __construct(string $key)
{
$this->key = $key;
}
/**
* @return array
*/
public function getPayload(): array
{
return [
'event' => 'subscribe',
'channel' => 'status',
'key' => $this->key
];
}
/**
* @return Frame
*/
public function getFrame(): Frame
{
return new Frame(json_encode($this->getPayload()));
}
}