diff --git a/README.md b/README.md index 6221c8ba65c0a..9c481875633e2 100644 --- a/README.md +++ b/README.md @@ -218,13 +218,13 @@ console.log (ccxt.exchanges) // print all available exchanges All-in-one browser bundle (dependencies included), served from a CDN of your choice: -* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.27.40/dist/ccxt.browser.js -* unpkg: https://unpkg.com/ccxt@1.27.40/dist/ccxt.browser.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.27.41/dist/ccxt.browser.js +* unpkg: https://unpkg.com/ccxt@1.27.41/dist/ccxt.browser.js CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers. ```HTML - + ``` Creates a global `ccxt` object: diff --git a/ccxt.js b/ccxt.js index d92b4037dddb6..72386eb473f82 100644 --- a/ccxt.js +++ b/ccxt.js @@ -35,7 +35,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.27.40' +const version = '1.27.41' Exchange.ccxtVersion = version diff --git a/dist/ccxt.browser.js b/dist/ccxt.browser.js index 53f9605b0d6d7..2f5ef4f2ec3d0 100644 --- a/dist/ccxt.browser.js +++ b/dist/ccxt.browser.js @@ -43,7 +43,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.27.40' +const version = '1.27.41' Exchange.ccxtVersion = version @@ -12433,8 +12433,60 @@ module.exports = class bitbay extends Exchange { }, 'fees': { 'trading': { + 'maker': 0.0, + 'taker': 0.1 / 100, + 'percentage': true, + 'tierBased': false, + }, + 'fiat': { 'maker': 0.30 / 100, 'taker': 0.43 / 100, + 'percentage': true, + 'tierBased': true, + 'tiers': { + 'taker': [ + [ 0.0043, 0 ], + [ 0.0042, 1250 ], + [ 0.0041, 3750 ], + [ 0.0040, 7500 ], + [ 0.0039, 10000 ], + [ 0.0038, 15000 ], + [ 0.0037, 20000 ], + [ 0.0036, 25000 ], + [ 0.0035, 37500 ], + [ 0.0034, 50000 ], + [ 0.0033, 75000 ], + [ 0.0032, 100000 ], + [ 0.0031, 150000 ], + [ 0.0030, 200000 ], + [ 0.0029, 250000 ], + [ 0.0028, 375000 ], + [ 0.0027, 500000 ], + [ 0.0026, 625000 ], + [ 0.0025, 875000 ], + ], + 'maker': [ + [ 0.0030, 0 ], + [ 0.0029, 1250 ], + [ 0.0028, 3750 ], + [ 0.0028, 7500 ], + [ 0.0027, 10000 ], + [ 0.0026, 15000 ], + [ 0.0025, 20000 ], + [ 0.0025, 25000 ], + [ 0.0024, 37500 ], + [ 0.0023, 50000 ], + [ 0.0023, 75000 ], + [ 0.0022, 100000 ], + [ 0.0021, 150000 ], + [ 0.0021, 200000 ], + [ 0.0020, 250000 ], + [ 0.0019, 375000 ], + [ 0.0018, 500000 ], + [ 0.0018, 625000 ], + [ 0.0017, 875000 ], + ], + }, }, 'funding': { 'withdraw': { @@ -12451,6 +12503,9 @@ module.exports = class bitbay extends Exchange { }, }, }, + 'options': { + 'fiatCurrencies': [ 'EUR', 'USD', 'GBP', 'PLN' ], + }, 'exceptions': { '400': ExchangeError, // At least one parameter wasn't set '401': InvalidOrder, // Invalid order type @@ -12482,6 +12537,7 @@ module.exports = class bitbay extends Exchange { async fetchMarkets (params = {}) { const response = await this.v1_01PublicGetTradingTicker (params); + const fiatCurrencies = this.safeValue (this.options, 'fiatCurrencies', []); // // { // status: 'Ok', @@ -12520,6 +12576,12 @@ module.exports = class bitbay extends Exchange { 'amount': this.safeInteger (first, 'scale'), 'price': this.safeInteger (second, 'scale'), }; + let fees = this.safeValue (this.fees, 'trading', {}); + if (this.inArray (base, fiatCurrencies) || this.inArray (quote, fiatCurrencies)) { + fees = this.safeValue (this.fees, 'fiat', {}); + } + const maker = this.safeFloat (fees, 'maker'); + const taker = this.safeFloat (fees, 'taker'); // todo: check that the limits have ben interpreted correctly // todo: parse the fees page result.push ({ @@ -12531,7 +12593,8 @@ module.exports = class bitbay extends Exchange { 'quoteId': quoteId, 'precision': precision, 'active': undefined, - 'fee': undefined, + 'maker': maker, + 'taker': taker, 'limits': { 'amount': { 'min': this.safeFloat (first, 'minOffer'), diff --git a/doc/README.rst b/doc/README.rst index 52fc5e9c3332b..fdcaca75b084b 100644 --- a/doc/README.rst +++ b/doc/README.rst @@ -355,14 +355,14 @@ JavaScript (for use with the `` + Creates a global ``ccxt`` object: diff --git a/doc/install.rst b/doc/install.rst index 6d9db4842981d..b692dcb682308 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -62,14 +62,14 @@ JavaScript (for use with the `` + Creates a global ``ccxt`` object: diff --git a/package-lock.json b/package-lock.json index af43b9487a3fc..79d626cb45c0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.27.40", + "version": "1.27.41", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 081382614c62b..2e45681077271 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.27.40", + "version": "1.27.41", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges", "main": "./ccxt.js", "unpkg": "dist/ccxt.browser.js", diff --git a/php/base/Exchange.php b/php/base/Exchange.php index acfc0a262ef94..e8bb07a3cb657 100644 --- a/php/base/Exchange.php +++ b/php/base/Exchange.php @@ -35,7 +35,7 @@ use Elliptic\EC; use BN\BN; -$version = '1.27.40'; +$version = '1.27.41'; // rounding mode const TRUNCATE = 0; @@ -54,7 +54,7 @@ class Exchange { - const VERSION = '1.27.40'; + const VERSION = '1.27.41'; public static $exchanges = array( '_1btcxe', diff --git a/php/bitbay.php b/php/bitbay.php index eecceac215a85..1c4b6489d26bb 100644 --- a/php/bitbay.php +++ b/php/bitbay.php @@ -120,8 +120,60 @@ public function describe() { ), 'fees' => array( 'trading' => array( + 'maker' => 0.0, + 'taker' => 0.1 / 100, + 'percentage' => true, + 'tierBased' => false, + ), + 'fiat' => array( 'maker' => 0.30 / 100, 'taker' => 0.43 / 100, + 'percentage' => true, + 'tierBased' => true, + 'tiers' => array( + 'taker' => array( + array( 0.0043, 0 ), + array( 0.0042, 1250 ), + array( 0.0041, 3750 ), + array( 0.0040, 7500 ), + array( 0.0039, 10000 ), + array( 0.0038, 15000 ), + array( 0.0037, 20000 ), + array( 0.0036, 25000 ), + array( 0.0035, 37500 ), + array( 0.0034, 50000 ), + array( 0.0033, 75000 ), + array( 0.0032, 100000 ), + array( 0.0031, 150000 ), + array( 0.0030, 200000 ), + array( 0.0029, 250000 ), + array( 0.0028, 375000 ), + array( 0.0027, 500000 ), + array( 0.0026, 625000 ), + array( 0.0025, 875000 ), + ), + 'maker' => array( + array( 0.0030, 0 ), + array( 0.0029, 1250 ), + array( 0.0028, 3750 ), + array( 0.0028, 7500 ), + array( 0.0027, 10000 ), + array( 0.0026, 15000 ), + array( 0.0025, 20000 ), + array( 0.0025, 25000 ), + array( 0.0024, 37500 ), + array( 0.0023, 50000 ), + array( 0.0023, 75000 ), + array( 0.0022, 100000 ), + array( 0.0021, 150000 ), + array( 0.0021, 200000 ), + array( 0.0020, 250000 ), + array( 0.0019, 375000 ), + array( 0.0018, 500000 ), + array( 0.0018, 625000 ), + array( 0.0017, 875000 ), + ), + ), ), 'funding' => array( 'withdraw' => array( @@ -138,6 +190,9 @@ public function describe() { ), ), ), + 'options' => array( + 'fiatCurrencies' => array( 'EUR', 'USD', 'GBP', 'PLN' ), + ), 'exceptions' => array( '400' => '\\ccxt\\ExchangeError', // At least one parameter wasn't set '401' => '\\ccxt\\InvalidOrder', // Invalid order type @@ -169,6 +224,7 @@ public function describe() { public function fetch_markets($params = array ()) { $response = $this->v1_01PublicGetTradingTicker ($params); + $fiatCurrencies = $this->safe_value($this->options, 'fiatCurrencies', array()); // // { // status => 'Ok', @@ -207,8 +263,14 @@ public function fetch_markets($params = array ()) { 'amount' => $this->safe_integer($first, 'scale'), 'price' => $this->safe_integer($second, 'scale'), ); + $fees = $this->safe_value($this->fees, 'trading', array()); + if ($this->in_array($base, $fiatCurrencies) || $this->in_array($quote, $fiatCurrencies)) { + $fees = $this->safe_value($this->fees, 'fiat', array()); + } + $maker = $this->safe_float($fees, 'maker'); + $taker = $this->safe_float($fees, 'taker'); // todo => check that the limits have ben interpreted correctly - // todo => parse the fees page + // todo => parse the $fees page $result[] = array( 'id' => $id, 'symbol' => $symbol, @@ -218,7 +280,8 @@ public function fetch_markets($params = array ()) { 'quoteId' => $quoteId, 'precision' => $precision, 'active' => null, - 'fee' => null, + 'maker' => $maker, + 'taker' => $taker, 'limits' => array( 'amount' => array( 'min' => $this->safe_float($first, 'minOffer'), diff --git a/python/README.rst b/python/README.rst index 7ddbfaac492c2..45fa45c4f32d7 100644 --- a/python/README.rst +++ b/python/README.rst @@ -355,14 +355,14 @@ JavaScript (for use with the `` + Creates a global ``ccxt`` object: diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index f12b97209e8a6..8c079be28e927 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -22,7 +22,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.27.40' +__version__ = '1.27.41' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/__init__.py b/python/ccxt/async_support/__init__.py index b64e55a2b5d12..890d55b5f6017 100644 --- a/python/ccxt/async_support/__init__.py +++ b/python/ccxt/async_support/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.27.40' +__version__ = '1.27.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/base/exchange.py b/python/ccxt/async_support/base/exchange.py index df6116bff48c2..dd1aacdd936bb 100644 --- a/python/ccxt/async_support/base/exchange.py +++ b/python/ccxt/async_support/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.27.40' +__version__ = '1.27.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/bitbay.py b/python/ccxt/async_support/bitbay.py index 5aedfe1238b3d..19152e3b7a942 100644 --- a/python/ccxt/async_support/bitbay.py +++ b/python/ccxt/async_support/bitbay.py @@ -130,8 +130,60 @@ def describe(self): }, 'fees': { 'trading': { + 'maker': 0.0, + 'taker': 0.1 / 100, + 'percentage': True, + 'tierBased': False, + }, + 'fiat': { 'maker': 0.30 / 100, 'taker': 0.43 / 100, + 'percentage': True, + 'tierBased': True, + 'tiers': { + 'taker': [ + [0.0043, 0], + [0.0042, 1250], + [0.0041, 3750], + [0.0040, 7500], + [0.0039, 10000], + [0.0038, 15000], + [0.0037, 20000], + [0.0036, 25000], + [0.0035, 37500], + [0.0034, 50000], + [0.0033, 75000], + [0.0032, 100000], + [0.0031, 150000], + [0.0030, 200000], + [0.0029, 250000], + [0.0028, 375000], + [0.0027, 500000], + [0.0026, 625000], + [0.0025, 875000], + ], + 'maker': [ + [0.0030, 0], + [0.0029, 1250], + [0.0028, 3750], + [0.0028, 7500], + [0.0027, 10000], + [0.0026, 15000], + [0.0025, 20000], + [0.0025, 25000], + [0.0024, 37500], + [0.0023, 50000], + [0.0023, 75000], + [0.0022, 100000], + [0.0021, 150000], + [0.0021, 200000], + [0.0020, 250000], + [0.0019, 375000], + [0.0018, 500000], + [0.0018, 625000], + [0.0017, 875000], + ], + }, }, 'funding': { 'withdraw': { @@ -148,6 +200,9 @@ def describe(self): }, }, }, + 'options': { + 'fiatCurrencies': ['EUR', 'USD', 'GBP', 'PLN'], + }, 'exceptions': { '400': ExchangeError, # At least one parameter wasn't set '401': InvalidOrder, # Invalid order type @@ -178,6 +233,7 @@ def describe(self): async def fetch_markets(self, params={}): response = await self.v1_01PublicGetTradingTicker(params) + fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', []) # # { # status: 'Ok', @@ -216,6 +272,11 @@ async def fetch_markets(self, params={}): 'amount': self.safe_integer(first, 'scale'), 'price': self.safe_integer(second, 'scale'), } + fees = self.safe_value(self.fees, 'trading', {}) + if self.in_array(base, fiatCurrencies) or self.in_array(quote, fiatCurrencies): + fees = self.safe_value(self.fees, 'fiat', {}) + maker = self.safe_float(fees, 'maker') + taker = self.safe_float(fees, 'taker') # todo: check that the limits have ben interpreted correctly # todo: parse the fees page result.append({ @@ -227,7 +288,8 @@ async def fetch_markets(self, params={}): 'quoteId': quoteId, 'precision': precision, 'active': None, - 'fee': None, + 'maker': maker, + 'taker': taker, 'limits': { 'amount': { 'min': self.safe_float(first, 'minOffer'), diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 901848babc25c..9e021bf58b631 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.27.40' +__version__ = '1.27.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/bitbay.py b/python/ccxt/bitbay.py index eedfa0575702e..bec00d7fdb221 100644 --- a/python/ccxt/bitbay.py +++ b/python/ccxt/bitbay.py @@ -130,8 +130,60 @@ def describe(self): }, 'fees': { 'trading': { + 'maker': 0.0, + 'taker': 0.1 / 100, + 'percentage': True, + 'tierBased': False, + }, + 'fiat': { 'maker': 0.30 / 100, 'taker': 0.43 / 100, + 'percentage': True, + 'tierBased': True, + 'tiers': { + 'taker': [ + [0.0043, 0], + [0.0042, 1250], + [0.0041, 3750], + [0.0040, 7500], + [0.0039, 10000], + [0.0038, 15000], + [0.0037, 20000], + [0.0036, 25000], + [0.0035, 37500], + [0.0034, 50000], + [0.0033, 75000], + [0.0032, 100000], + [0.0031, 150000], + [0.0030, 200000], + [0.0029, 250000], + [0.0028, 375000], + [0.0027, 500000], + [0.0026, 625000], + [0.0025, 875000], + ], + 'maker': [ + [0.0030, 0], + [0.0029, 1250], + [0.0028, 3750], + [0.0028, 7500], + [0.0027, 10000], + [0.0026, 15000], + [0.0025, 20000], + [0.0025, 25000], + [0.0024, 37500], + [0.0023, 50000], + [0.0023, 75000], + [0.0022, 100000], + [0.0021, 150000], + [0.0021, 200000], + [0.0020, 250000], + [0.0019, 375000], + [0.0018, 500000], + [0.0018, 625000], + [0.0017, 875000], + ], + }, }, 'funding': { 'withdraw': { @@ -148,6 +200,9 @@ def describe(self): }, }, }, + 'options': { + 'fiatCurrencies': ['EUR', 'USD', 'GBP', 'PLN'], + }, 'exceptions': { '400': ExchangeError, # At least one parameter wasn't set '401': InvalidOrder, # Invalid order type @@ -178,6 +233,7 @@ def describe(self): def fetch_markets(self, params={}): response = self.v1_01PublicGetTradingTicker(params) + fiatCurrencies = self.safe_value(self.options, 'fiatCurrencies', []) # # { # status: 'Ok', @@ -216,6 +272,11 @@ def fetch_markets(self, params={}): 'amount': self.safe_integer(first, 'scale'), 'price': self.safe_integer(second, 'scale'), } + fees = self.safe_value(self.fees, 'trading', {}) + if self.in_array(base, fiatCurrencies) or self.in_array(quote, fiatCurrencies): + fees = self.safe_value(self.fees, 'fiat', {}) + maker = self.safe_float(fees, 'maker') + taker = self.safe_float(fees, 'taker') # todo: check that the limits have ben interpreted correctly # todo: parse the fees page result.append({ @@ -227,7 +288,8 @@ def fetch_markets(self, params={}): 'quoteId': quoteId, 'precision': precision, 'active': None, - 'fee': None, + 'maker': maker, + 'taker': taker, 'limits': { 'amount': { 'min': self.safe_float(first, 'minOffer'), diff --git a/python/package.json b/python/package.json index 081382614c62b..2e45681077271 100644 --- a/python/package.json +++ b/python/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.27.40", + "version": "1.27.41", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges", "main": "./ccxt.js", "unpkg": "dist/ccxt.browser.js", diff --git a/wiki/Install.md b/wiki/Install.md index 5d50ade5fb38b..56f845a094aa5 100644 --- a/wiki/Install.md +++ b/wiki/Install.md @@ -58,13 +58,13 @@ If that does not help, please, follow here: https://github.com/nodejs/node-gyp#o All-in-one browser bundle (dependencies included), served from a CDN of your choice: -* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.27.40/dist/ccxt.browser.js -* unpkg: https://unpkg.com/ccxt@1.27.40/dist/ccxt.browser.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.27.41/dist/ccxt.browser.js +* unpkg: https://unpkg.com/ccxt@1.27.41/dist/ccxt.browser.js You can obtain a live-updated version of the bundle by removing the version number from the URL (the `@a.b.c` thing) — however, we do not recommend to do that, as it may break your app eventually. Also, please keep in mind that we are not responsible for the correct operation of those CDN servers. ```HTML - + ``` Creates a global `ccxt` object: