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/cryptomus.js
CHANGED
|
@@ -74,7 +74,7 @@ export default class cryptomus extends Exchange {
|
|
|
74
74
|
'fetchConvertTradeHistory': false,
|
|
75
75
|
'fetchCrossBorrowRate': false,
|
|
76
76
|
'fetchCrossBorrowRates': false,
|
|
77
|
-
'fetchCurrencies':
|
|
77
|
+
'fetchCurrencies': true,
|
|
78
78
|
'fetchDepositAddress': false,
|
|
79
79
|
'fetchDeposits': false,
|
|
80
80
|
'fetchDepositsWithdrawals': false,
|
|
@@ -401,46 +401,50 @@ export default class cryptomus extends Exchange {
|
|
|
401
401
|
//
|
|
402
402
|
const coins = this.safeList(response, 'result');
|
|
403
403
|
const groupedById = this.groupBy(coins, 'currency_code');
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
'limits': {
|
|
419
|
-
'withdraw': {
|
|
420
|
-
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
421
|
-
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
422
|
-
},
|
|
423
|
-
'deposit': {
|
|
424
|
-
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
425
|
-
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
'active': undefined,
|
|
429
|
-
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
430
|
-
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
431
|
-
'fee': undefined,
|
|
432
|
-
'precision': undefined,
|
|
433
|
-
'info': networkEntry,
|
|
434
|
-
};
|
|
404
|
+
const groupedArray = Object.values(groupedById);
|
|
405
|
+
return this.parseCurrencies(groupedArray);
|
|
406
|
+
}
|
|
407
|
+
parseCurrency(rawCurrency) {
|
|
408
|
+
// currency here is array of networks
|
|
409
|
+
let id = undefined; // all entried have same id, as they were grouped by
|
|
410
|
+
let code = undefined;
|
|
411
|
+
const networks = {};
|
|
412
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
413
|
+
const networkEntry = rawCurrency[i];
|
|
414
|
+
// set ID on first loop
|
|
415
|
+
if (id === undefined) {
|
|
416
|
+
id = this.safeString(networkEntry, 'currency_code');
|
|
417
|
+
code = this.safeCurrencyCode(id);
|
|
435
418
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
'
|
|
440
|
-
'
|
|
441
|
-
|
|
419
|
+
const networkId = this.safeString(networkEntry, 'network_code');
|
|
420
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
421
|
+
networks[networkCode] = {
|
|
422
|
+
'id': networkId,
|
|
423
|
+
'network': networkCode,
|
|
424
|
+
'limits': {
|
|
425
|
+
'withdraw': {
|
|
426
|
+
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
427
|
+
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
428
|
+
},
|
|
429
|
+
'deposit': {
|
|
430
|
+
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
431
|
+
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
'active': undefined,
|
|
435
|
+
'deposit': this.safeBool(networkEntry, 'can_deposit'),
|
|
436
|
+
'withdraw': this.safeBool(networkEntry, 'can_withdraw'),
|
|
437
|
+
'fee': undefined,
|
|
438
|
+
'precision': undefined,
|
|
439
|
+
'info': networkEntry,
|
|
440
|
+
};
|
|
442
441
|
}
|
|
443
|
-
return
|
|
442
|
+
return this.safeCurrencyStructure({
|
|
443
|
+
'id': id,
|
|
444
|
+
'code': code,
|
|
445
|
+
'networks': networks,
|
|
446
|
+
'info': rawCurrency,
|
|
447
|
+
});
|
|
444
448
|
}
|
|
445
449
|
/**
|
|
446
450
|
* @method
|
package/js/src/deepcoin.js
CHANGED
|
@@ -508,6 +508,8 @@ export default class deepcoin extends Exchange {
|
|
|
508
508
|
const maxLimitSize = this.safeString(market, 'maxLmtSz');
|
|
509
509
|
const maxAmount = this.parseNumber(Precise.stringMax(maxMarketSize, maxLimitSize));
|
|
510
510
|
const state = this.safeString(market, 'state');
|
|
511
|
+
const isMargin = spot && (Precise.stringGt(maxLeverage, '1'));
|
|
512
|
+
const isInverse = swap ? (!isLinear) : undefined;
|
|
511
513
|
return this.extend(fees, {
|
|
512
514
|
'id': id,
|
|
513
515
|
'symbol': symbol,
|
|
@@ -519,14 +521,14 @@ export default class deepcoin extends Exchange {
|
|
|
519
521
|
'settleId': settleId,
|
|
520
522
|
'type': type,
|
|
521
523
|
'spot': spot,
|
|
522
|
-
'margin':
|
|
524
|
+
'margin': isMargin,
|
|
523
525
|
'swap': swap,
|
|
524
526
|
'future': false,
|
|
525
527
|
'option': false,
|
|
526
528
|
'active': state === 'live',
|
|
527
529
|
'contract': swap,
|
|
528
530
|
'linear': isLinear,
|
|
529
|
-
'inverse':
|
|
531
|
+
'inverse': isInverse,
|
|
530
532
|
'contractSize': swap ? this.safeNumber(market, 'ctVal') : undefined,
|
|
531
533
|
'expiry': undefined,
|
|
532
534
|
'expiryDatetime': undefined,
|
|
@@ -1059,7 +1061,7 @@ export default class deepcoin extends Exchange {
|
|
|
1059
1061
|
const amount = this.safeNumber(transaction, 'amount');
|
|
1060
1062
|
const timestamp = this.safeTimestamp(transaction, 'createTime');
|
|
1061
1063
|
const networkId = this.safeString(transaction, 'chainName');
|
|
1062
|
-
const network = this.networkIdToCode(networkId);
|
|
1064
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1063
1065
|
const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
1064
1066
|
return {
|
|
1065
1067
|
'info': transaction,
|
|
@@ -1206,10 +1208,11 @@ export default class deepcoin extends Exchange {
|
|
|
1206
1208
|
const chain = this.safeString(response, 'chain');
|
|
1207
1209
|
const address = this.safeString(response, 'address');
|
|
1208
1210
|
this.checkAddress(address);
|
|
1211
|
+
const code = this.safeString(currency, 'code');
|
|
1209
1212
|
return {
|
|
1210
1213
|
'info': response,
|
|
1211
1214
|
'currency': undefined,
|
|
1212
|
-
'network': this.networkIdToCode(chain),
|
|
1215
|
+
'network': this.networkIdToCode(chain, code),
|
|
1213
1216
|
'address': address,
|
|
1214
1217
|
'tag': this.safeString(response, 'memo'),
|
|
1215
1218
|
};
|
|
@@ -2187,11 +2190,12 @@ export default class deepcoin extends Exchange {
|
|
|
2187
2190
|
}
|
|
2188
2191
|
let merged = true;
|
|
2189
2192
|
[merged, params] = this.handleOptionAndParams(params, 'cancelAllOrders', 'merged', merged);
|
|
2193
|
+
const isMergedMode = merged ? 1 : 0;
|
|
2190
2194
|
const request = {
|
|
2191
2195
|
'InstrumentID': market['id'],
|
|
2192
2196
|
'ProductGroup': productGroup,
|
|
2193
2197
|
'IsCrossMargin': encodedMarginMode,
|
|
2194
|
-
'IsMergeMode':
|
|
2198
|
+
'IsMergeMode': isMergedMode,
|
|
2195
2199
|
};
|
|
2196
2200
|
const response = await this.privatePostDeepcoinTradeSwapCancelAll(this.extend(request, params));
|
|
2197
2201
|
const data = this.safeList(response, 'data', []);
|
package/js/src/delta.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export default class delta extends Exchange {
|
|
|
39
39
|
* @returns {object} an associative dictionary of currencies
|
|
40
40
|
*/
|
|
41
41
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
42
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
42
43
|
loadMarkets(reload?: boolean, params?: {}): Promise<import("./base/types.js").Dictionary<MarketInterface>>;
|
|
43
44
|
indexByStringifiedNumericId(input: any): Dict;
|
|
44
45
|
/**
|
package/js/src/delta.js
CHANGED
|
@@ -360,6 +360,7 @@ export default class delta extends Exchange {
|
|
|
360
360
|
const strike = this.safeString(optionParts, 2);
|
|
361
361
|
const datetime = this.convertExpireDate(expiry);
|
|
362
362
|
const timestamp = this.parse8601(datetime);
|
|
363
|
+
const optionTypeUnified = (optionType === 'C') ? 'call' : 'put';
|
|
363
364
|
return {
|
|
364
365
|
'id': optionType + '-' + base + '-' + strike + '-' + expiry,
|
|
365
366
|
'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
|
|
@@ -382,7 +383,7 @@ export default class delta extends Exchange {
|
|
|
382
383
|
'contractSize': this.parseNumber('1'),
|
|
383
384
|
'expiry': timestamp,
|
|
384
385
|
'expiryDatetime': datetime,
|
|
385
|
-
'optionType':
|
|
386
|
+
'optionType': optionTypeUnified,
|
|
386
387
|
'strike': this.parseNumber(strike),
|
|
387
388
|
'precision': {
|
|
388
389
|
'amount': undefined,
|
|
@@ -559,62 +560,60 @@ export default class delta extends Exchange {
|
|
|
559
560
|
// }
|
|
560
561
|
//
|
|
561
562
|
const currencies = this.safeList(response, 'result', []);
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
'limits': {
|
|
584
|
-
'deposit': {
|
|
585
|
-
'min': this.safeNumber(chain, 'min_deposit_amount'),
|
|
586
|
-
'max': undefined,
|
|
587
|
-
},
|
|
588
|
-
'withdraw': {
|
|
589
|
-
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
590
|
-
'max': undefined,
|
|
591
|
-
},
|
|
592
|
-
},
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
result[code] = this.safeCurrencyStructure({
|
|
596
|
-
'id': id,
|
|
597
|
-
'numericId': numericId,
|
|
598
|
-
'code': code,
|
|
599
|
-
'name': this.safeString(currency, 'name'),
|
|
600
|
-
'info': currency,
|
|
601
|
-
'active': undefined,
|
|
602
|
-
'deposit': this.safeString(currency, 'deposit_status') === 'enabled',
|
|
603
|
-
'withdraw': this.safeString(currency, 'withdrawal_status') === 'enabled',
|
|
604
|
-
'fee': this.safeNumber(currency, 'base_withdrawal_fee'),
|
|
605
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
|
|
563
|
+
return this.parseCurrencies(currencies);
|
|
564
|
+
}
|
|
565
|
+
parseCurrency(rawCurrency) {
|
|
566
|
+
const id = this.safeString(rawCurrency, 'symbol');
|
|
567
|
+
const numericId = this.safeInteger(rawCurrency, 'id');
|
|
568
|
+
const code = this.safeCurrencyCode(id);
|
|
569
|
+
const chains = this.safeList(rawCurrency, 'networks', []);
|
|
570
|
+
const networks = {};
|
|
571
|
+
for (let j = 0; j < chains.length; j++) {
|
|
572
|
+
const chain = chains[j];
|
|
573
|
+
const networkId = this.safeString(chain, 'network');
|
|
574
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
575
|
+
networks[networkCode] = {
|
|
576
|
+
'id': networkId,
|
|
577
|
+
'network': networkCode,
|
|
578
|
+
'name': this.safeString(chain, 'name'),
|
|
579
|
+
'info': chain,
|
|
580
|
+
'active': this.safeString(chain, 'status') === 'enabled',
|
|
581
|
+
'deposit': this.safeString(chain, 'deposit_status') === 'enabled',
|
|
582
|
+
'withdraw': this.safeString(chain, 'withdrawal_status') === 'enabled',
|
|
583
|
+
'fee': this.safeNumber(chain, 'base_withdrawal_fee'),
|
|
606
584
|
'limits': {
|
|
607
|
-
'
|
|
585
|
+
'deposit': {
|
|
586
|
+
'min': this.safeNumber(chain, 'min_deposit_amount'),
|
|
587
|
+
'max': undefined,
|
|
588
|
+
},
|
|
608
589
|
'withdraw': {
|
|
609
|
-
'min': this.safeNumber(
|
|
590
|
+
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
610
591
|
'max': undefined,
|
|
611
592
|
},
|
|
612
593
|
},
|
|
613
|
-
|
|
614
|
-
'type': 'crypto',
|
|
615
|
-
});
|
|
594
|
+
};
|
|
616
595
|
}
|
|
617
|
-
return
|
|
596
|
+
return this.safeCurrencyStructure({
|
|
597
|
+
'id': id,
|
|
598
|
+
'numericId': numericId,
|
|
599
|
+
'code': code,
|
|
600
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
601
|
+
'info': rawCurrency,
|
|
602
|
+
'active': undefined,
|
|
603
|
+
'deposit': this.safeString(rawCurrency, 'deposit_status') === 'enabled',
|
|
604
|
+
'withdraw': this.safeString(rawCurrency, 'withdrawal_status') === 'enabled',
|
|
605
|
+
'fee': this.safeNumber(rawCurrency, 'base_withdrawal_fee'),
|
|
606
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
|
|
607
|
+
'limits': {
|
|
608
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
609
|
+
'withdraw': {
|
|
610
|
+
'min': this.safeNumber(rawCurrency, 'min_withdrawal_amount'),
|
|
611
|
+
'max': undefined,
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
'networks': networks,
|
|
615
|
+
'type': 'crypto',
|
|
616
|
+
});
|
|
618
617
|
}
|
|
619
618
|
async loadMarkets(reload = false, params = {}) {
|
|
620
619
|
const markets = await super.loadMarkets(reload, params);
|
|
@@ -2602,11 +2601,12 @@ export default class delta extends Exchange {
|
|
|
2602
2601
|
const address = this.safeString(depositAddress, 'address');
|
|
2603
2602
|
const marketId = this.safeString(depositAddress, 'asset_symbol');
|
|
2604
2603
|
const networkId = this.safeString(depositAddress, 'network');
|
|
2604
|
+
const code = this.safeCurrencyCode(marketId, currency);
|
|
2605
2605
|
this.checkAddress(address);
|
|
2606
2606
|
return {
|
|
2607
2607
|
'info': depositAddress,
|
|
2608
|
-
'currency':
|
|
2609
|
-
'network': this.networkIdToCode(networkId),
|
|
2608
|
+
'currency': code,
|
|
2609
|
+
'network': this.networkIdToCode(networkId, code),
|
|
2610
2610
|
'address': address,
|
|
2611
2611
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
2612
2612
|
};
|
package/js/src/deribit.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export default class deribit extends Exchange {
|
|
|
26
26
|
* @returns {object} an associative dictionary of currencies
|
|
27
27
|
*/
|
|
28
28
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
29
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
29
30
|
codeFromOptions(methodName: any, params?: {}): any;
|
|
30
31
|
/**
|
|
31
32
|
* @method
|
package/js/src/deribit.js
CHANGED
|
@@ -526,9 +526,11 @@ export default class deribit extends Exchange {
|
|
|
526
526
|
const optionType = this.safeString(optionParts, 3);
|
|
527
527
|
const datetime = this.convertExpireDate(expiry);
|
|
528
528
|
const timestamp = this.parse8601(datetime);
|
|
529
|
+
const id = base + '-' + this.convertExpireDateToMarketIdDate(expiry) + '-' + strike + '-' + optionType;
|
|
530
|
+
const symbolExpired = splitBase + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType;
|
|
529
531
|
return {
|
|
530
|
-
'id':
|
|
531
|
-
'symbol':
|
|
532
|
+
'id': id,
|
|
533
|
+
'symbol': symbolExpired,
|
|
532
534
|
'base': base,
|
|
533
535
|
'quote': quote,
|
|
534
536
|
'settle': settle,
|
|
@@ -636,40 +638,38 @@ export default class deribit extends Exchange {
|
|
|
636
638
|
// }
|
|
637
639
|
//
|
|
638
640
|
const data = this.safeList(response, 'result', []);
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
},
|
|
660
|
-
'withdraw': {
|
|
661
|
-
'min': undefined,
|
|
662
|
-
'max': undefined,
|
|
663
|
-
},
|
|
664
|
-
'deposit': {
|
|
665
|
-
'min': undefined,
|
|
666
|
-
'max': undefined,
|
|
667
|
-
},
|
|
641
|
+
return this.parseCurrencies(data);
|
|
642
|
+
}
|
|
643
|
+
parseCurrency(rawCurrency) {
|
|
644
|
+
const currencyId = this.safeString(rawCurrency, 'currency');
|
|
645
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
646
|
+
return this.safeCurrencyStructure({
|
|
647
|
+
'info': rawCurrency,
|
|
648
|
+
'code': code,
|
|
649
|
+
'id': currencyId,
|
|
650
|
+
'name': this.safeString(rawCurrency, 'currency_long'),
|
|
651
|
+
'active': undefined,
|
|
652
|
+
'deposit': undefined,
|
|
653
|
+
'withdraw': undefined,
|
|
654
|
+
'type': 'crypto',
|
|
655
|
+
'fee': this.safeNumber(rawCurrency, 'withdrawal_fee'),
|
|
656
|
+
'precision': undefined,
|
|
657
|
+
'limits': {
|
|
658
|
+
'amount': {
|
|
659
|
+
'min': undefined,
|
|
660
|
+
'max': undefined,
|
|
668
661
|
},
|
|
669
|
-
'
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
662
|
+
'withdraw': {
|
|
663
|
+
'min': undefined,
|
|
664
|
+
'max': undefined,
|
|
665
|
+
},
|
|
666
|
+
'deposit': {
|
|
667
|
+
'min': undefined,
|
|
668
|
+
'max': undefined,
|
|
669
|
+
},
|
|
670
|
+
},
|
|
671
|
+
'networks': undefined,
|
|
672
|
+
});
|
|
673
673
|
}
|
|
674
674
|
codeFromOptions(methodName, params = {}) {
|
|
675
675
|
const defaultCode = this.safeValue(this.options, 'code', 'BTC');
|
package/js/src/derive.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export default class derive 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 derive#fetchMarkets
|
package/js/src/derive.js
CHANGED
|
@@ -445,7 +445,6 @@ export default class derive extends Exchange {
|
|
|
445
445
|
* @returns {object} an associative dictionary of currencies
|
|
446
446
|
*/
|
|
447
447
|
async fetchCurrencies(params = {}) {
|
|
448
|
-
const result = {};
|
|
449
448
|
const tokenResponse = await this.publicGetGetAllCurrencies(params);
|
|
450
449
|
//
|
|
451
450
|
// {
|
|
@@ -496,34 +495,33 @@ export default class derive extends Exchange {
|
|
|
496
495
|
// }
|
|
497
496
|
//
|
|
498
497
|
const currencies = this.safeList(tokenResponse, 'result', []);
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
'withdraw': {
|
|
519
|
-
'min': undefined,
|
|
520
|
-
'max': undefined,
|
|
521
|
-
},
|
|
498
|
+
return this.parseCurrencies(currencies);
|
|
499
|
+
}
|
|
500
|
+
parseCurrency(rawCurrency) {
|
|
501
|
+
const currencyId = this.safeString(rawCurrency, 'currency');
|
|
502
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
503
|
+
return this.safeCurrencyStructure({
|
|
504
|
+
'id': currencyId,
|
|
505
|
+
'name': undefined,
|
|
506
|
+
'code': code,
|
|
507
|
+
'precision': undefined,
|
|
508
|
+
'active': undefined,
|
|
509
|
+
'fee': undefined,
|
|
510
|
+
'networks': undefined,
|
|
511
|
+
'deposit': undefined,
|
|
512
|
+
'withdraw': undefined,
|
|
513
|
+
'limits': {
|
|
514
|
+
'deposit': {
|
|
515
|
+
'min': undefined,
|
|
516
|
+
'max': undefined,
|
|
522
517
|
},
|
|
523
|
-
'
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
518
|
+
'withdraw': {
|
|
519
|
+
'min': undefined,
|
|
520
|
+
'max': undefined,
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
'info': rawCurrency,
|
|
524
|
+
});
|
|
527
525
|
}
|
|
528
526
|
/**
|
|
529
527
|
* @method
|
|
@@ -672,6 +670,8 @@ export default class derive extends Exchange {
|
|
|
672
670
|
linear = true;
|
|
673
671
|
inverse = false;
|
|
674
672
|
}
|
|
673
|
+
const contractSize = (spot) ? undefined : 1;
|
|
674
|
+
const isContract = (swap || option);
|
|
675
675
|
return this.safeMarketStructure({
|
|
676
676
|
'id': marketId,
|
|
677
677
|
'symbol': symbol,
|
|
@@ -688,10 +688,10 @@ export default class derive extends Exchange {
|
|
|
688
688
|
'future': false,
|
|
689
689
|
'option': option,
|
|
690
690
|
'active': this.safeBool(market, 'is_active'),
|
|
691
|
-
'contract':
|
|
691
|
+
'contract': isContract,
|
|
692
692
|
'linear': linear,
|
|
693
693
|
'inverse': inverse,
|
|
694
|
-
'contractSize':
|
|
694
|
+
'contractSize': contractSize,
|
|
695
695
|
'expiry': expiry,
|
|
696
696
|
'expiryDatetime': this.iso8601(expiry),
|
|
697
697
|
'taker': this.safeNumber(market, 'taker_fee_rate'),
|
|
@@ -1817,7 +1817,7 @@ export default class derive extends Exchange {
|
|
|
1817
1817
|
'gtc': 'GTC',
|
|
1818
1818
|
'post_only': 'PO',
|
|
1819
1819
|
};
|
|
1820
|
-
return this.safeString(timeInForces, timeInForce
|
|
1820
|
+
return this.safeString(timeInForces, timeInForce);
|
|
1821
1821
|
}
|
|
1822
1822
|
parseOrderStatus(status) {
|
|
1823
1823
|
if (status !== undefined) {
|
package/js/src/digifinex.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export default class digifinex extends Exchange {
|
|
|
14
14
|
* @returns {object} an associative dictionary of currencies
|
|
15
15
|
*/
|
|
16
16
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
17
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
17
18
|
/**
|
|
18
19
|
* @method
|
|
19
20
|
* @name digifinex#fetchMarkets
|