ccxt 4.1.55 → 4.1.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/.git-templates/hooks/pre-push +2 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -6
- package/build.sh +30 -8
- package/dist/ccxt.browser.js +5592 -4907
- package/dist/ccxt.browser.min.js +13 -13
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +17 -13
- package/dist/cjs/src/alpaca.js +6 -6
- package/dist/cjs/src/ascendex.js +35 -29
- package/dist/cjs/src/base/Exchange.js +39 -26
- package/dist/cjs/src/base/Precise.js +1 -3
- package/dist/cjs/src/bigone.js +24 -20
- package/dist/cjs/src/binance.js +97 -76
- package/dist/cjs/src/bingx.js +63 -44
- package/dist/cjs/src/bit2c.js +18 -15
- package/dist/cjs/src/bitbank.js +17 -15
- package/dist/cjs/src/bitbns.js +28 -18
- package/dist/cjs/src/bitfinex.js +23 -21
- package/dist/cjs/src/bitfinex2.js +32 -28
- package/dist/cjs/src/bitflyer.js +28 -20
- package/dist/cjs/src/bitforex.js +25 -18
- package/dist/cjs/src/bitget.js +184 -147
- package/dist/cjs/src/bithumb.js +23 -16
- package/dist/cjs/src/bitmart.js +129 -94
- package/dist/cjs/src/bitmex.js +104 -64
- package/dist/cjs/src/bitopro.js +38 -26
- package/dist/cjs/src/bitpanda.js +24 -23
- package/dist/cjs/src/bitrue.js +33 -24
- package/dist/cjs/src/bitso.js +24 -23
- package/dist/cjs/src/bitstamp.js +24 -23
- package/dist/cjs/src/bittrex.js +30 -29
- package/dist/cjs/src/bitvavo.js +38 -30
- package/dist/cjs/src/bl3p.js +11 -10
- package/dist/cjs/src/blockchaincom.js +20 -20
- package/dist/cjs/src/btcalpha.js +18 -17
- package/dist/cjs/src/btcbox.js +13 -12
- package/dist/cjs/src/btcmarkets.js +20 -19
- package/dist/cjs/src/btcturk.js +14 -13
- package/dist/cjs/src/bybit.js +84 -54
- package/dist/cjs/src/cex.js +16 -14
- package/dist/cjs/src/coinbase.js +29 -27
- package/dist/cjs/src/coinbasepro.js +27 -25
- package/dist/cjs/src/coincheck.js +15 -14
- package/dist/cjs/src/coinex.js +101 -78
- package/dist/cjs/src/coinlist.js +28 -27
- package/dist/cjs/src/coinmate.js +20 -17
- package/dist/cjs/src/coinone.js +21 -16
- package/dist/cjs/src/coinsph.js +37 -28
- package/dist/cjs/src/coinspot.js +12 -11
- package/dist/cjs/src/cryptocom.js +40 -202
- package/dist/cjs/src/currencycom.js +32 -25
- package/dist/cjs/src/delta.js +34 -28
- package/dist/cjs/src/deribit.js +39 -36
- package/dist/cjs/src/digifinex.js +64 -44
- package/dist/cjs/src/exmo.js +29 -27
- package/dist/cjs/src/gate.js +67 -53
- package/dist/cjs/src/gemini.js +23 -20
- package/dist/cjs/src/hitbtc.js +65 -56
- package/dist/cjs/src/hollaex.js +30 -27
- package/dist/cjs/src/htx.js +135 -143
- package/dist/cjs/src/huobijp.js +22 -20
- package/dist/cjs/src/idex.js +22 -21
- package/dist/cjs/src/independentreserve.js +15 -14
- package/dist/cjs/src/indodax.js +30 -26
- package/dist/cjs/src/kraken.js +29 -27
- package/dist/cjs/src/krakenfutures.js +29 -22
- package/dist/cjs/src/kucoin.js +48 -43
- package/dist/cjs/src/kucoinfutures.js +33 -28
- package/dist/cjs/src/kuna.js +25 -24
- package/dist/cjs/src/latoken.js +24 -22
- package/dist/cjs/src/lbank.js +45 -30
- package/dist/cjs/src/luno.js +22 -19
- package/dist/cjs/src/lykke.js +19 -17
- package/dist/cjs/src/mercado.js +30 -19
- package/dist/cjs/src/mexc.js +60 -49
- package/dist/cjs/src/ndax.js +23 -22
- package/dist/cjs/src/novadax.js +23 -22
- package/dist/cjs/src/oceanex.js +22 -19
- package/dist/cjs/src/okcoin.js +29 -23
- package/dist/cjs/src/okx.js +92 -84
- package/dist/cjs/src/p2b.js +80 -83
- package/dist/cjs/src/paymium.js +10 -10
- package/dist/cjs/src/phemex.js +63 -40
- package/dist/cjs/src/poloniex.js +22 -22
- package/dist/cjs/src/poloniexfutures.js +23 -19
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/ascendex.js +4 -4
- package/dist/cjs/src/pro/binance.js +16 -16
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +4 -4
- package/dist/cjs/src/pro/bitfinex2.js +6 -6
- package/dist/cjs/src/pro/bitget.js +7 -7
- package/dist/cjs/src/pro/bitmart.js +7 -5
- package/dist/cjs/src/pro/bitmex.js +6 -6
- package/dist/cjs/src/pro/bitopro.js +4 -4
- package/dist/cjs/src/pro/bitpanda.js +6 -6
- package/dist/cjs/src/pro/bitrue.js +2 -2
- package/dist/cjs/src/pro/bitstamp.js +6 -4
- package/dist/cjs/src/pro/bittrex.js +6 -6
- package/dist/cjs/src/pro/bitvavo.js +11 -7
- package/dist/cjs/src/pro/blockchaincom.js +8 -8
- package/dist/cjs/src/pro/bybit.js +7 -7
- package/dist/cjs/src/pro/cex.js +13 -9
- package/dist/cjs/src/pro/coinbase.js +5 -5
- package/dist/cjs/src/pro/coinbasepro.js +11 -10
- package/dist/cjs/src/pro/coinex.js +7 -9
- package/dist/cjs/src/pro/cryptocom.js +9 -9
- package/dist/cjs/src/pro/currencycom.js +4 -4
- package/dist/cjs/src/pro/deribit.js +6 -6
- package/dist/cjs/src/pro/exmo.js +12 -14
- package/dist/cjs/src/pro/gate.js +7 -7
- package/dist/cjs/src/pro/gemini.js +3 -3
- package/dist/cjs/src/pro/hitbtc.js +263 -4
- package/dist/cjs/src/pro/hollaex.js +5 -5
- package/dist/cjs/src/pro/htx.js +6 -6
- package/dist/cjs/src/pro/huobijp.js +3 -3
- package/dist/cjs/src/pro/idex.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +10 -10
- package/dist/cjs/src/pro/krakenfutures.js +41 -17
- package/dist/cjs/src/pro/kucoin.js +7 -7
- package/dist/cjs/src/pro/kucoinfutures.js +8 -6
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +6 -6
- package/dist/cjs/src/pro/ndax.js +3 -3
- package/dist/cjs/src/pro/okcoin.js +5 -5
- package/dist/cjs/src/pro/okx.js +12 -12
- package/dist/cjs/src/pro/phemex.js +6 -6
- package/dist/cjs/src/pro/poloniex.js +7 -7
- package/dist/cjs/src/pro/poloniexfutures.js +5 -5
- package/dist/cjs/src/pro/probit.js +6 -6
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/wazirx.js +8 -8
- package/dist/cjs/src/pro/whitebit.js +12 -8
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/probit.js +28 -23
- package/dist/cjs/src/tidex.js +16 -15
- package/dist/cjs/src/timex.js +19 -18
- package/dist/cjs/src/tokocrypto.js +27 -22
- package/dist/cjs/src/upbit.js +19 -19
- package/dist/cjs/src/wavesexchange.js +22 -19
- package/dist/cjs/src/wazirx.js +24 -17
- package/dist/cjs/src/whitebit.js +33 -27
- package/dist/cjs/src/woo.js +44 -34
- package/dist/cjs/src/yobit.js +25 -20
- package/dist/cjs/src/zaif.js +9 -9
- package/dist/cjs/src/zonda.js +18 -17
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitbank.d.ts +1 -0
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/cryptocom.d.ts +0 -20
- package/js/src/abstract/htx.d.ts +3 -0
- package/js/src/abstract/huobi.d.ts +3 -0
- package/js/src/abstract/huobipro.d.ts +3 -0
- package/js/src/abstract/okex.d.ts +3 -1
- package/js/src/abstract/okex5.d.ts +3 -1
- package/js/src/abstract/okx.d.ts +3 -1
- package/js/src/ace.js +18 -14
- package/js/src/alpaca.js +6 -6
- package/js/src/ascendex.js +35 -29
- package/js/src/base/Exchange.d.ts +37 -34
- package/js/src/base/Exchange.js +39 -26
- package/js/src/base/Precise.d.ts +4 -4
- package/js/src/base/Precise.js +1 -3
- package/js/src/base/functions/type.d.ts +25 -25
- package/js/src/base/types.d.ts +21 -14
- package/js/src/bigone.js +25 -21
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +97 -76
- package/js/src/bingx.js +63 -44
- package/js/src/bit2c.js +19 -16
- package/js/src/bitbank.js +17 -15
- package/js/src/bitbns.js +28 -18
- package/js/src/bitfinex.js +23 -21
- package/js/src/bitfinex2.js +32 -28
- package/js/src/bitflyer.js +28 -20
- package/js/src/bitforex.js +26 -19
- package/js/src/bitget.d.ts +25 -3
- package/js/src/bitget.js +184 -147
- package/js/src/bithumb.js +23 -16
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +129 -94
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitmex.js +104 -64
- package/js/src/bitopro.js +38 -26
- package/js/src/bitpanda.js +24 -23
- package/js/src/bitrue.js +33 -24
- package/js/src/bitso.js +24 -23
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp.js +24 -23
- package/js/src/bittrex.js +30 -29
- package/js/src/bitvavo.js +38 -30
- package/js/src/bl3p.js +11 -10
- package/js/src/blockchaincom.js +20 -20
- package/js/src/btcalpha.js +18 -17
- package/js/src/btcbox.js +13 -12
- package/js/src/btcmarkets.js +20 -19
- package/js/src/btcturk.js +14 -13
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +84 -54
- package/js/src/cex.js +16 -14
- package/js/src/coinbase.js +29 -27
- package/js/src/coinbasepro.js +27 -25
- package/js/src/coincheck.js +15 -14
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +101 -78
- package/js/src/coinlist.js +28 -27
- package/js/src/coinmate.js +21 -18
- package/js/src/coinone.js +21 -16
- package/js/src/coinsph.js +37 -28
- package/js/src/coinspot.js +12 -11
- package/js/src/cryptocom.d.ts +0 -23
- package/js/src/cryptocom.js +40 -202
- package/js/src/currencycom.js +32 -25
- package/js/src/delta.js +35 -29
- package/js/src/deribit.js +39 -36
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/digifinex.js +65 -45
- package/js/src/exmo.js +29 -27
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +67 -53
- package/js/src/gemini.js +23 -20
- package/js/src/hitbtc.d.ts +1 -0
- package/js/src/hitbtc.js +65 -56
- package/js/src/hollaex.js +30 -27
- package/js/src/htx.d.ts +11 -3
- package/js/src/htx.js +135 -143
- package/js/src/huobijp.js +23 -21
- package/js/src/idex.js +22 -21
- package/js/src/independentreserve.js +15 -14
- package/js/src/indodax.js +30 -26
- package/js/src/kraken.js +29 -27
- package/js/src/krakenfutures.js +29 -22
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +48 -43
- package/js/src/kucoinfutures.js +33 -28
- package/js/src/kuna.js +25 -24
- package/js/src/latoken.js +25 -23
- package/js/src/lbank.js +46 -31
- package/js/src/luno.js +22 -19
- package/js/src/lykke.js +19 -17
- package/js/src/mercado.js +30 -19
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +60 -49
- package/js/src/ndax.js +23 -22
- package/js/src/novadax.js +23 -22
- package/js/src/oceanex.js +22 -19
- package/js/src/okcoin.js +29 -23
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +92 -84
- package/js/src/p2b.d.ts +8 -7
- package/js/src/p2b.js +80 -82
- package/js/src/paymium.js +10 -10
- package/js/src/phemex.js +63 -40
- package/js/src/poloniex.js +22 -22
- package/js/src/poloniexfutures.js +23 -19
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/ascendex.js +4 -4
- package/js/src/pro/binance.js +16 -16
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.js +4 -4
- package/js/src/pro/bitfinex2.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +6 -6
- package/js/src/pro/bitget.js +7 -7
- package/js/src/pro/bitmart.js +7 -5
- package/js/src/pro/bitmex.js +6 -6
- package/js/src/pro/bitopro.js +4 -4
- package/js/src/pro/bitpanda.js +6 -6
- package/js/src/pro/bitrue.js +2 -2
- package/js/src/pro/bitstamp.js +7 -5
- package/js/src/pro/bittrex.js +6 -6
- package/js/src/pro/bitvavo.js +12 -8
- package/js/src/pro/blockchaincom.js +8 -8
- package/js/src/pro/bybit.js +7 -7
- package/js/src/pro/cex.js +14 -10
- package/js/src/pro/coinbase.js +5 -5
- package/js/src/pro/coinbasepro.js +12 -11
- package/js/src/pro/coinex.js +7 -9
- package/js/src/pro/cryptocom.js +9 -9
- package/js/src/pro/currencycom.js +4 -4
- package/js/src/pro/deribit.js +6 -6
- package/js/src/pro/exmo.js +12 -14
- package/js/src/pro/gate.js +7 -7
- package/js/src/pro/gemini.js +3 -3
- package/js/src/pro/hitbtc.d.ts +8 -1
- package/js/src/pro/hitbtc.js +264 -5
- package/js/src/pro/hollaex.js +5 -5
- package/js/src/pro/htx.js +6 -6
- package/js/src/pro/huobijp.js +3 -3
- package/js/src/pro/idex.js +4 -4
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.js +10 -10
- package/js/src/pro/krakenfutures.d.ts +1 -0
- package/js/src/pro/krakenfutures.js +42 -18
- package/js/src/pro/kucoin.js +7 -7
- package/js/src/pro/kucoinfutures.js +8 -6
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.js +6 -6
- package/js/src/pro/ndax.js +3 -3
- package/js/src/pro/okcoin.js +5 -5
- package/js/src/pro/okx.js +12 -12
- package/js/src/pro/phemex.js +6 -6
- package/js/src/pro/poloniex.js +7 -7
- package/js/src/pro/poloniexfutures.js +5 -5
- package/js/src/pro/probit.js +6 -6
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/wazirx.js +8 -8
- package/js/src/pro/whitebit.js +13 -9
- package/js/src/pro/woo.js +1 -1
- package/js/src/probit.js +29 -24
- package/js/src/tidex.js +16 -15
- package/js/src/timex.js +19 -18
- package/js/src/tokocrypto.js +28 -23
- package/js/src/upbit.js +19 -19
- package/js/src/wavesexchange.js +23 -20
- package/js/src/wazirx.js +25 -18
- package/js/src/whitebit.js +33 -27
- package/js/src/woo.js +45 -35
- package/js/src/yobit.js +25 -20
- package/js/src/zaif.js +9 -9
- package/js/src/zonda.js +18 -17
- package/package.json +2 -2
- package/js/src/bitstamp1.d.ts +0 -28
- package/js/src/bitstamp1.js +0 -430
- package/js/src/lbank2.d.ts +0 -90
- package/js/src/lbank2.js +0 -2779
package/js/src/coinex.js
CHANGED
|
@@ -50,23 +50,25 @@ export default class coinex extends Exchange {
|
|
|
50
50
|
'editOrder': true,
|
|
51
51
|
'fetchBalance': true,
|
|
52
52
|
'fetchBorrowInterest': true,
|
|
53
|
-
'fetchBorrowRate': true,
|
|
54
53
|
'fetchBorrowRateHistories': false,
|
|
55
54
|
'fetchBorrowRateHistory': false,
|
|
56
|
-
'fetchBorrowRates': true,
|
|
57
55
|
'fetchClosedOrders': true,
|
|
56
|
+
'fetchCrossBorrowRate': false,
|
|
57
|
+
'fetchCrossBorrowRates': false,
|
|
58
58
|
'fetchCurrencies': true,
|
|
59
59
|
'fetchDepositAddress': true,
|
|
60
60
|
'fetchDepositAddressByNetwork': false,
|
|
61
61
|
'fetchDepositAddresses': false,
|
|
62
62
|
'fetchDeposits': true,
|
|
63
|
-
'fetchDepositWithdrawFees': true,
|
|
64
63
|
'fetchDepositWithdrawFee': 'emulated',
|
|
64
|
+
'fetchDepositWithdrawFees': true,
|
|
65
65
|
'fetchFundingHistory': true,
|
|
66
66
|
'fetchFundingRate': true,
|
|
67
67
|
'fetchFundingRateHistory': true,
|
|
68
68
|
'fetchFundingRates': true,
|
|
69
69
|
'fetchIndexOHLCV': false,
|
|
70
|
+
'fetchIsolatedBorrowRate': true,
|
|
71
|
+
'fetchIsolatedBorrowRates': true,
|
|
70
72
|
'fetchLeverage': false,
|
|
71
73
|
'fetchLeverageTiers': true,
|
|
72
74
|
'fetchMarketLeverageTiers': 'emulated',
|
|
@@ -735,7 +737,7 @@ export default class coinex extends Exchange {
|
|
|
735
737
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
736
738
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
737
739
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
738
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
740
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
739
741
|
*/
|
|
740
742
|
await this.loadMarkets();
|
|
741
743
|
const market = this.market(symbol);
|
|
@@ -809,7 +811,7 @@ export default class coinex extends Exchange {
|
|
|
809
811
|
* @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http009_market_ticker_all
|
|
810
812
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
811
813
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
812
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
814
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
813
815
|
*/
|
|
814
816
|
await this.loadMarkets();
|
|
815
817
|
symbols = this.marketSymbols(symbols);
|
|
@@ -923,7 +925,7 @@ export default class coinex extends Exchange {
|
|
|
923
925
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
924
926
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
925
927
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
926
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
928
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
927
929
|
*/
|
|
928
930
|
await this.loadMarkets();
|
|
929
931
|
const market = this.market(symbol);
|
|
@@ -1081,11 +1083,11 @@ export default class coinex extends Exchange {
|
|
|
1081
1083
|
}
|
|
1082
1084
|
let side = undefined;
|
|
1083
1085
|
if (market['type'] === 'swap') {
|
|
1084
|
-
|
|
1085
|
-
if (
|
|
1086
|
+
const rawSide = this.safeInteger(trade, 'side');
|
|
1087
|
+
if (rawSide === 1) {
|
|
1086
1088
|
side = 'sell';
|
|
1087
1089
|
}
|
|
1088
|
-
else if (
|
|
1090
|
+
else if (rawSide === 2) {
|
|
1089
1091
|
side = 'buy';
|
|
1090
1092
|
}
|
|
1091
1093
|
if (side === undefined) {
|
|
@@ -1120,7 +1122,7 @@ export default class coinex extends Exchange {
|
|
|
1120
1122
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1121
1123
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1122
1124
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
1123
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1125
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1124
1126
|
*/
|
|
1125
1127
|
await this.loadMarkets();
|
|
1126
1128
|
const market = this.market(symbol);
|
|
@@ -1160,7 +1162,7 @@ export default class coinex extends Exchange {
|
|
|
1160
1162
|
* @description fetch the trading fees for a market
|
|
1161
1163
|
* @param {string} symbol unified market symbol
|
|
1162
1164
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
1163
|
-
* @returns {object} a [fee structure]{@link https://
|
|
1165
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
1164
1166
|
*/
|
|
1165
1167
|
await this.loadMarkets();
|
|
1166
1168
|
const market = this.market(symbol);
|
|
@@ -1193,7 +1195,7 @@ export default class coinex extends Exchange {
|
|
|
1193
1195
|
* @name coinex#fetchTradingFees
|
|
1194
1196
|
* @description fetch the trading fees for multiple markets
|
|
1195
1197
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
1196
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
1198
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
1197
1199
|
*/
|
|
1198
1200
|
await this.loadMarkets();
|
|
1199
1201
|
const response = await this.publicGetMarketInfo(params);
|
|
@@ -1511,7 +1513,7 @@ export default class coinex extends Exchange {
|
|
|
1511
1513
|
* @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http016_asset_query // swap
|
|
1512
1514
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
1513
1515
|
* @param {string} [params.type] 'margin', 'swap', 'financial', or 'spot'
|
|
1514
|
-
* @returns {object} a [balance structure]{@link https://
|
|
1516
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1515
1517
|
*/
|
|
1516
1518
|
let marketType = undefined;
|
|
1517
1519
|
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
@@ -1796,11 +1798,11 @@ export default class coinex extends Exchange {
|
|
|
1796
1798
|
const rawType = this.safeString(order, 'order_type');
|
|
1797
1799
|
let type = undefined;
|
|
1798
1800
|
if (rawType === undefined) {
|
|
1799
|
-
|
|
1800
|
-
if (
|
|
1801
|
+
const typeInteger = this.safeInteger(order, 'type');
|
|
1802
|
+
if (typeInteger === 1) {
|
|
1801
1803
|
type = 'limit';
|
|
1802
1804
|
}
|
|
1803
|
-
else if (
|
|
1805
|
+
else if (typeInteger === 2) {
|
|
1804
1806
|
type = 'market';
|
|
1805
1807
|
}
|
|
1806
1808
|
}
|
|
@@ -1865,7 +1867,7 @@ export default class coinex extends Exchange {
|
|
|
1865
1867
|
* @param {bool} params.postOnly
|
|
1866
1868
|
* @param {bool} params.reduceOnly
|
|
1867
1869
|
* @param {bool} [params.position_id] *required for reduce only orders* the position id to reduce
|
|
1868
|
-
* @returns {object} an [order structure]{@link https://
|
|
1870
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1869
1871
|
*/
|
|
1870
1872
|
await this.loadMarkets();
|
|
1871
1873
|
const market = this.market(symbol);
|
|
@@ -2129,9 +2131,11 @@ export default class coinex extends Exchange {
|
|
|
2129
2131
|
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
2130
2132
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
2131
2133
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2132
|
-
* @returns {object} an [order structure]{@link https://
|
|
2134
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2133
2135
|
*/
|
|
2134
|
-
|
|
2136
|
+
if (symbol === undefined) {
|
|
2137
|
+
throw new ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
|
|
2138
|
+
}
|
|
2135
2139
|
await this.loadMarkets();
|
|
2136
2140
|
const market = this.market(symbol);
|
|
2137
2141
|
if (!market['spot']) {
|
|
@@ -2190,8 +2194,11 @@ export default class coinex extends Exchange {
|
|
|
2190
2194
|
* @param {string} id order id
|
|
2191
2195
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2192
2196
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2193
|
-
* @returns {object} An [order structure]{@link https://
|
|
2197
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2194
2198
|
*/
|
|
2199
|
+
if (symbol === undefined) {
|
|
2200
|
+
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
2201
|
+
}
|
|
2195
2202
|
await this.loadMarkets();
|
|
2196
2203
|
const market = this.market(symbol);
|
|
2197
2204
|
const stop = this.safeValue(params, 'stop');
|
|
@@ -2336,9 +2343,11 @@ export default class coinex extends Exchange {
|
|
|
2336
2343
|
* @description cancel all open orders in a market
|
|
2337
2344
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
2338
2345
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2339
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
2346
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2340
2347
|
*/
|
|
2341
|
-
|
|
2348
|
+
if (symbol === undefined) {
|
|
2349
|
+
throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
2350
|
+
}
|
|
2342
2351
|
await this.loadMarkets();
|
|
2343
2352
|
const market = this.market(symbol);
|
|
2344
2353
|
const marketId = market['id'];
|
|
@@ -2350,7 +2359,7 @@ export default class coinex extends Exchange {
|
|
|
2350
2359
|
};
|
|
2351
2360
|
const swap = market['swap'];
|
|
2352
2361
|
const stop = this.safeValue(params, 'stop');
|
|
2353
|
-
let method
|
|
2362
|
+
let method;
|
|
2354
2363
|
if (swap) {
|
|
2355
2364
|
method = 'perpetualPrivatePostOrderCancelAll';
|
|
2356
2365
|
if (stop) {
|
|
@@ -2384,9 +2393,11 @@ export default class coinex extends Exchange {
|
|
|
2384
2393
|
* @description fetches information on an order made by the user
|
|
2385
2394
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2386
2395
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2387
|
-
* @returns {object} An [order structure]{@link https://
|
|
2396
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2388
2397
|
*/
|
|
2389
|
-
|
|
2398
|
+
if (symbol === undefined) {
|
|
2399
|
+
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
2400
|
+
}
|
|
2390
2401
|
await this.loadMarkets();
|
|
2391
2402
|
const market = this.market(symbol);
|
|
2392
2403
|
const swap = market['swap'];
|
|
@@ -2724,7 +2735,7 @@ export default class coinex extends Exchange {
|
|
|
2724
2735
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2725
2736
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2726
2737
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2727
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2738
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2728
2739
|
*/
|
|
2729
2740
|
return await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
|
|
2730
2741
|
}
|
|
@@ -2737,7 +2748,7 @@ export default class coinex extends Exchange {
|
|
|
2737
2748
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2738
2749
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
2739
2750
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2740
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2751
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2741
2752
|
*/
|
|
2742
2753
|
return await this.fetchOrdersByStatus('finished', symbol, since, limit, params);
|
|
2743
2754
|
}
|
|
@@ -2748,7 +2759,7 @@ export default class coinex extends Exchange {
|
|
|
2748
2759
|
* @description create a currency deposit address
|
|
2749
2760
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
2750
2761
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2751
|
-
* @returns {object} an [address structure]{@link https://
|
|
2762
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2752
2763
|
*/
|
|
2753
2764
|
await this.loadMarkets();
|
|
2754
2765
|
const currency = this.currency(code);
|
|
@@ -2780,7 +2791,7 @@ export default class coinex extends Exchange {
|
|
|
2780
2791
|
* @description fetch the deposit address for a currency associated with this account
|
|
2781
2792
|
* @param {string} code unified currency code
|
|
2782
2793
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2783
|
-
* @returns {object} an [address structure]{@link https://
|
|
2794
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2784
2795
|
*/
|
|
2785
2796
|
await this.loadMarkets();
|
|
2786
2797
|
const currency = this.currency(code);
|
|
@@ -2876,7 +2887,7 @@ export default class coinex extends Exchange {
|
|
|
2876
2887
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2877
2888
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2878
2889
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
2879
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2890
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2880
2891
|
*/
|
|
2881
2892
|
await this.loadMarkets();
|
|
2882
2893
|
let market = undefined;
|
|
@@ -3012,7 +3023,7 @@ export default class coinex extends Exchange {
|
|
|
3012
3023
|
* @description fetch all open positions
|
|
3013
3024
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3014
3025
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3015
|
-
* @returns {object[]} a list of [position structure]{@link https://
|
|
3026
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3016
3027
|
*/
|
|
3017
3028
|
await this.loadMarkets();
|
|
3018
3029
|
symbols = this.marketSymbols(symbols);
|
|
@@ -3107,7 +3118,7 @@ export default class coinex extends Exchange {
|
|
|
3107
3118
|
* @description fetch data on a single open contract trade position
|
|
3108
3119
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
3109
3120
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3110
|
-
* @returns {object} a [position structure]{@link https://
|
|
3121
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3111
3122
|
*/
|
|
3112
3123
|
await this.loadMarkets();
|
|
3113
3124
|
const market = this.market(symbol);
|
|
@@ -3289,7 +3300,9 @@ export default class coinex extends Exchange {
|
|
|
3289
3300
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3290
3301
|
* @returns {object} response from the exchange
|
|
3291
3302
|
*/
|
|
3292
|
-
|
|
3303
|
+
if (symbol === undefined) {
|
|
3304
|
+
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
3305
|
+
}
|
|
3293
3306
|
marginMode = marginMode.toLowerCase();
|
|
3294
3307
|
if (marginMode !== 'isolated' && marginMode !== 'cross') {
|
|
3295
3308
|
throw new BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
|
|
@@ -3337,7 +3350,9 @@ export default class coinex extends Exchange {
|
|
|
3337
3350
|
* @param {string} [params.marginMode] 'cross' or 'isolated' (default is 'cross')
|
|
3338
3351
|
* @returns {object} response from the exchange
|
|
3339
3352
|
*/
|
|
3340
|
-
|
|
3353
|
+
if (symbol === undefined) {
|
|
3354
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
3355
|
+
}
|
|
3341
3356
|
await this.loadMarkets();
|
|
3342
3357
|
const market = this.market(symbol);
|
|
3343
3358
|
if (!market['swap']) {
|
|
@@ -3371,7 +3386,7 @@ export default class coinex extends Exchange {
|
|
|
3371
3386
|
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
3372
3387
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3373
3388
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3374
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://
|
|
3389
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
3375
3390
|
*/
|
|
3376
3391
|
await this.loadMarkets();
|
|
3377
3392
|
const response = await this.perpetualPublicGetMarketLimitConfig(params);
|
|
@@ -3536,7 +3551,7 @@ export default class coinex extends Exchange {
|
|
|
3536
3551
|
* @param {string} symbol unified market symbol
|
|
3537
3552
|
* @param {float} amount amount of margin to add
|
|
3538
3553
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3539
|
-
* @returns {object} a [margin structure]{@link https://
|
|
3554
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
3540
3555
|
*/
|
|
3541
3556
|
return await this.modifyMarginHelper(symbol, amount, 1, params);
|
|
3542
3557
|
}
|
|
@@ -3548,7 +3563,7 @@ export default class coinex extends Exchange {
|
|
|
3548
3563
|
* @param {string} symbol unified market symbol
|
|
3549
3564
|
* @param {float} amount the amount of margin to remove
|
|
3550
3565
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3551
|
-
* @returns {object} a [margin structure]{@link https://
|
|
3566
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
3552
3567
|
*/
|
|
3553
3568
|
return await this.modifyMarginHelper(symbol, amount, 2, params);
|
|
3554
3569
|
}
|
|
@@ -3561,9 +3576,11 @@ export default class coinex extends Exchange {
|
|
|
3561
3576
|
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
3562
3577
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
3563
3578
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3564
|
-
* @returns {object} a [funding history structure]{@link https://
|
|
3579
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
3565
3580
|
*/
|
|
3566
|
-
|
|
3581
|
+
if (symbol === undefined) {
|
|
3582
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
|
|
3583
|
+
}
|
|
3567
3584
|
limit = (limit === undefined) ? 100 : limit;
|
|
3568
3585
|
await this.loadMarkets();
|
|
3569
3586
|
const market = this.market(symbol);
|
|
@@ -3632,7 +3649,7 @@ export default class coinex extends Exchange {
|
|
|
3632
3649
|
* @description fetch the current funding rate
|
|
3633
3650
|
* @param {string} symbol unified market symbol
|
|
3634
3651
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3635
|
-
* @returns {object} a [funding rate structure]{@link https://
|
|
3652
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3636
3653
|
*/
|
|
3637
3654
|
await this.loadMarkets();
|
|
3638
3655
|
const market = this.market(symbol);
|
|
@@ -3740,7 +3757,7 @@ export default class coinex extends Exchange {
|
|
|
3740
3757
|
* @description fetch the current funding rates
|
|
3741
3758
|
* @param {string[]} symbols unified market symbols
|
|
3742
3759
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3743
|
-
* @returns {object[]} an array of [funding rate structures]{@link https://
|
|
3760
|
+
* @returns {object[]} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3744
3761
|
*/
|
|
3745
3762
|
await this.loadMarkets();
|
|
3746
3763
|
symbols = this.marketSymbols(symbols);
|
|
@@ -3814,7 +3831,7 @@ export default class coinex extends Exchange {
|
|
|
3814
3831
|
* @param {string} tag
|
|
3815
3832
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3816
3833
|
* @param {string} [params.network] unified network code
|
|
3817
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3834
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3818
3835
|
*/
|
|
3819
3836
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
3820
3837
|
this.checkAddress(address);
|
|
@@ -3877,13 +3894,15 @@ export default class coinex extends Exchange {
|
|
|
3877
3894
|
* @description fetches historical funding rate prices
|
|
3878
3895
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3879
3896
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3880
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://
|
|
3897
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3881
3898
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
3882
3899
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3883
3900
|
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
3884
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://
|
|
3901
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3885
3902
|
*/
|
|
3886
|
-
|
|
3903
|
+
if (symbol === undefined) {
|
|
3904
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
3905
|
+
}
|
|
3887
3906
|
await this.loadMarkets();
|
|
3888
3907
|
let paginate = false;
|
|
3889
3908
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
@@ -4067,7 +4086,7 @@ export default class coinex extends Exchange {
|
|
|
4067
4086
|
* @param {string} fromAccount account to transfer from
|
|
4068
4087
|
* @param {string} toAccount account to transfer to
|
|
4069
4088
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4070
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
4089
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4071
4090
|
*/
|
|
4072
4091
|
await this.loadMarkets();
|
|
4073
4092
|
const currency = this.currency(code);
|
|
@@ -4179,7 +4198,7 @@ export default class coinex extends Exchange {
|
|
|
4179
4198
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
4180
4199
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
4181
4200
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4182
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
4201
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4183
4202
|
*/
|
|
4184
4203
|
await this.loadMarkets();
|
|
4185
4204
|
let currency = undefined;
|
|
@@ -4263,7 +4282,7 @@ export default class coinex extends Exchange {
|
|
|
4263
4282
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4264
4283
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
4265
4284
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4266
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
4285
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4267
4286
|
*/
|
|
4268
4287
|
const request = {};
|
|
4269
4288
|
let currency = undefined;
|
|
@@ -4329,7 +4348,7 @@ export default class coinex extends Exchange {
|
|
|
4329
4348
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4330
4349
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
4331
4350
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4332
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
4351
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4333
4352
|
*/
|
|
4334
4353
|
const request = {};
|
|
4335
4354
|
let currency = undefined;
|
|
@@ -4386,7 +4405,7 @@ export default class coinex extends Exchange {
|
|
|
4386
4405
|
}
|
|
4387
4406
|
return this.parseTransactions(data, currency, since, limit);
|
|
4388
4407
|
}
|
|
4389
|
-
|
|
4408
|
+
parseIsolatedBorrowRate(info, market = undefined) {
|
|
4390
4409
|
//
|
|
4391
4410
|
// {
|
|
4392
4411
|
// "market": "BTCUSDT",
|
|
@@ -4406,15 +4425,13 @@ export default class coinex extends Exchange {
|
|
|
4406
4425
|
const marketId = this.safeString(info, 'market');
|
|
4407
4426
|
market = this.safeMarket(marketId, market, undefined, 'spot');
|
|
4408
4427
|
const baseInfo = this.safeValue(info, market['baseId']);
|
|
4409
|
-
const baseRate = this.safeNumber(baseInfo, 'day_rate');
|
|
4410
4428
|
const quoteInfo = this.safeValue(info, market['quoteId']);
|
|
4411
|
-
const quoteRate = this.safeNumber(quoteInfo, 'day_rate');
|
|
4412
4429
|
return {
|
|
4413
4430
|
'symbol': market['symbol'],
|
|
4414
4431
|
'base': market['base'],
|
|
4415
|
-
'baseRate':
|
|
4432
|
+
'baseRate': this.safeNumber(baseInfo, 'day_rate'),
|
|
4416
4433
|
'quote': market['quote'],
|
|
4417
|
-
'quoteRate':
|
|
4434
|
+
'quoteRate': this.safeNumber(quoteInfo, 'day_rate'),
|
|
4418
4435
|
'period': 86400000,
|
|
4419
4436
|
'timestamp': undefined,
|
|
4420
4437
|
'datetime': undefined,
|
|
@@ -4424,19 +4441,17 @@ export default class coinex extends Exchange {
|
|
|
4424
4441
|
async fetchIsolatedBorrowRate(symbol, params = {}) {
|
|
4425
4442
|
/**
|
|
4426
4443
|
* @method
|
|
4427
|
-
* @name coinex#
|
|
4444
|
+
* @name coinex#fetchIsolatedBorrowRate
|
|
4428
4445
|
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
4429
|
-
* @param {string}
|
|
4446
|
+
* @param {string} symbol unified symbol of the market to fetch the borrow rate for
|
|
4430
4447
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4431
|
-
* @returns {object}
|
|
4448
|
+
* @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
|
|
4432
4449
|
*/
|
|
4433
4450
|
await this.loadMarkets();
|
|
4434
|
-
|
|
4435
|
-
const request = {
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
request['market'] = market['id'];
|
|
4439
|
-
}
|
|
4451
|
+
const market = this.market(symbol);
|
|
4452
|
+
const request = {
|
|
4453
|
+
'market': market['id'],
|
|
4454
|
+
};
|
|
4440
4455
|
const response = await this.privateGetMarginConfig(this.extend(request, params));
|
|
4441
4456
|
//
|
|
4442
4457
|
// {
|
|
@@ -4459,16 +4474,20 @@ export default class coinex extends Exchange {
|
|
|
4459
4474
|
// }
|
|
4460
4475
|
//
|
|
4461
4476
|
const data = this.safeValue(response, 'data', {});
|
|
4462
|
-
return this.
|
|
4477
|
+
return this.parseIsolatedBorrowRate(data, market);
|
|
4463
4478
|
}
|
|
4464
4479
|
async fetchIsolatedBorrowRates(params = {}) {
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4480
|
+
//
|
|
4481
|
+
// @method
|
|
4482
|
+
// @name coinex#fetchIsolatedBorrowRates
|
|
4483
|
+
// @description fetch the borrow interest rates of all currencies
|
|
4484
|
+
// @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4485
|
+
// <<<<<<< HEAD
|
|
4486
|
+
// @returns {object} a list of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
4487
|
+
// =======
|
|
4488
|
+
// @returns {object} a list of [isolated borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
|
|
4489
|
+
// >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
|
|
4490
|
+
//
|
|
4472
4491
|
await this.loadMarkets();
|
|
4473
4492
|
const response = await this.privateGetMarginConfig(params);
|
|
4474
4493
|
//
|
|
@@ -4493,10 +4512,10 @@ export default class coinex extends Exchange {
|
|
|
4493
4512
|
// "message": "Success"
|
|
4494
4513
|
// }
|
|
4495
4514
|
//
|
|
4496
|
-
const data = this.safeValue(response, 'data',
|
|
4515
|
+
const data = this.safeValue(response, 'data', []);
|
|
4497
4516
|
const rates = [];
|
|
4498
4517
|
for (let i = 0; i < data.length; i++) {
|
|
4499
|
-
rates.push(this.
|
|
4518
|
+
rates.push(this.parseIsolatedBorrowRate(data[i]));
|
|
4500
4519
|
}
|
|
4501
4520
|
return rates;
|
|
4502
4521
|
}
|
|
@@ -4597,9 +4616,11 @@ export default class coinex extends Exchange {
|
|
|
4597
4616
|
* @param {float} amount the amount to borrow
|
|
4598
4617
|
* @param {string} symbol unified market symbol, required for coinex
|
|
4599
4618
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4600
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
4619
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
4601
4620
|
*/
|
|
4602
|
-
|
|
4621
|
+
if (symbol === undefined) {
|
|
4622
|
+
throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
|
|
4623
|
+
}
|
|
4603
4624
|
await this.loadMarkets();
|
|
4604
4625
|
const market = this.market(symbol);
|
|
4605
4626
|
const currency = this.currency(code);
|
|
@@ -4636,9 +4657,11 @@ export default class coinex extends Exchange {
|
|
|
4636
4657
|
* @param {string} symbol unified market symbol, required for coinex
|
|
4637
4658
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4638
4659
|
* @param {string} [params.loan_id] extra parameter that is not required
|
|
4639
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
4660
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
4640
4661
|
*/
|
|
4641
|
-
|
|
4662
|
+
if (symbol === undefined) {
|
|
4663
|
+
throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
|
|
4664
|
+
}
|
|
4642
4665
|
await this.loadMarkets();
|
|
4643
4666
|
const market = this.market(symbol);
|
|
4644
4667
|
const currency = this.currency(code);
|
|
@@ -4699,7 +4722,7 @@ export default class coinex extends Exchange {
|
|
|
4699
4722
|
* @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market010_asset_config
|
|
4700
4723
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
4701
4724
|
* @param {object} [params] extra parameters specific to the coinex api endpoint
|
|
4702
|
-
* @returns {object[]} a list of [fees structures]{@link https://
|
|
4725
|
+
* @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
4703
4726
|
*/
|
|
4704
4727
|
await this.loadMarkets();
|
|
4705
4728
|
const request = {};
|