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

PublicTradeChannel::getOperation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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
}