1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CryptoMarkets\Binance; |
4
|
|
|
|
5
|
|
|
use CryptoMarkets\Common\Gateway as BaseGateway; |
6
|
|
|
|
7
|
|
|
class Gateway extends BaseGateway |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Get the default options. |
11
|
|
|
* |
12
|
|
|
* @return array |
13
|
|
|
*/ |
14
|
|
|
public function getDefaultOptions() |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
|
|
'api_key' => null, |
18
|
|
|
'secret' => null, |
19
|
|
|
]; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Get the gateway name. |
24
|
|
|
* |
25
|
|
|
* @return string |
26
|
|
|
*/ |
27
|
|
|
public function getName() |
28
|
|
|
{ |
29
|
|
|
return 'Binance'; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* {@inheritdoc} |
34
|
|
|
*/ |
35
|
|
|
public function symbols(array $params = []) |
36
|
|
|
{ |
37
|
|
|
return $this->createRequest(Endpoints\Symbol::class, $params); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* {@inheritdoc} |
42
|
|
|
*/ |
43
|
|
|
public function ticker(array $params = []) |
44
|
|
|
{ |
45
|
|
|
return $this->createRequest(Endpoints\Ticker::class, $params); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* {@inheritdoc} |
50
|
|
|
*/ |
51
|
|
|
public function orderBook(array $params = []) |
52
|
|
|
{ |
53
|
|
|
return $this->createRequest(Endpoints\OrderBook::class, $params); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* {@inheritdoc} |
58
|
|
|
*/ |
59
|
|
|
public function trades(array $params = []) |
60
|
|
|
{ |
61
|
|
|
return $this->createRequest(Endpoints\Trade::class, $params); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* {@inheritdoc} |
66
|
|
|
*/ |
67
|
|
|
public function balances(array $params = []) |
68
|
|
|
{ |
69
|
|
|
return $this->createRequest(Endpoints\Balance::class, $params); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* {@inheritdoc} |
74
|
|
|
*/ |
75
|
|
|
public function buy(array $params = []) |
76
|
|
|
{ |
77
|
|
|
return $this->createRequest(Endpoints\Buy::class, $params); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* {@inheritdoc} |
82
|
|
|
*/ |
83
|
|
|
public function sell(array $params = []) |
84
|
|
|
{ |
85
|
|
|
return $this->createRequest(Endpoints\Sell::class, $params); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* {@inheritdoc} |
90
|
|
|
*/ |
91
|
|
|
public function status(array $params = []) |
92
|
|
|
{ |
93
|
|
|
return $this->createRequest(Endpoints\Status::class, $params); |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* {@inheritdoc} |
98
|
|
|
*/ |
99
|
|
|
public function cancel(array $params = []) |
100
|
|
|
{ |
101
|
|
|
return $this->createRequest(Endpoints\Cancel::class, $params); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* {@inheritdoc} |
106
|
|
|
*/ |
107
|
|
|
public function openOrders(array $params = []) |
108
|
|
|
{ |
109
|
|
|
return $this->createRequest(Endpoints\OpenOrders::class, $params); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* {@inheritdoc} |
114
|
|
|
*/ |
115
|
|
|
public function tradeHistory(array $params = []) |
116
|
|
|
{ |
117
|
|
|
return $this->createRequest(Endpoints\TradeHistory::class, $params); |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
|