1
|
|
|
<?php |
2
|
|
|
namespace Carpenstar\ByBitAPI\Spot\LeverageToken\AllAssetInfo\Response; |
3
|
|
|
|
4
|
|
|
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper; |
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse; |
6
|
|
|
use Carpenstar\ByBitAPI\Spot\LeverageToken\AllAssetInfo\Interfaces\AllAssetInfoResponseInterface; |
7
|
|
|
|
8
|
|
|
class AllAssetInfoResponse extends AbstractResponse implements AllAssetInfoResponseInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Abbreviation of the LT |
12
|
|
|
* @var string $ltCode |
13
|
|
|
*/ |
14
|
|
|
private string $ltCode; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Full name of the LT |
18
|
|
|
* @var string $ltName |
19
|
|
|
*/ |
20
|
|
|
private string $ltName; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Max. purchase amount per transaction |
24
|
|
|
* @var float $maxPurchase |
25
|
|
|
*/ |
26
|
|
|
private float $maxPurchase; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Min. purchase amount per transaction |
30
|
|
|
* @var float $minPurchase |
31
|
|
|
*/ |
32
|
|
|
private float $minPurchase; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Max. purchase amount per day |
36
|
|
|
* @var float $maxPurchaseDaily |
37
|
|
|
*/ |
38
|
|
|
private float $maxPurchaseDaily; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Max. redemption amount per transaction |
42
|
|
|
* @var float $maxRedeem |
43
|
|
|
*/ |
44
|
|
|
private float $maxRedeem; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Min. redemption amount per transaction |
48
|
|
|
* @var float $minRedeem |
49
|
|
|
*/ |
50
|
|
|
private float $minRedeem; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Max. redemption amount per day |
54
|
|
|
* @var float $maxRedeemDaily |
55
|
|
|
*/ |
56
|
|
|
private float $maxRedeemDaily; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Purchase fees |
60
|
|
|
* @var float $purchaseFeeRate |
61
|
|
|
*/ |
62
|
|
|
private float $purchaseFeeRate; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Redemption fees |
66
|
|
|
* @var float $redeemFeeRate |
67
|
|
|
*/ |
68
|
|
|
private float $redeemFeeRate; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Whether the LT can be purchased or redeemed |
72
|
|
|
* @var string $status |
73
|
|
|
*/ |
74
|
|
|
private string $status; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Funding fees charged daily to users who hold LT |
78
|
|
|
* @var float $fundFee |
79
|
|
|
*/ |
80
|
|
|
private float $fundFee; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Timestamps when funding fees are charged |
84
|
|
|
* @var \DateTime $fundFeeTime |
85
|
|
|
*/ |
86
|
|
|
private \DateTime $fundFeeTime; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Management fees |
90
|
|
|
* @var float $manageFeeRate |
91
|
|
|
*/ |
92
|
|
|
private float $manageFeeRate; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Timestamps when management fees are charged |
96
|
|
|
* @var \DateTime $manageFeeTime |
97
|
|
|
*/ |
98
|
|
|
private \DateTime $manageFeeTime; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Application upper limit |
102
|
|
|
* @var float $total |
103
|
|
|
*/ |
104
|
|
|
private float $total; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Net asset value |
108
|
|
|
* @var float $netValue |
109
|
|
|
*/ |
110
|
|
|
private float $netValue; |
111
|
|
|
|
112
|
|
|
public function __construct(array $data) |
113
|
|
|
{ |
114
|
|
|
$this |
115
|
|
|
->setLtCode($data['ltCode']) |
116
|
|
|
->setLtName($data['ltName']) |
117
|
|
|
->setMaxPurchase($data['maxPurchase']) |
118
|
|
|
->setMinPurchase($data['minPurchase']) |
119
|
|
|
->setMaxPurchaseDaily($data['maxPurchaseDaily']) |
120
|
|
|
->setMaxRedeem($data['maxRedeem']) |
121
|
|
|
->setMaxRedeemDaily($data['maxRedeemDaily']) |
122
|
|
|
->setPurchaseFeeRate($data['purchaseFeeRate']) |
123
|
|
|
->setRedeemFeeRate($data['redeemFeeRate']) |
124
|
|
|
->setStatus($data['status']) |
125
|
|
|
->setFundFee($data['fundFee']) |
126
|
|
|
->setFundFeeTime($data['fundFeeTime']) |
127
|
|
|
->setManageFeeRate($data['manageFeeRate']) |
128
|
|
|
->setManageFeeTime($data['manageFeeTime']) |
129
|
|
|
->setTotal($data['total']) |
130
|
|
|
->setNetValue($data['netValue']); |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @return string |
135
|
|
|
*/ |
136
|
|
|
public function getLtCode(): string |
137
|
|
|
{ |
138
|
|
|
return $this->ltCode; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @param string $ltCode |
143
|
|
|
* @return AllAssetInfoResponse |
144
|
|
|
*/ |
145
|
|
|
private function setLtCode(string $ltCode): self |
146
|
|
|
{ |
147
|
|
|
$this->ltCode = $ltCode; |
148
|
|
|
return $this; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return string |
153
|
|
|
*/ |
154
|
|
|
public function getLtName(): string |
155
|
|
|
{ |
156
|
|
|
return $this->ltName; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @param string $ltName |
161
|
|
|
* @return AllAssetInfoResponse |
162
|
|
|
*/ |
163
|
|
|
private function setLtName(string $ltName): self |
164
|
|
|
{ |
165
|
|
|
$this->ltName = $ltName; |
166
|
|
|
return $this; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @return float |
171
|
|
|
*/ |
172
|
|
|
public function getMaxPurchase(): float |
173
|
|
|
{ |
174
|
|
|
return $this->maxPurchase; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @param float $maxPurchase |
179
|
|
|
* @return AllAssetInfoResponse |
180
|
|
|
*/ |
181
|
|
|
private function setMaxPurchase(float $maxPurchase): self |
182
|
|
|
{ |
183
|
|
|
$this->maxPurchase = $maxPurchase; |
184
|
|
|
return $this; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @return float |
189
|
|
|
*/ |
190
|
|
|
public function getMinPurchase(): float |
191
|
|
|
{ |
192
|
|
|
return $this->minPurchase; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @param float $minPurchase |
197
|
|
|
* @return AllAssetInfoResponse |
198
|
|
|
*/ |
199
|
|
|
private function setMinPurchase(float $minPurchase): self |
200
|
|
|
{ |
201
|
|
|
$this->minPurchase = $minPurchase; |
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* @return float |
207
|
|
|
*/ |
208
|
|
|
public function getMaxPurchaseDaily(): float |
209
|
|
|
{ |
210
|
|
|
return $this->maxPurchaseDaily; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* @param float $maxPurchaseDaily |
215
|
|
|
* @return AllAssetInfoResponse |
216
|
|
|
*/ |
217
|
|
|
private function setMaxPurchaseDaily(float $maxPurchaseDaily): self |
218
|
|
|
{ |
219
|
|
|
$this->maxPurchaseDaily = $maxPurchaseDaily; |
220
|
|
|
return $this; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* @return float |
225
|
|
|
*/ |
226
|
|
|
public function getMaxRedeem(): float |
227
|
|
|
{ |
228
|
|
|
return $this->maxRedeem; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* @param float $maxRedeem |
233
|
|
|
* @return AllAssetInfoResponse |
234
|
|
|
*/ |
235
|
|
|
private function setMaxRedeem(float $maxRedeem): self |
236
|
|
|
{ |
237
|
|
|
$this->maxRedeem = $maxRedeem; |
238
|
|
|
return $this; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @return float |
243
|
|
|
*/ |
244
|
|
|
public function getMinRedeem(): float |
245
|
|
|
{ |
246
|
|
|
return $this->minRedeem; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* @param float $minRedeem |
251
|
|
|
* @return AllAssetInfoResponse |
252
|
|
|
*/ |
253
|
|
|
private function setMinRedeem(float $minRedeem): self |
|
|
|
|
254
|
|
|
{ |
255
|
|
|
$this->minRedeem = $minRedeem; |
256
|
|
|
return $this; |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @return float |
261
|
|
|
*/ |
262
|
|
|
public function getMaxRedeemDaily(): float |
263
|
|
|
{ |
264
|
|
|
return $this->maxRedeemDaily; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* @param float $maxRedeemDaily |
269
|
|
|
* @return AllAssetInfoResponse |
270
|
|
|
*/ |
271
|
|
|
private function setMaxRedeemDaily(float $maxRedeemDaily): self |
272
|
|
|
{ |
273
|
|
|
$this->maxRedeemDaily = $maxRedeemDaily; |
274
|
|
|
return $this; |
275
|
|
|
} |
276
|
|
|
|
277
|
|
|
/** |
278
|
|
|
* @return float |
279
|
|
|
*/ |
280
|
|
|
public function getPurchaseFeeRate(): float |
281
|
|
|
{ |
282
|
|
|
return $this->purchaseFeeRate; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* @param float $purchaseFeeRate |
287
|
|
|
* @return AllAssetInfoResponse |
288
|
|
|
*/ |
289
|
|
|
private function setPurchaseFeeRate(float $purchaseFeeRate): self |
290
|
|
|
{ |
291
|
|
|
$this->purchaseFeeRate = $purchaseFeeRate; |
292
|
|
|
return $this; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* @return float |
297
|
|
|
*/ |
298
|
|
|
public function getRedeemFeeRate(): float |
299
|
|
|
{ |
300
|
|
|
return $this->redeemFeeRate; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* @param float $redeemFeeRate |
305
|
|
|
* @return AllAssetInfoResponse |
306
|
|
|
*/ |
307
|
|
|
private function setRedeemFeeRate(float $redeemFeeRate): self |
308
|
|
|
{ |
309
|
|
|
$this->redeemFeeRate = $redeemFeeRate; |
310
|
|
|
return $this; |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* @return string |
315
|
|
|
*/ |
316
|
|
|
public function getStatus(): string |
317
|
|
|
{ |
318
|
|
|
return $this->status; |
319
|
|
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* @param string $status |
323
|
|
|
* @return AllAssetInfoResponse |
324
|
|
|
*/ |
325
|
|
|
private function setStatus(string $status): self |
326
|
|
|
{ |
327
|
|
|
$this->status = $status; |
328
|
|
|
return $this; |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
/** |
332
|
|
|
* @return float |
333
|
|
|
*/ |
334
|
|
|
public function getFundFee(): float |
335
|
|
|
{ |
336
|
|
|
return $this->fundFee; |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* @param float $fundFee |
341
|
|
|
* @return AllAssetInfoResponse |
342
|
|
|
*/ |
343
|
|
|
private function setFundFee(float $fundFee): self |
344
|
|
|
{ |
345
|
|
|
$this->fundFee = $fundFee; |
346
|
|
|
return $this; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* @return \DateTime |
351
|
|
|
*/ |
352
|
|
|
public function getFundFeeTime(): \DateTime |
353
|
|
|
{ |
354
|
|
|
return $this->fundFeeTime; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @param string $fundFeeTime |
359
|
|
|
* @return AllAssetInfoResponse |
360
|
|
|
*/ |
361
|
|
|
private function setFundFeeTime(string $fundFeeTime): self |
362
|
|
|
{ |
363
|
|
|
$this->fundFeeTime = DateTimeHelper::makeFromTimestamp($fundFeeTime); |
|
|
|
|
364
|
|
|
return $this; |
365
|
|
|
} |
366
|
|
|
|
367
|
|
|
/** |
368
|
|
|
* @return float |
369
|
|
|
*/ |
370
|
|
|
public function getManageFeeRate(): float |
371
|
|
|
{ |
372
|
|
|
return $this->manageFeeRate; |
373
|
|
|
} |
374
|
|
|
|
375
|
|
|
/** |
376
|
|
|
* @param float $manageFeeRate |
377
|
|
|
* @return AllAssetInfoResponse |
378
|
|
|
*/ |
379
|
|
|
private function setManageFeeRate(float $manageFeeRate): self |
380
|
|
|
{ |
381
|
|
|
$this->manageFeeRate = $manageFeeRate; |
382
|
|
|
return $this; |
383
|
|
|
} |
384
|
|
|
|
385
|
|
|
/** |
386
|
|
|
* @return \DateTime |
387
|
|
|
*/ |
388
|
|
|
public function getManageFeeTime(): \DateTime |
389
|
|
|
{ |
390
|
|
|
return $this->manageFeeTime; |
391
|
|
|
} |
392
|
|
|
|
393
|
|
|
/** |
394
|
|
|
* @param string $manageFeeTime |
395
|
|
|
* @return AllAssetInfoResponse |
396
|
|
|
*/ |
397
|
|
|
public function setManageFeeTime(string $manageFeeTime): self |
398
|
|
|
{ |
399
|
|
|
$this->manageFeeTime = DateTimeHelper::makeFromTimestamp($manageFeeTime); |
|
|
|
|
400
|
|
|
return $this; |
401
|
|
|
} |
402
|
|
|
|
403
|
|
|
/** |
404
|
|
|
* @return float |
405
|
|
|
*/ |
406
|
|
|
public function getTotal(): float |
407
|
|
|
{ |
408
|
|
|
return $this->total; |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
/** |
412
|
|
|
* @param float $total |
413
|
|
|
* @return AllAssetInfoResponse |
414
|
|
|
*/ |
415
|
|
|
public function setTotal(float $total): self |
416
|
|
|
{ |
417
|
|
|
$this->total = $total; |
418
|
|
|
return $this; |
419
|
|
|
} |
420
|
|
|
|
421
|
|
|
/** |
422
|
|
|
* @return float |
423
|
|
|
*/ |
424
|
|
|
public function getNetValue(): float |
425
|
|
|
{ |
426
|
|
|
return $this->netValue; |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
/** |
430
|
|
|
* @param float $netValue |
431
|
|
|
* @return AllAssetInfoResponse |
432
|
|
|
*/ |
433
|
|
|
private function setNetValue(float $netValue): self |
434
|
|
|
{ |
435
|
|
|
$this->netValue = $netValue; |
436
|
|
|
return $this; |
437
|
|
|
} |
438
|
|
|
} |
This check looks for private methods that have been defined, but are not used inside the class.