ccxt 4.0.67 → 4.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +146 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +193 -71
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +1 -1
- package/dist/cjs/src/binance.js +1 -0
- package/dist/cjs/src/bitget.js +18 -1
- package/dist/cjs/src/bybit.js +10 -0
- package/dist/cjs/src/lykke.js +1 -1
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/bitfinex2.js +7 -6
- package/dist/cjs/src/pro/bitget.js +10 -7
- package/dist/cjs/src/pro/bitmart.js +7 -6
- package/dist/cjs/src/pro/bittrex.js +2 -3
- package/dist/cjs/src/pro/coinbasepro.js +71 -9
- package/dist/cjs/src/pro/huobi.js +4 -2
- package/dist/cjs/src/pro/idex.js +1 -1
- package/dist/cjs/src/pro/okx.js +22 -16
- package/dist/cjs/src/wavesexchange.js +34 -15
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.js +1 -1
- package/js/src/binance.js +1 -0
- package/js/src/bitget.js +18 -1
- package/js/src/bybit.js +10 -0
- package/js/src/lykke.js +1 -1
- package/js/src/phemex.js +2 -1
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/bitfinex2.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +7 -6
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +10 -7
- package/js/src/pro/bitmart.d.ts +1 -1
- package/js/src/pro/bitmart.js +7 -6
- package/js/src/pro/bittrex.js +2 -3
- package/js/src/pro/coinbasepro.d.ts +3 -1
- package/js/src/pro/coinbasepro.js +71 -9
- package/js/src/pro/huobi.js +4 -2
- package/js/src/pro/idex.js +1 -1
- package/js/src/pro/okx.d.ts +1 -0
- package/js/src/pro/okx.js +22 -16
- package/js/src/wavesexchange.d.ts +2 -1
- package/js/src/wavesexchange.js +34 -15
- package/package.json +1 -1
package/js/src/wavesexchange.js
CHANGED
|
@@ -617,19 +617,32 @@ export default class wavesexchange extends Exchange {
|
|
|
617
617
|
}
|
|
618
618
|
parseOrderBookSide(bookSide, market = undefined, limit = undefined) {
|
|
619
619
|
const precision = market['precision'];
|
|
620
|
-
const wavesPrecision = this.
|
|
621
|
-
const amountPrecision =
|
|
622
|
-
const
|
|
623
|
-
const
|
|
620
|
+
const wavesPrecision = this.safeString(this.options, 'wavesPrecision', '8');
|
|
621
|
+
const amountPrecision = '1e' + this.numberToString(precision['amount']);
|
|
622
|
+
const amountPrecisionString = this.numberToString(precision['amount']);
|
|
623
|
+
const pricePrecisionString = this.numberToString(precision['price']);
|
|
624
|
+
const difference = Precise.stringSub(amountPrecisionString, pricePrecisionString);
|
|
625
|
+
const pricePrecision = '1e' + Precise.stringSub(wavesPrecision, difference);
|
|
624
626
|
const result = [];
|
|
625
627
|
for (let i = 0; i < bookSide.length; i++) {
|
|
626
628
|
const entry = bookSide[i];
|
|
627
|
-
const
|
|
628
|
-
const
|
|
629
|
+
const entryPrice = this.safeString(entry, 'price', '0');
|
|
630
|
+
const entryAmount = this.safeString(entry, 'amount', '0');
|
|
631
|
+
let price = undefined;
|
|
632
|
+
let amount = undefined;
|
|
633
|
+
if ((pricePrecision !== undefined) && (entryPrice !== undefined)) {
|
|
634
|
+
price = Precise.stringDiv(entryPrice, pricePrecision);
|
|
635
|
+
}
|
|
636
|
+
if ((amountPrecision !== undefined) && (entryAmount !== undefined)) {
|
|
637
|
+
amount = Precise.stringDiv(entryAmount, amountPrecision);
|
|
638
|
+
}
|
|
629
639
|
if ((limit !== undefined) && (i > limit)) {
|
|
630
640
|
break;
|
|
631
641
|
}
|
|
632
|
-
result.push([
|
|
642
|
+
result.push([
|
|
643
|
+
this.parseNumber(price),
|
|
644
|
+
this.parseNumber(amount),
|
|
645
|
+
]);
|
|
633
646
|
}
|
|
634
647
|
return result;
|
|
635
648
|
}
|
|
@@ -1209,15 +1222,21 @@ export default class wavesexchange extends Exchange {
|
|
|
1209
1222
|
}
|
|
1210
1223
|
customPriceToPrecision(symbol, price) {
|
|
1211
1224
|
const market = this.markets[symbol];
|
|
1212
|
-
const wavesPrecision = this.
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1225
|
+
const wavesPrecision = this.safeString(this.options, 'wavesPrecision', '8');
|
|
1226
|
+
const amount = this.numberToString(market['precision']['amount']);
|
|
1227
|
+
const precisionPrice = this.numberToString(market['precision']['price']);
|
|
1228
|
+
const difference = Precise.stringSub(amount, precisionPrice);
|
|
1229
|
+
const precision = Precise.stringSub(wavesPrecision, difference);
|
|
1230
|
+
const pricePrecision = this.toPrecision(price, precision).toString();
|
|
1231
|
+
return this.parseToInt(parseFloat(pricePrecision));
|
|
1215
1232
|
}
|
|
1216
1233
|
customAmountToPrecision(symbol, amount) {
|
|
1217
|
-
|
|
1234
|
+
const amountPrecision = this.numberToString(this.toPrecision(amount, this.numberToString(this.markets[symbol]['precision']['amount'])));
|
|
1235
|
+
return this.parseToInt(parseFloat(amountPrecision));
|
|
1218
1236
|
}
|
|
1219
1237
|
currencyToPrecision(code, amount, networkCode = undefined) {
|
|
1220
|
-
|
|
1238
|
+
const amountPrecision = this.numberToString(this.toPrecision(amount, this.currencies[code]['precision']));
|
|
1239
|
+
return this.parseToInt(parseFloat(amountPrecision));
|
|
1221
1240
|
}
|
|
1222
1241
|
fromPrecision(amount, scale) {
|
|
1223
1242
|
if (amount === undefined) {
|
|
@@ -1229,11 +1248,11 @@ export default class wavesexchange extends Exchange {
|
|
|
1229
1248
|
return precise.toString();
|
|
1230
1249
|
}
|
|
1231
1250
|
toPrecision(amount, scale) {
|
|
1232
|
-
const amountString =
|
|
1251
|
+
const amountString = this.numberToString(amount);
|
|
1233
1252
|
const precise = new Precise(amountString);
|
|
1234
|
-
precise.decimals = precise.decimals
|
|
1253
|
+
precise.decimals = Precise.stringSub(precise.decimals, scale);
|
|
1235
1254
|
precise.reduce();
|
|
1236
|
-
return precise
|
|
1255
|
+
return precise;
|
|
1237
1256
|
}
|
|
1238
1257
|
currencyFromPrecision(currency, amount) {
|
|
1239
1258
|
const scale = this.currencies[currency]['precision'];
|
package/package.json
CHANGED