1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\SwitchCrossIsolatedMargin\Request; |
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
6
|
|
|
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\SwitchCrossIsolatedMargin\Interfaces\ISwitchCrossIsolatedMarginRequestInterface; |
7
|
|
|
|
8
|
|
|
class SwitchCrossIsolatedMarginRequest extends AbstractParameters implements ISwitchCrossIsolatedMarginRequestInterface |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Symbol name |
12
|
|
|
* @var string $symbol |
13
|
|
|
*/ |
14
|
|
|
protected string $symbol; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* 0: cross margin. 1: isolated margin |
18
|
|
|
* @var int $tradeMode |
19
|
|
|
*/ |
20
|
|
|
protected int $tradeMode; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Buy side leverage. Make sure buyLeverage equals to sellLeverage |
24
|
|
|
* @var float $buyLeverage |
25
|
|
|
*/ |
26
|
|
|
protected float $buyLeverage; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* Sell side leverage. Make sure buyLeverage equals to sellLeverage |
30
|
|
|
* @var float $sellLeverage |
31
|
|
|
*/ |
32
|
|
|
protected float $sellLeverage; |
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 SwitchCrossIsolatedMarginRequest |
45
|
|
|
*/ |
46
|
|
|
public function setSymbol(string $symbol): self |
47
|
|
|
{ |
48
|
|
|
$this->symbol = $symbol; |
49
|
|
|
return $this; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @return int |
54
|
|
|
*/ |
55
|
|
|
public function getTradeMode(): int |
56
|
|
|
{ |
57
|
|
|
return $this->tradeMode; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param int $tradeMode |
62
|
|
|
* @return SwitchCrossIsolatedMarginRequest |
63
|
|
|
*/ |
64
|
|
|
public function setTradeMode(int $tradeMode): self |
65
|
|
|
{ |
66
|
|
|
$this->tradeMode = $tradeMode; |
67
|
|
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return float |
72
|
|
|
*/ |
73
|
|
|
public function getBuyLeverage(): float |
74
|
|
|
{ |
75
|
|
|
return $this->buyLeverage; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @param float $buyLeverage |
80
|
|
|
* @return SwitchCrossIsolatedMarginRequest |
81
|
|
|
*/ |
82
|
|
|
public function setBuyLeverage(float $buyLeverage): self |
83
|
|
|
{ |
84
|
|
|
$this->buyLeverage = $buyLeverage; |
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return float |
90
|
|
|
*/ |
91
|
|
|
public function getSellLeverage(): float |
92
|
|
|
{ |
93
|
|
|
return $this->sellLeverage; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param float $sellLeverage |
98
|
|
|
* @return SwitchCrossIsolatedMarginRequest |
99
|
|
|
*/ |
100
|
|
|
public function setSellLeverage(float $sellLeverage): self |
101
|
|
|
{ |
102
|
|
|
$this->sellLeverage = $sellLeverage; |
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
|
107
|
|
|
} |
108
|
|
|
|