1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\GetExecutionList\Response; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper; |
6
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse; |
7
|
|
|
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\GetExecutionList\Interfaces\IGetExecutionListResponseItemInterface; |
8
|
|
|
|
9
|
|
|
class GetExecutionListResponseItem extends AbstractResponse implements IGetExecutionListResponseItemInterface |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* Symbol name |
13
|
|
|
* @var string $symbol |
14
|
|
|
*/ |
15
|
|
|
private string $symbol; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Buy,Sell |
19
|
|
|
* @var string $side |
20
|
|
|
*/ |
21
|
|
|
private string $side; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Order id |
25
|
|
|
* @var string $orderId |
26
|
|
|
*/ |
27
|
|
|
private string $orderId; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* User customised order id |
31
|
|
|
* @var string $orderLinkId |
32
|
|
|
*/ |
33
|
|
|
private string $orderLinkId; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Order price |
37
|
|
|
* @var float $orderPrice |
38
|
|
|
*/ |
39
|
|
|
private float $orderPrice; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Order qty |
43
|
|
|
* @var float $orderQty |
44
|
|
|
*/ |
45
|
|
|
private float $orderQty; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Market,Limit |
49
|
|
|
* @var string $orderType |
50
|
|
|
*/ |
51
|
|
|
private string $orderType; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Stop order type |
55
|
|
|
* @var string $stopOrderType |
56
|
|
|
*/ |
57
|
|
|
private string $stopOrderType; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Trade Id |
61
|
|
|
* @var string $execId |
62
|
|
|
*/ |
63
|
|
|
private string $execId; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Execution price |
67
|
|
|
* @var float $execPrice |
68
|
|
|
*/ |
69
|
|
|
private float $execPrice; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Execution qty |
73
|
|
|
* @var float $execQty |
74
|
|
|
*/ |
75
|
|
|
private float $execQty; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Execution fee |
79
|
|
|
* @var float $execFee |
80
|
|
|
*/ |
81
|
|
|
private float $execFee; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Execution type |
85
|
|
|
* @var string $execType |
86
|
|
|
*/ |
87
|
|
|
private string $execType; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Execution position value |
91
|
|
|
* @var float $execValue |
92
|
|
|
*/ |
93
|
|
|
private float $execValue; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* Trading fee rate |
97
|
|
|
* @var float $feeRate |
98
|
|
|
*/ |
99
|
|
|
private float $feeRate; |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* AddedLiquidity, RemovedLiquidity |
103
|
|
|
* @var string $lastLiquidityInd |
104
|
|
|
*/ |
105
|
|
|
private string $lastLiquidityInd; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Is maker |
109
|
|
|
* @var bool $isMaker |
110
|
|
|
*/ |
111
|
|
|
private bool $isMaker; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Remaining qty waiting for execution |
115
|
|
|
* @var float $leavesQty |
116
|
|
|
*/ |
117
|
|
|
private float $leavesQty; |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Close size |
121
|
|
|
* @var float $closedSize |
122
|
|
|
*/ |
123
|
|
|
private float $closedSize; |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Block trade id |
127
|
|
|
* @var string $blockTradeId |
128
|
|
|
*/ |
129
|
|
|
private string $blockTradeId; |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Mark price |
133
|
|
|
* @var float $markPrice |
134
|
|
|
*/ |
135
|
|
|
private float $markPrice; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* Index price |
139
|
|
|
* @var float $indexPrice |
140
|
|
|
*/ |
141
|
|
|
private float $indexPrice; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Underlying price |
145
|
|
|
* @var float $underlyingPrice |
146
|
|
|
*/ |
147
|
|
|
private float $underlyingPrice; |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Execution timestamp (ms) |
151
|
|
|
* @var \DateTime $execTime |
152
|
|
|
*/ |
153
|
|
|
private \DateTime $execTime; |
154
|
|
|
|
155
|
|
|
public function __construct(array $data) |
156
|
|
|
{ |
157
|
|
|
$this->symbol = $data['symbol']; |
158
|
|
|
$this->side = $data['side']; |
159
|
|
|
$this->orderId = $data['orderId']; |
160
|
|
|
$this->orderLinkId = $data['orderLinkId']; |
161
|
|
|
$this->orderPrice = (float) $data['orderPrice']; |
162
|
|
|
$this->orderQty = (float) $data['orderQty']; |
163
|
|
|
$this->orderType = $data['orderType']; |
164
|
|
|
$this->stopOrderType = $data['stopOrderType']; |
165
|
|
|
$this->execId = $data['execId']; |
166
|
|
|
$this->execPrice = (float) $data['execPrice']; |
167
|
|
|
$this->execQty = (float) $data['execQty']; |
168
|
|
|
$this->execFee = (float) $data['execFee']; |
169
|
|
|
$this->execType = $data['execType']; |
170
|
|
|
$this->execValue = (float) $data['execValue']; |
171
|
|
|
$this->feeRate = (float) $data['feeRate']; |
172
|
|
|
$this->lastLiquidityInd = $data['lastLiquidityInd']; |
173
|
|
|
$this->isMaker = $data['isMaker']; |
174
|
|
|
$this->leavesQty = (float) $data['leavesQty']; |
175
|
|
|
$this->closedSize = (float) $data['closedSize']; |
176
|
|
|
$this->blockTradeId = $data['blockTradeId']; |
177
|
|
|
$this->markPrice = (float) $data['markPrice']; |
178
|
|
|
$this->indexPrice = (float) $data['indexPrice']; |
179
|
|
|
$this->underlyingPrice = (float) $data['underlyingPrice']; |
180
|
|
|
$this->execTime = DateTimeHelper::makeFromTimestamp($data['execTime']); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* @return string |
185
|
|
|
*/ |
186
|
|
|
public function getSymbol(): string |
187
|
|
|
{ |
188
|
|
|
return $this->symbol; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* @return string |
193
|
|
|
*/ |
194
|
|
|
public function getSide(): string |
195
|
|
|
{ |
196
|
|
|
return $this->side; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* @return string |
201
|
|
|
*/ |
202
|
|
|
public function getOrderId(): string |
203
|
|
|
{ |
204
|
|
|
return $this->orderId; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return string |
209
|
|
|
*/ |
210
|
|
|
public function getOrderLinkId(): string |
211
|
|
|
{ |
212
|
|
|
return $this->orderLinkId; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @return float |
217
|
|
|
*/ |
218
|
|
|
public function getOrderPrice(): float |
219
|
|
|
{ |
220
|
|
|
return $this->orderPrice; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @return float |
225
|
|
|
*/ |
226
|
|
|
public function getOrderQty(): float |
227
|
|
|
{ |
228
|
|
|
return $this->orderQty; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* @return string |
233
|
|
|
*/ |
234
|
|
|
public function getOrderType(): string |
235
|
|
|
{ |
236
|
|
|
return $this->orderType; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @return string |
241
|
|
|
*/ |
242
|
|
|
public function getStopOrderType(): string |
243
|
|
|
{ |
244
|
|
|
return $this->stopOrderType; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @return string |
249
|
|
|
*/ |
250
|
|
|
public function getExecId(): string |
251
|
|
|
{ |
252
|
|
|
return $this->execId; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @return float |
257
|
|
|
*/ |
258
|
|
|
public function getExecPrice(): float |
259
|
|
|
{ |
260
|
|
|
return $this->execPrice; |
261
|
|
|
} |
262
|
|
|
|
263
|
|
|
/** |
264
|
|
|
* @return float |
265
|
|
|
*/ |
266
|
|
|
public function getExecQty(): float |
267
|
|
|
{ |
268
|
|
|
return $this->execQty; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* @return float |
273
|
|
|
*/ |
274
|
|
|
public function getExecFee(): float |
275
|
|
|
{ |
276
|
|
|
return $this->execFee; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* @return string |
281
|
|
|
*/ |
282
|
|
|
public function getExecType(): string |
283
|
|
|
{ |
284
|
|
|
return $this->execType; |
285
|
|
|
} |
286
|
|
|
|
287
|
|
|
/** |
288
|
|
|
* @return float |
289
|
|
|
*/ |
290
|
|
|
public function getExecValue(): float |
291
|
|
|
{ |
292
|
|
|
return $this->execValue; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* @return float |
297
|
|
|
*/ |
298
|
|
|
public function getFeeRate(): float |
299
|
|
|
{ |
300
|
|
|
return $this->feeRate; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* @return string |
305
|
|
|
*/ |
306
|
|
|
public function getLastLiquidityInd(): string |
307
|
|
|
{ |
308
|
|
|
return $this->lastLiquidityInd; |
309
|
|
|
} |
310
|
|
|
|
311
|
|
|
/** |
312
|
|
|
* @return bool |
313
|
|
|
*/ |
314
|
|
|
public function isMaker(): bool |
315
|
|
|
{ |
316
|
|
|
return $this->isMaker; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @return float |
321
|
|
|
*/ |
322
|
|
|
public function getLeavesQty(): float |
323
|
|
|
{ |
324
|
|
|
return $this->leavesQty; |
325
|
|
|
} |
326
|
|
|
|
327
|
|
|
/** |
328
|
|
|
* @return float |
329
|
|
|
*/ |
330
|
|
|
public function getClosedSize(): float |
331
|
|
|
{ |
332
|
|
|
return $this->closedSize; |
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
/** |
336
|
|
|
* @return string |
337
|
|
|
*/ |
338
|
|
|
public function getBlockTradeId(): string |
339
|
|
|
{ |
340
|
|
|
return $this->blockTradeId; |
341
|
|
|
} |
342
|
|
|
|
343
|
|
|
/** |
344
|
|
|
* @return float |
345
|
|
|
*/ |
346
|
|
|
public function getMarkPrice(): float |
347
|
|
|
{ |
348
|
|
|
return $this->markPrice; |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
/** |
352
|
|
|
* @return float |
353
|
|
|
*/ |
354
|
|
|
public function getIndexPrice(): float |
355
|
|
|
{ |
356
|
|
|
return $this->indexPrice; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
/** |
360
|
|
|
* @return float |
361
|
|
|
*/ |
362
|
|
|
public function getUnderlyingPrice(): float |
363
|
|
|
{ |
364
|
|
|
return $this->underlyingPrice; |
365
|
|
|
} |
366
|
|
|
|
367
|
|
|
/** |
368
|
|
|
* @return \DateTime |
369
|
|
|
*/ |
370
|
|
|
public function getExecTime(): \DateTime |
371
|
|
|
{ |
372
|
|
|
return $this->execTime; |
373
|
|
|
} |
374
|
|
|
} |
375
|
|
|
|