ccxt 4.1.56 → 4.1.58
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/README.md +3 -3
- package/build.sh +30 -18
- package/dist/ccxt.browser.js +3893 -3214
- package/dist/ccxt.browser.min.js +10 -10
- 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/base/ws/Client.js +1 -1
- 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 +16 -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 +110 -89
- 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 +100 -77
- 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 +132 -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 +87 -82
- package/dist/cjs/src/p2b.js +79 -82
- 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 +15 -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/bybit.d.ts +1 -0
- package/js/src/abstract/cryptocom.d.ts +0 -20
- 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/base/ws/Client.js +1 -1
- 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 +16 -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 +110 -89
- 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 +100 -77
- 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 +132 -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 +87 -82
- package/js/src/p2b.d.ts +8 -7
- package/js/src/p2b.js +79 -81
- 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 +15 -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 +1 -1
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,
|
|
@@ -130,15 +132,15 @@ export default class bitmart extends Exchange {
|
|
|
130
132
|
'spot/v1/symbols/details': 5,
|
|
131
133
|
'spot/quotation/v3/tickers': 6,
|
|
132
134
|
'spot/quotation/v3/ticker': 4,
|
|
133
|
-
'spot/quotation/v3/lite-klines':
|
|
134
|
-
'spot/quotation/v3/klines':
|
|
135
|
+
'spot/quotation/v3/lite-klines': 5,
|
|
136
|
+
'spot/quotation/v3/klines': 7,
|
|
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
|
-
'spot/v1/symbols/kline':
|
|
143
|
+
'spot/v1/symbols/kline': 6,
|
|
142
144
|
'spot/v1/symbols/book': 5,
|
|
143
145
|
'spot/v1/symbols/trades': 5,
|
|
144
146
|
// contract markets
|
|
@@ -147,7 +149,7 @@ export default class bitmart extends Exchange {
|
|
|
147
149
|
'contract/public/depth': 5,
|
|
148
150
|
'contract/public/open-interest': 30,
|
|
149
151
|
'contract/public/funding-rate': 30,
|
|
150
|
-
'contract/public/kline':
|
|
152
|
+
'contract/public/kline': 6,
|
|
151
153
|
'account/v1/currencies': 30,
|
|
152
154
|
},
|
|
153
155
|
},
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -2673,7 +2683,7 @@ export default class bitmart extends Exchange {
|
|
|
2673
2683
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2674
2684
|
* @param {int} [params.until] timestamp in ms of the latest entry
|
|
2675
2685
|
* @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
|
|
2676
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2686
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2677
2687
|
*/
|
|
2678
2688
|
await this.loadMarkets();
|
|
2679
2689
|
let market = undefined;
|
|
@@ -2685,7 +2695,9 @@ export default class bitmart extends Exchange {
|
|
|
2685
2695
|
let type = undefined;
|
|
2686
2696
|
[type, params] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
|
|
2687
2697
|
if (type !== 'spot') {
|
|
2688
|
-
|
|
2698
|
+
if (symbol === undefined) {
|
|
2699
|
+
throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
2700
|
+
}
|
|
2689
2701
|
}
|
|
2690
2702
|
let marginMode = undefined;
|
|
2691
2703
|
[marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
|
|
@@ -2721,7 +2733,7 @@ export default class bitmart extends Exchange {
|
|
|
2721
2733
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2722
2734
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
2723
2735
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2724
|
-
* @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}
|
|
2725
2737
|
*/
|
|
2726
2738
|
return await this.fetchOrdersByStatus('canceled', symbol, since, limit, params);
|
|
2727
2739
|
}
|
|
@@ -2737,7 +2749,7 @@ export default class bitmart extends Exchange {
|
|
|
2737
2749
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2738
2750
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2739
2751
|
* @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
|
|
2740
|
-
* @returns {object} An [order structure]{@link https://
|
|
2752
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2741
2753
|
*/
|
|
2742
2754
|
await this.loadMarkets();
|
|
2743
2755
|
const request = {};
|
|
@@ -2761,7 +2773,9 @@ export default class bitmart extends Exchange {
|
|
|
2761
2773
|
}
|
|
2762
2774
|
}
|
|
2763
2775
|
else if (type === 'swap') {
|
|
2764
|
-
|
|
2776
|
+
if (symbol === undefined) {
|
|
2777
|
+
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
2778
|
+
}
|
|
2765
2779
|
request['symbol'] = market['id'];
|
|
2766
2780
|
request['order_id'] = id;
|
|
2767
2781
|
response = await this.privateGetContractPrivateOrder(this.extend(request, params));
|
|
@@ -2826,7 +2840,7 @@ export default class bitmart extends Exchange {
|
|
|
2826
2840
|
* @description fetch the deposit address for a currency associated with this account
|
|
2827
2841
|
* @param {string} code unified currency code
|
|
2828
2842
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2829
|
-
* @returns {object} an [address structure]{@link https://
|
|
2843
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2830
2844
|
*/
|
|
2831
2845
|
await this.loadMarkets();
|
|
2832
2846
|
const currency = this.currency(code);
|
|
@@ -2891,7 +2905,7 @@ export default class bitmart extends Exchange {
|
|
|
2891
2905
|
* @param {string} address the address to withdraw to
|
|
2892
2906
|
* @param {string} tag
|
|
2893
2907
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
2894
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2908
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2895
2909
|
*/
|
|
2896
2910
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2897
2911
|
this.checkAddress(address);
|
|
@@ -3000,7 +3014,7 @@ export default class bitmart extends Exchange {
|
|
|
3000
3014
|
* @param {string} id deposit id
|
|
3001
3015
|
* @param {string} code not used by bitmart fetchDeposit ()
|
|
3002
3016
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3003
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3017
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3004
3018
|
*/
|
|
3005
3019
|
await this.loadMarkets();
|
|
3006
3020
|
const request = {
|
|
@@ -3042,7 +3056,7 @@ export default class bitmart extends Exchange {
|
|
|
3042
3056
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
3043
3057
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
3044
3058
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3045
|
-
* @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}
|
|
3046
3060
|
*/
|
|
3047
3061
|
return await this.fetchTransactionsByType('deposit', code, since, limit, params);
|
|
3048
3062
|
}
|
|
@@ -3054,7 +3068,7 @@ export default class bitmart extends Exchange {
|
|
|
3054
3068
|
* @param {string} id withdrawal id
|
|
3055
3069
|
* @param {string} code not used by bitmart.fetchWithdrawal
|
|
3056
3070
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3057
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
3071
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3058
3072
|
*/
|
|
3059
3073
|
await this.loadMarkets();
|
|
3060
3074
|
const request = {
|
|
@@ -3096,7 +3110,7 @@ export default class bitmart extends Exchange {
|
|
|
3096
3110
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3097
3111
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3098
3112
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3099
|
-
* @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}
|
|
3100
3114
|
*/
|
|
3101
3115
|
return await this.fetchTransactionsByType('withdraw', code, since, limit, params);
|
|
3102
3116
|
}
|
|
@@ -3197,9 +3211,11 @@ export default class bitmart extends Exchange {
|
|
|
3197
3211
|
* @param {string} symbol unified market symbol
|
|
3198
3212
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3199
3213
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3200
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
3214
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
3201
3215
|
*/
|
|
3202
|
-
|
|
3216
|
+
if (symbol === undefined) {
|
|
3217
|
+
throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
|
|
3218
|
+
}
|
|
3203
3219
|
await this.loadMarkets();
|
|
3204
3220
|
const market = this.market(symbol);
|
|
3205
3221
|
const currency = this.currency(code);
|
|
@@ -3238,9 +3254,11 @@ export default class bitmart extends Exchange {
|
|
|
3238
3254
|
* @param {string} symbol unified market symbol
|
|
3239
3255
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3240
3256
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3241
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
3257
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
3242
3258
|
*/
|
|
3243
|
-
|
|
3259
|
+
if (symbol === undefined) {
|
|
3260
|
+
throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
|
|
3261
|
+
}
|
|
3244
3262
|
await this.loadMarkets();
|
|
3245
3263
|
const market = this.market(symbol);
|
|
3246
3264
|
const currency = this.currency(code);
|
|
@@ -3294,20 +3312,21 @@ export default class bitmart extends Exchange {
|
|
|
3294
3312
|
};
|
|
3295
3313
|
}
|
|
3296
3314
|
async fetchIsolatedBorrowRate(symbol, params = {}) {
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
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
|
+
//
|
|
3306
3328
|
await this.loadMarkets();
|
|
3307
|
-
|
|
3308
|
-
if (symbol !== undefined) {
|
|
3309
|
-
market = this.market(symbol);
|
|
3310
|
-
}
|
|
3329
|
+
const market = this.market(symbol);
|
|
3311
3330
|
const request = {
|
|
3312
3331
|
'symbol': market['id'],
|
|
3313
3332
|
};
|
|
@@ -3375,20 +3394,16 @@ export default class bitmart extends Exchange {
|
|
|
3375
3394
|
//
|
|
3376
3395
|
const marketId = this.safeString(info, 'symbol');
|
|
3377
3396
|
const symbol = this.safeSymbol(marketId, market);
|
|
3378
|
-
const baseData = this.safeValue(info, 'base');
|
|
3379
|
-
const quoteData = this.safeValue(info, 'quote');
|
|
3397
|
+
const baseData = this.safeValue(info, 'base', {});
|
|
3398
|
+
const quoteData = this.safeValue(info, 'quote', {});
|
|
3380
3399
|
const baseId = this.safeString(baseData, 'currency');
|
|
3381
3400
|
const quoteId = this.safeString(quoteData, 'currency');
|
|
3382
|
-
const base = this.safeCurrencyCode(baseId);
|
|
3383
|
-
const quote = this.safeCurrencyCode(quoteId);
|
|
3384
|
-
const baseRate = this.safeNumber(baseData, 'hourly_interest');
|
|
3385
|
-
const quoteRate = this.safeNumber(quoteData, 'hourly_interest');
|
|
3386
3401
|
return {
|
|
3387
3402
|
'symbol': symbol,
|
|
3388
|
-
'base':
|
|
3389
|
-
'baseRate':
|
|
3390
|
-
'quote':
|
|
3391
|
-
'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'),
|
|
3392
3407
|
'period': 3600000,
|
|
3393
3408
|
'timestamp': undefined,
|
|
3394
3409
|
'datetime': undefined,
|
|
@@ -3398,11 +3413,11 @@ export default class bitmart extends Exchange {
|
|
|
3398
3413
|
async fetchIsolatedBorrowRates(params = {}) {
|
|
3399
3414
|
/**
|
|
3400
3415
|
* @method
|
|
3401
|
-
* @name bitmart#
|
|
3416
|
+
* @name bitmart#fetchIsolatedBorrowRates
|
|
3402
3417
|
* @description fetch the borrow interest rates of all currencies, currently only works for isolated margin
|
|
3403
|
-
* @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
|
|
3404
3419
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3405
|
-
* @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}
|
|
3406
3421
|
*/
|
|
3407
3422
|
await this.loadMarkets();
|
|
3408
3423
|
const response = await this.privateGetSpotV1MarginIsolatedPairs(params);
|
|
@@ -3459,7 +3474,7 @@ export default class bitmart extends Exchange {
|
|
|
3459
3474
|
* @param {string} fromAccount account to transfer from
|
|
3460
3475
|
* @param {string} toAccount account to transfer to
|
|
3461
3476
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3462
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
3477
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
3463
3478
|
*/
|
|
3464
3479
|
await this.loadMarkets();
|
|
3465
3480
|
const currency = this.currency(code);
|
|
@@ -3600,7 +3615,7 @@ export default class bitmart extends Exchange {
|
|
|
3600
3615
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3601
3616
|
* @param {int} [params.page] the required number of pages, default is 1, max is 1000
|
|
3602
3617
|
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
3603
|
-
* @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}
|
|
3604
3619
|
*/
|
|
3605
3620
|
await this.loadMarkets();
|
|
3606
3621
|
if (limit === undefined) {
|
|
@@ -3662,9 +3677,11 @@ export default class bitmart extends Exchange {
|
|
|
3662
3677
|
* @param {int} [since] the earliest time in ms to fetch borrrow interest for
|
|
3663
3678
|
* @param {int} [limit] the maximum number of structures to retrieve
|
|
3664
3679
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3665
|
-
* @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}
|
|
3666
3681
|
*/
|
|
3667
|
-
|
|
3682
|
+
if (symbol === undefined) {
|
|
3683
|
+
throw new ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
|
|
3684
|
+
}
|
|
3668
3685
|
await this.loadMarkets();
|
|
3669
3686
|
const market = this.market(symbol);
|
|
3670
3687
|
const request = {
|
|
@@ -3739,7 +3756,7 @@ export default class bitmart extends Exchange {
|
|
|
3739
3756
|
* @see https://developer-pro.bitmart.com/en/futures/#get-futures-openinterest
|
|
3740
3757
|
* @param {string} symbol Unified CCXT market symbol
|
|
3741
3758
|
* @param {object} [params] exchange specific parameters
|
|
3742
|
-
* @returns {object} an open interest structure{@link https://
|
|
3759
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3743
3760
|
*/
|
|
3744
3761
|
await this.loadMarkets();
|
|
3745
3762
|
const market = this.market(symbol);
|
|
@@ -3798,7 +3815,9 @@ export default class bitmart extends Exchange {
|
|
|
3798
3815
|
* @param {string} [params.marginMode] 'isolated' or 'cross'
|
|
3799
3816
|
* @returns {object} response from the exchange
|
|
3800
3817
|
*/
|
|
3801
|
-
|
|
3818
|
+
if (symbol === undefined) {
|
|
3819
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
3820
|
+
}
|
|
3802
3821
|
let marginMode = undefined;
|
|
3803
3822
|
[marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
|
|
3804
3823
|
this.checkRequiredArgument('setLeverage', marginMode, 'marginMode', ['isolated', 'cross']);
|
|
@@ -3822,7 +3841,7 @@ export default class bitmart extends Exchange {
|
|
|
3822
3841
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
|
|
3823
3842
|
* @param {string} symbol unified market symbol
|
|
3824
3843
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3825
|
-
* @returns {object} a [funding rate structure]{@link https://
|
|
3844
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3826
3845
|
*/
|
|
3827
3846
|
await this.loadMarkets();
|
|
3828
3847
|
const market = this.market(symbol);
|
|
@@ -3888,7 +3907,7 @@ export default class bitmart extends Exchange {
|
|
|
3888
3907
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
|
|
3889
3908
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
3890
3909
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3891
|
-
* @returns {object} a [position structure]{@link https://
|
|
3910
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3892
3911
|
*/
|
|
3893
3912
|
await this.loadMarkets();
|
|
3894
3913
|
const market = this.market(symbol);
|
|
@@ -3937,7 +3956,7 @@ export default class bitmart extends Exchange {
|
|
|
3937
3956
|
* @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
|
|
3938
3957
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3939
3958
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3940
|
-
* @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}
|
|
3941
3960
|
*/
|
|
3942
3961
|
await this.loadMarkets();
|
|
3943
3962
|
let market = undefined;
|
|
@@ -4065,9 +4084,11 @@ export default class bitmart extends Exchange {
|
|
|
4065
4084
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
4066
4085
|
* @param {object} [params] exchange specific parameters for the bitmart api endpoint
|
|
4067
4086
|
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
4068
|
-
* @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}
|
|
4069
4088
|
*/
|
|
4070
|
-
|
|
4089
|
+
if (symbol === undefined) {
|
|
4090
|
+
throw new ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
|
|
4091
|
+
}
|
|
4071
4092
|
await this.loadMarkets();
|
|
4072
4093
|
const market = this.market(symbol);
|
|
4073
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;
|