TradeHistoryRequest   A
last analyzed

Complexity

Total Complexity 14

Size/Duplication

Total Lines 168
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 168
rs 10
c 0
b 0
f 0
wmc 14

14 Methods

Rating   Name   Duplication   Size   Complexity  
A getToTradeId() 0 3 1
A setStartTime() 0 4 1
A setEndTime() 0 4 1
A getEndTime() 0 3 1
A setLimit() 0 4 1
A getLimit() 0 3 1
A setToTradeId() 0 4 1
A getOrderId() 0 3 1
A setFromTradeId() 0 4 1
A getStartTime() 0 3 1
A getFromTradeId() 0 3 1
A getSymbol() 0 3 1
A setSymbol() 0 4 1
A setOrderId() 0 4 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Spot\Trade\TradeHistory\Request;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
6
use Carpenstar\ByBitAPI\Spot\Trade\TradeHistory\Interfaces\ITradeHistoryRequestInterface;
7
use Carpenstar\ByBitAPI\Spot\Trade\TradeHistory\Interfaces\ITradeHistoryResponseItemInterface;
8
9
/**
10
 * Notice: If startTime is not specified, you can only query for records in the last 7 days.
11
 * If you want to query for records older than 7 days, startTime is required.
12
 * If the orderId is null, fromTicketId is passed, and toTicketId is null,
13
 * then the result is sorted by ticketId in ascend. Otherwise, the result is sorted by ticketId in descend.
14
 */
15
class TradeHistoryRequest extends AbstractParameters implements ITradeHistoryRequestInterface
16
{
17
    /**
18
     * Name of the trading pair
19
     * @var string $symbol
20
     */
21
    protected string $symbol;
22
23
    /**
24
     * Order ID
25
     * @var int $orderId
26
     */
27
    protected int $orderId;
28
29
    /**
30
     * Default value is 50, max 50
31
     * @var int $limit
32
     */
33
    protected int $limit;
34
35
    /**
36
     * Start timestamp (ms)
37
     * @var int $startTime
38
     */
39
    protected int $startTime;
40
41
    /**
42
     * End time timestamp (ms)
43
     * @var int $endTime
44
     */
45
    protected int $endTime;
46
47
    /**
48
     * Query greater than the trade ID
49
     * @var int $fromTradeId
50
     */
51
    protected int $fromTradeId;
52
53
    /**
54
     * Query smaller than the trade ID
55
     * @var int $toTradeId
56
     */
57
    protected int $toTradeId;
58
59
    /**
60
     * @return string
61
     */
62
    public function getSymbol(): string
63
    {
64
        return $this->symbol;
65
    }
66
67
    /**
68
     * @param string $symbol
69
     * @return TradeHistoryRequest
70
     */
71
    public function setSymbol(string $symbol): self
72
    {
73
        $this->symbol = $symbol;
74
        return $this;
75
    }
76
77
    /**
78
     * @return int
79
     */
80
    public function getOrderId(): int
81
    {
82
        return $this->orderId;
83
    }
84
85
    /**
86
     * @param int $orderId
87
     * @return TradeHistoryRequest
88
     */
89
    public function setOrderId(int $orderId): self
90
    {
91
        $this->orderId = $orderId;
92
        return $this;
93
    }
94
95
    /**
96
     * @return int
97
     */
98
    public function getEndTime(): int
99
    {
100
        return $this->endTime;
101
    }
102
103
    /**
104
     * @param int $endTime
105
     * @return TradeHistoryRequest
106
     */
107
    public function setEndTime(int $endTime): self
108
    {
109
        $this->endTime = $endTime;
110
        return $this;
111
    }
112
113
    /**
114
     * @return int
115
     */
116
    public function getStartTime(): int
117
    {
118
        return $this->startTime;
119
    }
120
121
    /**
122
     * @param int $startTime
123
     * @return TradeHistoryRequest
124
     */
125
    public function setStartTime(int $startTime): self
126
    {
127
        $this->startTime = $startTime;
128
        return $this;
129
    }
130
131
    /**
132
     * @return int
133
     */
134
    public function getLimit(): int
135
    {
136
        return $this->limit;
137
    }
138
139
    /**
140
     * @param int $limit
141
     * @return TradeHistoryRequest
142
     */
143
    public function setLimit(int $limit): self
144
    {
145
        $this->limit = $limit;
146
        return $this;
147
    }
148
149
    /**
150
     * @return int
151
     */
152
    public function getToTradeId(): int
153
    {
154
        return $this->toTradeId;
155
    }
156
157
    /**
158
     * @param int $toTradeId
159
     * @return TradeHistoryRequest
160
     */
161
    public function setToTradeId(int $toTradeId): self
162
    {
163
        $this->toTradeId = $toTradeId;
164
        return $this;
165
    }
166
167
    /**
168
     * @return int
169
     */
170
    public function getFromTradeId(): int
171
    {
172
        return $this->fromTradeId;
173
    }
174
175
    /**
176
     * @param int $fromTradeId
177
     * @return TradeHistoryRequest
178
     */
179
    public function setFromTradeId(int $fromTradeId): self
180
    {
181
        $this->fromTradeId = $fromTradeId;
182
        return $this;
183
    }
184
}
185