ccxt 4.5.56 → 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 +10 -9
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/apex.js +1 -1
- package/dist/cjs/src/arkham.js +3 -3
- package/dist/cjs/src/ascendex.js +2 -2
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +69 -32
- 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 +3 -3
- package/dist/cjs/src/binance.js +192 -194
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bitmart.js +13 -6
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +2 -2
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +2 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +0 -1
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +26 -3
- package/dist/cjs/src/bullish.js +6 -5
- 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 +2 -2
- package/dist/cjs/src/coinbaseinternational.js +2 -1
- package/dist/cjs/src/coinex.js +74 -74
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/cryptocom.js +46 -48
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +3 -2
- package/dist/cjs/src/delta.js +51 -52
- package/dist/cjs/src/deribit.js +31 -33
- package/dist/cjs/src/derive.js +26 -28
- package/dist/cjs/src/digifinex.js +43 -44
- package/dist/cjs/src/exmo.js +92 -83
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +71 -75
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +41 -43
- package/dist/cjs/src/grvt.js +4 -4
- package/dist/cjs/src/hashkey.js +52 -54
- package/dist/cjs/src/hitbtc.js +3 -13
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +75 -67
- package/dist/cjs/src/hyperliquid.js +41 -42
- package/dist/cjs/src/indodax.js +2 -2
- package/dist/cjs/src/kraken.js +57 -58
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +56 -56
- package/dist/cjs/src/lighter.js +35 -37
- package/dist/cjs/src/luno.js +35 -43
- package/dist/cjs/src/mexc.js +48 -49
- package/dist/cjs/src/modetrade.js +50 -52
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +17 -2
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/phemex.js +43 -45
- package/dist/cjs/src/poloniex.js +17 -12
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +1 -1
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.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/independentreserve.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- 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/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +2 -2
- 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 +65 -54
- package/dist/cjs/src/woofipro.js +53 -47
- package/dist/cjs/src/xt.js +1 -1
- package/dist/cjs/src/zebpay.js +70 -72
- 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/apex.js +1 -1
- package/js/src/arkham.js +3 -3
- package/js/src/ascendex.js +2 -2
- 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 +69 -32
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +3 -3
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +196 -198
- package/js/src/bingx.js +3 -3
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitget.js +2 -2
- package/js/src/bitmart.js +13 -6
- package/js/src/bitmex.js +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +2 -2
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.js +2 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +0 -1
- 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 +26 -3
- package/js/src/bullish.js +6 -5
- 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 +2 -2
- package/js/src/coinbaseinternational.js +2 -1
- package/js/src/coinex.d.ts +1 -0
- package/js/src/coinex.js +74 -74
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +1 -1
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +46 -48
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +3 -2
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +51 -52
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +31 -33
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +26 -28
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +43 -44
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +92 -83
- 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 +71 -75
- 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 +41 -43
- package/js/src/grvt.js +4 -4
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +52 -54
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +3 -13
- 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 +75 -67
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +41 -42
- package/js/src/indodax.js +2 -2
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +57 -58
- 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 +56 -56
- package/js/src/lighter.d.ts +1 -0
- package/js/src/lighter.js +35 -37
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +35 -43
- package/js/src/mexc.d.ts +2 -1
- package/js/src/mexc.js +48 -49
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +50 -52
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +17 -2
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +43 -45
- package/js/src/poloniex.js +17 -12
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +1 -1
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.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/independentreserve.js +1 -1
- 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/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.js +2 -2
- 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 +65 -54
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +53 -47
- package/js/src/xt.js +1 -1
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +70 -72
- package/package.json +7 -7
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2933
- 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 -2926
- 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');
|
|
@@ -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) {
|
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++) {
|
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/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.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,
|
|
@@ -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
|
package/js/src/whitebit.js
CHANGED
|
@@ -639,76 +639,74 @@ export default class whitebit extends Exchange {
|
|
|
639
639
|
// }
|
|
640
640
|
// }
|
|
641
641
|
//
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
'active': undefined,
|
|
667
|
-
'deposit': this.inArray(networkId, depositsNetworks),
|
|
668
|
-
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
669
|
-
'fee': undefined,
|
|
670
|
-
'precision': undefined,
|
|
671
|
-
'limits': {
|
|
672
|
-
'deposit': {
|
|
673
|
-
'min': this.safeNumber(networkDepositLimits, 'min'),
|
|
674
|
-
'max': this.safeNumber(networkDepositLimits, 'max'),
|
|
675
|
-
},
|
|
676
|
-
'withdraw': {
|
|
677
|
-
'min': this.safeNumber(networkWithdrawLimits, 'min'),
|
|
678
|
-
'max': this.safeNumber(networkWithdrawLimits, 'max'),
|
|
679
|
-
},
|
|
680
|
-
},
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
result[code] = this.safeCurrencyStructure({
|
|
684
|
-
'id': id,
|
|
685
|
-
'code': code,
|
|
686
|
-
'info': currency,
|
|
687
|
-
'name': undefined,
|
|
642
|
+
const enhancedArray = this.addKeyInArrayItems(response, '_coin_id');
|
|
643
|
+
return this.parseCurrencies(enhancedArray);
|
|
644
|
+
}
|
|
645
|
+
parseCurrency(rawCurrency) {
|
|
646
|
+
// const name = this.safeString (currency, 'name'); // breaks down in Python due to utf8 encoding issues on the exchange side
|
|
647
|
+
const id = this.safeString(rawCurrency, '_coin_id');
|
|
648
|
+
const code = this.safeCurrencyCode(id);
|
|
649
|
+
const hasProvider = ('providers' in rawCurrency);
|
|
650
|
+
const networks = {};
|
|
651
|
+
const rawNetworks = this.safeDict(rawCurrency, 'networks', {});
|
|
652
|
+
const depositsNetworks = this.safeList(rawNetworks, 'deposits', []);
|
|
653
|
+
const withdrawsNetworks = this.safeList(rawNetworks, 'withdraws', []);
|
|
654
|
+
const networkLimits = this.safeDict(rawCurrency, 'limits', {});
|
|
655
|
+
const depositLimits = this.safeDict(networkLimits, 'deposit', {});
|
|
656
|
+
const withdrawLimits = this.safeDict(networkLimits, 'withdraw', {});
|
|
657
|
+
const allNetworks = this.arrayConcat(depositsNetworks, withdrawsNetworks);
|
|
658
|
+
for (let j = 0; j < allNetworks.length; j++) {
|
|
659
|
+
const networkId = allNetworks[j];
|
|
660
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
661
|
+
const networkDepositLimits = this.safeDict(depositLimits, networkId, {});
|
|
662
|
+
const networkWithdrawLimits = this.safeDict(withdrawLimits, networkId, {});
|
|
663
|
+
networks[networkCode] = {
|
|
664
|
+
'id': networkId,
|
|
665
|
+
'network': networkCode,
|
|
688
666
|
'active': undefined,
|
|
689
|
-
'deposit': this.
|
|
690
|
-
'withdraw': this.
|
|
667
|
+
'deposit': this.inArray(networkId, depositsNetworks),
|
|
668
|
+
'withdraw': this.inArray(networkId, withdrawsNetworks),
|
|
691
669
|
'fee': undefined,
|
|
692
|
-
'
|
|
693
|
-
'type': hasProvider ? 'fiat' : 'crypto',
|
|
694
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'currency_precision'))),
|
|
670
|
+
'precision': undefined,
|
|
695
671
|
'limits': {
|
|
696
|
-
'
|
|
697
|
-
'min':
|
|
698
|
-
'max':
|
|
672
|
+
'deposit': {
|
|
673
|
+
'min': this.safeNumber(networkDepositLimits, 'min'),
|
|
674
|
+
'max': this.safeNumber(networkDepositLimits, 'max'),
|
|
699
675
|
},
|
|
700
676
|
'withdraw': {
|
|
701
|
-
'min': this.safeNumber(
|
|
702
|
-
'max': this.safeNumber(
|
|
703
|
-
},
|
|
704
|
-
'deposit': {
|
|
705
|
-
'min': this.safeNumber(currency, 'min_deposit'),
|
|
706
|
-
'max': this.safeNumber(currency, 'max_deposit'),
|
|
677
|
+
'min': this.safeNumber(networkWithdrawLimits, 'min'),
|
|
678
|
+
'max': this.safeNumber(networkWithdrawLimits, 'max'),
|
|
707
679
|
},
|
|
708
680
|
},
|
|
709
|
-
}
|
|
681
|
+
};
|
|
710
682
|
}
|
|
711
|
-
return
|
|
683
|
+
return this.safeCurrencyStructure({
|
|
684
|
+
'id': id,
|
|
685
|
+
'code': code,
|
|
686
|
+
'info': rawCurrency,
|
|
687
|
+
'name': undefined,
|
|
688
|
+
'active': undefined,
|
|
689
|
+
'deposit': this.safeBool(rawCurrency, 'can_deposit'),
|
|
690
|
+
'withdraw': this.safeBool(rawCurrency, 'can_withdraw'),
|
|
691
|
+
'fee': undefined,
|
|
692
|
+
'networks': networks,
|
|
693
|
+
'type': hasProvider ? 'fiat' : 'crypto',
|
|
694
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'currency_precision'))),
|
|
695
|
+
'limits': {
|
|
696
|
+
'amount': {
|
|
697
|
+
'min': undefined,
|
|
698
|
+
'max': undefined,
|
|
699
|
+
},
|
|
700
|
+
'withdraw': {
|
|
701
|
+
'min': this.safeNumber(rawCurrency, 'min_withdraw'),
|
|
702
|
+
'max': this.safeNumber(rawCurrency, 'max_withdraw'),
|
|
703
|
+
},
|
|
704
|
+
'deposit': {
|
|
705
|
+
'min': this.safeNumber(rawCurrency, 'min_deposit'),
|
|
706
|
+
'max': this.safeNumber(rawCurrency, 'max_deposit'),
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
|
+
});
|
|
712
710
|
}
|
|
713
711
|
/**
|
|
714
712
|
* @method
|
|
@@ -896,7 +894,7 @@ export default class whitebit extends Exchange {
|
|
|
896
894
|
if (networkId !== undefined) {
|
|
897
895
|
const networkLength = networkId.length;
|
|
898
896
|
networkId = networkId.slice(1, networkLength - 1);
|
|
899
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
897
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
900
898
|
depositWithdrawFees[code]['networks'][networkCode] = {
|
|
901
899
|
'withdraw': withdrawResult,
|
|
902
900
|
'deposit': depositResult,
|
package/js/src/woo.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export default class woo extends Exchange {
|
|
|
85
85
|
* @returns {object} an associative dictionary of currencies
|
|
86
86
|
*/
|
|
87
87
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
88
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
88
89
|
/**
|
|
89
90
|
* @method
|
|
90
91
|
* @name woo#createMarketBuyOrderWithCost
|
package/js/src/woo.js
CHANGED
|
@@ -1019,65 +1019,76 @@ export default class woo extends Exchange {
|
|
|
1019
1019
|
const tokensById = this.groupBy(tokenRows, 'balance_token');
|
|
1020
1020
|
const currencyIds = Object.keys(tokensById);
|
|
1021
1021
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
1022
|
-
const
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1052
|
-
},
|
|
1053
|
-
'info': [networkEntry, tokenEntry],
|
|
1054
|
-
};
|
|
1055
|
-
}
|
|
1056
|
-
result[code] = this.safeCurrencyStructure({
|
|
1057
|
-
'id': currencyId,
|
|
1058
|
-
'name': undefined,
|
|
1059
|
-
'code': code,
|
|
1060
|
-
'precision': undefined,
|
|
1022
|
+
const id = currencyIds[i];
|
|
1023
|
+
const customCurrency = {
|
|
1024
|
+
'_coin_id': id,
|
|
1025
|
+
'_tokens_by_id': tokensById[id],
|
|
1026
|
+
'_networks_by_id': networksById[id],
|
|
1027
|
+
};
|
|
1028
|
+
const parsed = this.parseCurrency(customCurrency);
|
|
1029
|
+
const code = parsed['code'];
|
|
1030
|
+
result[code] = parsed;
|
|
1031
|
+
}
|
|
1032
|
+
return result;
|
|
1033
|
+
}
|
|
1034
|
+
parseCurrency(rawCurrency) {
|
|
1035
|
+
const currencyId = this.safeString(rawCurrency, '_coin_id');
|
|
1036
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1037
|
+
const tokensByNetworkId = this.indexBy(rawCurrency['_tokens_by_id'], 'network');
|
|
1038
|
+
const chainsByNetworkId = this.indexBy(rawCurrency['_networks_by_id'], 'network');
|
|
1039
|
+
const keys = Object.keys(chainsByNetworkId);
|
|
1040
|
+
const resultingNetworks = {};
|
|
1041
|
+
for (let j = 0; j < keys.length; j++) {
|
|
1042
|
+
const networkId = keys[j];
|
|
1043
|
+
const tokenEntry = this.safeDict(tokensByNetworkId, networkId, {});
|
|
1044
|
+
const networkEntry = this.safeDict(chainsByNetworkId, networkId, {});
|
|
1045
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
1046
|
+
const specialNetworkId = this.safeString(tokenEntry, 'token');
|
|
1047
|
+
resultingNetworks[networkCode] = {
|
|
1048
|
+
'id': networkId,
|
|
1049
|
+
'currencyNetworkId': specialNetworkId,
|
|
1050
|
+
'network': networkCode,
|
|
1061
1051
|
'active': undefined,
|
|
1062
|
-
'
|
|
1063
|
-
'
|
|
1064
|
-
'
|
|
1065
|
-
'
|
|
1066
|
-
'type': 'crypto',
|
|
1052
|
+
'deposit': this.safeString(networkEntry, 'allow_deposit') === '1',
|
|
1053
|
+
'withdraw': this.safeString(networkEntry, 'allow_withdraw') === '1',
|
|
1054
|
+
'fee': this.safeNumber(networkEntry, 'withdrawal_fee'),
|
|
1055
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(tokenEntry, 'decimals'))),
|
|
1067
1056
|
'limits': {
|
|
1068
|
-
'
|
|
1069
|
-
'min':
|
|
1057
|
+
'withdraw': {
|
|
1058
|
+
'min': this.safeNumber(networkEntry, 'minimum_withdrawal'),
|
|
1070
1059
|
'max': undefined,
|
|
1071
1060
|
},
|
|
1072
|
-
'
|
|
1061
|
+
'deposit': {
|
|
1073
1062
|
'min': undefined,
|
|
1074
1063
|
'max': undefined,
|
|
1075
1064
|
},
|
|
1076
1065
|
},
|
|
1077
|
-
'info':
|
|
1078
|
-
}
|
|
1066
|
+
'info': { 'network': networkEntry, 'token': tokenEntry },
|
|
1067
|
+
};
|
|
1079
1068
|
}
|
|
1080
|
-
return
|
|
1069
|
+
return this.safeCurrencyStructure({
|
|
1070
|
+
'id': currencyId,
|
|
1071
|
+
'name': undefined,
|
|
1072
|
+
'code': code,
|
|
1073
|
+
'precision': undefined,
|
|
1074
|
+
'active': undefined,
|
|
1075
|
+
'fee': undefined,
|
|
1076
|
+
'networks': resultingNetworks,
|
|
1077
|
+
'deposit': undefined,
|
|
1078
|
+
'withdraw': undefined,
|
|
1079
|
+
'type': 'crypto',
|
|
1080
|
+
'limits': {
|
|
1081
|
+
'deposit': {
|
|
1082
|
+
'min': undefined,
|
|
1083
|
+
'max': undefined,
|
|
1084
|
+
},
|
|
1085
|
+
'withdraw': {
|
|
1086
|
+
'min': undefined,
|
|
1087
|
+
'max': undefined,
|
|
1088
|
+
},
|
|
1089
|
+
},
|
|
1090
|
+
'info': rawCurrency,
|
|
1091
|
+
});
|
|
1081
1092
|
}
|
|
1082
1093
|
/**
|
|
1083
1094
|
* @method
|
|
@@ -2477,7 +2488,7 @@ export default class woo extends Exchange {
|
|
|
2477
2488
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2478
2489
|
const request = {
|
|
2479
2490
|
'token': currency['id'],
|
|
2480
|
-
'network': this.networkCodeToId(networkCode),
|
|
2491
|
+
'network': this.networkCodeToId(networkCode, currency['code']),
|
|
2481
2492
|
};
|
|
2482
2493
|
const response = await this.v3PrivateGetAssetWalletDeposit(this.extend(request, params));
|
|
2483
2494
|
//
|
|
@@ -2527,7 +2538,7 @@ export default class woo extends Exchange {
|
|
|
2527
2538
|
let networkCode = undefined;
|
|
2528
2539
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2529
2540
|
if (networkCode !== undefined) {
|
|
2530
|
-
request['network'] = this.networkCodeToId(networkCode);
|
|
2541
|
+
request['network'] = this.networkCodeToId(networkCode, currency['code']);
|
|
2531
2542
|
}
|
|
2532
2543
|
if (since !== undefined) {
|
|
2533
2544
|
request['startTime'] = since;
|
|
@@ -2776,7 +2787,7 @@ export default class woo extends Exchange {
|
|
|
2776
2787
|
'comment': undefined,
|
|
2777
2788
|
'internal': undefined,
|
|
2778
2789
|
'fee': fee,
|
|
2779
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'network')),
|
|
2790
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'network'), code),
|
|
2780
2791
|
};
|
|
2781
2792
|
}
|
|
2782
2793
|
parseTransactionStatus(status) {
|
|
@@ -2999,7 +3010,7 @@ export default class woo extends Exchange {
|
|
|
2999
3010
|
}
|
|
3000
3011
|
params = this.omit(params, 'network');
|
|
3001
3012
|
request['token'] = currency['id'];
|
|
3002
|
-
request['network'] = this.networkCodeToId(network);
|
|
3013
|
+
request['network'] = this.networkCodeToId(network, currency['code']);
|
|
3003
3014
|
const response = await this.v3PrivatePostAssetWalletWithdraw(this.extend(request, params));
|
|
3004
3015
|
//
|
|
3005
3016
|
// {
|