1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetAutoAddMargin\Request; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
6
|
|
|
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetAutoAddMargin\Interfaces\ISetAutoAddMarginRequestInterface; |
7
|
|
|
|
8
|
|
|
class SetAutoAddMarginRequest extends AbstractParameters implements ISetAutoAddMarginRequestInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Symbol name |
12
|
|
|
* @var string $symbol |
13
|
|
|
*/ |
14
|
|
|
protected string $symbol; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Side. Buy,Sell |
18
|
|
|
* @var string $side |
19
|
|
|
*/ |
20
|
|
|
protected string $side; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Turn on/off auto add margin. 0: off. 1: on |
24
|
|
|
* @var int $autoAddMargin |
25
|
|
|
*/ |
26
|
|
|
protected int $autoAddMargin; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Position index |
30
|
|
|
* @var int $positionIdx |
31
|
|
|
*/ |
32
|
|
|
protected int $positionIdx; |
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 SetAutoAddMarginRequest |
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 getSide(): string |
56
|
|
|
{ |
57
|
|
|
return $this->side; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param string $side |
62
|
|
|
* @return SetAutoAddMarginRequest |
63
|
|
|
*/ |
64
|
|
|
public function setSide(string $side): self |
65
|
|
|
{ |
66
|
|
|
$this->side = $side; |
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return int |
72
|
|
|
*/ |
73
|
|
|
public function getAutoAddMargin(): int |
74
|
|
|
{ |
75
|
|
|
return $this->autoAddMargin; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param int $autoAddMargin |
80
|
|
|
* @return SetAutoAddMarginRequest |
81
|
|
|
*/ |
82
|
|
|
public function setAutoAddMargin(int $autoAddMargin): self |
83
|
|
|
{ |
84
|
|
|
$this->autoAddMargin = $autoAddMargin; |
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return int |
90
|
|
|
*/ |
91
|
|
|
public function getPositionIdx(): int |
92
|
|
|
{ |
93
|
|
|
return $this->positionIdx; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param int $positionIdx |
98
|
|
|
* @return SetAutoAddMarginRequest |
99
|
|
|
*/ |
100
|
|
|
public function setPositionIdx(int $positionIdx): self |
101
|
|
|
{ |
102
|
|
|
$this->positionIdx = $positionIdx; |
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|