|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace HanischIt\KrakenApi\Call\ClosedOrders; |
|
4
|
|
|
|
|
5
|
|
|
use HanischIt\KrakenApi\Enum\VisibilityEnum; |
|
6
|
|
|
use HanischIt\KrakenApi\Model\RequestInterface; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class ClosedOrdersRequest |
|
10
|
|
|
* @package HanischIt\KrakenApi\Call\ClosedOrders |
|
11
|
|
|
*/ |
|
12
|
|
|
class ClosedOrdersRequest implements RequestInterface |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @var bool |
|
16
|
|
|
*/ |
|
17
|
|
|
private $trades; |
|
18
|
|
|
/** |
|
19
|
|
|
* @var string|null |
|
20
|
|
|
*/ |
|
21
|
|
|
private $userref; |
|
22
|
|
|
/** |
|
23
|
|
|
* @var null|string |
|
24
|
|
|
*/ |
|
25
|
|
|
private $start; |
|
26
|
|
|
/** |
|
27
|
|
|
* @var null|string |
|
28
|
|
|
*/ |
|
29
|
|
|
private $end; |
|
30
|
|
|
/** |
|
31
|
|
|
* @var int|null |
|
32
|
|
|
*/ |
|
33
|
|
|
private $ofs; |
|
34
|
|
|
/** |
|
35
|
|
|
* @var null|string |
|
36
|
|
|
*/ |
|
37
|
|
|
private $closetime; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* OrderBookRequest constructor. |
|
41
|
|
|
* |
|
42
|
|
|
* @param bool $trades |
|
43
|
|
|
* @param null|string $userref |
|
44
|
|
|
* @param null|string $start |
|
45
|
|
|
* @param null|string $end |
|
46
|
|
|
* @param null|int $ofs |
|
47
|
|
|
* @param null|string $closetime |
|
48
|
|
|
*/ |
|
49
|
3 |
|
public function __construct( |
|
50
|
|
|
$trades = false, |
|
51
|
|
|
$userref = null, |
|
52
|
|
|
$start = null, |
|
53
|
|
|
$end = null, |
|
54
|
|
|
$ofs = null, |
|
55
|
|
|
$closetime = null |
|
56
|
|
|
) { |
|
57
|
3 |
|
$this->trades = $trades; |
|
58
|
3 |
|
$this->userref = $userref; |
|
59
|
3 |
|
$this->start = $start; |
|
60
|
3 |
|
$this->end = $end; |
|
61
|
3 |
|
$this->ofs = $ofs; |
|
62
|
3 |
|
$this->closetime = $closetime; |
|
63
|
3 |
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Returns the api request name |
|
67
|
|
|
* |
|
68
|
|
|
* @return string |
|
69
|
|
|
*/ |
|
70
|
2 |
|
public function getMethod() |
|
71
|
|
|
{ |
|
72
|
2 |
|
return 'ClosedOrders'; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @return string |
|
77
|
|
|
*/ |
|
78
|
2 |
|
public function getVisibility() |
|
79
|
|
|
{ |
|
80
|
2 |
|
return VisibilityEnum::VISIBILITY_PRIVATE; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @return array |
|
85
|
|
|
*/ |
|
86
|
2 |
|
public function getRequestData() |
|
87
|
|
|
{ |
|
88
|
2 |
|
$arr = []; |
|
89
|
2 |
|
$arr["trades"] = $this->trades; |
|
90
|
2 |
|
if (null !== $this->userref) { |
|
91
|
1 |
|
$arr["userref"] = $this->userref; |
|
92
|
1 |
|
} |
|
93
|
2 |
|
if (null !== $this->start) { |
|
94
|
1 |
|
$arr["start"] = $this->start; |
|
95
|
1 |
|
} |
|
96
|
2 |
|
if (null !== $this->end) { |
|
97
|
1 |
|
$arr["end"] = $this->end; |
|
98
|
1 |
|
} |
|
99
|
2 |
|
if (null !== $this->ofs) { |
|
100
|
1 |
|
$arr["ofs"] = $this->ofs; |
|
101
|
1 |
|
} |
|
102
|
2 |
|
if (null !== $this->closetime) { |
|
103
|
1 |
|
$arr["closetime"] = $this->closetime; |
|
104
|
1 |
|
} |
|
105
|
|
|
|
|
106
|
2 |
|
return $arr; |
|
107
|
|
|
} |
|
108
|
|
|
|
|
109
|
|
|
/** |
|
110
|
|
|
* @return string |
|
111
|
|
|
*/ |
|
112
|
2 |
|
public function getResponseClassName() |
|
113
|
|
|
{ |
|
114
|
2 |
|
return ClosedOrdersResponse::class; |
|
115
|
|
|
} |
|
116
|
|
|
} |
|
117
|
|
|
|