Skip to content

Commit

Permalink
added load_trading_limits to Exchange.php
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed May 31, 2018
1 parent 16c868c commit 77d9d16
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions php/Exchange.php
Expand Up @@ -684,6 +684,7 @@ public function __construct ($options = array ()) {
'fetchTickers' => false,
'fetchTrades' => true,
'fetchTradingFees' => false,
'fetchTradingLimits' => false,
'withdraw' => false,
);

Expand Down Expand Up @@ -1258,6 +1259,24 @@ public function fetchTotalBalance ($params = array ()) {
return $this->fetch_total_balance ($params);
}

public function load_trading_limits ($symbols = null, $reload = false, $params = array ()) {
if ($this->has['fetchTradingLimits']) {
if ($reload || !(is_array ($this->options) && array_key_exists ('limitsLoaded', $this->options))) {
$response = $this->fetch_trading_limits ($symbols);
$limits = $response['limits'];
$keys = is_array ($limits) ? array_keys ($limits) : array ();
for ($i = 0; $i < count ($keys); $i++) {
$symbol = $keys[$i];
$this->markets[$symbol] = array_replace_recursive ($this->markets[$symbol], array (
'limits' => $limits[$symbol],
));
}
$this->options['limitsLoaded'] = $this->milliseconds ();
}
}
return $this->markets;
}

public function filter_by_since_limit ($array, $since = null, $limit = null) {
$result = array ();
$array = array_values ($array);
Expand Down

0 comments on commit 77d9d16

Please sign in to comment.