|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Account\WalletBalance\Response; |
|
4
|
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse; |
|
6
|
|
|
use Carpenstar\ByBitAPI\Derivatives\Contract\Account\WalletBalance\Interfaces\IWalletBalanceResponseItemInterface; |
|
7
|
|
|
|
|
8
|
|
|
class WalletBalanceResponseItem extends AbstractResponse implements IWalletBalanceResponseItemInterface |
|
9
|
|
|
{ |
|
10
|
|
|
private string $coin; |
|
11
|
|
|
private float $equity; |
|
12
|
|
|
private float $walletBalance; |
|
13
|
|
|
private float $positionMargin; |
|
14
|
|
|
private float $availableBalance; |
|
15
|
|
|
private float $orderMargin; |
|
16
|
|
|
private float $occClosingFee; |
|
17
|
|
|
private float $occFundingFee; |
|
18
|
|
|
private float $unrealisedPnl; |
|
19
|
|
|
private float $cumRealisedPnl; |
|
20
|
|
|
private float $givenCash; |
|
21
|
|
|
private float $serviceCash; |
|
22
|
|
|
private float $accountIM; |
|
23
|
|
|
private float $accountMM; |
|
24
|
|
|
|
|
25
|
|
|
public function __construct(array $data) |
|
26
|
|
|
{ |
|
27
|
|
|
$this->coin = $data['coin']; |
|
28
|
|
|
$this->equity = $data['equity']; |
|
29
|
|
|
$this->walletBalance = (float) $data['walletBalance']; |
|
30
|
|
|
$this->positionMargin = (float) $data['positionMargin']; |
|
31
|
|
|
$this->availableBalance = (float) $data['availableBalance']; |
|
32
|
|
|
$this->orderMargin = (float) $data['orderMargin']; |
|
33
|
|
|
$this->occClosingFee = (float) $data['occClosingFee']; |
|
34
|
|
|
$this->occFundingFee = (float) $data['occFundingFee']; |
|
35
|
|
|
$this->unrealisedPnl = (float) $data['unrealisedPnl']; |
|
36
|
|
|
$this->cumRealisedPnl = (float) $data['cumRealisedPnl']; |
|
37
|
|
|
$this->givenCash = (float) $data['givenCash']; |
|
38
|
|
|
$this->serviceCash = (float) $data['serviceCash']; |
|
39
|
|
|
$this->accountIM = (float) $data['accountIM']; |
|
40
|
|
|
$this->accountMM = (float) $data['accountMM']; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @return string |
|
45
|
|
|
*/ |
|
46
|
|
|
public function getCoin(): string |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->coin; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @return float |
|
53
|
|
|
*/ |
|
54
|
|
|
public function getEquity(): float |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->equity; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @return float |
|
61
|
|
|
*/ |
|
62
|
|
|
public function getWalletBalance(): float |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->walletBalance; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @return float |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getPositionMargin(): float |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->positionMargin; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @return float |
|
77
|
|
|
*/ |
|
78
|
|
|
public function getAvailableBalance(): float |
|
79
|
|
|
{ |
|
80
|
|
|
return $this->availableBalance; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @return float |
|
85
|
|
|
*/ |
|
86
|
|
|
public function getOrderMargin(): float |
|
87
|
|
|
{ |
|
88
|
|
|
return $this->orderMargin; |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* @return float |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getOccClosingFee(): float |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->occClosingFee; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* @return float |
|
101
|
|
|
*/ |
|
102
|
|
|
public function getOccFundingFee(): float |
|
103
|
|
|
{ |
|
104
|
|
|
return $this->occFundingFee; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @return float |
|
109
|
|
|
*/ |
|
110
|
|
|
public function getUnrealisedPnl(): float |
|
111
|
|
|
{ |
|
112
|
|
|
return $this->unrealisedPnl; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* @return float |
|
117
|
|
|
*/ |
|
118
|
|
|
public function getCumRealisedPnl(): float |
|
119
|
|
|
{ |
|
120
|
|
|
return $this->cumRealisedPnl; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* @return float |
|
125
|
|
|
*/ |
|
126
|
|
|
public function getGivenCash(): float |
|
127
|
|
|
{ |
|
128
|
|
|
return $this->givenCash; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @return float |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getServiceCash(): float |
|
135
|
|
|
{ |
|
136
|
|
|
return $this->serviceCash; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @return string |
|
141
|
|
|
*/ |
|
142
|
|
|
public function getAccountIM(): float |
|
143
|
|
|
{ |
|
144
|
|
|
return $this->accountIM; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* @return string |
|
149
|
|
|
*/ |
|
150
|
|
|
public function getAccountMM(): float |
|
151
|
|
|
{ |
|
152
|
|
|
return $this->accountMM; |
|
153
|
|
|
} |
|
154
|
|
|
} |