1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\InstrumentInfo\Request; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
6
|
|
|
use Carpenstar\ByBitAPI\Derivatives\MarketData\InstrumentInfo\Interfaces\IInstrumentInfoRequestInterface; |
7
|
|
|
|
8
|
|
|
class InstrumentInfoRequest extends AbstractParameters implements IInstrumentInfoRequestInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Product type. linear only supports at now |
12
|
|
|
* @var string $category |
13
|
|
|
*/ |
14
|
|
|
protected string $category = "linear"; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Symbol name. query an option symbol, category is required |
18
|
|
|
* @var string $symbol |
19
|
|
|
*/ |
20
|
|
|
protected string $symbol; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Limit for data size per page. [1, 1000]. Default: 500 |
24
|
|
|
* @var int $limit |
25
|
|
|
*/ |
26
|
|
|
protected int $limit = 500; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Cursor. Used for pagination |
30
|
|
|
* @var string $cursor |
31
|
|
|
*/ |
32
|
|
|
protected string $cursor; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @return string |
36
|
|
|
*/ |
37
|
|
|
public function getSymbol(): string |
38
|
|
|
{ |
39
|
|
|
return $this->symbol; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @param string $symbol |
44
|
|
|
* @return InstrumentInfoRequest |
45
|
|
|
*/ |
46
|
|
|
public function setSymbol(string $symbol): self |
47
|
|
|
{ |
48
|
|
|
$this->symbol = $symbol; |
49
|
|
|
return $this; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @return string |
54
|
|
|
*/ |
55
|
|
|
public function getCategory(): string |
56
|
|
|
{ |
57
|
|
|
return $this->category; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param string $category |
62
|
|
|
* @return InstrumentInfoRequest |
63
|
|
|
*/ |
64
|
|
|
public function setCategory(string $category): self |
65
|
|
|
{ |
66
|
|
|
$this->category = $category; |
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return int |
72
|
|
|
*/ |
73
|
|
|
public function getLimit(): int |
74
|
|
|
{ |
75
|
|
|
return $this->limit; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param int $limit |
80
|
|
|
* @return InstrumentInfoRequest |
81
|
|
|
*/ |
82
|
|
|
public function setLimit(int $limit): self |
83
|
|
|
{ |
84
|
|
|
$this->limit = $limit; |
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return string |
90
|
|
|
*/ |
91
|
|
|
public function getCursor(): string |
92
|
|
|
{ |
93
|
|
|
return $this->cursor; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param string $cursor |
98
|
|
|
* @return InstrumentInfoRequest |
99
|
|
|
*/ |
100
|
|
|
public function setCursor(string $cursor): self |
101
|
|
|
{ |
102
|
|
|
$this->cursor = $cursor; |
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|