1 | <?php |
||
14 | class PublicClient |
||
15 | { |
||
16 | /** |
||
17 | * @var GuzzleClient |
||
18 | */ |
||
19 | protected $client; |
||
20 | |||
21 | 13 | public function __construct() |
|
25 | |||
26 | /** |
||
27 | * @param string $url |
||
28 | * @return mixed |
||
29 | */ |
||
30 | 8 | protected function get($url) |
|
37 | |||
38 | /** |
||
39 | * @param string $endpoint The public endpoint name. |
||
40 | * @param array $params Optional named parameters. |
||
41 | * @param string $visibility `Public` or `Private`. |
||
42 | * @param string $method |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 12 | public function getEndpoint($endpoint, array $params = array(), $visibility = 'Public', |
|
59 | |||
60 | 12 | public function getEndpointUrl($endpoint, $visibility) { |
|
63 | |||
64 | /** |
||
65 | * Returns a list of valid primary currency codes. These are the digital currencies which can be |
||
66 | * traded on Independent Reserve. |
||
67 | * @return array |
||
68 | */ |
||
69 | 1 | public function getValidPrimaryCurrencyCodes() |
|
73 | |||
74 | /** |
||
75 | * Returns a list of valid secondary currency codes. These are the fiat currencies which are |
||
76 | * supported by Independent Reserve for trading purposes. |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getValidSecondaryCurrencyCodes() |
||
83 | |||
84 | /** |
||
85 | * Returns a list of valid limit order types which can be placed onto the Independent Reserve |
||
86 | * exchange platform. |
||
87 | * @return array |
||
88 | */ |
||
89 | 1 | public function getGetValidLimitOrderTypes() |
|
93 | |||
94 | /** |
||
95 | * Returns a list of valid market order types which can be placed onto the Independent Reserve |
||
96 | * exchange platform. |
||
97 | * @return array |
||
98 | */ |
||
99 | 1 | public function getValidMarketOrderTypes() |
|
103 | |||
104 | /** |
||
105 | * Returns a current snapshot of the Independent Reserve market for a given currency pair. |
||
106 | * @param string $primaryCurrencyCode The digital currency for which to retrieve market summary. |
||
107 | * Must be a valid primary currency, which can be checked via the |
||
108 | * getValidPrimaryCurrencyCodes() method. |
||
109 | * @param string $secondaryCurrencyCode The fiat currency in which to retrieve market summary. |
||
110 | * Must be a valid secondary currency, which can be checked via the |
||
111 | * getValidSecondaryCurrencyCodes() method. |
||
112 | * @return MarketSummary |
||
113 | */ |
||
114 | 1 | public function getMarketSummary($primaryCurrencyCode, $secondaryCurrencyCode) |
|
121 | |||
122 | /** |
||
123 | * Returns the Order Book for a given currency pair. |
||
124 | * @param string $primaryCurrencyCode The digital currency for which to retrieve order book. |
||
125 | * Must be a valid primary currency, which can be checked via the |
||
126 | * getValidPrimaryCurrencyCodes() method. |
||
127 | * @param string $secondaryCurrencyCode The fiat currency in which to retrieve order book. Must |
||
128 | * be a valid secondary currency, which can be checked via the |
||
129 | * getValidSecondaryCurrencyCodes() method. |
||
130 | * @return OrderBook |
||
131 | */ |
||
132 | 1 | public function getOrderBook($primaryCurrencyCode, $secondaryCurrencyCode) |
|
139 | |||
140 | /** |
||
141 | * Returns summarised historical trading data for a given currency pair. Data is summarised into |
||
142 | * 1 hour intervals. |
||
143 | * @note This method caches return values for 30 minutes. Calling it more than once per 30 |
||
144 | * minutes will result in cached data being returned. |
||
145 | * @param string $primaryCurrencyCode The digital currency for which to retrieve the trade |
||
146 | * history summary. Must be a valid primary currency, which can be checked via the |
||
147 | * getValidPrimaryCurrencyCodes() method. |
||
148 | * @param string $secondaryCurrencyCode The fiat currency in which to retrieve the trade history |
||
149 | * summary. Must be a valid secondary currency, which can be checked via the |
||
150 | * getValidSecondaryCurrencyCodes() method. |
||
151 | * @param int $numberOfHoursInThePastToRetrieve How many past hours of historical summary data |
||
152 | * to retrieve (maximum is 240). |
||
153 | * @return TradeHistorySummary |
||
154 | */ |
||
155 | 1 | public function getTradeHistorySummary($primaryCurrencyCode, $secondaryCurrencyCode, |
|
164 | |||
165 | /** |
||
166 | * Returns a list of most recently executed trades for a given currency pair. |
||
167 | * @note This method caches return values for 1 second. Calling it more than once per second |
||
168 | * will result in cached data being returned. |
||
169 | * @param string $primaryCurrencyCode The digital currency for which to retrieve recent trades. |
||
170 | * Must be a valid primary currency, which can be checked via the |
||
171 | * getValidPrimaryCurrencyCodes() method. |
||
172 | * @param string $secondaryCurrencyCode The fiat currency in which to retrieve recent trades. |
||
173 | * Must be a valid secondary currency, which can be checked via the |
||
174 | * getValidPrimaryCurrencyCodes() method. |
||
175 | * @param integer $numberOfRecentTradesToRetrieve How many recent trades to retrieve (maximum |
||
176 | * is 50). |
||
177 | * @return RecentTrades |
||
178 | */ |
||
179 | 1 | public function getRecentTrades($primaryCurrencyCode, $secondaryCurrencyCode, |
|
188 | |||
189 | /** |
||
190 | * Returns a list of exchange rates used by Independent Reserve when depositing funds or |
||
191 | * withdrawing funds from accounts. |
||
192 | * @note The rates represent the amount of Currency Code B that can be bought with 1 unit of |
||
193 | * Currency Code A. |
||
194 | * @note This method caches return values for 1 minute. Calling it more than once per minute |
||
195 | * will result in cached data being returned. |
||
196 | * @return FxRate[] |
||
197 | */ |
||
198 | public function getFxRates() |
||
204 | } |
||
205 |