ccxt 4.1.22 → 4.1.23
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/README.md +7 -3
- package/dist/ccxt.browser.js +34 -11
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/ws/OrderBookSide.js +20 -4
- package/dist/cjs/src/bybit.js +4 -2
- package/dist/cjs/src/pro/bitfinex2.js +8 -4
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/ascendex.d.ts +1 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/ws/OrderBookSide.js +20 -4
- package/js/src/bybit.js +4 -2
- package/js/src/pro/bitfinex2.js +8 -4
- package/package.json +1 -1
- package/skip-tests.json +2 -1
package/README.md
CHANGED
|
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
210
210
|
|
|
211
211
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
212
212
|
|
|
213
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
214
|
-
* unpkg: https://unpkg.com/ccxt@4.1.
|
|
213
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.23/dist/ccxt.browser.js
|
|
214
|
+
* unpkg: https://unpkg.com/ccxt@4.1.23/dist/ccxt.browser.js
|
|
215
215
|
|
|
216
216
|
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.
|
|
217
217
|
|
|
218
218
|
```HTML
|
|
219
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.
|
|
219
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.23/dist/ccxt.browser.js"></script>
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
Creates a global `ccxt` object:
|
|
@@ -561,6 +561,10 @@ Thank you!
|
|
|
561
561
|
- [CCXT Channel on Telegram](https://t.me/ccxt_announcements) (important announcements)
|
|
562
562
|
- [CCXT Chat on Telegram](https://t.me/ccxt_chat) (technical support)
|
|
563
563
|
|
|
564
|
+
## Star History
|
|
565
|
+
|
|
566
|
+
[](https://star-history.com/#ccxt/ccxt&Date)
|
|
567
|
+
|
|
564
568
|
## Contact Us
|
|
565
569
|
|
|
566
570
|
For business inquiries: info@ccxt.trade
|
package/dist/ccxt.browser.js
CHANGED
|
@@ -3601,6 +3601,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
3601
3601
|
'futures/position': 1,
|
|
3602
3602
|
'futures/free-margin': 1,
|
|
3603
3603
|
'futures/order/hist/current': 1,
|
|
3604
|
+
'futures/funding-payments': 1,
|
|
3604
3605
|
'futures/order/open': 1,
|
|
3605
3606
|
'futures/order/status': 1,
|
|
3606
3607
|
},
|
|
@@ -13968,14 +13969,22 @@ class IndexedOrderBookSide extends Array {
|
|
|
13968
13969
|
// in case price is not sent
|
|
13969
13970
|
delta[0] = Math.abs(index_price);
|
|
13970
13971
|
if (index_price === old_price) {
|
|
13971
|
-
|
|
13972
|
+
// find index by price and advance till the id is found
|
|
13973
|
+
let index = bisectLeft(this.index, index_price);
|
|
13974
|
+
while (this[index][2] !== id) {
|
|
13975
|
+
index++;
|
|
13976
|
+
}
|
|
13972
13977
|
this.index[index] = index_price;
|
|
13973
13978
|
this[index] = delta;
|
|
13974
13979
|
return;
|
|
13975
13980
|
}
|
|
13976
13981
|
else {
|
|
13977
13982
|
// remove old price from index
|
|
13978
|
-
|
|
13983
|
+
// find index by price and advance till the id is found
|
|
13984
|
+
let old_index = bisectLeft(this.index, old_price);
|
|
13985
|
+
while (this[old_index][2] !== id) {
|
|
13986
|
+
old_index++;
|
|
13987
|
+
}
|
|
13979
13988
|
this.index.copyWithin(old_index, old_index + 1, this.index.length);
|
|
13980
13989
|
this.index[this.length - 1] = Number.MAX_VALUE;
|
|
13981
13990
|
this.copyWithin(old_index, old_index + 1, this.length);
|
|
@@ -13984,7 +13993,12 @@ class IndexedOrderBookSide extends Array {
|
|
|
13984
13993
|
}
|
|
13985
13994
|
// insert new price level
|
|
13986
13995
|
this.hashmap.set(id, index_price);
|
|
13987
|
-
|
|
13996
|
+
// find index by price to insert
|
|
13997
|
+
let index = bisectLeft(this.index, index_price);
|
|
13998
|
+
// if several with the same price order by id
|
|
13999
|
+
while (index < this.length && this.index[index] === index_price && this[index][2] < id) {
|
|
14000
|
+
index++;
|
|
14001
|
+
}
|
|
13988
14002
|
// insert new price level into index
|
|
13989
14003
|
this.length++;
|
|
13990
14004
|
this.index.copyWithin(index + 1, index, this.index.length);
|
|
@@ -14001,7 +14015,10 @@ class IndexedOrderBookSide extends Array {
|
|
|
14001
14015
|
}
|
|
14002
14016
|
else if (this.hashmap.has(id)) {
|
|
14003
14017
|
const old_price = this.hashmap.get(id);
|
|
14004
|
-
|
|
14018
|
+
let index = bisectLeft(this.index, old_price);
|
|
14019
|
+
while (this[index][2] !== id) {
|
|
14020
|
+
index++;
|
|
14021
|
+
}
|
|
14005
14022
|
this.index.copyWithin(index, index + 1, this.index.length);
|
|
14006
14023
|
this.index[this.length - 1] = Number.MAX_VALUE;
|
|
14007
14024
|
this.copyWithin(index, index + 1, this.length);
|
|
@@ -76302,8 +76319,10 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
76302
76319
|
request['accountType'] = unifiedType;
|
|
76303
76320
|
response = await this.privateGetV5AssetTransferQueryAccountCoinsBalance(this.extend(request, params));
|
|
76304
76321
|
}
|
|
76305
|
-
|
|
76306
|
-
|
|
76322
|
+
else {
|
|
76323
|
+
request['accountType'] = unifiedType;
|
|
76324
|
+
response = await this.privateGetV5AccountWalletBalance(this.extend(request, params));
|
|
76325
|
+
}
|
|
76307
76326
|
//
|
|
76308
76327
|
// cross
|
|
76309
76328
|
// {
|
|
@@ -200955,7 +200974,6 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
200955
200974
|
const messageHash = channel + ':' + marketId;
|
|
200956
200975
|
const prec = this.safeString(subscription, 'prec', 'P0');
|
|
200957
200976
|
const isRaw = (prec === 'R0');
|
|
200958
|
-
const id = this.safeString(message, 0);
|
|
200959
200977
|
// if it is an initial snapshot
|
|
200960
200978
|
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
200961
200979
|
if (orderbook === undefined) {
|
|
@@ -200994,6 +201012,7 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
200994
201012
|
bookside.store(price, size, counter);
|
|
200995
201013
|
}
|
|
200996
201014
|
}
|
|
201015
|
+
orderbook['symbol'] = symbol;
|
|
200997
201016
|
client.resolve(orderbook, messageHash);
|
|
200998
201017
|
}
|
|
200999
201018
|
else {
|
|
@@ -201006,7 +201025,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
201006
201025
|
const bookside = orderbookItem[side];
|
|
201007
201026
|
// price = 0 means that you have to remove the order from your book
|
|
201008
201027
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise.stringGt */ .O.stringGt(price, '0') ? size : '0';
|
|
201009
|
-
|
|
201028
|
+
const idString = this.safeString(deltas, 0);
|
|
201029
|
+
bookside.store(this.parseNumber(price), this.parseNumber(amount), idString);
|
|
201010
201030
|
}
|
|
201011
201031
|
else {
|
|
201012
201032
|
const amount = this.safeString(deltas, 2);
|
|
@@ -201036,16 +201056,19 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
201036
201056
|
const stringArray = [];
|
|
201037
201057
|
const bids = book['bids'];
|
|
201038
201058
|
const asks = book['asks'];
|
|
201059
|
+
const prec = this.safeString(subscription, 'prec', 'P0');
|
|
201060
|
+
const isRaw = (prec === 'R0');
|
|
201061
|
+
const idToCheck = isRaw ? 2 : 0;
|
|
201039
201062
|
// pepperoni pizza from bitfinex
|
|
201040
201063
|
for (let i = 0; i < depth; i++) {
|
|
201041
201064
|
const bid = this.safeValue(bids, i);
|
|
201042
201065
|
const ask = this.safeValue(asks, i);
|
|
201043
201066
|
if (bid !== undefined) {
|
|
201044
|
-
stringArray.push(this.numberToString(bids[i][
|
|
201067
|
+
stringArray.push(this.numberToString(bids[i][idToCheck]));
|
|
201045
201068
|
stringArray.push(this.numberToString(bids[i][1]));
|
|
201046
201069
|
}
|
|
201047
201070
|
if (ask !== undefined) {
|
|
201048
|
-
stringArray.push(this.numberToString(asks[i][
|
|
201071
|
+
stringArray.push(this.numberToString(asks[i][idToCheck]));
|
|
201049
201072
|
stringArray.push(this.numberToString(-asks[i][1]));
|
|
201050
201073
|
}
|
|
201051
201074
|
}
|
|
@@ -277678,7 +277701,7 @@ SOFTWARE.
|
|
|
277678
277701
|
|
|
277679
277702
|
//-----------------------------------------------------------------------------
|
|
277680
277703
|
// this is updated by vss.js when building
|
|
277681
|
-
const version = '4.1.
|
|
277704
|
+
const version = '4.1.23';
|
|
277682
277705
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
277683
277706
|
//-----------------------------------------------------------------------------
|
|
277684
277707
|
|