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