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/lbank.js
CHANGED
|
@@ -448,66 +448,65 @@ export default class lbank extends Exchange {
|
|
|
448
448
|
//
|
|
449
449
|
const currenciesData = this.safeList(response, 'data', []);
|
|
450
450
|
const grouped = this.groupBy(currenciesData, 'assetCode');
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
465
|
-
networks[networkCode] = {
|
|
466
|
-
'id': networkId,
|
|
467
|
-
'network': networkCode,
|
|
468
|
-
'limits': {
|
|
469
|
-
'withdraw': {
|
|
470
|
-
'min': this.safeNumber(networkEntry, 'min'),
|
|
471
|
-
'max': undefined,
|
|
472
|
-
},
|
|
473
|
-
'deposit': {
|
|
474
|
-
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
475
|
-
'max': undefined,
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
'active': undefined,
|
|
479
|
-
'deposit': undefined,
|
|
480
|
-
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
481
|
-
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
482
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
483
|
-
'info': networkEntry,
|
|
484
|
-
};
|
|
451
|
+
const values = Object.values(grouped);
|
|
452
|
+
return this.parseCurrencies(values);
|
|
453
|
+
}
|
|
454
|
+
parseCurrency(rawCurrency) {
|
|
455
|
+
const id = this.safeString(rawCurrency[0], 'assetCode'); // first member is guaranteed
|
|
456
|
+
const code = this.safeCurrencyCode(id);
|
|
457
|
+
const networksRaw = rawCurrency;
|
|
458
|
+
const networks = {};
|
|
459
|
+
for (let j = 0; j < networksRaw.length; j++) {
|
|
460
|
+
const networkEntry = networksRaw[j];
|
|
461
|
+
let networkId = this.safeString(networkEntry, 'chain');
|
|
462
|
+
if (networkId === undefined) {
|
|
463
|
+
networkId = this.safeString(networkEntry, 'assetCode'); // use type as fallback if networkId is not present
|
|
485
464
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
'
|
|
489
|
-
'
|
|
490
|
-
'type': undefined,
|
|
491
|
-
'name': undefined,
|
|
492
|
-
'active': undefined,
|
|
493
|
-
'deposit': undefined,
|
|
494
|
-
'withdraw': undefined,
|
|
495
|
-
'fee': undefined,
|
|
465
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
466
|
+
networks[networkCode] = {
|
|
467
|
+
'id': networkId,
|
|
468
|
+
'network': networkCode,
|
|
496
469
|
'limits': {
|
|
497
470
|
'withdraw': {
|
|
498
|
-
'min':
|
|
471
|
+
'min': this.safeNumber(networkEntry, 'min'),
|
|
499
472
|
'max': undefined,
|
|
500
473
|
},
|
|
501
474
|
'deposit': {
|
|
502
|
-
'min':
|
|
475
|
+
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
503
476
|
'max': undefined,
|
|
504
477
|
},
|
|
505
478
|
},
|
|
506
|
-
'
|
|
507
|
-
'
|
|
508
|
-
|
|
479
|
+
'active': undefined,
|
|
480
|
+
'deposit': undefined,
|
|
481
|
+
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
482
|
+
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
483
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
484
|
+
'info': networkEntry,
|
|
485
|
+
};
|
|
509
486
|
}
|
|
510
|
-
return
|
|
487
|
+
return this.safeCurrencyStructure({
|
|
488
|
+
'id': id,
|
|
489
|
+
'code': code,
|
|
490
|
+
'precision': undefined,
|
|
491
|
+
'type': undefined,
|
|
492
|
+
'name': undefined,
|
|
493
|
+
'active': undefined,
|
|
494
|
+
'deposit': undefined,
|
|
495
|
+
'withdraw': undefined,
|
|
496
|
+
'fee': undefined,
|
|
497
|
+
'limits': {
|
|
498
|
+
'withdraw': {
|
|
499
|
+
'min': undefined,
|
|
500
|
+
'max': undefined,
|
|
501
|
+
},
|
|
502
|
+
'deposit': {
|
|
503
|
+
'min': undefined,
|
|
504
|
+
'max': undefined,
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
'networks': networks,
|
|
508
|
+
'info': networksRaw,
|
|
509
|
+
});
|
|
511
510
|
}
|
|
512
511
|
/**
|
|
513
512
|
* @method
|
|
@@ -1055,9 +1054,10 @@ export default class lbank extends Exchange {
|
|
|
1055
1054
|
let fee = undefined;
|
|
1056
1055
|
const feeCost = this.safeString(trade, 'tradeFee');
|
|
1057
1056
|
if (feeCost !== undefined) {
|
|
1057
|
+
const feeCurr = (side === 'buy') ? market['base'] : market['quote'];
|
|
1058
1058
|
fee = {
|
|
1059
1059
|
'cost': feeCost,
|
|
1060
|
-
'currency':
|
|
1060
|
+
'currency': feeCurr,
|
|
1061
1061
|
'rate': this.safeString(trade, 'tradeFeeRate'),
|
|
1062
1062
|
};
|
|
1063
1063
|
}
|
|
@@ -1180,11 +1180,13 @@ export default class lbank extends Exchange {
|
|
|
1180
1180
|
const duration = this.parseTimeframe(timeframe);
|
|
1181
1181
|
since = this.milliseconds() - (duration * 1000 * limit);
|
|
1182
1182
|
}
|
|
1183
|
+
const parsedSince = this.parseToInt(since / 1000);
|
|
1184
|
+
const parsedLimit = Math.min(limit + 1, 2000); // max 2000;
|
|
1183
1185
|
const request = {
|
|
1184
1186
|
'symbol': market['id'],
|
|
1185
1187
|
'type': this.safeString(this.timeframes, timeframe, timeframe),
|
|
1186
|
-
'time':
|
|
1187
|
-
'size':
|
|
1188
|
+
'time': parsedSince,
|
|
1189
|
+
'size': parsedLimit,
|
|
1188
1190
|
};
|
|
1189
1191
|
const response = await this.spotPublicGetKline(this.extend(request, params));
|
|
1190
1192
|
const ohlcvs = this.safeList(response, 'data', []);
|
|
@@ -2267,7 +2269,7 @@ export default class lbank extends Exchange {
|
|
|
2267
2269
|
return {
|
|
2268
2270
|
'info': response,
|
|
2269
2271
|
'currency': code,
|
|
2270
|
-
'network': this.networkIdToCode(this.safeString(result, 'netWork')),
|
|
2272
|
+
'network': this.networkIdToCode(this.safeString(result, 'netWork'), code),
|
|
2271
2273
|
'address': address,
|
|
2272
2274
|
'tag': tag,
|
|
2273
2275
|
};
|
|
@@ -2456,7 +2458,7 @@ export default class lbank extends Exchange {
|
|
|
2456
2458
|
'txid': txid,
|
|
2457
2459
|
'timestamp': timestamp,
|
|
2458
2460
|
'datetime': this.iso8601(timestamp),
|
|
2459
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
|
|
2461
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'networkName'), code),
|
|
2460
2462
|
'address': address,
|
|
2461
2463
|
'addressTo': addressTo,
|
|
2462
2464
|
'addressFrom': addressFrom,
|
|
@@ -2661,7 +2663,7 @@ export default class lbank extends Exchange {
|
|
|
2661
2663
|
const networkEntry = networkList[j];
|
|
2662
2664
|
const fee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2663
2665
|
if (fee !== undefined) {
|
|
2664
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2666
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2665
2667
|
withdrawFees[code][networkCode] = fee;
|
|
2666
2668
|
}
|
|
2667
2669
|
}
|
|
@@ -2713,7 +2715,7 @@ export default class lbank extends Exchange {
|
|
|
2713
2715
|
if (canWithdraw === 'true') {
|
|
2714
2716
|
const currencyId = this.safeString(item, 'assetCode');
|
|
2715
2717
|
const codeInner = this.safeCurrencyCode(currencyId);
|
|
2716
|
-
let network = this.networkIdToCode(this.safeString(item, 'chain'));
|
|
2718
|
+
let network = this.networkIdToCode(this.safeString(item, 'chain'), codeInner);
|
|
2717
2719
|
if (network === undefined) {
|
|
2718
2720
|
network = codeInner;
|
|
2719
2721
|
}
|
|
@@ -2864,7 +2866,7 @@ export default class lbank extends Exchange {
|
|
|
2864
2866
|
const resultCodeInfo = result[code]['info'];
|
|
2865
2867
|
resultCodeInfo.push(fee);
|
|
2866
2868
|
}
|
|
2867
|
-
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
|
|
2869
|
+
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'), code);
|
|
2868
2870
|
if (networkCode !== undefined) {
|
|
2869
2871
|
result[code]['networks'][networkCode] = {
|
|
2870
2872
|
'withdraw': {
|
|
@@ -2917,10 +2919,11 @@ export default class lbank extends Exchange {
|
|
|
2917
2919
|
// }
|
|
2918
2920
|
//
|
|
2919
2921
|
const result = this.depositWithdrawFee(fee);
|
|
2922
|
+
const code = this.safeString(currency, 'code');
|
|
2920
2923
|
const networkList = this.safeValue(fee, 'networkList', []);
|
|
2921
2924
|
for (let j = 0; j < networkList.length; j++) {
|
|
2922
2925
|
const networkEntry = networkList[j];
|
|
2923
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2926
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2924
2927
|
const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2925
2928
|
const isDefault = this.safeValue(networkEntry, 'isDefault');
|
|
2926
2929
|
if (withdrawFee !== undefined) {
|
|
@@ -2973,9 +2976,10 @@ export default class lbank extends Exchange {
|
|
|
2973
2976
|
else {
|
|
2974
2977
|
signatureMethod = 'HmacSHA256';
|
|
2975
2978
|
}
|
|
2979
|
+
const finalSig = signatureMethod; // java req
|
|
2976
2980
|
const auth = this.rawencode(this.keysort(this.extend({
|
|
2977
2981
|
'echostr': echostr,
|
|
2978
|
-
'signature_method':
|
|
2982
|
+
'signature_method': finalSig,
|
|
2979
2983
|
'timestamp': timestamp,
|
|
2980
2984
|
}, query)));
|
|
2981
2985
|
const encoded = this.encode(auth);
|
package/js/src/lighter.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class lighter extends Exchange {
|
|
|
13
13
|
* @method
|
|
14
14
|
* @name lighter#preLoadLighterLibrary
|
|
15
15
|
* @description if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
|
|
16
|
-
* @param params
|
|
16
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17
17
|
* @returns {boolean} true if the signer was loaded, false otherwise
|
|
18
18
|
*/
|
|
19
19
|
preLoadLighterLibrary(params?: {}): Promise<boolean>;
|
|
@@ -110,6 +110,7 @@ export default class lighter extends Exchange {
|
|
|
110
110
|
* @returns {object} an associative dictionary of currencies
|
|
111
111
|
*/
|
|
112
112
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
113
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
113
114
|
/**
|
|
114
115
|
* @method
|
|
115
116
|
* @name lighter#fetchOrderBook
|
package/js/src/lighter.js
CHANGED
|
@@ -438,7 +438,7 @@ export default class lighter extends Exchange {
|
|
|
438
438
|
* @method
|
|
439
439
|
* @name lighter#preLoadLighterLibrary
|
|
440
440
|
* @description if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
|
|
441
|
-
* @param params
|
|
441
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
442
442
|
* @returns {boolean} true if the signer was loaded, false otherwise
|
|
443
443
|
*/
|
|
444
444
|
async preLoadLighterLibrary(params = {}) {
|
|
@@ -1270,44 +1270,42 @@ export default class lighter extends Exchange {
|
|
|
1270
1270
|
// }
|
|
1271
1271
|
//
|
|
1272
1272
|
const data = this.safeList(response, 'asset_details', []);
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
'withdraw': {
|
|
1303
|
-
'min': withdrawMin,
|
|
1304
|
-
'max': undefined,
|
|
1305
|
-
},
|
|
1273
|
+
return this.parseCurrencies(data);
|
|
1274
|
+
}
|
|
1275
|
+
parseCurrency(rawCurrency) {
|
|
1276
|
+
const id = this.safeString(rawCurrency, 'asset_id');
|
|
1277
|
+
const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'symbol'));
|
|
1278
|
+
const decimals = this.safeString(rawCurrency, 'decimals');
|
|
1279
|
+
const isUSDC = (code === 'USDC');
|
|
1280
|
+
let depositMin = undefined;
|
|
1281
|
+
let withdrawMin = undefined;
|
|
1282
|
+
if (isUSDC) {
|
|
1283
|
+
depositMin = this.safeNumber(rawCurrency, 'min_transfer_amount');
|
|
1284
|
+
withdrawMin = this.safeNumber(rawCurrency, 'min_withdrawal_amount');
|
|
1285
|
+
}
|
|
1286
|
+
return this.safeCurrencyStructure({
|
|
1287
|
+
'id': id,
|
|
1288
|
+
'name': code,
|
|
1289
|
+
'code': code,
|
|
1290
|
+
'precision': this.parseNumber('1e-' + decimals),
|
|
1291
|
+
'active': true,
|
|
1292
|
+
'fee': undefined,
|
|
1293
|
+
'networks': {},
|
|
1294
|
+
'deposit': isUSDC,
|
|
1295
|
+
'withdraw': isUSDC,
|
|
1296
|
+
'type': 'crypto',
|
|
1297
|
+
'limits': {
|
|
1298
|
+
'deposit': {
|
|
1299
|
+
'min': depositMin,
|
|
1300
|
+
'max': undefined,
|
|
1306
1301
|
},
|
|
1307
|
-
'
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1302
|
+
'withdraw': {
|
|
1303
|
+
'min': withdrawMin,
|
|
1304
|
+
'max': undefined,
|
|
1305
|
+
},
|
|
1306
|
+
},
|
|
1307
|
+
'info': rawCurrency,
|
|
1308
|
+
});
|
|
1311
1309
|
}
|
|
1312
1310
|
/**
|
|
1313
1311
|
* @method
|
package/js/src/luno.d.ts
CHANGED
package/js/src/luno.js
CHANGED
|
@@ -326,39 +326,19 @@ export default class luno extends Exchange {
|
|
|
326
326
|
// }
|
|
327
327
|
//
|
|
328
328
|
const currenciesData = this.safeList(response, 'data', []);
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
'type': undefined,
|
|
340
|
-
'name': undefined,
|
|
341
|
-
'active': undefined,
|
|
342
|
-
'deposit': undefined,
|
|
343
|
-
'withdraw': undefined,
|
|
344
|
-
'fee': undefined,
|
|
345
|
-
'limits': {
|
|
346
|
-
'withdraw': {
|
|
347
|
-
'min': undefined,
|
|
348
|
-
'max': undefined,
|
|
349
|
-
},
|
|
350
|
-
'deposit': {
|
|
351
|
-
'min': undefined,
|
|
352
|
-
'max': undefined,
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
'networks': {},
|
|
356
|
-
'info': {},
|
|
357
|
-
};
|
|
358
|
-
}
|
|
329
|
+
const grouped = this.groupBy(currenciesData, 'native_currency');
|
|
330
|
+
const values = Object.values(grouped);
|
|
331
|
+
return this.parseCurrencies(values);
|
|
332
|
+
}
|
|
333
|
+
parseCurrency(rawCurrency) {
|
|
334
|
+
const id = this.safeString(rawCurrency[0], 'native_currency'); // first item is guaranteed
|
|
335
|
+
const code = this.safeCurrencyCode(id);
|
|
336
|
+
const networks = {};
|
|
337
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
338
|
+
const networkEntry = rawCurrency[i];
|
|
359
339
|
const networkId = this.safeString(networkEntry, 'name');
|
|
360
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
361
|
-
|
|
340
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
341
|
+
networks[networkCode] = {
|
|
362
342
|
'id': networkId,
|
|
363
343
|
'network': networkCode,
|
|
364
344
|
'limits': {
|
|
@@ -378,18 +358,30 @@ export default class luno extends Exchange {
|
|
|
378
358
|
'precision': undefined,
|
|
379
359
|
'info': networkEntry,
|
|
380
360
|
};
|
|
381
|
-
// add entry in info
|
|
382
|
-
const info = this.safeList(result[code], 'info', []);
|
|
383
|
-
info.push(networkEntry);
|
|
384
|
-
result[code]['info'] = info;
|
|
385
361
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
362
|
+
return this.safeCurrencyStructure({
|
|
363
|
+
'id': id,
|
|
364
|
+
'code': code,
|
|
365
|
+
'precision': undefined,
|
|
366
|
+
'type': undefined,
|
|
367
|
+
'name': undefined,
|
|
368
|
+
'active': undefined,
|
|
369
|
+
'deposit': undefined,
|
|
370
|
+
'withdraw': undefined,
|
|
371
|
+
'fee': undefined,
|
|
372
|
+
'limits': {
|
|
373
|
+
'withdraw': {
|
|
374
|
+
'min': undefined,
|
|
375
|
+
'max': undefined,
|
|
376
|
+
},
|
|
377
|
+
'deposit': {
|
|
378
|
+
'min': undefined,
|
|
379
|
+
'max': undefined,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
'networks': networks,
|
|
383
|
+
'info': rawCurrency,
|
|
384
|
+
});
|
|
393
385
|
}
|
|
394
386
|
/**
|
|
395
387
|
* @method
|
|
@@ -1271,7 +1263,7 @@ export default class luno extends Exchange {
|
|
|
1271
1263
|
const firstWord = this.safeString(words, 0);
|
|
1272
1264
|
const thirdWord = this.safeString(words, 2);
|
|
1273
1265
|
const fourthWord = this.safeString(words, 3);
|
|
1274
|
-
let type = this.safeString(types, firstWord
|
|
1266
|
+
let type = this.safeString(types, firstWord);
|
|
1275
1267
|
if ((type === undefined) && (thirdWord === 'fee')) {
|
|
1276
1268
|
type = 'fee';
|
|
1277
1269
|
}
|
package/js/src/mercado.js
CHANGED
|
@@ -680,6 +680,7 @@ export default class mercado extends Exchange {
|
|
|
680
680
|
const filled = this.safeString(order, 'executed_quantity');
|
|
681
681
|
const lastTradeTimestamp = this.safeTimestamp(order, 'updated_timestamp');
|
|
682
682
|
const rawTrades = this.safeValue(order, 'operations', []);
|
|
683
|
+
const symbol = market['symbol'];
|
|
683
684
|
return this.safeOrder({
|
|
684
685
|
'info': order,
|
|
685
686
|
'id': id,
|
|
@@ -687,7 +688,7 @@ export default class mercado extends Exchange {
|
|
|
687
688
|
'timestamp': timestamp,
|
|
688
689
|
'datetime': this.iso8601(timestamp),
|
|
689
690
|
'lastTradeTimestamp': lastTradeTimestamp,
|
|
690
|
-
'symbol':
|
|
691
|
+
'symbol': symbol,
|
|
691
692
|
'type': 'limit',
|
|
692
693
|
'timeInForce': undefined,
|
|
693
694
|
'postOnly': undefined,
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export default class mexc extends Exchange {
|
|
|
41
41
|
* @returns {object} an associative dictionary of currencies
|
|
42
42
|
*/
|
|
43
43
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
44
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
44
45
|
/**
|
|
45
46
|
* @method
|
|
46
47
|
* @name mexc#fetchMarkets
|
|
@@ -83,7 +84,7 @@ export default class mexc extends Exchange {
|
|
|
83
84
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
84
85
|
*/
|
|
85
86
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
86
|
-
|
|
87
|
+
parseOrderBookBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): number[];
|
|
87
88
|
/**
|
|
88
89
|
* @method
|
|
89
90
|
* @name mexc#fetchTrades
|
|
@@ -626,8 +627,8 @@ export default class mexc extends Exchange {
|
|
|
626
627
|
* @description fetch a history of internal transfers made on an account
|
|
627
628
|
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
628
629
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
629
|
-
* @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
|
|
630
|
-
* @param code
|
|
630
|
+
* @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
|
|
631
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
631
632
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
632
633
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
633
634
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|