diff --git a/README.md b/README.md index ea1cb5e6e9b0..4dafd52ed369 100644 --- a/README.md +++ b/README.md @@ -223,13 +223,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.47.40/dist/ccxt.browser.js -* unpkg: https://unpkg.com/ccxt@1.47.40/dist/ccxt.browser.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.47.41/dist/ccxt.browser.js +* unpkg: https://unpkg.com/ccxt@1.47.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 c86ed7b1d64c..4ce90f9c17d6 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.47.40' +const version = '1.47.41' Exchange.ccxtVersion = version diff --git a/dist/ccxt.browser.js b/dist/ccxt.browser.js index 667e8be993b8..12c405937cac 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.47.40' +const version = '1.47.41' Exchange.ccxtVersion = version @@ -38729,6 +38729,7 @@ module.exports = class btcalpha extends Exchange { const Exchange = require ('./base/Exchange'); const { ExchangeError, InsufficientFunds, InvalidOrder, AuthenticationError, PermissionDenied, InvalidNonce, OrderNotFound, DDoSProtection } = require ('./base/errors'); +const Precise = require ('./base/Precise'); // --------------------------------------------------------------------------- @@ -38883,14 +38884,11 @@ module.exports = class btcbox extends Exchange { symbol = market['symbol']; } const id = this.safeString (trade, 'tid'); - const price = this.safeNumber (trade, 'price'); - const amount = this.safeNumber (trade, 'amount'); - let cost = undefined; - if (amount !== undefined) { - if (price !== undefined) { - cost = price * amount; - } - } + const priceString = this.safeString (trade, 'price'); + const amountString = this.safeString (trade, 'amount'); + const price = this.parseNumber (priceString); + const amount = this.parseNumber (amountString); + const cost = this.parseNumber (Precise.stringMul (priceString, amountString)); const type = undefined; const side = this.safeString (trade, 'type'); return { @@ -39150,7 +39148,7 @@ module.exports = class btcbox extends Exchange { } }; -},{"./base/Exchange":6,"./base/errors":9}],51:[function(require,module,exports){ +},{"./base/Exchange":6,"./base/Precise":7,"./base/errors":9}],51:[function(require,module,exports){ 'use strict'; // --------------------------------------------------------------------------- diff --git a/package-lock.json b/package-lock.json index 3da760516d33..313611dea69a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.47.40", + "version": "1.47.41", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c0dcdca0ee0b..430729752b38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.47.40", + "version": "1.47.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/Exchange.php b/php/Exchange.php index 3bd2a1829f7c..c8ddbf6afae3 100644 --- a/php/Exchange.php +++ b/php/Exchange.php @@ -37,7 +37,7 @@ use BN\BN; use Exception; -$version = '1.47.40'; +$version = '1.47.41'; // rounding mode const TRUNCATE = 0; @@ -56,7 +56,7 @@ class Exchange { - const VERSION = '1.47.40'; + const VERSION = '1.47.41'; private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; private static $base58_encoder = null; diff --git a/php/async/Exchange.php b/php/async/Exchange.php index 84b071fbeac5..fe9b1f5eb65e 100644 --- a/php/async/Exchange.php +++ b/php/async/Exchange.php @@ -28,11 +28,11 @@ include 'throttle.php'; -$version = '1.47.40'; +$version = '1.47.41'; class Exchange extends \ccxt\Exchange { - const VERSION = '1.47.40'; + const VERSION = '1.47.41'; public static $loop; public static $kernel; diff --git a/php/async/btcbox.php b/php/async/btcbox.php index 10807689b545..6432ac3e3dd1 100644 --- a/php/async/btcbox.php +++ b/php/async/btcbox.php @@ -7,6 +7,7 @@ use Exception; // a common import use \ccxt\ExchangeError; +use \ccxt\Precise; class btcbox extends Exchange { @@ -160,14 +161,11 @@ public function parse_trade($trade, $market = null) { $symbol = $market['symbol']; } $id = $this->safe_string($trade, 'tid'); - $price = $this->safe_number($trade, 'price'); - $amount = $this->safe_number($trade, 'amount'); - $cost = null; - if ($amount !== null) { - if ($price !== null) { - $cost = $price * $amount; - } - } + $priceString = $this->safe_string($trade, 'price'); + $amountString = $this->safe_string($trade, 'amount'); + $price = $this->parse_number($priceString); + $amount = $this->parse_number($amountString); + $cost = $this->parse_number(Precise::string_mul($priceString, $amountString)); $type = null; $side = $this->safe_string($trade, 'type'); return array( diff --git a/php/btcbox.php b/php/btcbox.php index df19bcd21aff..16bc502a0acf 100644 --- a/php/btcbox.php +++ b/php/btcbox.php @@ -160,14 +160,11 @@ public function parse_trade($trade, $market = null) { $symbol = $market['symbol']; } $id = $this->safe_string($trade, 'tid'); - $price = $this->safe_number($trade, 'price'); - $amount = $this->safe_number($trade, 'amount'); - $cost = null; - if ($amount !== null) { - if ($price !== null) { - $cost = $price * $amount; - } - } + $priceString = $this->safe_string($trade, 'price'); + $amountString = $this->safe_string($trade, 'amount'); + $price = $this->parse_number($priceString); + $amount = $this->parse_number($amountString); + $cost = $this->parse_number(Precise::string_mul($priceString, $amountString)); $type = null; $side = $this->safe_string($trade, 'type'); return array( diff --git a/python/README.md b/python/README.md index ea1cb5e6e9b0..4dafd52ed369 100644 --- a/python/README.md +++ b/python/README.md @@ -223,13 +223,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.47.40/dist/ccxt.browser.js -* unpkg: https://unpkg.com/ccxt@1.47.40/dist/ccxt.browser.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.47.41/dist/ccxt.browser.js +* unpkg: https://unpkg.com/ccxt@1.47.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/python/ccxt/__init__.py b/python/ccxt/__init__.py index f8a953364ced..bfc768113e2a 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -22,7 +22,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.47.40' +__version__ = '1.47.41' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/__init__.py b/python/ccxt/async_support/__init__.py index 04ecaffe8de5..1f02a55f8dae 100644 --- a/python/ccxt/async_support/__init__.py +++ b/python/ccxt/async_support/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.47.40' +__version__ = '1.47.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/base/exchange.py b/python/ccxt/async_support/base/exchange.py index a41b83786985..523a2fb31083 100644 --- a/python/ccxt/async_support/base/exchange.py +++ b/python/ccxt/async_support/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.47.40' +__version__ = '1.47.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async_support/btcbox.py b/python/ccxt/async_support/btcbox.py index 1c1b91860fad..1f1561fb49ce 100644 --- a/python/ccxt/async_support/btcbox.py +++ b/python/ccxt/async_support/btcbox.py @@ -20,6 +20,7 @@ from ccxt.base.errors import OrderNotFound from ccxt.base.errors import DDoSProtection from ccxt.base.errors import InvalidNonce +from ccxt.base.precise import Precise class btcbox(Exchange): @@ -163,12 +164,11 @@ def parse_trade(self, trade, market=None): if market is not None: symbol = market['symbol'] id = self.safe_string(trade, 'tid') - price = self.safe_number(trade, 'price') - amount = self.safe_number(trade, 'amount') - cost = None - if amount is not None: - if price is not None: - cost = price * amount + priceString = self.safe_string(trade, 'price') + amountString = self.safe_string(trade, 'amount') + price = self.parse_number(priceString) + amount = self.parse_number(amountString) + cost = self.parse_number(Precise.string_mul(priceString, amountString)) type = None side = self.safe_string(trade, 'type') return { diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 60ac79cd9c4b..cfde02c2ebcd 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.47.40' +__version__ = '1.47.41' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/btcbox.py b/python/ccxt/btcbox.py index e8c4fd01c2a1..cc3cdbd2f96e 100644 --- a/python/ccxt/btcbox.py +++ b/python/ccxt/btcbox.py @@ -20,6 +20,7 @@ from ccxt.base.errors import OrderNotFound from ccxt.base.errors import DDoSProtection from ccxt.base.errors import InvalidNonce +from ccxt.base.precise import Precise class btcbox(Exchange): @@ -163,12 +164,11 @@ def parse_trade(self, trade, market=None): if market is not None: symbol = market['symbol'] id = self.safe_string(trade, 'tid') - price = self.safe_number(trade, 'price') - amount = self.safe_number(trade, 'amount') - cost = None - if amount is not None: - if price is not None: - cost = price * amount + priceString = self.safe_string(trade, 'price') + amountString = self.safe_string(trade, 'amount') + price = self.parse_number(priceString) + amount = self.parse_number(amountString) + cost = self.parse_number(Precise.string_mul(priceString, amountString)) type = None side = self.safe_string(trade, 'type') return { diff --git a/python/package.json b/python/package.json index c0dcdca0ee0b..430729752b38 100644 --- a/python/package.json +++ b/python/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.47.40", + "version": "1.47.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 6089233595d4..b45236124ce1 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.47.40/dist/ccxt.browser.js -* unpkg: https://unpkg.com/ccxt@1.47.40/dist/ccxt.browser.js +* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.47.41/dist/ccxt.browser.js +* unpkg: https://unpkg.com/ccxt@1.47.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: