1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\GetExecutionList\Request; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper; |
6
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
7
|
|
|
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\GetExecutionList\Interfaces\IGetExecutionListRequestInterface; |
8
|
|
|
|
9
|
|
|
class GetExecutionListRequest extends AbstractParameters implements IGetExecutionListRequestInterface |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* Symbol name |
13
|
|
|
* @var string $symbol |
14
|
|
|
*/ |
15
|
|
|
protected string $symbol; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Order ID. Return all records if not passed |
19
|
|
|
* @var string $orderId |
20
|
|
|
*/ |
21
|
|
|
protected string $orderId; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* The start timestamp (ms) |
25
|
|
|
* @var \DateTime $startTime |
26
|
|
|
*/ |
27
|
|
|
protected \DateTime $startTime; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* The end timestamp (ms) |
31
|
|
|
* @var \DateTime $endTime |
32
|
|
|
*/ |
33
|
|
|
protected \DateTime $endTime; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Execution type |
37
|
|
|
* @var string $execType |
38
|
|
|
*/ |
39
|
|
|
protected string $execType; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Limit for data size per page. [1, 100]. Default: 50 |
43
|
|
|
* @var int $limit |
44
|
|
|
*/ |
45
|
|
|
protected int $limit = 50; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set |
49
|
|
|
* @var string $cursor |
50
|
|
|
*/ |
51
|
|
|
protected string $cursor; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function getSymbol(): string |
57
|
|
|
{ |
58
|
|
|
return $this->symbol; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @param string $symbol |
63
|
|
|
* @return GetExecutionListRequest |
64
|
|
|
*/ |
65
|
|
|
public function setSymbol(string $symbol): self |
66
|
|
|
{ |
67
|
|
|
$this->symbol = $symbol; |
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return string |
73
|
|
|
*/ |
74
|
|
|
public function getOrderId(): string |
75
|
|
|
{ |
76
|
|
|
return $this->orderId; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @param string $orderId |
81
|
|
|
* @return GetExecutionListRequest |
82
|
|
|
*/ |
83
|
|
|
public function setOrderId(string $orderId): self |
84
|
|
|
{ |
85
|
|
|
$this->orderId = $orderId; |
86
|
|
|
return $this; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return \DateTime |
91
|
|
|
*/ |
92
|
|
|
public function getStartTime(): \DateTime |
93
|
|
|
{ |
94
|
|
|
return $this->startTime; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param int $startTime |
99
|
|
|
* @return GetExecutionListRequest |
100
|
|
|
*/ |
101
|
|
|
public function setStartTime(int $startTime): self |
102
|
|
|
{ |
103
|
|
|
$this->startTime = DateTimeHelper::makeFromTimestamp($startTime); |
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return \DateTime |
109
|
|
|
*/ |
110
|
|
|
public function getEndTime(): \DateTime |
111
|
|
|
{ |
112
|
|
|
return $this->endTime; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @param int $endTime |
117
|
|
|
* @return GetExecutionListRequest |
118
|
|
|
*/ |
119
|
|
|
public function setEndTime(int $endTime): self |
120
|
|
|
{ |
121
|
|
|
$this->endTime = DateTimeHelper::makeFromTimestamp($endTime); |
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @return string |
127
|
|
|
*/ |
128
|
|
|
public function getExecType(): string |
129
|
|
|
{ |
130
|
|
|
return $this->execType; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @param string $execType |
135
|
|
|
* @return GetExecutionListRequest |
136
|
|
|
*/ |
137
|
|
|
public function setExecType(string $execType): self |
138
|
|
|
{ |
139
|
|
|
$this->execType = $execType; |
140
|
|
|
return $this; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @return int |
145
|
|
|
*/ |
146
|
|
|
public function getLimit(): int |
147
|
|
|
{ |
148
|
|
|
return $this->limit; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param int $limit |
153
|
|
|
*/ |
154
|
|
|
public function setLimit(int $limit): self |
155
|
|
|
{ |
156
|
|
|
$this->limit = $limit; |
157
|
|
|
return $this; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @return string |
162
|
|
|
*/ |
163
|
|
|
public function getCursor(): string |
164
|
|
|
{ |
165
|
|
|
return $this->cursor; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param string $cursor |
170
|
|
|
* @return GetExecutionListRequest |
171
|
|
|
*/ |
172
|
|
|
public function setCursor(string $cursor): self |
173
|
|
|
{ |
174
|
|
|
$this->cursor = $cursor; |
175
|
|
|
return $this; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
|
179
|
|
|
} |
180
|
|
|
|