Skip to content

Commit

Permalink
1.17.408
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Oct 24, 2018
1 parent 5e11881 commit c367904
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 157 deletions.
68 changes: 29 additions & 39 deletions build/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.17.407'
const version = '1.17.408'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -44777,68 +44777,58 @@ module.exports = class kuna extends acx {
}

async fetchMarkets () {
let predefinedMarkets = [
{ 'id': 'btcuah', 'symbol': 'BTC/UAH', 'base': 'BTC', 'quote': 'UAH', 'baseId': 'btc', 'quoteId': 'uah', 'precision': { 'amount': 6, 'price': 0 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 1, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'ethuah', 'symbol': 'ETH/UAH', 'base': 'ETH', 'quote': 'UAH', 'baseId': 'eth', 'quoteId': 'uah', 'precision': { 'amount': 6, 'price': 0 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 1, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'gbguah', 'symbol': 'GBG/UAH', 'base': 'GBG', 'quote': 'UAH', 'baseId': 'gbg', 'quoteId': 'uah', 'precision': { 'amount': 3, 'price': 2 }, 'limits': { 'amount': { 'min': 0.001, 'max': undefined }, 'price': { 'min': 0.01, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}}, // Golos Gold (GBG != GOLOS)
{ 'id': 'kunbtc', 'symbol': 'KUN/BTC', 'base': 'KUN', 'quote': 'BTC', 'baseId': 'kun', 'quoteId': 'btc', 'precision': { 'amount': 6, 'price': 6 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 0.000001, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'bchbtc', 'symbol': 'BCH/BTC', 'base': 'BCH', 'quote': 'BTC', 'baseId': 'bch', 'quoteId': 'btc', 'precision': { 'amount': 6, 'price': 6 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 0.000001, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'bchuah', 'symbol': 'BCH/UAH', 'base': 'BCH', 'quote': 'UAH', 'baseId': 'bch', 'quoteId': 'uah', 'precision': { 'amount': 6, 'price': 0 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 1, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'wavesuah', 'symbol': 'WAVES/UAH', 'base': 'WAVES', 'quote': 'UAH', 'baseId': 'waves', 'quoteId': 'uah', 'precision': { 'amount': 6, 'price': 0 }, 'limits': { 'amount': { 'min': 0.000001, 'max': undefined }, 'price': { 'min': 1, 'max': undefined }, 'cost': { 'min': 0.000001, 'max': undefined }}},
{ 'id': 'arnbtc', 'symbol': 'ARN/BTC', 'base': 'ARN', 'quote': 'BTC', 'baseId': 'arn', 'quoteId': 'btc' },
{ 'id': 'b2bbtc', 'symbol': 'B2B/BTC', 'base': 'B2B', 'quote': 'BTC', 'baseId': 'b2b', 'quoteId': 'btc' },
{ 'id': 'evrbtc', 'symbol': 'EVR/BTC', 'base': 'EVR', 'quote': 'BTC', 'baseId': 'evr', 'quoteId': 'btc' },
{ 'id': 'golgbg', 'symbol': 'GOL/GBG', 'base': 'GOL', 'quote': 'GBG', 'baseId': 'gol', 'quoteId': 'gbg' },
{ 'id': 'rbtc', 'symbol': 'R/BTC', 'base': 'R', 'quote': 'BTC', 'baseId': 'r', 'quoteId': 'btc' },
{ 'id': 'rmcbtc', 'symbol': 'RMC/BTC', 'base': 'RMC', 'quote': 'BTC', 'baseId': 'rmc', 'quoteId': 'btc' },
];
const quotes = [ 'btc', 'eth', 'eurs', 'gbg', 'uah' ];
const pricePrecisions = {
'UAH': 0,
};
let markets = [];
let tickers = await this.publicGetTickers ();
for (let i = 0; i < predefinedMarkets.length; i++) {
let market = predefinedMarkets[i];
if (market['id'] in tickers)
markets.push (market);
}
let marketsById = this.indexBy (markets, 'id');
let ids = Object.keys (tickers);
for (let i = 0; i < ids.length; i++) {
let id = ids[i];
if (!(id in marketsById)) {
let baseId = id.replace ('btc', '');
baseId = baseId.replace ('uah', '');
baseId = baseId.replace ('gbg', '');
baseId = baseId.replace ('eth', '');
if (baseId.length > 0) {
let baseIdLength = baseId.length - 0; // a transpiler workaround
let quoteId = id.slice (baseIdLength);
for (let j = 0; j < quotes.length; j++) {
let quoteId = quotes[j];
if (id.indexOf (quoteId) > 0) {
let baseId = id.replace (quoteId, '');
let base = baseId.toUpperCase ();
let quote = quoteId.toUpperCase ();
base = this.commonCurrencyCode (base);
quote = this.commonCurrencyCode (quote);
let symbol = base + '/' + quote;
let precision = {
'amount': 6,
'price': this.safeInteger (pricePrecisions, quote, 6),
};
markets.push ({
'id': id,
'symbol': symbol,
'base': base,
'quote': quote,
'baseId': baseId,
'quoteId': quoteId,
'precision': precision,
'limits': {
'amount': {
'min': Math.pow (10, -precision['amount']),
'max': Math.pow (10, precision['amount']),
},
'price': {
'min': Math.pow (10, -precision['price']),
'max': Math.pow (10, precision['price']),
},
'cost': {
'min': undefined,
'max': undefined,
},
},
});
break;
}
}
}
return markets;
}

async fetchOrderBook (symbol, limit = undefined, params = {}) {
await this.loadMarkets ();
let market = this.market (symbol);
let orderBook = await this.publicGetOrderBook (this.extend ({
'market': market['id'],
}, params));
return this.parseOrderBook (orderBook, undefined, 'bids', 'asks', 'price', 'remaining_volume');
}

async fetchL3OrderBook (symbol, limit = undefined, params = {}) {
return this.fetchOrderBook (symbol, limit, params);
}
Expand Down
2 changes: 1 addition & 1 deletion ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.17.407'
const version = '1.17.408'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.17.407",
"version": "1.17.408",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
4 changes: 2 additions & 2 deletions php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use kornrunner\Secp256k1;
use kornrunner\Solidity;

$version = '1.17.407';
$version = '1.17.408';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -50,7 +50,7 @@

class Exchange {

const VERSION = '1.17.407';
const VERSION = '1.17.408';

public static $eth_units = array (
'wei' => '1',
Expand Down
64 changes: 27 additions & 37 deletions php/kuna.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,68 +58,58 @@ public function describe () {
}

public function fetch_markets () {
$predefinedMarkets = array (
array ( 'id' => 'btcuah', 'symbol' => 'BTC/UAH', 'base' => 'BTC', 'quote' => 'UAH', 'baseId' => 'btc', 'quoteId' => 'uah', 'precision' => array ( 'amount' => 6, 'price' => 0 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 1, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'ethuah', 'symbol' => 'ETH/UAH', 'base' => 'ETH', 'quote' => 'UAH', 'baseId' => 'eth', 'quoteId' => 'uah', 'precision' => array ( 'amount' => 6, 'price' => 0 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 1, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'gbguah', 'symbol' => 'GBG/UAH', 'base' => 'GBG', 'quote' => 'UAH', 'baseId' => 'gbg', 'quoteId' => 'uah', 'precision' => array ( 'amount' => 3, 'price' => 2 ), 'limits' => array ( 'amount' => array ( 'min' => 0.001, 'max' => null ), 'price' => array ( 'min' => 0.01, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))), // Golos Gold (GBG != GOLOS)
array ( 'id' => 'kunbtc', 'symbol' => 'KUN/BTC', 'base' => 'KUN', 'quote' => 'BTC', 'baseId' => 'kun', 'quoteId' => 'btc', 'precision' => array ( 'amount' => 6, 'price' => 6 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 0.000001, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'bchbtc', 'symbol' => 'BCH/BTC', 'base' => 'BCH', 'quote' => 'BTC', 'baseId' => 'bch', 'quoteId' => 'btc', 'precision' => array ( 'amount' => 6, 'price' => 6 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 0.000001, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'bchuah', 'symbol' => 'BCH/UAH', 'base' => 'BCH', 'quote' => 'UAH', 'baseId' => 'bch', 'quoteId' => 'uah', 'precision' => array ( 'amount' => 6, 'price' => 0 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 1, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'wavesuah', 'symbol' => 'WAVES/UAH', 'base' => 'WAVES', 'quote' => 'UAH', 'baseId' => 'waves', 'quoteId' => 'uah', 'precision' => array ( 'amount' => 6, 'price' => 0 ), 'limits' => array ( 'amount' => array ( 'min' => 0.000001, 'max' => null ), 'price' => array ( 'min' => 1, 'max' => null ), 'cost' => array ( 'min' => 0.000001, 'max' => null ))),
array ( 'id' => 'arnbtc', 'symbol' => 'ARN/BTC', 'base' => 'ARN', 'quote' => 'BTC', 'baseId' => 'arn', 'quoteId' => 'btc' ),
array ( 'id' => 'b2bbtc', 'symbol' => 'B2B/BTC', 'base' => 'B2B', 'quote' => 'BTC', 'baseId' => 'b2b', 'quoteId' => 'btc' ),
array ( 'id' => 'evrbtc', 'symbol' => 'EVR/BTC', 'base' => 'EVR', 'quote' => 'BTC', 'baseId' => 'evr', 'quoteId' => 'btc' ),
array ( 'id' => 'golgbg', 'symbol' => 'GOL/GBG', 'base' => 'GOL', 'quote' => 'GBG', 'baseId' => 'gol', 'quoteId' => 'gbg' ),
array ( 'id' => 'rbtc', 'symbol' => 'R/BTC', 'base' => 'R', 'quote' => 'BTC', 'baseId' => 'r', 'quoteId' => 'btc' ),
array ( 'id' => 'rmcbtc', 'symbol' => 'RMC/BTC', 'base' => 'RMC', 'quote' => 'BTC', 'baseId' => 'rmc', 'quoteId' => 'btc' ),
$quotes = array ( 'btc', 'eth', 'eurs', 'gbg', 'uah' );
$pricePrecisions = array (
'UAH' => 0,
);
$markets = array ();
$tickers = $this->publicGetTickers ();
for ($i = 0; $i < count ($predefinedMarkets); $i++) {
$market = $predefinedMarkets[$i];
if (is_array ($tickers) && array_key_exists ($market['id'], $tickers))
$markets[] = $market;
}
$marketsById = $this->index_by($markets, 'id');
$ids = is_array ($tickers) ? array_keys ($tickers) : array ();
for ($i = 0; $i < count ($ids); $i++) {
$id = $ids[$i];
if (!(is_array ($marketsById) && array_key_exists ($id, $marketsById))) {
$baseId = str_replace ('btc', '', $id);
$baseId = str_replace ('uah', '', $baseId);
$baseId = str_replace ('gbg', '', $baseId);
$baseId = str_replace ('eth', '', $baseId);
if (strlen ($baseId) > 0) {
$baseIdLength = strlen ($baseId) - 0; // a transpiler workaround
$quoteId = mb_substr ($id, $baseIdLength);
for ($j = 0; $j < count ($quotes); $j++) {
$quoteId = $quotes[$j];
if (mb_strpos ($id, $quoteId) > 0) {
$baseId = str_replace ($quoteId, '', $id);
$base = strtoupper ($baseId);
$quote = strtoupper ($quoteId);
$base = $this->common_currency_code($base);
$quote = $this->common_currency_code($quote);
$symbol = $base . '/' . $quote;
$precision = array (
'amount' => 6,
'price' => $this->safe_integer($pricePrecisions, $quote, 6),
);
$markets[] = array (
'id' => $id,
'symbol' => $symbol,
'base' => $base,
'quote' => $quote,
'baseId' => $baseId,
'quoteId' => $quoteId,
'precision' => $precision,
'limits' => array (
'amount' => array (
'min' => pow (10, -$precision['amount']),
'max' => pow (10, $precision['amount']),
),
'price' => array (
'min' => pow (10, -$precision['price']),
'max' => pow (10, $precision['price']),
),
'cost' => array (
'min' => null,
'max' => null,
),
),
);
break;
}
}
}
return $markets;
}

public function fetch_order_book ($symbol, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market ($symbol);
$orderBook = $this->publicGetOrderBook (array_merge (array (
'market' => $market['id'],
), $params));
return $this->parse_order_book($orderBook, null, 'bids', 'asks', 'price', 'remaining_volume');
}

public function fetch_l3_order_book ($symbol, $limit = null, $params = array ()) {
return $this->fetch_order_book($symbol, $limit, $params);
}
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# ----------------------------------------------------------------------------

__version__ = '1.17.407'
__version__ = '1.17.408'

# ----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.17.407'
__version__ = '1.17.408'

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# -----------------------------------------------------------------------------

__version__ = '1.17.407'
__version__ = '1.17.408'

# -----------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit c367904

Please sign in to comment.