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/bingx.js
CHANGED
|
@@ -559,7 +559,7 @@ export default class bingx extends Exchange {
|
|
|
559
559
|
const isActive = this.safeString(market, 'status') === '1';
|
|
560
560
|
const isInverse = (spot) ? undefined : false;
|
|
561
561
|
const isLinear = (spot) ? undefined : swap;
|
|
562
|
-
|
|
562
|
+
return {
|
|
563
563
|
'id': id,
|
|
564
564
|
'symbol': symbol,
|
|
565
565
|
'base': base,
|
|
@@ -588,8 +588,6 @@ export default class bingx extends Exchange {
|
|
|
588
588
|
'precision': {
|
|
589
589
|
'amount': quantityPrecision,
|
|
590
590
|
'price': pricePrecision,
|
|
591
|
-
'base': undefined,
|
|
592
|
-
'quote': undefined,
|
|
593
591
|
},
|
|
594
592
|
'limits': {
|
|
595
593
|
'leverage': {
|
|
@@ -612,7 +610,6 @@ export default class bingx extends Exchange {
|
|
|
612
610
|
'created': undefined,
|
|
613
611
|
'info': market,
|
|
614
612
|
};
|
|
615
|
-
return entry;
|
|
616
613
|
}
|
|
617
614
|
async fetchMarkets(params = {}) {
|
|
618
615
|
/**
|
|
@@ -751,7 +748,7 @@ export default class bingx extends Exchange {
|
|
|
751
748
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
752
749
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
753
750
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
754
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
751
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
755
752
|
*/
|
|
756
753
|
await this.loadMarkets();
|
|
757
754
|
const market = this.market(symbol);
|
|
@@ -922,7 +919,7 @@ export default class bingx extends Exchange {
|
|
|
922
919
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
923
920
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
924
921
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
925
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
922
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
926
923
|
*/
|
|
927
924
|
await this.loadMarkets();
|
|
928
925
|
const market = this.market(symbol);
|
|
@@ -1010,7 +1007,7 @@ export default class bingx extends Exchange {
|
|
|
1010
1007
|
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1011
1008
|
* @param {string} symbol unified market symbol
|
|
1012
1009
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1013
|
-
* @returns {object} a [funding rate structure]{@link https://
|
|
1010
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1014
1011
|
*/
|
|
1015
1012
|
await this.loadMarkets();
|
|
1016
1013
|
const market = this.market(symbol);
|
|
@@ -1077,13 +1074,15 @@ export default class bingx extends Exchange {
|
|
|
1077
1074
|
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Funding%20Rate%20History
|
|
1078
1075
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1079
1076
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1080
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://
|
|
1077
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
1081
1078
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1082
1079
|
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
1083
1080
|
* @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)
|
|
1084
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://
|
|
1081
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
1085
1082
|
*/
|
|
1086
|
-
|
|
1083
|
+
if (symbol === undefined) {
|
|
1084
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
1085
|
+
}
|
|
1087
1086
|
await this.loadMarkets();
|
|
1088
1087
|
let paginate = false;
|
|
1089
1088
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
@@ -1146,7 +1145,7 @@ export default class bingx extends Exchange {
|
|
|
1146
1145
|
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Swap%20Open%20Positions
|
|
1147
1146
|
* @param {string} symbol Unified CCXT market symbol
|
|
1148
1147
|
* @param {object} [params] exchange specific parameters
|
|
1149
|
-
* @returns {object} an open interest structure{@link https://
|
|
1148
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
1150
1149
|
*/
|
|
1151
1150
|
await this.loadMarkets();
|
|
1152
1151
|
const market = this.market(symbol);
|
|
@@ -1200,7 +1199,7 @@ export default class bingx extends Exchange {
|
|
|
1200
1199
|
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#24%E5%B0%8F%E6%97%B6%E4%BB%B7%E6%A0%BC%E5%8F%98%E5%8A%A8%E6%83%85%E5%86%B5
|
|
1201
1200
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1202
1201
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1203
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
1202
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1204
1203
|
*/
|
|
1205
1204
|
await this.loadMarkets();
|
|
1206
1205
|
const market = this.market(symbol);
|
|
@@ -1255,7 +1254,7 @@ export default class bingx extends Exchange {
|
|
|
1255
1254
|
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Ticker
|
|
1256
1255
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1257
1256
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1258
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
1257
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1259
1258
|
*/
|
|
1260
1259
|
await this.loadMarkets();
|
|
1261
1260
|
let market = undefined;
|
|
@@ -1406,7 +1405,7 @@ export default class bingx extends Exchange {
|
|
|
1406
1405
|
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Query%20standard%20contract%20balance
|
|
1407
1406
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
1408
1407
|
* @param {boolean} [params.standard] whether to fetch standard contract balances
|
|
1409
|
-
* @returns {object} a [balance structure]{@link https://
|
|
1408
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1410
1409
|
*/
|
|
1411
1410
|
await this.loadMarkets();
|
|
1412
1411
|
let response = undefined;
|
|
@@ -1524,7 +1523,7 @@ export default class bingx extends Exchange {
|
|
|
1524
1523
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1525
1524
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1526
1525
|
* @param {boolean} [params.standard] whether to fetch standard contract positions
|
|
1527
|
-
* @returns {object[]} a list of [position structure]{@link https://
|
|
1526
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1528
1527
|
*/
|
|
1529
1528
|
await this.loadMarkets();
|
|
1530
1529
|
symbols = this.marketSymbols(symbols);
|
|
@@ -1767,7 +1766,7 @@ export default class bingx extends Exchange {
|
|
|
1767
1766
|
* @param {float} [params.triggerPrice] *swap only* triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
1768
1767
|
* @param {float} [params.stopLossPrice] *swap only* stop loss trigger price
|
|
1769
1768
|
* @param {float} [params.takeProfitPrice] *swap only* take profit trigger price
|
|
1770
|
-
* @returns {object} an [order structure]{@link https://
|
|
1769
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1771
1770
|
*/
|
|
1772
1771
|
await this.loadMarkets();
|
|
1773
1772
|
const market = this.market(symbol);
|
|
@@ -1830,7 +1829,7 @@ export default class bingx extends Exchange {
|
|
|
1830
1829
|
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
|
|
1831
1830
|
* @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
1832
1831
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1833
|
-
* @returns {object} an [order structure]{@link https://
|
|
1832
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1834
1833
|
*/
|
|
1835
1834
|
await this.loadMarkets();
|
|
1836
1835
|
const ordersRequests = [];
|
|
@@ -2089,9 +2088,11 @@ export default class bingx extends Exchange {
|
|
|
2089
2088
|
* @param {string} id order id
|
|
2090
2089
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2091
2090
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2092
|
-
* @returns {object} An [order structure]{@link https://
|
|
2091
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2093
2092
|
*/
|
|
2094
|
-
|
|
2093
|
+
if (symbol === undefined) {
|
|
2094
|
+
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
2095
|
+
}
|
|
2095
2096
|
await this.loadMarkets();
|
|
2096
2097
|
const market = this.market(symbol);
|
|
2097
2098
|
const request = {
|
|
@@ -2164,9 +2165,11 @@ export default class bingx extends Exchange {
|
|
|
2164
2165
|
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20All%20Orders
|
|
2165
2166
|
* @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2166
2167
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2167
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
2168
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2168
2169
|
*/
|
|
2169
|
-
|
|
2170
|
+
if (symbol === undefined) {
|
|
2171
|
+
throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
2172
|
+
}
|
|
2170
2173
|
await this.loadMarkets();
|
|
2171
2174
|
const market = this.market(symbol);
|
|
2172
2175
|
if (market['type'] !== 'swap') {
|
|
@@ -2217,9 +2220,11 @@ export default class bingx extends Exchange {
|
|
|
2217
2220
|
* @param {string[]} ids order ids
|
|
2218
2221
|
* @param {string} symbol unified market symbol, default is undefined
|
|
2219
2222
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2220
|
-
* @returns {object} an list of [order structures]{@link https://
|
|
2223
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2221
2224
|
*/
|
|
2222
|
-
|
|
2225
|
+
if (symbol === undefined) {
|
|
2226
|
+
throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
2227
|
+
}
|
|
2223
2228
|
await this.loadMarkets();
|
|
2224
2229
|
const market = this.market(symbol);
|
|
2225
2230
|
const request = {
|
|
@@ -2280,9 +2285,11 @@ export default class bingx extends Exchange {
|
|
|
2280
2285
|
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20Order
|
|
2281
2286
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2282
2287
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2283
|
-
* @returns {object} An [order structure]{@link https://
|
|
2288
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2284
2289
|
*/
|
|
2285
|
-
|
|
2290
|
+
if (symbol === undefined) {
|
|
2291
|
+
throw new ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
|
|
2292
|
+
}
|
|
2286
2293
|
await this.loadMarkets();
|
|
2287
2294
|
const market = this.market(symbol);
|
|
2288
2295
|
const request = {
|
|
@@ -2363,9 +2370,11 @@ export default class bingx extends Exchange {
|
|
|
2363
2370
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2364
2371
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
2365
2372
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2366
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
2373
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2367
2374
|
*/
|
|
2368
|
-
|
|
2375
|
+
if (symbol === undefined) {
|
|
2376
|
+
throw new ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
|
|
2377
|
+
}
|
|
2369
2378
|
await this.loadMarkets();
|
|
2370
2379
|
const market = this.market(symbol);
|
|
2371
2380
|
const request = {
|
|
@@ -2452,9 +2461,11 @@ export default class bingx extends Exchange {
|
|
|
2452
2461
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2453
2462
|
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2454
2463
|
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
2455
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
2464
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2456
2465
|
*/
|
|
2457
|
-
|
|
2466
|
+
if (symbol === undefined) {
|
|
2467
|
+
throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
2468
|
+
}
|
|
2458
2469
|
await this.loadMarkets();
|
|
2459
2470
|
const market = this.market(symbol);
|
|
2460
2471
|
const request = {
|
|
@@ -2543,7 +2554,7 @@ export default class bingx extends Exchange {
|
|
|
2543
2554
|
* @param {string} fromAccount account to transfer from
|
|
2544
2555
|
* @param {string} toAccount account to transfer to
|
|
2545
2556
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2546
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
2557
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2547
2558
|
*/
|
|
2548
2559
|
await this.loadMarkets();
|
|
2549
2560
|
const currency = this.currency(code);
|
|
@@ -2583,7 +2594,7 @@ export default class bingx extends Exchange {
|
|
|
2583
2594
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
2584
2595
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
2585
2596
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2586
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
2597
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2587
2598
|
*/
|
|
2588
2599
|
await this.loadMarkets();
|
|
2589
2600
|
let currency = undefined;
|
|
@@ -2658,7 +2669,7 @@ export default class bingx extends Exchange {
|
|
|
2658
2669
|
* @see https://bingx-api.github.io/docs/#/common/sub-account#Query%20Main%20Account%20Deposit%20Address
|
|
2659
2670
|
* @param {string} code unified currency code
|
|
2660
2671
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2661
|
-
* @returns {object} an [address structure]{@link https://
|
|
2672
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2662
2673
|
*/
|
|
2663
2674
|
await this.loadMarkets();
|
|
2664
2675
|
const currency = this.currency(code);
|
|
@@ -2728,7 +2739,7 @@ export default class bingx extends Exchange {
|
|
|
2728
2739
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2729
2740
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2730
2741
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2731
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2742
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2732
2743
|
*/
|
|
2733
2744
|
await this.loadMarkets();
|
|
2734
2745
|
const request = {};
|
|
@@ -2773,7 +2784,7 @@ export default class bingx extends Exchange {
|
|
|
2773
2784
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2774
2785
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2775
2786
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2776
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2787
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2777
2788
|
*/
|
|
2778
2789
|
await this.loadMarkets();
|
|
2779
2790
|
const request = {};
|
|
@@ -2920,7 +2931,9 @@ export default class bingx extends Exchange {
|
|
|
2920
2931
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2921
2932
|
* @returns {object} response from the exchange
|
|
2922
2933
|
*/
|
|
2923
|
-
|
|
2934
|
+
if (symbol === undefined) {
|
|
2935
|
+
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
2936
|
+
}
|
|
2924
2937
|
await this.loadMarkets();
|
|
2925
2938
|
const market = this.market(symbol);
|
|
2926
2939
|
if (market['type'] !== 'swap') {
|
|
@@ -2948,7 +2961,7 @@ export default class bingx extends Exchange {
|
|
|
2948
2961
|
* @param {string} symbol unified market symbol of the market to set margin in
|
|
2949
2962
|
* @param {float} amount the amount to set the margin to
|
|
2950
2963
|
* @param {object} [params] parameters specific to the bingx api endpoint
|
|
2951
|
-
* @returns {object} A [margin structure]{@link https://
|
|
2964
|
+
* @returns {object} A [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
2952
2965
|
*/
|
|
2953
2966
|
const type = this.safeInteger(params, 'type'); // 1 increase margin 2 decrease margin
|
|
2954
2967
|
if (type === undefined) {
|
|
@@ -2983,7 +2996,7 @@ export default class bingx extends Exchange {
|
|
|
2983
2996
|
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20Leverage
|
|
2984
2997
|
* @param {string} symbol unified market symbol
|
|
2985
2998
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2986
|
-
* @returns {object} a [leverage structure]{@link https://
|
|
2999
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
2987
3000
|
*/
|
|
2988
3001
|
await this.loadMarkets();
|
|
2989
3002
|
const market = this.market(symbol);
|
|
@@ -3014,7 +3027,9 @@ export default class bingx extends Exchange {
|
|
|
3014
3027
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
3015
3028
|
* @returns {object} response from the exchange
|
|
3016
3029
|
*/
|
|
3017
|
-
|
|
3030
|
+
if (symbol === undefined) {
|
|
3031
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
3032
|
+
}
|
|
3018
3033
|
const side = this.safeStringUpper(params, 'side');
|
|
3019
3034
|
this.checkRequiredArgument('setLeverage', side, 'side', ['LONG', 'SHORT']);
|
|
3020
3035
|
await this.loadMarkets();
|
|
@@ -3047,10 +3062,14 @@ export default class bingx extends Exchange {
|
|
|
3047
3062
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
3048
3063
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
3049
3064
|
* @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
|
|
3050
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
3065
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3051
3066
|
*/
|
|
3052
|
-
|
|
3053
|
-
|
|
3067
|
+
if (symbol === undefined) {
|
|
3068
|
+
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
3069
|
+
}
|
|
3070
|
+
if (since === undefined) {
|
|
3071
|
+
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a since argument');
|
|
3072
|
+
}
|
|
3054
3073
|
const tradingUnit = this.safeStringUpper(params, 'tradingUnit', 'CONT');
|
|
3055
3074
|
await this.loadMarkets();
|
|
3056
3075
|
const market = this.market(symbol);
|
|
@@ -3159,7 +3178,7 @@ export default class bingx extends Exchange {
|
|
|
3159
3178
|
* @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins'%20Information
|
|
3160
3179
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
3161
3180
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
3162
|
-
* @returns {object} a list of [fee structures]{@link https://
|
|
3181
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3163
3182
|
*/
|
|
3164
3183
|
await this.loadMarkets();
|
|
3165
3184
|
const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
|
|
@@ -3178,7 +3197,7 @@ export default class bingx extends Exchange {
|
|
|
3178
3197
|
* @param {string} [tag]
|
|
3179
3198
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
3180
3199
|
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account
|
|
3181
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3200
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3182
3201
|
*/
|
|
3183
3202
|
await this.loadMarkets();
|
|
3184
3203
|
const currency = this.currency(code);
|
|
@@ -3243,7 +3262,7 @@ export default class bingx extends Exchange {
|
|
|
3243
3262
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
3244
3263
|
* @param {object} [params] exchange specific parameters for the bingx api endpoint
|
|
3245
3264
|
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
3246
|
-
* @returns {object} an array of [liquidation structures]{@link https://
|
|
3265
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
3247
3266
|
*/
|
|
3248
3267
|
await this.loadMarkets();
|
|
3249
3268
|
let request = {
|
package/js/src/bit2c.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/bit2c.js';
|
|
9
|
-
import { ExchangeError, InvalidNonce, AuthenticationError, PermissionDenied, NotSupported, OrderNotFound } from './base/errors.js';
|
|
9
|
+
import { ExchangeError, InvalidNonce, AuthenticationError, PermissionDenied, NotSupported, OrderNotFound, ArgumentsRequired } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
12
12
|
import { sha512 } from './static_dependencies/noble-hashes/sha512.js';
|
|
@@ -35,17 +35,18 @@ export default class bit2c extends Exchange {
|
|
|
35
35
|
'createOrder': true,
|
|
36
36
|
'createReduceOnlyOrder': false,
|
|
37
37
|
'fetchBalance': true,
|
|
38
|
-
'fetchBorrowRate': false,
|
|
39
38
|
'fetchBorrowRateHistories': false,
|
|
40
39
|
'fetchBorrowRateHistory': false,
|
|
41
|
-
'
|
|
42
|
-
'
|
|
40
|
+
'fetchCrossBorrowRate': false,
|
|
41
|
+
'fetchCrossBorrowRates': false,
|
|
43
42
|
'fetchDepositAddress': true,
|
|
44
43
|
'fetchFundingHistory': false,
|
|
45
44
|
'fetchFundingRate': false,
|
|
46
45
|
'fetchFundingRateHistory': false,
|
|
47
46
|
'fetchFundingRates': false,
|
|
48
47
|
'fetchIndexOHLCV': false,
|
|
48
|
+
'fetchIsolatedBorrowRate': false,
|
|
49
|
+
'fetchIsolatedBorrowRates': false,
|
|
49
50
|
'fetchLeverage': false,
|
|
50
51
|
'fetchLeverageTiers': false,
|
|
51
52
|
'fetchMarginMode': false,
|
|
@@ -208,7 +209,7 @@ export default class bit2c extends Exchange {
|
|
|
208
209
|
* @name bit2c#fetchBalance
|
|
209
210
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
210
211
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
211
|
-
* @returns {object} a [balance structure]{@link https://
|
|
212
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
212
213
|
*/
|
|
213
214
|
await this.loadMarkets();
|
|
214
215
|
const response = await this.privateGetAccountBalanceV2(params);
|
|
@@ -264,7 +265,7 @@ export default class bit2c extends Exchange {
|
|
|
264
265
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
265
266
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
266
267
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
267
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
268
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
268
269
|
*/
|
|
269
270
|
await this.loadMarkets();
|
|
270
271
|
const market = this.market(symbol);
|
|
@@ -310,7 +311,7 @@ export default class bit2c extends Exchange {
|
|
|
310
311
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
311
312
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
312
313
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
313
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
314
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
314
315
|
*/
|
|
315
316
|
await this.loadMarkets();
|
|
316
317
|
const market = this.market(symbol);
|
|
@@ -329,7 +330,7 @@ export default class bit2c extends Exchange {
|
|
|
329
330
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
330
331
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
331
332
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
332
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
333
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
333
334
|
*/
|
|
334
335
|
await this.loadMarkets();
|
|
335
336
|
const market = this.market(symbol);
|
|
@@ -362,7 +363,7 @@ export default class bit2c extends Exchange {
|
|
|
362
363
|
* @name bit2c#fetchTradingFees
|
|
363
364
|
* @description fetch the trading fees for multiple markets
|
|
364
365
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
365
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
366
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
366
367
|
*/
|
|
367
368
|
await this.loadMarkets();
|
|
368
369
|
const response = await this.privateGetAccountBalance(params);
|
|
@@ -415,7 +416,7 @@ export default class bit2c extends Exchange {
|
|
|
415
416
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
416
417
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
417
418
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
418
|
-
* @returns {object} an [order structure]{@link https://
|
|
419
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
419
420
|
*/
|
|
420
421
|
await this.loadMarkets();
|
|
421
422
|
let method = 'privatePostOrderAddOrder';
|
|
@@ -445,7 +446,7 @@ export default class bit2c extends Exchange {
|
|
|
445
446
|
* @param {string} id order id
|
|
446
447
|
* @param {string} symbol Not used by bit2c cancelOrder ()
|
|
447
448
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
448
|
-
* @returns {object} An [order structure]{@link https://
|
|
449
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
449
450
|
*/
|
|
450
451
|
const request = {
|
|
451
452
|
'id': id,
|
|
@@ -461,9 +462,11 @@ export default class bit2c extends Exchange {
|
|
|
461
462
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
462
463
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
463
464
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
464
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
465
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
465
466
|
*/
|
|
466
|
-
|
|
467
|
+
if (symbol === undefined) {
|
|
468
|
+
throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
469
|
+
}
|
|
467
470
|
await this.loadMarkets();
|
|
468
471
|
const market = this.market(symbol);
|
|
469
472
|
const request = {
|
|
@@ -482,7 +485,7 @@ export default class bit2c extends Exchange {
|
|
|
482
485
|
* @description fetches information on an order made by the user
|
|
483
486
|
* @param {string} symbol unified market symbol
|
|
484
487
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
485
|
-
* @returns {object} An [order structure]{@link https://
|
|
488
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
486
489
|
*/
|
|
487
490
|
await this.loadMarkets();
|
|
488
491
|
const market = this.market(symbol);
|
|
@@ -636,7 +639,7 @@ export default class bit2c extends Exchange {
|
|
|
636
639
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
637
640
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
638
641
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
639
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
642
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
640
643
|
*/
|
|
641
644
|
await this.loadMarkets();
|
|
642
645
|
let market = undefined;
|
|
@@ -814,7 +817,7 @@ export default class bit2c extends Exchange {
|
|
|
814
817
|
* @description fetch the deposit address for a currency associated with this account
|
|
815
818
|
* @param {string} code unified currency code
|
|
816
819
|
* @param {object} [params] extra parameters specific to the bit2c api endpoint
|
|
817
|
-
* @returns {object} an [address structure]{@link https://
|
|
820
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
818
821
|
*/
|
|
819
822
|
await this.loadMarkets();
|
|
820
823
|
const currency = this.currency(code);
|
package/js/src/bitbank.js
CHANGED
|
@@ -33,17 +33,18 @@ export default class bitbank extends Exchange {
|
|
|
33
33
|
'createOrder': true,
|
|
34
34
|
'createReduceOnlyOrder': false,
|
|
35
35
|
'fetchBalance': true,
|
|
36
|
-
'fetchBorrowRate': false,
|
|
37
36
|
'fetchBorrowRateHistories': false,
|
|
38
37
|
'fetchBorrowRateHistory': false,
|
|
39
|
-
'
|
|
40
|
-
'
|
|
38
|
+
'fetchCrossBorrowRate': false,
|
|
39
|
+
'fetchCrossBorrowRates': false,
|
|
41
40
|
'fetchDepositAddress': true,
|
|
42
41
|
'fetchFundingHistory': false,
|
|
43
42
|
'fetchFundingRate': false,
|
|
44
43
|
'fetchFundingRateHistory': false,
|
|
45
44
|
'fetchFundingRates': false,
|
|
46
45
|
'fetchIndexOHLCV': false,
|
|
46
|
+
'fetchIsolatedBorrowRate': false,
|
|
47
|
+
'fetchIsolatedBorrowRates': false,
|
|
47
48
|
'fetchLeverage': false,
|
|
48
49
|
'fetchLeverageTiers': false,
|
|
49
50
|
'fetchMarginMode': false,
|
|
@@ -106,6 +107,7 @@ export default class bitbank extends Exchange {
|
|
|
106
107
|
'{pair}/transactions',
|
|
107
108
|
'{pair}/transactions/{yyyymmdd}',
|
|
108
109
|
'{pair}/candlestick/{candletype}/{yyyymmdd}',
|
|
110
|
+
'{pair}/circuit_break_info',
|
|
109
111
|
],
|
|
110
112
|
},
|
|
111
113
|
'private': {
|
|
@@ -288,7 +290,7 @@ export default class bitbank extends Exchange {
|
|
|
288
290
|
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/public-api.md#ticker
|
|
289
291
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
290
292
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
291
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
293
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
292
294
|
*/
|
|
293
295
|
await this.loadMarkets();
|
|
294
296
|
const market = this.market(symbol);
|
|
@@ -308,7 +310,7 @@ export default class bitbank extends Exchange {
|
|
|
308
310
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
309
311
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
310
312
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
311
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
313
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
312
314
|
*/
|
|
313
315
|
await this.loadMarkets();
|
|
314
316
|
const market = this.market(symbol);
|
|
@@ -375,7 +377,7 @@ export default class bitbank extends Exchange {
|
|
|
375
377
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
376
378
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
377
379
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
378
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
380
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
379
381
|
*/
|
|
380
382
|
await this.loadMarkets();
|
|
381
383
|
const market = this.market(symbol);
|
|
@@ -394,7 +396,7 @@ export default class bitbank extends Exchange {
|
|
|
394
396
|
* @description fetch the trading fees for multiple markets
|
|
395
397
|
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-all-pairs-info
|
|
396
398
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
397
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
399
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
398
400
|
*/
|
|
399
401
|
await this.loadMarkets();
|
|
400
402
|
const response = await this.marketsGetSpotPairs(params);
|
|
@@ -544,7 +546,7 @@ export default class bitbank extends Exchange {
|
|
|
544
546
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
545
547
|
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#assets
|
|
546
548
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
547
|
-
* @returns {object} a [balance structure]{@link https://
|
|
549
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
548
550
|
*/
|
|
549
551
|
await this.loadMarkets();
|
|
550
552
|
const response = await this.privateGetUserAssets(params);
|
|
@@ -643,7 +645,7 @@ export default class bitbank extends Exchange {
|
|
|
643
645
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
644
646
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
645
647
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
646
|
-
* @returns {object} an [order structure]{@link https://
|
|
648
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
647
649
|
*/
|
|
648
650
|
await this.loadMarkets();
|
|
649
651
|
const market = this.market(symbol);
|
|
@@ -669,7 +671,7 @@ export default class bitbank extends Exchange {
|
|
|
669
671
|
* @param {string} id order id
|
|
670
672
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
671
673
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
672
|
-
* @returns {object} An [order structure]{@link https://
|
|
674
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
673
675
|
*/
|
|
674
676
|
await this.loadMarkets();
|
|
675
677
|
const market = this.market(symbol);
|
|
@@ -689,7 +691,7 @@ export default class bitbank extends Exchange {
|
|
|
689
691
|
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#fetch-order-information
|
|
690
692
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
691
693
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
692
|
-
* @returns {object} An [order structure]{@link https://
|
|
694
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
693
695
|
*/
|
|
694
696
|
await this.loadMarkets();
|
|
695
697
|
const market = this.market(symbol);
|
|
@@ -711,7 +713,7 @@ export default class bitbank extends Exchange {
|
|
|
711
713
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
712
714
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
713
715
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
714
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
716
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
715
717
|
*/
|
|
716
718
|
await this.loadMarkets();
|
|
717
719
|
const market = this.market(symbol);
|
|
@@ -739,7 +741,7 @@ export default class bitbank extends Exchange {
|
|
|
739
741
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
740
742
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
741
743
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
742
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
744
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
743
745
|
*/
|
|
744
746
|
await this.loadMarkets();
|
|
745
747
|
const request = {};
|
|
@@ -767,7 +769,7 @@ export default class bitbank extends Exchange {
|
|
|
767
769
|
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-withdrawal-accounts
|
|
768
770
|
* @param {string} code unified currency code
|
|
769
771
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
770
|
-
* @returns {object} an [address structure]{@link https://
|
|
772
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
771
773
|
*/
|
|
772
774
|
await this.loadMarkets();
|
|
773
775
|
const currency = this.currency(code);
|
|
@@ -799,7 +801,7 @@ export default class bitbank extends Exchange {
|
|
|
799
801
|
* @param {string} address the address to withdraw to
|
|
800
802
|
* @param {string} tag
|
|
801
803
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
802
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
804
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
803
805
|
*/
|
|
804
806
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
805
807
|
if (!('uuid' in params)) {
|