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/bitmart.js
CHANGED
|
@@ -31,9 +31,9 @@ export default class bitmart extends Exchange {
|
|
|
31
31
|
'CORS': undefined,
|
|
32
32
|
'spot': true,
|
|
33
33
|
'margin': true,
|
|
34
|
-
'swap':
|
|
34
|
+
'swap': true,
|
|
35
35
|
'future': false,
|
|
36
|
-
'option':
|
|
36
|
+
'option': false,
|
|
37
37
|
'borrowMargin': true,
|
|
38
38
|
'cancelAllOrders': true,
|
|
39
39
|
'cancelOrder': true,
|
|
@@ -45,12 +45,12 @@ export default class bitmart extends Exchange {
|
|
|
45
45
|
'createStopOrder': false,
|
|
46
46
|
'fetchBalance': true,
|
|
47
47
|
'fetchBorrowInterest': true,
|
|
48
|
-
'fetchBorrowRate': true,
|
|
49
48
|
'fetchBorrowRateHistories': false,
|
|
50
49
|
'fetchBorrowRateHistory': false,
|
|
51
|
-
'fetchBorrowRates': true,
|
|
52
50
|
'fetchCanceledOrders': true,
|
|
53
51
|
'fetchClosedOrders': true,
|
|
52
|
+
'fetchCrossBorrowRate': false,
|
|
53
|
+
'fetchCrossBorrowRates': false,
|
|
54
54
|
'fetchCurrencies': true,
|
|
55
55
|
'fetchDeposit': true,
|
|
56
56
|
'fetchDepositAddress': true,
|
|
@@ -63,6 +63,8 @@ export default class bitmart extends Exchange {
|
|
|
63
63
|
'fetchFundingRate': true,
|
|
64
64
|
'fetchFundingRateHistory': false,
|
|
65
65
|
'fetchFundingRates': false,
|
|
66
|
+
'fetchIsolatedBorrowRate': true,
|
|
67
|
+
'fetchIsolatedBorrowRates': true,
|
|
66
68
|
'fetchLiquidations': false,
|
|
67
69
|
'fetchMarginMode': false,
|
|
68
70
|
'fetchMarkets': true,
|
|
@@ -135,7 +137,7 @@ export default class bitmart extends Exchange {
|
|
|
135
137
|
'spot/quotation/v3/books': 4,
|
|
136
138
|
'spot/quotation/v3/trades': 4,
|
|
137
139
|
'spot/v1/ticker': 5,
|
|
138
|
-
'spot/v2/ticker':
|
|
140
|
+
'spot/v2/ticker': 30,
|
|
139
141
|
'spot/v1/ticker_detail': 5,
|
|
140
142
|
'spot/v1/steps': 30,
|
|
141
143
|
'spot/v1/symbols/kline': 5,
|
|
@@ -180,10 +182,10 @@ export default class bitmart extends Exchange {
|
|
|
180
182
|
// margin
|
|
181
183
|
'spot/v1/margin/isolated/borrow_record': 1,
|
|
182
184
|
'spot/v1/margin/isolated/repay_record': 1,
|
|
183
|
-
'spot/v1/margin/isolated/pairs':
|
|
184
|
-
'spot/v1/margin/isolated/account':
|
|
185
|
-
'spot/v1/trade_fee':
|
|
186
|
-
'spot/v1/user_fee':
|
|
185
|
+
'spot/v1/margin/isolated/pairs': 30,
|
|
186
|
+
'spot/v1/margin/isolated/account': 5,
|
|
187
|
+
'spot/v1/trade_fee': 30,
|
|
188
|
+
'spot/v1/user_fee': 30,
|
|
187
189
|
// broker
|
|
188
190
|
'spot/v1/broker/rebate': 1,
|
|
189
191
|
// contract
|
|
@@ -223,9 +225,9 @@ export default class bitmart extends Exchange {
|
|
|
223
225
|
'spot/v2/submit_order': 1,
|
|
224
226
|
// margin
|
|
225
227
|
'spot/v1/margin/submit_order': 1,
|
|
226
|
-
'spot/v1/margin/isolated/borrow':
|
|
227
|
-
'spot/v1/margin/isolated/repay':
|
|
228
|
-
'spot/v1/margin/isolated/transfer':
|
|
228
|
+
'spot/v1/margin/isolated/borrow': 30,
|
|
229
|
+
'spot/v1/margin/isolated/repay': 30,
|
|
230
|
+
'spot/v1/margin/isolated/transfer': 30,
|
|
229
231
|
// contract
|
|
230
232
|
'account/v1/transfer-contract-list': 60,
|
|
231
233
|
'account/v1/transfer-contract': 60,
|
|
@@ -617,7 +619,7 @@ export default class bitmart extends Exchange {
|
|
|
617
619
|
* @name bitmart#fetchStatus
|
|
618
620
|
* @description the latest known information on the availability of the exchange API
|
|
619
621
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
620
|
-
* @returns {object} a [status structure]{@link https://
|
|
622
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
621
623
|
*/
|
|
622
624
|
const options = this.safeValue(this.options, 'fetchStatus', {});
|
|
623
625
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
@@ -953,7 +955,7 @@ export default class bitmart extends Exchange {
|
|
|
953
955
|
* @description please use fetchDepositWithdrawFee instead
|
|
954
956
|
* @param {string} code unified currency code
|
|
955
957
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
956
|
-
* @returns {object} a [fee structure]{@link https://
|
|
958
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
957
959
|
*/
|
|
958
960
|
await this.loadMarkets();
|
|
959
961
|
const currency = this.currency(code);
|
|
@@ -1012,7 +1014,7 @@ export default class bitmart extends Exchange {
|
|
|
1012
1014
|
* @description fetch the fee for deposits and withdrawals
|
|
1013
1015
|
* @param {string} code unified currency code
|
|
1014
1016
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1015
|
-
* @returns {object} a [fee structure]{@link https://
|
|
1017
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
1016
1018
|
*/
|
|
1017
1019
|
await this.loadMarkets();
|
|
1018
1020
|
const currency = this.currency(code);
|
|
@@ -1125,7 +1127,7 @@ export default class bitmart extends Exchange {
|
|
|
1125
1127
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1126
1128
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1127
1129
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1128
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
1130
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1129
1131
|
*/
|
|
1130
1132
|
await this.loadMarkets();
|
|
1131
1133
|
const market = this.market(symbol);
|
|
@@ -1214,7 +1216,7 @@ export default class bitmart extends Exchange {
|
|
|
1214
1216
|
* @see https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v2
|
|
1215
1217
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1216
1218
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1217
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
1219
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1218
1220
|
*/
|
|
1219
1221
|
await this.loadMarkets();
|
|
1220
1222
|
symbols = this.marketSymbols(symbols);
|
|
@@ -1250,7 +1252,7 @@ export default class bitmart extends Exchange {
|
|
|
1250
1252
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1251
1253
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1252
1254
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1253
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
1255
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1254
1256
|
*/
|
|
1255
1257
|
await this.loadMarkets();
|
|
1256
1258
|
const market = this.market(symbol);
|
|
@@ -1423,7 +1425,7 @@ export default class bitmart extends Exchange {
|
|
|
1423
1425
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1424
1426
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1425
1427
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1426
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1428
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1427
1429
|
*/
|
|
1428
1430
|
await this.loadMarkets();
|
|
1429
1431
|
const market = this.market(symbol);
|
|
@@ -1634,7 +1636,7 @@ export default class bitmart extends Exchange {
|
|
|
1634
1636
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1635
1637
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
1636
1638
|
* @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
|
|
1637
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1639
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1638
1640
|
*/
|
|
1639
1641
|
await this.loadMarkets();
|
|
1640
1642
|
let market = undefined;
|
|
@@ -1669,7 +1671,9 @@ export default class bitmart extends Exchange {
|
|
|
1669
1671
|
response = await this.privatePostSpotV4QueryTrades(this.extend(request, params));
|
|
1670
1672
|
}
|
|
1671
1673
|
else if (type === 'swap') {
|
|
1672
|
-
|
|
1674
|
+
if (symbol === undefined) {
|
|
1675
|
+
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
1676
|
+
}
|
|
1673
1677
|
if (since !== undefined) {
|
|
1674
1678
|
request['start_time'] = since;
|
|
1675
1679
|
}
|
|
@@ -1746,7 +1750,7 @@ export default class bitmart extends Exchange {
|
|
|
1746
1750
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1747
1751
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
1748
1752
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1749
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
1753
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1750
1754
|
*/
|
|
1751
1755
|
await this.loadMarkets();
|
|
1752
1756
|
const request = {
|
|
@@ -1819,7 +1823,7 @@ export default class bitmart extends Exchange {
|
|
|
1819
1823
|
* @see https://developer-pro.bitmart.com/en/spot/#get-account-balance
|
|
1820
1824
|
* @see https://developer-pro.bitmart.com/en/spot/#get-margin-account-details-isolated
|
|
1821
1825
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1822
|
-
* @returns {object} a [balance structure]{@link https://
|
|
1826
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1823
1827
|
*/
|
|
1824
1828
|
await this.loadMarkets();
|
|
1825
1829
|
let marketType = undefined;
|
|
@@ -1958,7 +1962,7 @@ export default class bitmart extends Exchange {
|
|
|
1958
1962
|
* @description fetch the trading fees for a market
|
|
1959
1963
|
* @param {string} symbol unified market symbol
|
|
1960
1964
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1961
|
-
* @returns {object} a [fee structure]{@link https://
|
|
1965
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
1962
1966
|
*/
|
|
1963
1967
|
await this.loadMarkets();
|
|
1964
1968
|
const market = this.market(symbol);
|
|
@@ -2121,17 +2125,17 @@ export default class bitmart extends Exchange {
|
|
|
2121
2125
|
parseOrderStatusByType(type, status) {
|
|
2122
2126
|
const statusesByType = {
|
|
2123
2127
|
'spot': {
|
|
2124
|
-
'1': '
|
|
2128
|
+
'1': 'rejected',
|
|
2125
2129
|
'2': 'open',
|
|
2126
|
-
'3': '
|
|
2130
|
+
'3': 'rejected',
|
|
2127
2131
|
'4': 'open',
|
|
2128
2132
|
'5': 'open',
|
|
2129
2133
|
'6': 'closed',
|
|
2130
|
-
'7': '
|
|
2134
|
+
'7': 'canceled',
|
|
2131
2135
|
'8': 'canceled',
|
|
2132
2136
|
'new': 'open',
|
|
2133
2137
|
'partially_filled': 'open',
|
|
2134
|
-
'filled': '
|
|
2138
|
+
'filled': 'closed',
|
|
2135
2139
|
'partially_canceled': 'canceled',
|
|
2136
2140
|
},
|
|
2137
2141
|
'swap': {
|
|
@@ -2162,7 +2166,7 @@ export default class bitmart extends Exchange {
|
|
|
2162
2166
|
* @param {string} [params.clientOrderId] client order id of the order
|
|
2163
2167
|
* @param {boolean} [params.reduceOnly] *swap only* reduce only
|
|
2164
2168
|
* @param {boolean} [params.postOnly] make sure the order is posted to the order book and not matched immediately
|
|
2165
|
-
* @returns {object} an [order structure]{@link https://
|
|
2169
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2166
2170
|
*/
|
|
2167
2171
|
await this.loadMarkets();
|
|
2168
2172
|
const market = this.market(symbol);
|
|
@@ -2221,7 +2225,7 @@ export default class bitmart extends Exchange {
|
|
|
2221
2225
|
* @param {boolean} [params.reduceOnly] *swap only* reduce only
|
|
2222
2226
|
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
|
|
2223
2227
|
* @param {string} [params.clientOrderId] client order id of the order
|
|
2224
|
-
* @returns {object} an [order structure]{@link https://
|
|
2228
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2225
2229
|
*/
|
|
2226
2230
|
const market = this.market(symbol);
|
|
2227
2231
|
const request = {
|
|
@@ -2297,7 +2301,7 @@ export default class bitmart extends Exchange {
|
|
|
2297
2301
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
2298
2302
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2299
2303
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
2300
|
-
* @returns {object} an [order structure]{@link https://
|
|
2304
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2301
2305
|
*/
|
|
2302
2306
|
const market = this.market(symbol);
|
|
2303
2307
|
const request = {
|
|
@@ -2369,9 +2373,11 @@ export default class bitmart extends Exchange {
|
|
|
2369
2373
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2370
2374
|
* @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
|
|
2371
2375
|
* @param {boolean} [params.stop] *swap only* whether the order is a stop order
|
|
2372
|
-
* @returns {object} An [order structure]{@link https://
|
|
2376
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2373
2377
|
*/
|
|
2374
|
-
|
|
2378
|
+
if (symbol === undefined) {
|
|
2379
|
+
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
2380
|
+
}
|
|
2375
2381
|
await this.loadMarkets();
|
|
2376
2382
|
const market = this.market(symbol);
|
|
2377
2383
|
const request = {
|
|
@@ -2455,7 +2461,7 @@ export default class bitmart extends Exchange {
|
|
|
2455
2461
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
2456
2462
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2457
2463
|
* @param {string} [params.side] *spot only* 'buy' or 'sell'
|
|
2458
|
-
* @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}
|
|
2459
2465
|
*/
|
|
2460
2466
|
await this.loadMarkets();
|
|
2461
2467
|
const request = {};
|
|
@@ -2471,7 +2477,9 @@ export default class bitmart extends Exchange {
|
|
|
2471
2477
|
response = await this.privatePostSpotV1CancelOrders(this.extend(request, params));
|
|
2472
2478
|
}
|
|
2473
2479
|
else if (type === 'swap') {
|
|
2474
|
-
|
|
2480
|
+
if (symbol === undefined) {
|
|
2481
|
+
throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
2482
|
+
}
|
|
2475
2483
|
response = await this.privatePostContractPrivateCancelOrders(this.extend(request, params));
|
|
2476
2484
|
}
|
|
2477
2485
|
//
|
|
@@ -2495,7 +2503,9 @@ export default class bitmart extends Exchange {
|
|
|
2495
2503
|
return response;
|
|
2496
2504
|
}
|
|
2497
2505
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2498
|
-
|
|
2506
|
+
if (symbol === undefined) {
|
|
2507
|
+
throw new ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol argument');
|
|
2508
|
+
}
|
|
2499
2509
|
await this.loadMarkets();
|
|
2500
2510
|
const market = this.market(symbol);
|
|
2501
2511
|
if (!market['spot']) {
|
|
@@ -2566,7 +2576,7 @@ export default class bitmart extends Exchange {
|
|
|
2566
2576
|
* @param {int} [params.until] *spot* the latest time in ms to fetch orders for
|
|
2567
2577
|
* @param {string} [params.type] *swap* order type, 'limit' or 'market'
|
|
2568
2578
|
* @param {string} [params.order_state] *swap* the order state, 'all' or 'partially_filled', default is 'all'
|
|
2569
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2579
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2570
2580
|
*/
|
|
2571
2581
|
await this.loadMarkets();
|
|
2572
2582
|
let market = undefined;
|
|
@@ -2665,12 +2675,15 @@ export default class bitmart extends Exchange {
|
|
|
2665
2675
|
* @method
|
|
2666
2676
|
* @name bitmart#fetchClosedOrders
|
|
2667
2677
|
* @see https://developer-pro.bitmart.com/en/spot/#account-orders-v4-signed
|
|
2678
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-order-history-keyed
|
|
2668
2679
|
* @description fetches information on multiple closed orders made by the user
|
|
2669
2680
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2670
2681
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2671
2682
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
2672
2683
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2673
|
-
* @
|
|
2684
|
+
* @param {int} [params.until] timestamp in ms of the latest entry
|
|
2685
|
+
* @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
|
|
2686
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2674
2687
|
*/
|
|
2675
2688
|
await this.loadMarkets();
|
|
2676
2689
|
let market = undefined;
|
|
@@ -2682,20 +2695,33 @@ export default class bitmart extends Exchange {
|
|
|
2682
2695
|
let type = undefined;
|
|
2683
2696
|
[type, params] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
|
|
2684
2697
|
if (type !== 'spot') {
|
|
2685
|
-
|
|
2698
|
+
if (symbol === undefined) {
|
|
2699
|
+
throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
2700
|
+
}
|
|
2686
2701
|
}
|
|
2687
2702
|
let marginMode = undefined;
|
|
2688
2703
|
[marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
|
|
2689
2704
|
if (marginMode === 'isolated') {
|
|
2690
2705
|
request['orderMode'] = 'iso_margin';
|
|
2691
2706
|
}
|
|
2692
|
-
const
|
|
2707
|
+
const startTimeKey = (type === 'spot') ? 'startTime' : 'start_time';
|
|
2708
|
+
if (since !== undefined) {
|
|
2709
|
+
request[startTimeKey] = since;
|
|
2710
|
+
}
|
|
2711
|
+
const endTimeKey = (type === 'spot') ? 'endTime' : 'end_time';
|
|
2712
|
+
const until = this.safeInteger2(params, 'until', endTimeKey);
|
|
2693
2713
|
if (until !== undefined) {
|
|
2694
|
-
params = this.omit(params, ['
|
|
2695
|
-
request[
|
|
2714
|
+
params = this.omit(params, ['until']);
|
|
2715
|
+
request[endTimeKey] = until;
|
|
2696
2716
|
}
|
|
2697
|
-
|
|
2698
|
-
|
|
2717
|
+
let response = undefined;
|
|
2718
|
+
if (type === 'spot') {
|
|
2719
|
+
response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
|
|
2720
|
+
}
|
|
2721
|
+
else {
|
|
2722
|
+
response = await this.privateGetContractPrivateOrderHistory(this.extend(request, params));
|
|
2723
|
+
}
|
|
2724
|
+
const data = this.safeValue(response, 'data', []);
|
|
2699
2725
|
return this.parseOrders(data, market, since, limit);
|
|
2700
2726
|
}
|
|
2701
2727
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2707,7 +2733,7 @@ export default class bitmart extends Exchange {
|
|
|
2707
2733
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2708
2734
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
2709
2735
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2710
|
-
* @returns {object} a list of [order structures]{@link https://
|
|
2736
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2711
2737
|
*/
|
|
2712
2738
|
return await this.fetchOrdersByStatus('canceled', symbol, since, limit, params);
|
|
2713
2739
|
}
|
|
@@ -2723,7 +2749,7 @@ export default class bitmart extends Exchange {
|
|
|
2723
2749
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2724
2750
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2725
2751
|
* @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
|
|
2726
|
-
* @returns {object} An [order structure]{@link https://
|
|
2752
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2727
2753
|
*/
|
|
2728
2754
|
await this.loadMarkets();
|
|
2729
2755
|
const request = {};
|
|
@@ -2747,7 +2773,9 @@ export default class bitmart extends Exchange {
|
|
|
2747
2773
|
}
|
|
2748
2774
|
}
|
|
2749
2775
|
else if (type === 'swap') {
|
|
2750
|
-
|
|
2776
|
+
if (symbol === undefined) {
|
|
2777
|
+
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
2778
|
+
}
|
|
2751
2779
|
request['symbol'] = market['id'];
|
|
2752
2780
|
request['order_id'] = id;
|
|
2753
2781
|
response = await this.privateGetContractPrivateOrder(this.extend(request, params));
|
|
@@ -2812,7 +2840,7 @@ export default class bitmart extends Exchange {
|
|
|
2812
2840
|
* @description fetch the deposit address for a currency associated with this account
|
|
2813
2841
|
* @param {string} code unified currency code
|
|
2814
2842
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2815
|
-
* @returns {object} an [address structure]{@link https://
|
|
2843
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2816
2844
|
*/
|
|
2817
2845
|
await this.loadMarkets();
|
|
2818
2846
|
const currency = this.currency(code);
|
|
@@ -2877,7 +2905,7 @@ export default class bitmart extends Exchange {
|
|
|
2877
2905
|
* @param {string} address the address to withdraw to
|
|
2878
2906
|
* @param {string} tag
|
|
2879
2907
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2880
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2908
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2881
2909
|
*/
|
|
2882
2910
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2883
2911
|
this.checkAddress(address);
|
|
@@ -2986,7 +3014,7 @@ export default class bitmart extends Exchange {
|
|
|
2986
3014
|
* @param {string} id deposit id
|
|
2987
3015
|
* @param {string} code not used by bitmart fetchDeposit ()
|
|
2988
3016
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2989
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3017
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2990
3018
|
*/
|
|
2991
3019
|
await this.loadMarkets();
|
|
2992
3020
|
const request = {
|
|
@@ -3028,7 +3056,7 @@ export default class bitmart extends Exchange {
|
|
|
3028
3056
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
3029
3057
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
3030
3058
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3031
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
3059
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3032
3060
|
*/
|
|
3033
3061
|
return await this.fetchTransactionsByType('deposit', code, since, limit, params);
|
|
3034
3062
|
}
|
|
@@ -3040,7 +3068,7 @@ export default class bitmart extends Exchange {
|
|
|
3040
3068
|
* @param {string} id withdrawal id
|
|
3041
3069
|
* @param {string} code not used by bitmart.fetchWithdrawal
|
|
3042
3070
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3043
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3071
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3044
3072
|
*/
|
|
3045
3073
|
await this.loadMarkets();
|
|
3046
3074
|
const request = {
|
|
@@ -3082,7 +3110,7 @@ export default class bitmart extends Exchange {
|
|
|
3082
3110
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3083
3111
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3084
3112
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3085
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
3113
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3086
3114
|
*/
|
|
3087
3115
|
return await this.fetchTransactionsByType('withdraw', code, since, limit, params);
|
|
3088
3116
|
}
|
|
@@ -3183,9 +3211,11 @@ export default class bitmart extends Exchange {
|
|
|
3183
3211
|
* @param {string} symbol unified market symbol
|
|
3184
3212
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3185
3213
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3186
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
3214
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
3187
3215
|
*/
|
|
3188
|
-
|
|
3216
|
+
if (symbol === undefined) {
|
|
3217
|
+
throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
|
|
3218
|
+
}
|
|
3189
3219
|
await this.loadMarkets();
|
|
3190
3220
|
const market = this.market(symbol);
|
|
3191
3221
|
const currency = this.currency(code);
|
|
@@ -3224,9 +3254,11 @@ export default class bitmart extends Exchange {
|
|
|
3224
3254
|
* @param {string} symbol unified market symbol
|
|
3225
3255
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3226
3256
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3227
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
3257
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
3228
3258
|
*/
|
|
3229
|
-
|
|
3259
|
+
if (symbol === undefined) {
|
|
3260
|
+
throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
|
|
3261
|
+
}
|
|
3230
3262
|
await this.loadMarkets();
|
|
3231
3263
|
const market = this.market(symbol);
|
|
3232
3264
|
const currency = this.currency(code);
|
|
@@ -3280,20 +3312,21 @@ export default class bitmart extends Exchange {
|
|
|
3280
3312
|
};
|
|
3281
3313
|
}
|
|
3282
3314
|
async fetchIsolatedBorrowRate(symbol, params = {}) {
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3315
|
+
//
|
|
3316
|
+
// @method
|
|
3317
|
+
// @name bitmart#fetchIsolatedBorrowRate
|
|
3318
|
+
// @description fetch the rate of interest to borrow a currency for margin trading
|
|
3319
|
+
// @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
|
|
3320
|
+
// @param {string} symbol unified symbol of the market to fetch the borrow rate for
|
|
3321
|
+
// @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3322
|
+
// <<<<<<< HEAD
|
|
3323
|
+
// @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
3324
|
+
// =======
|
|
3325
|
+
// @returns {object} an [isolated borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
|
|
3326
|
+
// >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
|
|
3327
|
+
//
|
|
3292
3328
|
await this.loadMarkets();
|
|
3293
|
-
|
|
3294
|
-
if (symbol !== undefined) {
|
|
3295
|
-
market = this.market(symbol);
|
|
3296
|
-
}
|
|
3329
|
+
const market = this.market(symbol);
|
|
3297
3330
|
const request = {
|
|
3298
3331
|
'symbol': market['id'],
|
|
3299
3332
|
};
|
|
@@ -3361,20 +3394,16 @@ export default class bitmart extends Exchange {
|
|
|
3361
3394
|
//
|
|
3362
3395
|
const marketId = this.safeString(info, 'symbol');
|
|
3363
3396
|
const symbol = this.safeSymbol(marketId, market);
|
|
3364
|
-
const baseData = this.safeValue(info, 'base');
|
|
3365
|
-
const quoteData = this.safeValue(info, 'quote');
|
|
3397
|
+
const baseData = this.safeValue(info, 'base', {});
|
|
3398
|
+
const quoteData = this.safeValue(info, 'quote', {});
|
|
3366
3399
|
const baseId = this.safeString(baseData, 'currency');
|
|
3367
3400
|
const quoteId = this.safeString(quoteData, 'currency');
|
|
3368
|
-
const base = this.safeCurrencyCode(baseId);
|
|
3369
|
-
const quote = this.safeCurrencyCode(quoteId);
|
|
3370
|
-
const baseRate = this.safeNumber(baseData, 'hourly_interest');
|
|
3371
|
-
const quoteRate = this.safeNumber(quoteData, 'hourly_interest');
|
|
3372
3401
|
return {
|
|
3373
3402
|
'symbol': symbol,
|
|
3374
|
-
'base':
|
|
3375
|
-
'baseRate':
|
|
3376
|
-
'quote':
|
|
3377
|
-
'quoteRate':
|
|
3403
|
+
'base': this.safeCurrencyCode(baseId),
|
|
3404
|
+
'baseRate': this.safeNumber(baseData, 'hourly_interest'),
|
|
3405
|
+
'quote': this.safeCurrencyCode(quoteId),
|
|
3406
|
+
'quoteRate': this.safeNumber(quoteData, 'hourly_interest'),
|
|
3378
3407
|
'period': 3600000,
|
|
3379
3408
|
'timestamp': undefined,
|
|
3380
3409
|
'datetime': undefined,
|
|
@@ -3384,11 +3413,11 @@ export default class bitmart extends Exchange {
|
|
|
3384
3413
|
async fetchIsolatedBorrowRates(params = {}) {
|
|
3385
3414
|
/**
|
|
3386
3415
|
* @method
|
|
3387
|
-
* @name bitmart#
|
|
3416
|
+
* @name bitmart#fetchIsolatedBorrowRates
|
|
3388
3417
|
* @description fetch the borrow interest rates of all currencies, currently only works for isolated margin
|
|
3389
|
-
* @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount
|
|
3418
|
+
* @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
|
|
3390
3419
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3391
|
-
* @returns {object} a list of [borrow rate structures]{@link https://
|
|
3420
|
+
* @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
|
|
3392
3421
|
*/
|
|
3393
3422
|
await this.loadMarkets();
|
|
3394
3423
|
const response = await this.privateGetSpotV1MarginIsolatedPairs(params);
|
|
@@ -3445,7 +3474,7 @@ export default class bitmart extends Exchange {
|
|
|
3445
3474
|
* @param {string} fromAccount account to transfer from
|
|
3446
3475
|
* @param {string} toAccount account to transfer to
|
|
3447
3476
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3448
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
3477
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
3449
3478
|
*/
|
|
3450
3479
|
await this.loadMarkets();
|
|
3451
3480
|
const currency = this.currency(code);
|
|
@@ -3586,7 +3615,7 @@ export default class bitmart extends Exchange {
|
|
|
3586
3615
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3587
3616
|
* @param {int} [params.page] the required number of pages, default is 1, max is 1000
|
|
3588
3617
|
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
3589
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
3618
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
3590
3619
|
*/
|
|
3591
3620
|
await this.loadMarkets();
|
|
3592
3621
|
if (limit === undefined) {
|
|
@@ -3648,9 +3677,11 @@ export default class bitmart extends Exchange {
|
|
|
3648
3677
|
* @param {int} [since] the earliest time in ms to fetch borrrow interest for
|
|
3649
3678
|
* @param {int} [limit] the maximum number of structures to retrieve
|
|
3650
3679
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3651
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://
|
|
3680
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
3652
3681
|
*/
|
|
3653
|
-
|
|
3682
|
+
if (symbol === undefined) {
|
|
3683
|
+
throw new ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
|
|
3684
|
+
}
|
|
3654
3685
|
await this.loadMarkets();
|
|
3655
3686
|
const market = this.market(symbol);
|
|
3656
3687
|
const request = {
|
|
@@ -3725,7 +3756,7 @@ export default class bitmart extends Exchange {
|
|
|
3725
3756
|
* @see https://developer-pro.bitmart.com/en/futures/#get-futures-openinterest
|
|
3726
3757
|
* @param {string} symbol Unified CCXT market symbol
|
|
3727
3758
|
* @param {object} [params] exchange specific parameters
|
|
3728
|
-
* @returns {object} an open interest structure{@link https://
|
|
3759
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3729
3760
|
*/
|
|
3730
3761
|
await this.loadMarkets();
|
|
3731
3762
|
const market = this.market(symbol);
|
|
@@ -3784,7 +3815,9 @@ export default class bitmart extends Exchange {
|
|
|
3784
3815
|
* @param {string} [params.marginMode] 'isolated' or 'cross'
|
|
3785
3816
|
* @returns {object} response from the exchange
|
|
3786
3817
|
*/
|
|
3787
|
-
|
|
3818
|
+
if (symbol === undefined) {
|
|
3819
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
3820
|
+
}
|
|
3788
3821
|
let marginMode = undefined;
|
|
3789
3822
|
[marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
|
|
3790
3823
|
this.checkRequiredArgument('setLeverage', marginMode, 'marginMode', ['isolated', 'cross']);
|
|
@@ -3808,7 +3841,7 @@ export default class bitmart extends Exchange {
|
|
|
3808
3841
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
|
|
3809
3842
|
* @param {string} symbol unified market symbol
|
|
3810
3843
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3811
|
-
* @returns {object} a [funding rate structure]{@link https://
|
|
3844
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3812
3845
|
*/
|
|
3813
3846
|
await this.loadMarkets();
|
|
3814
3847
|
const market = this.market(symbol);
|
|
@@ -3874,7 +3907,7 @@ export default class bitmart extends Exchange {
|
|
|
3874
3907
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
|
|
3875
3908
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
3876
3909
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3877
|
-
* @returns {object} a [position structure]{@link https://
|
|
3910
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3878
3911
|
*/
|
|
3879
3912
|
await this.loadMarkets();
|
|
3880
3913
|
const market = this.market(symbol);
|
|
@@ -3923,7 +3956,7 @@ export default class bitmart extends Exchange {
|
|
|
3923
3956
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
|
|
3924
3957
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3925
3958
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3926
|
-
* @returns {object[]} a list of [position structures]{@link https://
|
|
3959
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3927
3960
|
*/
|
|
3928
3961
|
await this.loadMarkets();
|
|
3929
3962
|
let market = undefined;
|
|
@@ -4051,9 +4084,11 @@ export default class bitmart extends Exchange {
|
|
|
4051
4084
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
4052
4085
|
* @param {object} [params] exchange specific parameters for the bitmart api endpoint
|
|
4053
4086
|
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
4054
|
-
* @returns {object} an array of [liquidation structures]{@link https://
|
|
4087
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
4055
4088
|
*/
|
|
4056
|
-
|
|
4089
|
+
if (symbol === undefined) {
|
|
4090
|
+
throw new ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
|
|
4091
|
+
}
|
|
4057
4092
|
await this.loadMarkets();
|
|
4058
4093
|
const market = this.market(symbol);
|
|
4059
4094
|
if (!market['swap']) {
|
package/js/src/bitmex.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export default class bitmex extends Exchange {
|
|
|
8
8
|
describe(): any;
|
|
9
9
|
fetchCurrencies(params?: {}): Promise<{}>;
|
|
10
10
|
convertFromRealAmount(code: any, amount: any): number;
|
|
11
|
-
convertToRealAmount(code:
|
|
11
|
+
convertToRealAmount(code: string, amount: string): string;
|
|
12
12
|
amountToPrecision(symbol: any, amount: any): any;
|
|
13
13
|
convertFromRawQuantity(symbol: any, rawQuantity: any, currencySide?: string): number;
|
|
14
14
|
convertFromRawCost(symbol: any, rawQuantity: any): number;
|
|
@@ -34,7 +34,7 @@ export default class bitmex extends Exchange {
|
|
|
34
34
|
referenceAccount: any;
|
|
35
35
|
type: string;
|
|
36
36
|
currency: string;
|
|
37
|
-
amount:
|
|
37
|
+
amount: string;
|
|
38
38
|
before: number;
|
|
39
39
|
after: number;
|
|
40
40
|
status: string;
|