ccxt 4.5.55 → 4.5.57
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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +3 -3
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +72 -76
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2924
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -636,7 +636,7 @@ class gate extends gate$1["default"] {
|
|
|
636
636
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
637
637
|
const bidAsk = bidAsks[i];
|
|
638
638
|
if (Array.isArray(bidAsk)) {
|
|
639
|
-
bookSide.storeArray(this.
|
|
639
|
+
bookSide.storeArray(this.parseOrderBookBidAsk(bidAsk));
|
|
640
640
|
}
|
|
641
641
|
else {
|
|
642
642
|
const price = this.safeFloat(bidAsk, 'p');
|
package/dist/cjs/src/pro/grvt.js
CHANGED
|
@@ -578,6 +578,14 @@ class grvt extends grvt$1["default"] {
|
|
|
578
578
|
orderbook['timestamp'] = timestamp;
|
|
579
579
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
580
580
|
}
|
|
581
|
+
// grvt defaults to the delta channel (v1.book.d); if the very first
|
|
582
|
+
// message is a delta, the freshly-created orderbook has symbol=null
|
|
583
|
+
// because no snapshot has reset it yet. Set it unconditionally — we
|
|
584
|
+
// know the symbol from the selector regardless of channel. Java's
|
|
585
|
+
// typed WsOrderBook surfaces this as `"symbol":null` in the output;
|
|
586
|
+
// Python/JS dict-backed orderbooks happen to mask it but the
|
|
587
|
+
// unconditional assignment is correct for every language.
|
|
588
|
+
orderbook['symbol'] = symbol;
|
|
581
589
|
orderbook['nonce'] = sequenceNumber;
|
|
582
590
|
const messageHash = 'orderbook::' + symbol;
|
|
583
591
|
this.orderbooks[symbol] = orderbook;
|
package/dist/cjs/src/pro/htx.js
CHANGED
|
@@ -1361,10 +1361,10 @@ class htx extends htx$1["default"] {
|
|
|
1361
1361
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
|
|
1362
1362
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
|
|
1363
1363
|
* @description watch all open positions. Note: huobi has one channel for each marginMode and type
|
|
1364
|
-
* @param {string[]
|
|
1365
|
-
* @param since
|
|
1366
|
-
* @param limit
|
|
1367
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1364
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1365
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1366
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1367
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1368
1368
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1369
1369
|
*/
|
|
1370
1370
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -241,7 +241,7 @@ class independentreserve extends independentreserve$1["default"] {
|
|
|
241
241
|
return result;
|
|
242
242
|
}
|
|
243
243
|
handleDelta(bookside, delta) {
|
|
244
|
-
const bidAsk = this.
|
|
244
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'Price', 'Volume');
|
|
245
245
|
bookside.storeArray(bidAsk);
|
|
246
246
|
}
|
|
247
247
|
handleDeltas(bookside, deltas) {
|
|
@@ -266,10 +266,10 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
266
266
|
* @name krakenfutures#watchPositions
|
|
267
267
|
* @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
|
|
268
268
|
* @description watch all open positions
|
|
269
|
-
* @param {string[]
|
|
270
|
-
* @param since
|
|
271
|
-
* @param limit
|
|
272
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
269
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
270
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
271
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
272
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
273
273
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
274
274
|
*/
|
|
275
275
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1542,8 +1542,20 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
1542
1542
|
// event: 'alert',
|
|
1543
1543
|
// message: 'Failed to subscribe to authenticated feed'
|
|
1544
1544
|
// }
|
|
1545
|
+
// {
|
|
1546
|
+
// event: 'alert',
|
|
1547
|
+
// message: 'Already subscribed to feed, re-requesting'
|
|
1548
|
+
// }
|
|
1545
1549
|
//
|
|
1546
1550
|
const errMsg = this.safeString(message, 'message');
|
|
1551
|
+
// Benign "already subscribed" notice: the original subscription is still
|
|
1552
|
+
// active and delivering data on this socket. The generic client.reject
|
|
1553
|
+
// below rejects every pending future on the connection, so a stray
|
|
1554
|
+
// re-subscribe warning would kill unrelated in-flight watch* calls —
|
|
1555
|
+
// mirrors the bitmart 90008 fix.
|
|
1556
|
+
if (errMsg !== undefined && errMsg.indexOf('Already subscribed') >= 0) {
|
|
1557
|
+
return false;
|
|
1558
|
+
}
|
|
1547
1559
|
try {
|
|
1548
1560
|
throw new errors.ExchangeError(this.id + ' ' + errMsg);
|
|
1549
1561
|
}
|
|
@@ -1753,7 +1753,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
1753
1753
|
}
|
|
1754
1754
|
handleBidAsks(bookSide, bidAsks) {
|
|
1755
1755
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
1756
|
-
const bidAsk = this.
|
|
1756
|
+
const bidAsk = this.parseOrderBookBidAsk(bidAsks[i]);
|
|
1757
1757
|
bookSide.storeArray(bidAsk);
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
package/dist/cjs/src/pro/luno.js
CHANGED
|
@@ -214,8 +214,8 @@ class luno extends luno$1["default"] {
|
|
|
214
214
|
client.resolve(orderbook, messageHash);
|
|
215
215
|
}
|
|
216
216
|
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
|
|
217
|
-
const bids = this.
|
|
218
|
-
const asks = this.
|
|
217
|
+
const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
218
|
+
const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
219
219
|
return {
|
|
220
220
|
'symbol': symbol,
|
|
221
221
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -225,7 +225,7 @@ class luno extends luno$1["default"] {
|
|
|
225
225
|
'nonce': undefined,
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
|
|
229
229
|
bidasks = this.toArray(bidasks);
|
|
230
230
|
const result = [];
|
|
231
231
|
for (let i = 0; i < bidasks.length; i++) {
|
|
@@ -961,9 +961,9 @@ class modetrade extends modetrade$1["default"] {
|
|
|
961
961
|
* @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/private/position-push
|
|
962
962
|
* @description watch all open positions
|
|
963
963
|
* @param {string[]} [symbols] list of unified market symbols
|
|
964
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
965
|
-
* @param limit the maximum number of positions to fetch
|
|
966
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
964
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
965
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
966
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
967
967
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
968
968
|
*/
|
|
969
969
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -1702,10 +1702,10 @@ class okx extends okx$1["default"] {
|
|
|
1702
1702
|
* @name okx#watchPositions
|
|
1703
1703
|
* @see https://www.okx.com/docs-v5/en/#trading-account-websocket-positions-channel
|
|
1704
1704
|
* @description watch all open positions
|
|
1705
|
-
* @param {string[]
|
|
1706
|
-
* @param since
|
|
1707
|
-
* @param limit
|
|
1708
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1705
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1706
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1707
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1708
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1709
1709
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1710
1710
|
*/
|
|
1711
1711
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -391,7 +391,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
391
391
|
//
|
|
392
392
|
// [ 'BUY', "0.053595", "0" ]
|
|
393
393
|
//
|
|
394
|
-
const bidAsk = this.
|
|
394
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 1, 2);
|
|
395
395
|
const type = this.safeString(delta, 0);
|
|
396
396
|
if (type === 'BUY') {
|
|
397
397
|
const bids = orderbook['bids'];
|
|
@@ -577,7 +577,7 @@ class toobit extends toobit$1["default"] {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
handleDelta(bookside, delta) {
|
|
580
|
-
const bidAsk = this.
|
|
580
|
+
const bidAsk = this.parseOrderBookBidAsk(delta);
|
|
581
581
|
bookside.storeArray(bidAsk);
|
|
582
582
|
}
|
|
583
583
|
handleOrderBookPartialSnapshot(client, message) {
|
package/dist/cjs/src/pro/weex.js
CHANGED
|
@@ -882,7 +882,7 @@ class weex extends weex$1["default"] {
|
|
|
882
882
|
client.resolve(orderbook, messageHash);
|
|
883
883
|
}
|
|
884
884
|
handleDelta(bookside, delta) {
|
|
885
|
-
const bidAsk = this.
|
|
885
|
+
const bidAsk = this.parseOrderBookBidAsk(delta);
|
|
886
886
|
bookside.storeArray(bidAsk);
|
|
887
887
|
}
|
|
888
888
|
/**
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -1202,10 +1202,10 @@ class woo extends woo$1["default"] {
|
|
|
1202
1202
|
* @name woo#watchPositions
|
|
1203
1203
|
* @see https://docs.woox.io/#position-push
|
|
1204
1204
|
* @description watch all open positions
|
|
1205
|
-
* @param {string[]
|
|
1206
|
-
* @param since
|
|
1207
|
-
* @param limit
|
|
1208
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1205
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1206
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1207
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1208
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1209
1209
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1210
1210
|
*/
|
|
1211
1211
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -961,9 +961,9 @@ class woofipro extends woofipro$1["default"] {
|
|
|
961
961
|
* @see https://orderly.network/docs/build-on-omnichain/evm-api/websocket-api/private/position-push
|
|
962
962
|
* @description watch all open positions
|
|
963
963
|
* @param {string[]} [symbols] list of unified market symbols
|
|
964
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
965
|
-
* @param limit the maximum number of positions to fetch
|
|
966
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
964
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
965
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
966
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
967
967
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
968
968
|
*/
|
|
969
969
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/pro/xt.js
CHANGED
|
@@ -603,7 +603,7 @@ class xt extends xt$1["default"] {
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
async loadPositionsSnapshot(client, messageHash) {
|
|
606
|
-
const positions = await this.fetchPositions(
|
|
606
|
+
const positions = await this.fetchPositions();
|
|
607
607
|
this.positions = new Cache.ArrayCacheBySymbolBySide();
|
|
608
608
|
const cache = this.positions;
|
|
609
609
|
for (let i = 0; i < positions.length; i++) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index
|
|
5
|
+
var index = require('../../../scure-starknet/index.js');
|
|
6
6
|
var constants = require('../../constants.js');
|
|
7
|
-
var index = require('../calldata/index.js');
|
|
7
|
+
var index$1 = require('../calldata/index.js');
|
|
8
8
|
var cairo = require('../calldata/cairo.js');
|
|
9
9
|
require('../../../scure-base/index.js');
|
|
10
10
|
var num = require('../num.js');
|
|
@@ -13,10 +13,10 @@ var num = require('../num.js');
|
|
|
13
13
|
* Class Hash
|
|
14
14
|
*/
|
|
15
15
|
function computePedersenHash(a, b) {
|
|
16
|
-
return index
|
|
16
|
+
return index.pedersen(BigInt(a), BigInt(b));
|
|
17
17
|
}
|
|
18
18
|
function computePoseidonHash(a, b) {
|
|
19
|
-
return num.toHex(index
|
|
19
|
+
return num.toHex(index.poseidonHash(BigInt(a), BigInt(b)));
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Compute pedersen hash from data
|
|
@@ -24,19 +24,19 @@ function computePoseidonHash(a, b) {
|
|
|
24
24
|
*/
|
|
25
25
|
function computeHashOnElements(data) {
|
|
26
26
|
return [...data, data.length]
|
|
27
|
-
.reduce((x, y) => index
|
|
27
|
+
.reduce((x, y) => index.pedersen(BigInt(x), BigInt(y)), 0)
|
|
28
28
|
.toString();
|
|
29
29
|
}
|
|
30
30
|
const computePedersenHashOnElements = computeHashOnElements;
|
|
31
31
|
function computePoseidonHashOnElements(data) {
|
|
32
|
-
return num.toHex(index
|
|
32
|
+
return num.toHex(index.poseidonHashMany(data.map((x) => BigInt(x))));
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Calculate contract address from class hash
|
|
36
36
|
* @returns format: hex-string
|
|
37
37
|
*/
|
|
38
38
|
function calculateContractAddressFromHash(salt, classHash, constructorCalldata, deployerAddress) {
|
|
39
|
-
const compiledCalldata = index.CallData.compile(constructorCalldata);
|
|
39
|
+
const compiledCalldata = index$1.CallData.compile(constructorCalldata);
|
|
40
40
|
const constructorCalldataHash = computeHashOnElements(compiledCalldata);
|
|
41
41
|
const CONTRACT_ADDRESS_PREFIX = cairo.felt('0x535441524b4e45545f434f4e54524143545f41444452455353'); // Equivalent to 'STARKNET_CONTRACT_ADDRESS'
|
|
42
42
|
const hash = computeHashOnElements([
|
|
@@ -2477,7 +2477,7 @@ class tokocrypto extends tokocrypto$1["default"] {
|
|
|
2477
2477
|
request['addressTag'] = tag;
|
|
2478
2478
|
}
|
|
2479
2479
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
2480
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2480
|
+
const networkId = this.networkCodeToId(networkCode, code);
|
|
2481
2481
|
if (networkId !== undefined) {
|
|
2482
2482
|
request['network'] = networkId.toUpperCase();
|
|
2483
2483
|
}
|
package/dist/cjs/src/toobit.js
CHANGED
|
@@ -612,7 +612,7 @@ class toobit extends toobit$1["default"] {
|
|
|
612
612
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
613
613
|
const rawNetwork = rawNetworks[j];
|
|
614
614
|
const networkId = this.safeString(rawNetwork, 'chainType');
|
|
615
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
615
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
616
616
|
networks[networkCode] = {
|
|
617
617
|
'id': networkId,
|
|
618
618
|
'network': networkCode,
|
|
@@ -2518,7 +2518,7 @@ class toobit extends toobit$1["default"] {
|
|
|
2518
2518
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2519
2519
|
return await this.fetchDepositsOrWithdrawalsHelper('withdrawals', code, since, limit, params);
|
|
2520
2520
|
}
|
|
2521
|
-
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params) {
|
|
2521
|
+
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params = {}) {
|
|
2522
2522
|
await this.loadMarkets();
|
|
2523
2523
|
let currency = undefined;
|
|
2524
2524
|
let request = {};
|
|
@@ -2700,7 +2700,7 @@ class toobit extends toobit$1["default"] {
|
|
|
2700
2700
|
if (networkCode === undefined) {
|
|
2701
2701
|
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() : param["network"] is required');
|
|
2702
2702
|
}
|
|
2703
|
-
request['chainType'] = this.networkCodeToId(networkCode);
|
|
2703
|
+
request['chainType'] = this.networkCodeToId(networkCode, code);
|
|
2704
2704
|
const response = await this.privateGetApiV1AccountDepositAddress(this.extend(request, paramsOmitted));
|
|
2705
2705
|
//
|
|
2706
2706
|
// {
|
package/dist/cjs/src/upbit.js
CHANGED
|
@@ -680,8 +680,8 @@ class upbit extends upbit$1["default"] {
|
|
|
680
680
|
const timestamp = this.safeInteger(orderbook, 'timestamp');
|
|
681
681
|
result[symbol] = {
|
|
682
682
|
'symbol': symbol,
|
|
683
|
-
'bids': this.sortBy(this.
|
|
684
|
-
'asks': this.sortBy(this.
|
|
683
|
+
'bids': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'bid_price', 'bid_size'), 0, true),
|
|
684
|
+
'asks': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'ask_price', 'ask_size'), 0),
|
|
685
685
|
'timestamp': timestamp,
|
|
686
686
|
'datetime': this.iso8601(timestamp),
|
|
687
687
|
'nonce': undefined,
|
|
@@ -2170,7 +2170,7 @@ class upbit extends upbit$1["default"] {
|
|
|
2170
2170
|
return {
|
|
2171
2171
|
'info': depositAddress,
|
|
2172
2172
|
'currency': code,
|
|
2173
|
-
'network': this.networkIdToCode(networkId),
|
|
2173
|
+
'network': this.networkIdToCode(networkId, code),
|
|
2174
2174
|
'address': address,
|
|
2175
2175
|
'tag': tag,
|
|
2176
2176
|
};
|
package/dist/cjs/src/weex.js
CHANGED
|
@@ -496,20 +496,17 @@ class weex extends weex$1["default"] {
|
|
|
496
496
|
'ETH': 'ERC20',
|
|
497
497
|
'POLYGON': 'POLYGON(MATIC)',
|
|
498
498
|
'MATIC': 'POLYGON(MATIC)',
|
|
499
|
-
'
|
|
500
|
-
'ARB': 'ARBITRUM(ARB)',
|
|
501
|
-
'SOLANA': 'SOLANA(SOL)',
|
|
499
|
+
'ARBONE': 'ARBITRUM(ARB)',
|
|
502
500
|
'SOL': 'SOLANA(SOL)',
|
|
503
501
|
'OP': 'OPTIMISM(OP)',
|
|
504
502
|
'OPTIMISM': 'OPTIMISM(OP)',
|
|
505
|
-
'AVALANCHEC': 'AVALANCHE_C(AVAX_C)',
|
|
506
503
|
'AVAXC': 'AVALANCHE_C(AVAX_C)',
|
|
507
504
|
},
|
|
508
505
|
'networksById': {
|
|
509
506
|
'BEP20(BSC)': 'BEP20',
|
|
510
507
|
'ERC20': 'ERC20',
|
|
511
508
|
'POLYGON(MATIC)': 'MATIC',
|
|
512
|
-
'ARBITRUM(ARB)': '
|
|
509
|
+
'ARBITRUM(ARB)': 'ARBONE',
|
|
513
510
|
'SOLANA(SOL)': 'SOL',
|
|
514
511
|
'OPTIMISM(OP)': 'OP',
|
|
515
512
|
'AVALANCHE_C(AVAX_C)': 'AVAXC',
|
|
@@ -853,73 +850,71 @@ class weex extends weex$1["default"] {
|
|
|
853
850
|
// }
|
|
854
851
|
// ]
|
|
855
852
|
//
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
'active': undefined,
|
|
873
|
-
'deposit': this.safeBool(chain, 'depositEnable'),
|
|
874
|
-
'withdraw': this.safeBool(chain, 'withdrawEnable'),
|
|
875
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
876
|
-
'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
|
|
877
|
-
'isDefault': this.safeBool(chain, 'isDefault', false),
|
|
878
|
-
'limits': {
|
|
879
|
-
'withdraw': {
|
|
880
|
-
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
881
|
-
'max': undefined,
|
|
882
|
-
},
|
|
883
|
-
'deposit': {
|
|
884
|
-
'min': this.safeNumber(chain, 'depositDust'),
|
|
885
|
-
'max': undefined,
|
|
886
|
-
},
|
|
887
|
-
},
|
|
888
|
-
};
|
|
889
|
-
}
|
|
890
|
-
const networkKeys = Object.keys(networks);
|
|
891
|
-
const networksLength = networkKeys.length;
|
|
892
|
-
const emptyChains = networksLength === 0; // non-functional coins
|
|
893
|
-
const valueForEmpty = emptyChains ? false : undefined;
|
|
894
|
-
result[code] = this.safeCurrencyStructure({
|
|
895
|
-
'info': currency,
|
|
896
|
-
'code': code,
|
|
897
|
-
'id': currencyId,
|
|
898
|
-
'type': 'crypto',
|
|
899
|
-
'name': name,
|
|
853
|
+
return this.parseCurrencies(response);
|
|
854
|
+
}
|
|
855
|
+
parseCurrency(rawCurrency) {
|
|
856
|
+
const currencyId = this.safeString(rawCurrency, 'coin');
|
|
857
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
858
|
+
const name = this.safeString(rawCurrency, 'name');
|
|
859
|
+
const networks = {};
|
|
860
|
+
const chains = this.safeList(rawCurrency, 'networkList', []);
|
|
861
|
+
for (let j = 0; j < chains.length; j++) {
|
|
862
|
+
const chain = this.safeDict(chains, j);
|
|
863
|
+
const networkId = this.safeString(chain, 'network');
|
|
864
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
865
|
+
networks[networkCode] = {
|
|
866
|
+
'info': chain,
|
|
867
|
+
'id': networkId,
|
|
868
|
+
'network': networkCode,
|
|
900
869
|
'active': undefined,
|
|
901
|
-
'deposit':
|
|
902
|
-
'withdraw':
|
|
903
|
-
'fee':
|
|
904
|
-
'precision':
|
|
870
|
+
'deposit': this.safeBool(chain, 'depositEnable'),
|
|
871
|
+
'withdraw': this.safeBool(chain, 'withdrawEnable'),
|
|
872
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
873
|
+
'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
|
|
874
|
+
'isDefault': this.safeBool(chain, 'isDefault', false),
|
|
905
875
|
'limits': {
|
|
906
|
-
'amount': {
|
|
907
|
-
'min': undefined,
|
|
908
|
-
'max': undefined,
|
|
909
|
-
},
|
|
910
876
|
'withdraw': {
|
|
911
|
-
'min':
|
|
877
|
+
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
912
878
|
'max': undefined,
|
|
913
879
|
},
|
|
914
880
|
'deposit': {
|
|
915
|
-
'min':
|
|
881
|
+
'min': this.safeNumber(chain, 'depositDust'),
|
|
916
882
|
'max': undefined,
|
|
917
883
|
},
|
|
918
884
|
},
|
|
919
|
-
|
|
920
|
-
});
|
|
885
|
+
};
|
|
921
886
|
}
|
|
922
|
-
|
|
887
|
+
const networkKeys = Object.keys(networks);
|
|
888
|
+
const networksLength = networkKeys.length;
|
|
889
|
+
const emptyChains = networksLength === 0; // non-functional coins
|
|
890
|
+
const valueForEmpty = emptyChains ? false : undefined;
|
|
891
|
+
return this.safeCurrencyStructure({
|
|
892
|
+
'info': rawCurrency,
|
|
893
|
+
'code': code,
|
|
894
|
+
'id': currencyId,
|
|
895
|
+
'type': 'crypto',
|
|
896
|
+
'name': name,
|
|
897
|
+
'active': undefined,
|
|
898
|
+
'deposit': valueForEmpty,
|
|
899
|
+
'withdraw': valueForEmpty,
|
|
900
|
+
'fee': undefined,
|
|
901
|
+
'precision': undefined,
|
|
902
|
+
'limits': {
|
|
903
|
+
'amount': {
|
|
904
|
+
'min': undefined,
|
|
905
|
+
'max': undefined,
|
|
906
|
+
},
|
|
907
|
+
'withdraw': {
|
|
908
|
+
'min': undefined,
|
|
909
|
+
'max': undefined,
|
|
910
|
+
},
|
|
911
|
+
'deposit': {
|
|
912
|
+
'min': undefined,
|
|
913
|
+
'max': undefined,
|
|
914
|
+
},
|
|
915
|
+
},
|
|
916
|
+
'networks': networks,
|
|
917
|
+
});
|
|
923
918
|
}
|
|
924
919
|
/**
|
|
925
920
|
* @method
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -644,76 +644,74 @@ class whitebit extends whitebit$1["default"] {
|
|
|
644
644
|
// }
|
|
645
645
|
// }
|
|
646
646
|
//
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
'active': undefined,
|
|
672
|
-
'deposit': this.inArray(networkId, depositsNetworks),
|
|
673
|
-
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
674
|
-
'fee': undefined,
|
|
675
|
-
'precision': undefined,
|
|
676
|
-
'limits': {
|
|
677
|
-
'deposit': {
|
|
678
|
-
'min': this.safeNumber(networkDepositLimits, 'min'),
|
|
679
|
-
'max': this.safeNumber(networkDepositLimits, 'max'),
|
|
680
|
-
},
|
|
681
|
-
'withdraw': {
|
|
682
|
-
'min': this.safeNumber(networkWithdrawLimits, 'min'),
|
|
683
|
-
'max': this.safeNumber(networkWithdrawLimits, 'max'),
|
|
684
|
-
},
|
|
685
|
-
},
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
result[code] = this.safeCurrencyStructure({
|
|
689
|
-
'id': id,
|
|
690
|
-
'code': code,
|
|
691
|
-
'info': currency,
|
|
692
|
-
'name': undefined,
|
|
647
|
+
const enhancedArray = this.addKeyInArrayItems(response, '_coin_id');
|
|
648
|
+
return this.parseCurrencies(enhancedArray);
|
|
649
|
+
}
|
|
650
|
+
parseCurrency(rawCurrency) {
|
|
651
|
+
// const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
|
|
652
|
+
const id = this.safeString(rawCurrency, '_coin_id');
|
|
653
|
+
const code = this.safeCurrencyCode(id);
|
|
654
|
+
const hasProvider = ('providers' in rawCurrency);
|
|
655
|
+
const networks = {};
|
|
656
|
+
const rawNetworks = this.safeDict(rawCurrency, 'networks', {});
|
|
657
|
+
const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
|
|
658
|
+
const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
|
|
659
|
+
const networkLimits = this.safeDict(rawCurrency, 'limits', {});
|
|
660
|
+
const depositLimits = this.safeDict(networkLimits, 'deposit', {});
|
|
661
|
+
const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
|
|
662
|
+
const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
|
|
663
|
+
for (let j = 0; j < allNetworks.length; j++) {
|
|
664
|
+
const networkId = allNetworks[j];
|
|
665
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
666
|
+
const networkDepositLimits = this.safeDict(depositLimits, networkId, {});
|
|
667
|
+
const networkWithdrawLimits = this.safeDict(withdrawLimits, networkId, {});
|
|
668
|
+
networks[networkCode] = {
|
|
669
|
+
'id': networkId,
|
|
670
|
+
'network': networkCode,
|
|
693
671
|
'active': undefined,
|
|
694
|
-
'deposit': this.
|
|
695
|
-
'withdraw': this.
|
|
672
|
+
'deposit': this.inArray(networkId, depositsNetworks),
|
|
673
|
+
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
696
674
|
'fee': undefined,
|
|
697
|
-
'
|
|
698
|
-
'type': hasProvider ? 'fiat' : 'crypto',
|
|
699
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'currency_precision'))),
|
|
675
|
+
'precision': undefined,
|
|
700
676
|
'limits': {
|
|
701
|
-
'
|
|
702
|
-
'min':
|
|
703
|
-
'max':
|
|
677
|
+
'deposit': {
|
|
678
|
+
'min': this.safeNumber(networkDepositLimits, 'min'),
|
|
679
|
+
'max': this.safeNumber(networkDepositLimits, 'max'),
|
|
704
680
|
},
|
|
705
681
|
'withdraw': {
|
|
706
|
-
'min': this.safeNumber(
|
|
707
|
-
'max': this.safeNumber(
|
|
708
|
-
},
|
|
709
|
-
'deposit': {
|
|
710
|
-
'min': this.safeNumber(currency, 'min_deposit'),
|
|
711
|
-
'max': this.safeNumber(currency, 'max_deposit'),
|
|
682
|
+
'min': this.safeNumber(networkWithdrawLimits, 'min'),
|
|
683
|
+
'max': this.safeNumber(networkWithdrawLimits, 'max'),
|
|
712
684
|
},
|
|
713
685
|
},
|
|
714
|
-
}
|
|
686
|
+
};
|
|
715
687
|
}
|
|
716
|
-
return
|
|
688
|
+
return this.safeCurrencyStructure({
|
|
689
|
+
'id': id,
|
|
690
|
+
'code': code,
|
|
691
|
+
'info': rawCurrency,
|
|
692
|
+
'name': undefined,
|
|
693
|
+
'active': undefined,
|
|
694
|
+
'deposit': this.safeBool(rawCurrency, 'can_deposit'),
|
|
695
|
+
'withdraw': this.safeBool(rawCurrency, 'can_withdraw'),
|
|
696
|
+
'fee': undefined,
|
|
697
|
+
'networks': networks,
|
|
698
|
+
'type': hasProvider ? 'fiat' : 'crypto',
|
|
699
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'currency_precision'))),
|
|
700
|
+
'limits': {
|
|
701
|
+
'amount': {
|
|
702
|
+
'min': undefined,
|
|
703
|
+
'max': undefined,
|
|
704
|
+
},
|
|
705
|
+
'withdraw': {
|
|
706
|
+
'min': this.safeNumber(rawCurrency, 'min_withdraw'),
|
|
707
|
+
'max': this.safeNumber(rawCurrency, 'max_withdraw'),
|
|
708
|
+
},
|
|
709
|
+
'deposit': {
|
|
710
|
+
'min': this.safeNumber(rawCurrency, 'min_deposit'),
|
|
711
|
+
'max': this.safeNumber(rawCurrency, 'max_deposit'),
|
|
712
|
+
},
|
|
713
|
+
},
|
|
714
|
+
});
|
|
717
715
|
}
|
|
718
716
|
/**
|
|
719
717
|
* @method
|
|
@@ -901,7 +899,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
901
899
|
if (networkId !== undefined) {
|
|
902
900
|
const networkLength = networkId.length;
|
|
903
901
|
networkId = networkId.slice(1, networkLength - 1);
|
|
904
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
902
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
905
903
|
depositWithdrawFees[code]['networks'][networkCode] = {
|
|
906
904
|
'withdraw': withdrawResult,
|
|
907
905
|
'deposit': depositResult,
|