|
1
|
|
|
<?php |
|
2
|
|
|
namespace Carpenstar\ByBitAPI\Spot\Trade\OrderHistory\Request; |
|
3
|
|
|
|
|
4
|
|
|
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper; |
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
|
6
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\OptionsEntity; |
|
|
|
|
|
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Info: If startTime and endTime are both not specified, it returns last 7 days records by default. |
|
10
|
|
|
* 3 days records for institutional clients. |
|
11
|
|
|
* Supports fetching 3 months worth of data per request. Returns data up to 6 months old. |
|
12
|
|
|
*/ |
|
13
|
|
|
class OrderHistoryRequest extends AbstractParameters |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* Name of the trading pair |
|
17
|
|
|
* @var string $symbol |
|
18
|
|
|
*/ |
|
19
|
|
|
protected string $symbol; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Specify orderId to return all the orders that orderId of which are smaller |
|
23
|
|
|
* than this particular one for pagination purpose |
|
24
|
|
|
* @var int $orderId |
|
25
|
|
|
*/ |
|
26
|
|
|
protected int $orderId; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Limit for data size. [1, 500]. Default: 100 |
|
30
|
|
|
* @var int $limit = 100; |
|
31
|
|
|
*/ |
|
32
|
|
|
protected int $limit; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* The start timestamp (ms) |
|
36
|
|
|
* @var int $startTime |
|
37
|
|
|
*/ |
|
38
|
|
|
protected int $startTime; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* The end timestamp (ms) |
|
42
|
|
|
* @var int $endTime |
|
43
|
|
|
*/ |
|
44
|
|
|
protected int $endTime; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Order category. 0:normal order by default; 1:TP/SL order, Required for TP/SL order. |
|
48
|
|
|
* @var int $orderCategory |
|
49
|
|
|
*/ |
|
50
|
|
|
protected int $orderCategory; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @param string $symbol |
|
54
|
|
|
* @return OrderHistoryRequest |
|
55
|
|
|
*/ |
|
56
|
|
|
public function setSymbol(string $symbol): self |
|
57
|
|
|
{ |
|
58
|
|
|
$this->symbol = $symbol; |
|
59
|
|
|
return $this; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* @return string |
|
64
|
|
|
*/ |
|
65
|
|
|
public function getSymbol(): string |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->symbol; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* @param int $orderId |
|
72
|
|
|
* @return OrderHistoryRequest |
|
73
|
|
|
*/ |
|
74
|
|
|
public function setOrderId(int $orderId): self |
|
75
|
|
|
{ |
|
76
|
|
|
$this->orderId = $orderId; |
|
77
|
|
|
return $this; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @return int |
|
82
|
|
|
*/ |
|
83
|
|
|
public function getOrderId(): int |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->orderId; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @param int $limit |
|
90
|
|
|
* @return OrderHistoryRequest |
|
91
|
|
|
*/ |
|
92
|
|
|
public function setLimit(int $limit): self |
|
93
|
|
|
{ |
|
94
|
|
|
$this->limit = $limit; |
|
95
|
|
|
return $this; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @return int |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getLimit(): int |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->limit; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* The start timestamp (ms) |
|
108
|
|
|
* @param string $dateTime |
|
109
|
|
|
* @return OrderHistoryRequest |
|
110
|
|
|
*/ |
|
111
|
|
|
public function setStartTime(string $dateTime): self |
|
112
|
|
|
{ |
|
113
|
|
|
$this->startTime = DateTimeHelper::makeTimestampFromDateString($dateTime); |
|
114
|
|
|
return $this; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
/** |
|
118
|
|
|
* @return int |
|
119
|
|
|
*/ |
|
120
|
|
|
public function getStartTime(): int |
|
121
|
|
|
{ |
|
122
|
|
|
return $this->startTime; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
/** |
|
126
|
|
|
* @param string $endTime |
|
127
|
|
|
* @return OrderHistoryRequest |
|
128
|
|
|
*/ |
|
129
|
|
|
public function setEndTime(string $endTime): self |
|
130
|
|
|
{ |
|
131
|
|
|
$this->endTime = DateTimeHelper::makeTimestampFromDateString($endTime); |
|
132
|
|
|
return $this; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @return int |
|
137
|
|
|
*/ |
|
138
|
|
|
public function getEndTime(): int |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->endTime; |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
/** |
|
144
|
|
|
* @param int $orderCategory |
|
145
|
|
|
* @return OrderHistoryRequest |
|
146
|
|
|
*/ |
|
147
|
|
|
public function setOrderCategory(int $orderCategory): self |
|
148
|
|
|
{ |
|
149
|
|
|
$this->orderCategory = $orderCategory; |
|
150
|
|
|
return $this; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* @return int |
|
155
|
|
|
*/ |
|
156
|
|
|
public function getOrderCategory(): int |
|
157
|
|
|
{ |
|
158
|
|
|
return $this->orderCategory; |
|
159
|
|
|
} |
|
160
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths