for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Carpenstar\ByBitAPI\WebSockets\Channels\Spot\PublicChannels\PublicTrade\Entities;
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper;
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
class PublicTradeResponseItem extends AbstractResponse
{
/**
* Trade ID
* @var string $tradeId
*/
private string $tradeId;
* Timestamp (trading time in the match box)
* @var \DateTime $tradingTime
private \DateTime $tradingTime;
* Price
* @var float $price
private float $price;
* Quantity
* @var float $quantity
private float $quantity;
* True indicates buy side is taker, false indicates sell side is taker
* @var bool $isTaker
private bool $isTaker;
* Trade type. 0:Spot trade. 1:Paradigm block trade
* @var int $tradeType
private int $tradeType;
public function __construct(array $data)
$this->price = $data['p'];
$this->quantity = $data['q'];
$this->tradeId = $data['v'];
$this->tradeType = $data['type'];
$this->isTaker = $data['m'];
$this->tradingTime = DateTimeHelper::makeFromTimestamp($data['t']);
}
public function getPrice(): float
return $this->price;
public function getQuantity(): float
return $this->quantity;
public function getTradeId(): string
return $this->tradeId;
public function getTradeType(): int
return $this->tradeType;
public function getTradingTime(): \DateTime
return $this->tradingTime;
public function getIsTaker(): bool
return $this->isTaker;