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/js/src/pro/gate.js
CHANGED
|
@@ -631,7 +631,7 @@ export default class gate extends gateRest {
|
|
|
631
631
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
632
632
|
const bidAsk = bidAsks[i];
|
|
633
633
|
if (Array.isArray(bidAsk)) {
|
|
634
|
-
bookSide.storeArray(this.
|
|
634
|
+
bookSide.storeArray(this.parseOrderBookBidAsk(bidAsk));
|
|
635
635
|
}
|
|
636
636
|
else {
|
|
637
637
|
const price = this.safeFloat(bidAsk, 'p');
|
package/js/src/pro/grvt.js
CHANGED
|
@@ -573,6 +573,14 @@ export default class grvt extends grvtRest {
|
|
|
573
573
|
orderbook['timestamp'] = timestamp;
|
|
574
574
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
575
575
|
}
|
|
576
|
+
// grvt defaults to the delta channel (v1.book.d); if the very first
|
|
577
|
+
// message is a delta, the freshly-created orderbook has symbol=null
|
|
578
|
+
// because no snapshot has reset it yet. Set it unconditionally — we
|
|
579
|
+
// know the symbol from the selector regardless of channel. Java's
|
|
580
|
+
// typed WsOrderBook surfaces this as `"symbol":null` in the output;
|
|
581
|
+
// Python/JS dict-backed orderbooks happen to mask it but the
|
|
582
|
+
// unconditional assignment is correct for every language.
|
|
583
|
+
orderbook['symbol'] = symbol;
|
|
576
584
|
orderbook['nonce'] = sequenceNumber;
|
|
577
585
|
const messageHash = 'orderbook::' + symbol;
|
|
578
586
|
this.orderbooks[symbol] = orderbook;
|
package/js/src/pro/htx.d.ts
CHANGED
|
@@ -153,10 +153,10 @@ export default class htx extends htxRest {
|
|
|
153
153
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
|
|
154
154
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
|
|
155
155
|
* @description watch all open positions. Note: huobi has one channel for each marginMode and type
|
|
156
|
-
* @param {string[]
|
|
157
|
-
* @param since
|
|
158
|
-
* @param limit
|
|
159
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
156
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
157
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
158
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
159
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
160
160
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
161
161
|
*/
|
|
162
162
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
package/js/src/pro/htx.js
CHANGED
|
@@ -1356,10 +1356,10 @@ export default class htx extends htxRest {
|
|
|
1356
1356
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
|
|
1357
1357
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
|
|
1358
1358
|
* @description watch all open positions. Note: huobi has one channel for each marginMode and type
|
|
1359
|
-
* @param {string[]
|
|
1360
|
-
* @param since
|
|
1361
|
-
* @param limit
|
|
1362
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1359
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1360
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1361
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1362
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1363
1363
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1364
1364
|
*/
|
|
1365
1365
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -236,7 +236,7 @@ export default class independentreserve extends independentreserveRest {
|
|
|
236
236
|
return result;
|
|
237
237
|
}
|
|
238
238
|
handleDelta(bookside, delta) {
|
|
239
|
-
const bidAsk = this.
|
|
239
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'Price', 'Volume');
|
|
240
240
|
bookside.storeArray(bidAsk);
|
|
241
241
|
}
|
|
242
242
|
handleDeltas(bookside, deltas) {
|
|
@@ -112,10 +112,10 @@ export default class krakenfutures extends krakenfuturesRest {
|
|
|
112
112
|
* @name krakenfutures#watchPositions
|
|
113
113
|
* @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
|
|
114
114
|
* @description watch all open positions
|
|
115
|
-
* @param {string[]
|
|
116
|
-
* @param since
|
|
117
|
-
* @param limit
|
|
118
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
115
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
116
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
117
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
118
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
119
119
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
120
120
|
*/
|
|
121
121
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
@@ -261,10 +261,10 @@ export default class krakenfutures extends krakenfuturesRest {
|
|
|
261
261
|
* @name krakenfutures#watchPositions
|
|
262
262
|
* @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
|
|
263
263
|
* @description watch all open positions
|
|
264
|
-
* @param {string[]
|
|
265
|
-
* @param since
|
|
266
|
-
* @param limit
|
|
267
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
264
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
265
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
266
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
267
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
268
268
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
269
269
|
*/
|
|
270
270
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1537,8 +1537,20 @@ export default class krakenfutures extends krakenfuturesRest {
|
|
|
1537
1537
|
// event: 'alert',
|
|
1538
1538
|
// message: 'Failed to subscribe to authenticated feed'
|
|
1539
1539
|
// }
|
|
1540
|
+
// {
|
|
1541
|
+
// event: 'alert',
|
|
1542
|
+
// message: 'Already subscribed to feed, re-requesting'
|
|
1543
|
+
// }
|
|
1540
1544
|
//
|
|
1541
1545
|
const errMsg = this.safeString(message, 'message');
|
|
1546
|
+
// Benign "already subscribed" notice: the original subscription is still
|
|
1547
|
+
// active and delivering data on this socket. The generic client.reject
|
|
1548
|
+
// below rejects every pending future on the connection, so a stray
|
|
1549
|
+
// re-subscribe warning would kill unrelated in-flight watch* calls —
|
|
1550
|
+
// mirrors the bitmart 90008 fix.
|
|
1551
|
+
if (errMsg !== undefined && errMsg.indexOf('Already subscribed') >= 0) {
|
|
1552
|
+
return false;
|
|
1553
|
+
}
|
|
1542
1554
|
try {
|
|
1543
1555
|
throw new ExchangeError(this.id + ' ' + errMsg);
|
|
1544
1556
|
}
|
package/js/src/pro/kucoin.js
CHANGED
|
@@ -1748,7 +1748,7 @@ export default class kucoin extends kucoinRest {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
handleBidAsks(bookSide, bidAsks) {
|
|
1750
1750
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
1751
|
-
const bidAsk = this.
|
|
1751
|
+
const bidAsk = this.parseOrderBookBidAsk(bidAsks[i]);
|
|
1752
1752
|
bookSide.storeArray(bidAsk);
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
package/js/src/pro/luno.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export default class luno extends lunoRest {
|
|
|
37
37
|
datetime: string;
|
|
38
38
|
nonce: any;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
parseOrderBookBidsAsks(bidasks: any, priceKey?: IndexType, amountKey?: IndexType, thirdKey?: IndexType): any[];
|
|
41
41
|
customParseBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, thirdKey?: IndexType): number[];
|
|
42
42
|
handleDelta(orderbook: any, message: any): void;
|
|
43
43
|
handleMessage(client: Client, message: any): void;
|
package/js/src/pro/luno.js
CHANGED
|
@@ -209,8 +209,8 @@ export default class luno extends lunoRest {
|
|
|
209
209
|
client.resolve(orderbook, messageHash);
|
|
210
210
|
}
|
|
211
211
|
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
|
|
212
|
-
const bids = this.
|
|
213
|
-
const asks = this.
|
|
212
|
+
const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
213
|
+
const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
214
214
|
return {
|
|
215
215
|
'symbol': symbol,
|
|
216
216
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -220,7 +220,7 @@ export default class luno extends lunoRest {
|
|
|
220
220
|
'nonce': undefined,
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
|
|
224
224
|
bidasks = this.toArray(bidasks);
|
|
225
225
|
const result = [];
|
|
226
226
|
for (let i = 0; i < bidasks.length; i++) {
|
|
@@ -122,9 +122,9 @@ export default class modetrade extends modetradeRest {
|
|
|
122
122
|
* @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/private/position-push
|
|
123
123
|
* @description watch all open positions
|
|
124
124
|
* @param {string[]} [symbols] list of unified market symbols
|
|
125
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
126
|
-
* @param limit the maximum number of positions to fetch
|
|
127
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
125
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
126
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
127
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
128
128
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
129
129
|
*/
|
|
130
130
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
package/js/src/pro/modetrade.js
CHANGED
|
@@ -956,9 +956,9 @@ export default class modetrade extends modetradeRest {
|
|
|
956
956
|
* @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/private/position-push
|
|
957
957
|
* @description watch all open positions
|
|
958
958
|
* @param {string[]} [symbols] list of unified market symbols
|
|
959
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
960
|
-
* @param limit the maximum number of positions to fetch
|
|
961
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
959
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
960
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
961
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
962
962
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
963
963
|
*/
|
|
964
964
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/js/src/pro/okx.d.ts
CHANGED
|
@@ -309,10 +309,10 @@ export default class okx extends okxRest {
|
|
|
309
309
|
* @name okx#watchPositions
|
|
310
310
|
* @see https://www.okx.com/docs-v5/en/#trading-account-websocket-positions-channel
|
|
311
311
|
* @description watch all open positions
|
|
312
|
-
* @param {string[]
|
|
313
|
-
* @param since
|
|
314
|
-
* @param limit
|
|
315
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
312
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
313
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
314
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
315
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
316
316
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
317
317
|
*/
|
|
318
318
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
package/js/src/pro/okx.js
CHANGED
|
@@ -1699,10 +1699,10 @@ export default class okx extends okxRest {
|
|
|
1699
1699
|
* @name okx#watchPositions
|
|
1700
1700
|
* @see https://www.okx.com/docs-v5/en/#trading-account-websocket-positions-channel
|
|
1701
1701
|
* @description watch all open positions
|
|
1702
|
-
* @param {string[]
|
|
1703
|
-
* @param since
|
|
1704
|
-
* @param limit
|
|
1705
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1702
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1703
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1704
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1705
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1706
1706
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1707
1707
|
*/
|
|
1708
1708
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/js/src/pro/onetrading.js
CHANGED
|
@@ -386,7 +386,7 @@ export default class onetrading extends onetradingRest {
|
|
|
386
386
|
//
|
|
387
387
|
// [ 'BUY', "0.053595", "0" ]
|
|
388
388
|
//
|
|
389
|
-
const bidAsk = this.
|
|
389
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 1, 2);
|
|
390
390
|
const type = this.safeString(delta, 0);
|
|
391
391
|
if (type === 'BUY') {
|
|
392
392
|
const bids = orderbook['bids'];
|
package/js/src/pro/toobit.js
CHANGED
|
@@ -578,7 +578,7 @@ export default class toobit extends toobitRest {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
handleDelta(bookside, delta) {
|
|
581
|
-
const bidAsk = this.
|
|
581
|
+
const bidAsk = this.parseOrderBookBidAsk(delta);
|
|
582
582
|
bookside.storeArray(bidAsk);
|
|
583
583
|
}
|
|
584
584
|
handleOrderBookPartialSnapshot(client, message) {
|
package/js/src/pro/weex.js
CHANGED
|
@@ -877,7 +877,7 @@ export default class weex extends weexRest {
|
|
|
877
877
|
client.resolve(orderbook, messageHash);
|
|
878
878
|
}
|
|
879
879
|
handleDelta(bookside, delta) {
|
|
880
|
-
const bidAsk = this.
|
|
880
|
+
const bidAsk = this.parseOrderBookBidAsk(delta);
|
|
881
881
|
bookside.storeArray(bidAsk);
|
|
882
882
|
}
|
|
883
883
|
/**
|
package/js/src/pro/woo.d.ts
CHANGED
|
@@ -190,10 +190,10 @@ export default class woo extends wooRest {
|
|
|
190
190
|
* @name woo#watchPositions
|
|
191
191
|
* @see https://docs.woox.io/#position-push
|
|
192
192
|
* @description watch all open positions
|
|
193
|
-
* @param {string[]
|
|
194
|
-
* @param since
|
|
195
|
-
* @param limit
|
|
196
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
193
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
194
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
195
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
196
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
197
197
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
198
198
|
*/
|
|
199
199
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
package/js/src/pro/woo.js
CHANGED
|
@@ -1197,10 +1197,10 @@ export default class woo extends wooRest {
|
|
|
1197
1197
|
* @name woo#watchPositions
|
|
1198
1198
|
* @see https://docs.woox.io/#position-push
|
|
1199
1199
|
* @description watch all open positions
|
|
1200
|
-
* @param {string[]
|
|
1201
|
-
* @param since
|
|
1202
|
-
* @param limit
|
|
1203
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1200
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1201
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1202
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1203
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1204
1204
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1205
1205
|
*/
|
|
1206
1206
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/js/src/pro/woofipro.d.ts
CHANGED
|
@@ -122,9 +122,9 @@ export default class woofipro extends woofiproRest {
|
|
|
122
122
|
* @see https://orderly.network/docs/build-on-omnichain/evm-api/websocket-api/private/position-push
|
|
123
123
|
* @description watch all open positions
|
|
124
124
|
* @param {string[]} [symbols] list of unified market symbols
|
|
125
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
126
|
-
* @param limit the maximum number of positions to fetch
|
|
127
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
125
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
126
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
127
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
128
128
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
129
129
|
*/
|
|
130
130
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
package/js/src/pro/woofipro.js
CHANGED
|
@@ -956,9 +956,9 @@ export default class woofipro extends woofiproRest {
|
|
|
956
956
|
* @see https://orderly.network/docs/build-on-omnichain/evm-api/websocket-api/private/position-push
|
|
957
957
|
* @description watch all open positions
|
|
958
958
|
* @param {string[]} [symbols] list of unified market symbols
|
|
959
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
960
|
-
* @param limit the maximum number of positions to fetch
|
|
961
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
959
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
960
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
961
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
962
962
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
963
963
|
*/
|
|
964
964
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/js/src/pro/xt.js
CHANGED
|
@@ -598,7 +598,7 @@ export default class xt extends xtRest {
|
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
600
|
async loadPositionsSnapshot(client, messageHash) {
|
|
601
|
-
const positions = await this.fetchPositions(
|
|
601
|
+
const positions = await this.fetchPositions();
|
|
602
602
|
this.positions = new ArrayCacheBySymbolBySide();
|
|
603
603
|
const cache = this.positions;
|
|
604
604
|
for (let i = 0; i < positions.length; i++) {
|
package/js/src/tokocrypto.js
CHANGED
|
@@ -2472,7 +2472,7 @@ export default class tokocrypto extends Exchange {
|
|
|
2472
2472
|
request['addressTag'] = tag;
|
|
2473
2473
|
}
|
|
2474
2474
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
2475
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2475
|
+
const networkId = this.networkCodeToId(networkCode, code);
|
|
2476
2476
|
if (networkId !== undefined) {
|
|
2477
2477
|
request['network'] = networkId.toUpperCase();
|
|
2478
2478
|
}
|
package/js/src/toobit.d.ts
CHANGED
|
@@ -375,7 +375,7 @@ export default class toobit extends Exchange {
|
|
|
375
375
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
|
|
376
376
|
*/
|
|
377
377
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
378
|
-
fetchDepositsOrWithdrawalsHelper(type: any, code: any, since: any, limit: any, params
|
|
378
|
+
fetchDepositsOrWithdrawalsHelper(type: any, code: any, since: any, limit: any, params?: {}): Promise<Transaction[]>;
|
|
379
379
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
380
380
|
parseTransactionStatus(status: Str): string;
|
|
381
381
|
/**
|
package/js/src/toobit.js
CHANGED
|
@@ -607,7 +607,7 @@ export default class toobit extends Exchange {
|
|
|
607
607
|
for (let j = 0; j < rawNetworks.length; j++) {
|
|
608
608
|
const rawNetwork = rawNetworks[j];
|
|
609
609
|
const networkId = this.safeString(rawNetwork, 'chainType');
|
|
610
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
610
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
611
611
|
networks[networkCode] = {
|
|
612
612
|
'id': networkId,
|
|
613
613
|
'network': networkCode,
|
|
@@ -2513,7 +2513,7 @@ export default class toobit extends Exchange {
|
|
|
2513
2513
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2514
2514
|
return await this.fetchDepositsOrWithdrawalsHelper('withdrawals', code, since, limit, params);
|
|
2515
2515
|
}
|
|
2516
|
-
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params) {
|
|
2516
|
+
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params = {}) {
|
|
2517
2517
|
await this.loadMarkets();
|
|
2518
2518
|
let currency = undefined;
|
|
2519
2519
|
let request = {};
|
|
@@ -2695,7 +2695,7 @@ export default class toobit extends Exchange {
|
|
|
2695
2695
|
if (networkCode === undefined) {
|
|
2696
2696
|
throw new ArgumentsRequired(this.id + ' fetchDepositAddress() : param["network"] is required');
|
|
2697
2697
|
}
|
|
2698
|
-
request['chainType'] = this.networkCodeToId(networkCode);
|
|
2698
|
+
request['chainType'] = this.networkCodeToId(networkCode, code);
|
|
2699
2699
|
const response = await this.privateGetApiV1AccountDepositAddress(this.extend(request, paramsOmitted));
|
|
2700
2700
|
//
|
|
2701
2701
|
// {
|
package/js/src/upbit.js
CHANGED
|
@@ -675,8 +675,8 @@ export default class upbit extends Exchange {
|
|
|
675
675
|
const timestamp = this.safeInteger(orderbook, 'timestamp');
|
|
676
676
|
result[symbol] = {
|
|
677
677
|
'symbol': symbol,
|
|
678
|
-
'bids': this.sortBy(this.
|
|
679
|
-
'asks': this.sortBy(this.
|
|
678
|
+
'bids': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'bid_price', 'bid_size'), 0, true),
|
|
679
|
+
'asks': this.sortBy(this.parseOrderBookBidsAsks(orderbook['orderbook_units'], 'ask_price', 'ask_size'), 0),
|
|
680
680
|
'timestamp': timestamp,
|
|
681
681
|
'datetime': this.iso8601(timestamp),
|
|
682
682
|
'nonce': undefined,
|
|
@@ -2165,7 +2165,7 @@ export default class upbit extends Exchange {
|
|
|
2165
2165
|
return {
|
|
2166
2166
|
'info': depositAddress,
|
|
2167
2167
|
'currency': code,
|
|
2168
|
-
'network': this.networkIdToCode(networkId),
|
|
2168
|
+
'network': this.networkIdToCode(networkId, code),
|
|
2169
2169
|
'address': address,
|
|
2170
2170
|
'tag': tag,
|
|
2171
2171
|
};
|
package/js/src/weex.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export default class weex extends Exchange {
|
|
|
42
42
|
* @returns {object} an associative dictionary of currencies
|
|
43
43
|
*/
|
|
44
44
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
45
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
45
46
|
/**
|
|
46
47
|
* @method
|
|
47
48
|
* @name weex#fetchMarkets
|
package/js/src/weex.js
CHANGED
|
@@ -491,20 +491,17 @@ export default class weex extends Exchange {
|
|
|
491
491
|
'ETH': 'ERC20',
|
|
492
492
|
'POLYGON': 'POLYGON(MATIC)',
|
|
493
493
|
'MATIC': 'POLYGON(MATIC)',
|
|
494
|
-
'
|
|
495
|
-
'ARB': 'ARBITRUM(ARB)',
|
|
496
|
-
'SOLANA': 'SOLANA(SOL)',
|
|
494
|
+
'ARBONE': 'ARBITRUM(ARB)',
|
|
497
495
|
'SOL': 'SOLANA(SOL)',
|
|
498
496
|
'OP': 'OPTIMISM(OP)',
|
|
499
497
|
'OPTIMISM': 'OPTIMISM(OP)',
|
|
500
|
-
'AVALANCHEC': 'AVALANCHE_C(AVAX_C)',
|
|
501
498
|
'AVAXC': 'AVALANCHE_C(AVAX_C)',
|
|
502
499
|
},
|
|
503
500
|
'networksById': {
|
|
504
501
|
'BEP20(BSC)': 'BEP20',
|
|
505
502
|
'ERC20': 'ERC20',
|
|
506
503
|
'POLYGON(MATIC)': 'MATIC',
|
|
507
|
-
'ARBITRUM(ARB)': '
|
|
504
|
+
'ARBITRUM(ARB)': 'ARBONE',
|
|
508
505
|
'SOLANA(SOL)': 'SOL',
|
|
509
506
|
'OPTIMISM(OP)': 'OP',
|
|
510
507
|
'AVALANCHE_C(AVAX_C)': 'AVAXC',
|
|
@@ -848,73 +845,71 @@ export default class weex extends Exchange {
|
|
|
848
845
|
// }
|
|
849
846
|
// ]
|
|
850
847
|
//
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
'active': undefined,
|
|
868
|
-
'deposit': this.safeBool(chain, 'depositEnable'),
|
|
869
|
-
'withdraw': this.safeBool(chain, 'withdrawEnable'),
|
|
870
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
871
|
-
'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
|
|
872
|
-
'isDefault': this.safeBool(chain, 'isDefault', false),
|
|
873
|
-
'limits': {
|
|
874
|
-
'withdraw': {
|
|
875
|
-
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
876
|
-
'max': undefined,
|
|
877
|
-
},
|
|
878
|
-
'deposit': {
|
|
879
|
-
'min': this.safeNumber(chain, 'depositDust'),
|
|
880
|
-
'max': undefined,
|
|
881
|
-
},
|
|
882
|
-
},
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
const networkKeys = Object.keys(networks);
|
|
886
|
-
const networksLength = networkKeys.length;
|
|
887
|
-
const emptyChains = networksLength === 0; // non-functional coins
|
|
888
|
-
const valueForEmpty = emptyChains ? false : undefined;
|
|
889
|
-
result[code] = this.safeCurrencyStructure({
|
|
890
|
-
'info': currency,
|
|
891
|
-
'code': code,
|
|
892
|
-
'id': currencyId,
|
|
893
|
-
'type': 'crypto',
|
|
894
|
-
'name': name,
|
|
848
|
+
return this.parseCurrencies(response);
|
|
849
|
+
}
|
|
850
|
+
parseCurrency(rawCurrency) {
|
|
851
|
+
const currencyId = this.safeString(rawCurrency, 'coin');
|
|
852
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
853
|
+
const name = this.safeString(rawCurrency, 'name');
|
|
854
|
+
const networks = {};
|
|
855
|
+
const chains = this.safeList(rawCurrency, 'networkList', []);
|
|
856
|
+
for (let j = 0; j < chains.length; j++) {
|
|
857
|
+
const chain = this.safeDict(chains, j);
|
|
858
|
+
const networkId = this.safeString(chain, 'network');
|
|
859
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
860
|
+
networks[networkCode] = {
|
|
861
|
+
'info': chain,
|
|
862
|
+
'id': networkId,
|
|
863
|
+
'network': networkCode,
|
|
895
864
|
'active': undefined,
|
|
896
|
-
'deposit':
|
|
897
|
-
'withdraw':
|
|
898
|
-
'fee':
|
|
899
|
-
'precision':
|
|
865
|
+
'deposit': this.safeBool(chain, 'depositEnable'),
|
|
866
|
+
'withdraw': this.safeBool(chain, 'withdrawEnable'),
|
|
867
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
868
|
+
'precision': this.safeNumber(chain, 'withdrawIntegerMultiple'),
|
|
869
|
+
'isDefault': this.safeBool(chain, 'isDefault', false),
|
|
900
870
|
'limits': {
|
|
901
|
-
'amount': {
|
|
902
|
-
'min': undefined,
|
|
903
|
-
'max': undefined,
|
|
904
|
-
},
|
|
905
871
|
'withdraw': {
|
|
906
|
-
'min':
|
|
872
|
+
'min': this.safeNumber(chain, 'withdrawMin'),
|
|
907
873
|
'max': undefined,
|
|
908
874
|
},
|
|
909
875
|
'deposit': {
|
|
910
|
-
'min':
|
|
876
|
+
'min': this.safeNumber(chain, 'depositDust'),
|
|
911
877
|
'max': undefined,
|
|
912
878
|
},
|
|
913
879
|
},
|
|
914
|
-
|
|
915
|
-
});
|
|
880
|
+
};
|
|
916
881
|
}
|
|
917
|
-
|
|
882
|
+
const networkKeys = Object.keys(networks);
|
|
883
|
+
const networksLength = networkKeys.length;
|
|
884
|
+
const emptyChains = networksLength === 0; // non-functional coins
|
|
885
|
+
const valueForEmpty = emptyChains ? false : undefined;
|
|
886
|
+
return this.safeCurrencyStructure({
|
|
887
|
+
'info': rawCurrency,
|
|
888
|
+
'code': code,
|
|
889
|
+
'id': currencyId,
|
|
890
|
+
'type': 'crypto',
|
|
891
|
+
'name': name,
|
|
892
|
+
'active': undefined,
|
|
893
|
+
'deposit': valueForEmpty,
|
|
894
|
+
'withdraw': valueForEmpty,
|
|
895
|
+
'fee': undefined,
|
|
896
|
+
'precision': undefined,
|
|
897
|
+
'limits': {
|
|
898
|
+
'amount': {
|
|
899
|
+
'min': undefined,
|
|
900
|
+
'max': undefined,
|
|
901
|
+
},
|
|
902
|
+
'withdraw': {
|
|
903
|
+
'min': undefined,
|
|
904
|
+
'max': undefined,
|
|
905
|
+
},
|
|
906
|
+
'deposit': {
|
|
907
|
+
'min': undefined,
|
|
908
|
+
'max': undefined,
|
|
909
|
+
},
|
|
910
|
+
},
|
|
911
|
+
'networks': networks,
|
|
912
|
+
});
|
|
918
913
|
}
|
|
919
914
|
/**
|
|
920
915
|
* @method
|
package/js/src/whitebit.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export default class whitebit extends Exchange {
|
|
|
25
25
|
* @returns {object} an associative dictionary of currencies
|
|
26
26
|
*/
|
|
27
27
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
28
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
28
29
|
/**
|
|
29
30
|
* @method
|
|
30
31
|
* @name whitebit#fetchTransactionFees
|