Passed
Push — master ( 8ca73d...2eaf19 )
by Vladislav
02:37 queued 15s
created

PublicTradeChannel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 13
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponseClassname() 0 3 1
A getOperation() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\WebSockets\Spot\PublicChannels\PublicTrade;
4
5
use Carpenstar\ByBitAPI\Core\Enums\WebSocketOperationsEnum;
6
use Carpenstar\ByBitAPI\Core\Objects\WebSockets\WebSocketsSpotPublicChannel;
7
use Carpenstar\ByBitAPI\WebSockets\Spot\PublicChannels\PublicTrade\Entities\PublicTradeResponse;
8
9
/**
10
 * https://bybit-exchange.github.io/docs/spot/ws-public/public-trade
11
 *
12
 * Topic: trade.{symbol}
13
 *
14
 * This topic pushes raw trade information; each trade has a unique buyer and seller.
15
 * Variable "v" acts as a tradeId. This variable is shared across different symbols; however, each ID is unique.
16
 * For example, suppose in the last 5 seconds 3 trades happened in ETHUSDT, BTCUSDT, and BHTBTC.
17
 * Their tradeId (which is "v") will be consecutive: 112, 113, 114.
18
 */
19
class PublicTradeChannel extends WebSocketsSpotPublicChannel
20
{
21
    /**
22
     * @return string
23
     */
24
    public function getResponseClassname(): string
25
    {
26
        return PublicTradeResponse::class;
27
    }
28
29
    public function getOperation(): string
30
    {
31
        return WebSocketOperationsEnum::SUBSCRIBE;
32
    }
33
}