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/digifinex.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/digifinex.js';
|
|
9
|
-
import { AccountSuspended, BadRequest, BadResponse, NetworkError, DDoSProtection, NotSupported, AuthenticationError, PermissionDenied, ExchangeError, InsufficientFunds, InvalidOrder, InvalidNonce, OrderNotFound, InvalidAddress, RateLimitExceeded, BadSymbol } from './base/errors.js';
|
|
9
|
+
import { AccountSuspended, BadRequest, BadResponse, NetworkError, DDoSProtection, NotSupported, AuthenticationError, PermissionDenied, ExchangeError, InsufficientFunds, InvalidOrder, InvalidNonce, OrderNotFound, InvalidAddress, RateLimitExceeded, BadSymbol, ArgumentsRequired } from './base/errors.js';
|
|
10
10
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
@@ -42,10 +42,10 @@ export default class digifinex extends Exchange {
|
|
|
42
42
|
'createStopOrder': false,
|
|
43
43
|
'fetchBalance': true,
|
|
44
44
|
'fetchBorrowInterest': true,
|
|
45
|
-
'fetchBorrowRate': true,
|
|
46
45
|
'fetchBorrowRateHistories': false,
|
|
47
46
|
'fetchBorrowRateHistory': false,
|
|
48
|
-
'
|
|
47
|
+
'fetchCrossBorrowRate': true,
|
|
48
|
+
'fetchCrossBorrowRates': true,
|
|
49
49
|
'fetchCurrencies': true,
|
|
50
50
|
'fetchDepositAddress': true,
|
|
51
51
|
'fetchDeposits': true,
|
|
@@ -56,6 +56,8 @@ export default class digifinex extends Exchange {
|
|
|
56
56
|
'fetchFundingRateHistory': true,
|
|
57
57
|
'fetchFundingRates': false,
|
|
58
58
|
'fetchIndexOHLCV': false,
|
|
59
|
+
'fetchIsolatedBorrowRate': false,
|
|
60
|
+
'fetchIsolatedBorrowRates': false,
|
|
59
61
|
'fetchLedger': true,
|
|
60
62
|
'fetchLeverage': false,
|
|
61
63
|
'fetchLeverageTiers': true,
|
|
@@ -803,7 +805,7 @@ export default class digifinex extends Exchange {
|
|
|
803
805
|
* @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#margin-assets
|
|
804
806
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#accountbalance
|
|
805
807
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
806
|
-
* @returns {object} a [balance structure]{@link https://
|
|
808
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
807
809
|
*/
|
|
808
810
|
await this.loadMarkets();
|
|
809
811
|
let marketType = undefined;
|
|
@@ -869,7 +871,7 @@ export default class digifinex extends Exchange {
|
|
|
869
871
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
870
872
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
871
873
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
872
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
874
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
873
875
|
*/
|
|
874
876
|
await this.loadMarkets();
|
|
875
877
|
const market = this.market(symbol);
|
|
@@ -947,7 +949,7 @@ export default class digifinex extends Exchange {
|
|
|
947
949
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#tickers
|
|
948
950
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
949
951
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
950
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
952
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
951
953
|
*/
|
|
952
954
|
await this.loadMarkets();
|
|
953
955
|
symbols = this.marketSymbols(symbols);
|
|
@@ -1034,7 +1036,7 @@ export default class digifinex extends Exchange {
|
|
|
1034
1036
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#ticker
|
|
1035
1037
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1036
1038
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1037
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
1039
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1038
1040
|
*/
|
|
1039
1041
|
await this.loadMarkets();
|
|
1040
1042
|
const market = this.market(symbol);
|
|
@@ -1342,7 +1344,7 @@ export default class digifinex extends Exchange {
|
|
|
1342
1344
|
* @name digifinex#fetchStatus
|
|
1343
1345
|
* @description the latest known information on the availability of the exchange API
|
|
1344
1346
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1345
|
-
* @returns {object} a [status structure]{@link https://
|
|
1347
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
1346
1348
|
*/
|
|
1347
1349
|
const response = await this.publicSpotGetPing(params);
|
|
1348
1350
|
//
|
|
@@ -1372,7 +1374,7 @@ export default class digifinex extends Exchange {
|
|
|
1372
1374
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1373
1375
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1374
1376
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1375
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1377
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1376
1378
|
*/
|
|
1377
1379
|
await this.loadMarkets();
|
|
1378
1380
|
const market = this.market(symbol);
|
|
@@ -1563,7 +1565,7 @@ export default class digifinex extends Exchange {
|
|
|
1563
1565
|
* @param {bool} [params.postOnly] true or false
|
|
1564
1566
|
* @param {bool} [params.reduceOnly] true or false
|
|
1565
1567
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
1566
|
-
* @returns {object} an [order structure]{@link https://
|
|
1568
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1567
1569
|
*/
|
|
1568
1570
|
await this.loadMarkets();
|
|
1569
1571
|
const market = this.market(symbol);
|
|
@@ -1614,7 +1616,7 @@ export default class digifinex extends Exchange {
|
|
|
1614
1616
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#batchorder
|
|
1615
1617
|
* @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
1616
1618
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1617
|
-
* @returns {object} an [order structure]{@link https://
|
|
1619
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1618
1620
|
*/
|
|
1619
1621
|
await this.loadMarkets();
|
|
1620
1622
|
const ordersRequests = [];
|
|
@@ -1818,7 +1820,7 @@ export default class digifinex extends Exchange {
|
|
|
1818
1820
|
* @param {string} id order id
|
|
1819
1821
|
* @param {string} symbol not used by digifinex cancelOrder ()
|
|
1820
1822
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1821
|
-
* @returns {object} An [order structure]{@link https://
|
|
1823
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1822
1824
|
*/
|
|
1823
1825
|
await this.loadMarkets();
|
|
1824
1826
|
let market = undefined;
|
|
@@ -1842,7 +1844,9 @@ export default class digifinex extends Exchange {
|
|
|
1842
1844
|
'order_id': id,
|
|
1843
1845
|
};
|
|
1844
1846
|
if (marketType === 'swap') {
|
|
1845
|
-
|
|
1847
|
+
if (symbol === undefined) {
|
|
1848
|
+
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
1849
|
+
}
|
|
1846
1850
|
request['instrument_id'] = market['id'];
|
|
1847
1851
|
}
|
|
1848
1852
|
else {
|
|
@@ -1887,7 +1891,7 @@ export default class digifinex extends Exchange {
|
|
|
1887
1891
|
* @param {string[]} ids order ids
|
|
1888
1892
|
* @param {string} symbol not used by digifinex cancelOrders ()
|
|
1889
1893
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
1890
|
-
* @returns {object} an list of [order structures]{@link https://
|
|
1894
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1891
1895
|
*/
|
|
1892
1896
|
await this.loadMarkets();
|
|
1893
1897
|
const defaultType = this.safeString(this.options, 'defaultType', 'spot');
|
|
@@ -2086,7 +2090,7 @@ export default class digifinex extends Exchange {
|
|
|
2086
2090
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2087
2091
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2088
2092
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2089
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2093
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2090
2094
|
*/
|
|
2091
2095
|
await this.loadMarkets();
|
|
2092
2096
|
let market = undefined;
|
|
@@ -2188,7 +2192,7 @@ export default class digifinex extends Exchange {
|
|
|
2188
2192
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2189
2193
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
2190
2194
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2191
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2195
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2192
2196
|
*/
|
|
2193
2197
|
await this.loadMarkets();
|
|
2194
2198
|
let market = undefined;
|
|
@@ -2291,7 +2295,7 @@ export default class digifinex extends Exchange {
|
|
|
2291
2295
|
* @param {string} id order id
|
|
2292
2296
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2293
2297
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2294
|
-
* @returns {object} An [order structure]{@link https://
|
|
2298
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2295
2299
|
*/
|
|
2296
2300
|
await this.loadMarkets();
|
|
2297
2301
|
let market = undefined;
|
|
@@ -2388,7 +2392,7 @@ export default class digifinex extends Exchange {
|
|
|
2388
2392
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2389
2393
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2390
2394
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2391
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2395
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2392
2396
|
*/
|
|
2393
2397
|
await this.loadMarkets();
|
|
2394
2398
|
let market = undefined;
|
|
@@ -2538,7 +2542,7 @@ export default class digifinex extends Exchange {
|
|
|
2538
2542
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2539
2543
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
2540
2544
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2541
|
-
* @returns {object} a [ledger structure]{@link https://
|
|
2545
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2542
2546
|
*/
|
|
2543
2547
|
await this.loadMarkets();
|
|
2544
2548
|
const request = {};
|
|
@@ -2646,7 +2650,7 @@ export default class digifinex extends Exchange {
|
|
|
2646
2650
|
* @description fetch the deposit address for a currency associated with this account
|
|
2647
2651
|
* @param {string} code unified currency code
|
|
2648
2652
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2649
|
-
* @returns {object} an [address structure]{@link https://
|
|
2653
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2650
2654
|
*/
|
|
2651
2655
|
await this.loadMarkets();
|
|
2652
2656
|
const currency = this.currency(code);
|
|
@@ -2725,7 +2729,7 @@ export default class digifinex extends Exchange {
|
|
|
2725
2729
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2726
2730
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2727
2731
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2728
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2732
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2729
2733
|
*/
|
|
2730
2734
|
return await this.fetchTransactionsByType('deposit', code, since, limit, params);
|
|
2731
2735
|
}
|
|
@@ -2738,7 +2742,7 @@ export default class digifinex extends Exchange {
|
|
|
2738
2742
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2739
2743
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2740
2744
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2741
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2745
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2742
2746
|
*/
|
|
2743
2747
|
return await this.fetchTransactionsByType('withdrawal', code, since, limit, params);
|
|
2744
2748
|
}
|
|
@@ -2875,7 +2879,7 @@ export default class digifinex extends Exchange {
|
|
|
2875
2879
|
* @param {string} fromAccount account to transfer from
|
|
2876
2880
|
* @param {string} toAccount account to transfer to
|
|
2877
2881
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2878
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
2882
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2879
2883
|
*/
|
|
2880
2884
|
await this.loadMarkets();
|
|
2881
2885
|
const currency = this.currency(code);
|
|
@@ -2906,7 +2910,7 @@ export default class digifinex extends Exchange {
|
|
|
2906
2910
|
* @param {string} address the address to withdraw to
|
|
2907
2911
|
* @param {string} tag
|
|
2908
2912
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
2909
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2913
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2910
2914
|
*/
|
|
2911
2915
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2912
2916
|
this.checkAddress(address);
|
|
@@ -2997,7 +3001,16 @@ export default class digifinex extends Exchange {
|
|
|
2997
3001
|
'info': info,
|
|
2998
3002
|
};
|
|
2999
3003
|
}
|
|
3000
|
-
async
|
|
3004
|
+
async fetchCrossBorrowRate(code, params = {}) {
|
|
3005
|
+
/**
|
|
3006
|
+
* @method
|
|
3007
|
+
* @name digifinex#fetchCrossBorrowRate
|
|
3008
|
+
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
3009
|
+
* @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#margin-assets
|
|
3010
|
+
* @param {string} code unified currency code
|
|
3011
|
+
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3012
|
+
* @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
3013
|
+
*/
|
|
3001
3014
|
await this.loadMarkets();
|
|
3002
3015
|
const request = {};
|
|
3003
3016
|
const response = await this.privateSpotGetMarginAssets(this.extend(request, params));
|
|
@@ -3029,13 +3042,14 @@ export default class digifinex extends Exchange {
|
|
|
3029
3042
|
const currency = this.currency(code);
|
|
3030
3043
|
return this.parseBorrowRate(result, currency);
|
|
3031
3044
|
}
|
|
3032
|
-
async
|
|
3045
|
+
async fetchCrossBorrowRates(params = {}) {
|
|
3033
3046
|
/**
|
|
3034
3047
|
* @method
|
|
3035
|
-
* @name digifinex#
|
|
3048
|
+
* @name digifinex#fetchCrossBorrowRates
|
|
3036
3049
|
* @description fetch the borrow interest rates of all currencies
|
|
3050
|
+
* @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#margin-assets
|
|
3037
3051
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3038
|
-
* @returns {object} a list of [borrow rate structures]{@link https://
|
|
3052
|
+
* @returns {object} a list of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
3039
3053
|
*/
|
|
3040
3054
|
await this.loadMarkets();
|
|
3041
3055
|
const response = await this.privateSpotGetMarginAssets(params);
|
|
@@ -3056,7 +3070,7 @@ export default class digifinex extends Exchange {
|
|
|
3056
3070
|
// "equity": 45.133305540922
|
|
3057
3071
|
// }
|
|
3058
3072
|
//
|
|
3059
|
-
const result = this.safeValue(response, 'list');
|
|
3073
|
+
const result = this.safeValue(response, 'list', []);
|
|
3060
3074
|
return this.parseBorrowRates(result, 'currency');
|
|
3061
3075
|
}
|
|
3062
3076
|
parseBorrowRate(info, currency = undefined) {
|
|
@@ -3106,7 +3120,7 @@ export default class digifinex extends Exchange {
|
|
|
3106
3120
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#currentfundingrate
|
|
3107
3121
|
* @param {string} symbol unified market symbol
|
|
3108
3122
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3109
|
-
* @returns {object} a [funding rate structure]{@link https://
|
|
3123
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3110
3124
|
*/
|
|
3111
3125
|
await this.loadMarkets();
|
|
3112
3126
|
const market = this.market(symbol);
|
|
@@ -3172,11 +3186,13 @@ export default class digifinex extends Exchange {
|
|
|
3172
3186
|
* @description fetches historical funding rate prices
|
|
3173
3187
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3174
3188
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3175
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://
|
|
3189
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3176
3190
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3177
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://
|
|
3191
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3178
3192
|
*/
|
|
3179
|
-
|
|
3193
|
+
if (symbol === undefined) {
|
|
3194
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
3195
|
+
}
|
|
3180
3196
|
await this.loadMarkets();
|
|
3181
3197
|
const market = this.market(symbol);
|
|
3182
3198
|
if (!market['swap']) {
|
|
@@ -3234,7 +3250,7 @@ export default class digifinex extends Exchange {
|
|
|
3234
3250
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#tradingfee
|
|
3235
3251
|
* @param {string} symbol unified market symbol
|
|
3236
3252
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3237
|
-
* @returns {object} a [fee structure]{@link https://
|
|
3253
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3238
3254
|
*/
|
|
3239
3255
|
await this.loadMarkets();
|
|
3240
3256
|
const market = this.market(symbol);
|
|
@@ -3284,7 +3300,7 @@ export default class digifinex extends Exchange {
|
|
|
3284
3300
|
* @see https://docs.digifinex.com/en-ww/swap/v2/rest.html#positions
|
|
3285
3301
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3286
3302
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3287
|
-
* @returns {object[]} a list of [position structures]{@link https://
|
|
3303
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3288
3304
|
*/
|
|
3289
3305
|
await this.loadMarkets();
|
|
3290
3306
|
symbols = this.marketSymbols(symbols);
|
|
@@ -3390,7 +3406,7 @@ export default class digifinex extends Exchange {
|
|
|
3390
3406
|
* @description fetch data on a single open contract trade position
|
|
3391
3407
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
3392
3408
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3393
|
-
* @returns {object} a [position structure]{@link https://
|
|
3409
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3394
3410
|
*/
|
|
3395
3411
|
await this.loadMarkets();
|
|
3396
3412
|
const market = this.market(symbol);
|
|
@@ -3570,8 +3586,10 @@ export default class digifinex extends Exchange {
|
|
|
3570
3586
|
* @param {string} [params.side] either 'long' or 'short', required for isolated markets only
|
|
3571
3587
|
* @returns {object} response from the exchange
|
|
3572
3588
|
*/
|
|
3589
|
+
if (symbol === undefined) {
|
|
3590
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
3591
|
+
}
|
|
3573
3592
|
await this.loadMarkets();
|
|
3574
|
-
this.checkRequiredSymbol('setLeverage', symbol);
|
|
3575
3593
|
const market = this.market(symbol);
|
|
3576
3594
|
if (market['type'] !== 'swap') {
|
|
3577
3595
|
throw new BadSymbol(this.id + ' setLeverage() supports swap contracts only');
|
|
@@ -3623,7 +3641,7 @@ export default class digifinex extends Exchange {
|
|
|
3623
3641
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
3624
3642
|
* @param {int} [limit] the maximum number of transfers to retrieve
|
|
3625
3643
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3626
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
3644
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
3627
3645
|
*/
|
|
3628
3646
|
await this.loadMarkets();
|
|
3629
3647
|
let currency = undefined;
|
|
@@ -3665,7 +3683,7 @@ export default class digifinex extends Exchange {
|
|
|
3665
3683
|
* @description retrieve information on the maximum leverage, for different trade sizes
|
|
3666
3684
|
* @param {string[]|undefined} symbols a list of unified market symbols
|
|
3667
3685
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3668
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://
|
|
3686
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
3669
3687
|
*/
|
|
3670
3688
|
await this.loadMarkets();
|
|
3671
3689
|
const response = await this.publicSwapGetPublicInstruments(params);
|
|
@@ -3758,7 +3776,7 @@ export default class digifinex extends Exchange {
|
|
|
3758
3776
|
* @description retrieve information on the maximum leverage, for different trade sizes for a single market
|
|
3759
3777
|
* @param {string} symbol unified market symbol
|
|
3760
3778
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3761
|
-
* @returns {object} a [leverage tiers structure]{@link https://
|
|
3779
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
3762
3780
|
*/
|
|
3763
3781
|
await this.loadMarkets();
|
|
3764
3782
|
const market = this.market(symbol);
|
|
@@ -3874,7 +3892,7 @@ export default class digifinex extends Exchange {
|
|
|
3874
3892
|
* @see https://docs.digifinex.com/en-ww/spot/v3/rest.html#get-currency-deposit-and-withdrawal-information
|
|
3875
3893
|
* @param {string[]|undefined} codes not used by fetchDepositWithdrawFees ()
|
|
3876
3894
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3877
|
-
* @returns {object} a list of [fee structures]{@link https://
|
|
3895
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3878
3896
|
*/
|
|
3879
3897
|
await this.loadMarkets();
|
|
3880
3898
|
const response = await this.publicSpotGetCurrencies(params);
|
|
@@ -3991,7 +4009,7 @@ export default class digifinex extends Exchange {
|
|
|
3991
4009
|
* @param {float} amount amount of margin to add
|
|
3992
4010
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
3993
4011
|
* @param {string} params.side the position side: 'long' or 'short'
|
|
3994
|
-
* @returns {object} a [margin structure]{@link https://
|
|
4012
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=margin-structure}
|
|
3995
4013
|
*/
|
|
3996
4014
|
const side = this.safeString(params, 'side');
|
|
3997
4015
|
this.checkRequiredArgument('addMargin', side, 'side', ['long', 'short']);
|
|
@@ -4007,7 +4025,7 @@ export default class digifinex extends Exchange {
|
|
|
4007
4025
|
* @param {float} amount the amount of margin to remove
|
|
4008
4026
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
4009
4027
|
* @param {string} params.side the position side: 'long' or 'short'
|
|
4010
|
-
* @returns {object} a [margin structure]{@link https://
|
|
4028
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=margin-structure}
|
|
4011
4029
|
*/
|
|
4012
4030
|
const side = this.safeString(params, 'side');
|
|
4013
4031
|
this.checkRequiredArgument('reduceMargin', side, 'side', ['long', 'short']);
|
|
@@ -4074,7 +4092,7 @@ export default class digifinex extends Exchange {
|
|
|
4074
4092
|
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
4075
4093
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
4076
4094
|
* @param {int} [params.until] timestamp in ms of the latest funding payment
|
|
4077
|
-
* @returns {object} a [funding history structure]{@link https://
|
|
4095
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
4078
4096
|
*/
|
|
4079
4097
|
await this.loadMarkets();
|
|
4080
4098
|
let request = {};
|
|
@@ -4140,7 +4158,9 @@ export default class digifinex extends Exchange {
|
|
|
4140
4158
|
* @param {object} [params] extra parameters specific to the digifinex api endpoint
|
|
4141
4159
|
* @returns {object} response from the exchange
|
|
4142
4160
|
*/
|
|
4143
|
-
|
|
4161
|
+
if (symbol === undefined) {
|
|
4162
|
+
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
4163
|
+
}
|
|
4144
4164
|
await this.loadMarkets();
|
|
4145
4165
|
const market = this.market(symbol);
|
|
4146
4166
|
marginMode = marginMode.toLowerCase();
|
package/js/src/exmo.js
CHANGED
|
@@ -282,7 +282,7 @@ export default class exmo extends Exchange {
|
|
|
282
282
|
* @param {string} symbol unified market symbol
|
|
283
283
|
* @param {float} amount the amount of margin to remove
|
|
284
284
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
285
|
-
* @returns {object} a [margin structure]{@link https://
|
|
285
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
286
286
|
*/
|
|
287
287
|
return await this.modifyMarginHelper(symbol, amount, 'reduce', params);
|
|
288
288
|
}
|
|
@@ -294,7 +294,7 @@ export default class exmo extends Exchange {
|
|
|
294
294
|
* @param {string} symbol unified market symbol
|
|
295
295
|
* @param {float} amount amount of margin to add
|
|
296
296
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
297
|
-
* @returns {object} a [margin structure]{@link https://
|
|
297
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
298
298
|
*/
|
|
299
299
|
return await this.modifyMarginHelper(symbol, amount, 'add', params);
|
|
300
300
|
}
|
|
@@ -304,7 +304,7 @@ export default class exmo extends Exchange {
|
|
|
304
304
|
* @name exmo#fetchTradingFees
|
|
305
305
|
* @description fetch the trading fees for multiple markets
|
|
306
306
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
307
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
307
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
308
308
|
*/
|
|
309
309
|
let method = this.safeString(params, 'method');
|
|
310
310
|
params = this.omit(params, 'method');
|
|
@@ -430,7 +430,7 @@ export default class exmo extends Exchange {
|
|
|
430
430
|
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#4190035d-24b1-453d-833b-37e0a52f88e2
|
|
431
431
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
432
432
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
433
|
-
* @returns {object} a list of [transaction fees structures]{@link https://
|
|
433
|
+
* @returns {object} a list of [transaction fees structures]{@link https://docs.ccxt.com/#/?id=fees-structure}
|
|
434
434
|
*/
|
|
435
435
|
await this.loadMarkets();
|
|
436
436
|
const cryptoList = await this.publicGetPaymentsProvidersCryptoList(params);
|
|
@@ -503,7 +503,7 @@ export default class exmo extends Exchange {
|
|
|
503
503
|
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#4190035d-24b1-453d-833b-37e0a52f88e2
|
|
504
504
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
505
505
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
506
|
-
* @returns {object} a list of [transaction fees structures]{@link https://
|
|
506
|
+
* @returns {object} a list of [transaction fees structures]{@link https://docs.ccxt.com/#/?id=fees-structure}
|
|
507
507
|
*/
|
|
508
508
|
await this.loadMarkets();
|
|
509
509
|
const response = await this.publicGetPaymentsProvidersCryptoList(params);
|
|
@@ -955,7 +955,7 @@ export default class exmo extends Exchange {
|
|
|
955
955
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
956
956
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
957
957
|
* @param {string} [params.marginMode] *isolated* fetches the isolated margin balance
|
|
958
|
-
* @returns {object} a [balance structure]{@link https://
|
|
958
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
959
959
|
*/
|
|
960
960
|
await this.loadMarkets();
|
|
961
961
|
let marginMode = undefined;
|
|
@@ -1003,7 +1003,7 @@ export default class exmo extends Exchange {
|
|
|
1003
1003
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1004
1004
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1005
1005
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1006
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
1006
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1007
1007
|
*/
|
|
1008
1008
|
await this.loadMarkets();
|
|
1009
1009
|
const market = this.market(symbol);
|
|
@@ -1025,7 +1025,7 @@ export default class exmo extends Exchange {
|
|
|
1025
1025
|
* @param {string[]|undefined} symbols list of unified market symbols, all symbols fetched if undefined, default is undefined
|
|
1026
1026
|
* @param {int} [limit] max number of entries per orderbook to return, default is undefined
|
|
1027
1027
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1028
|
-
* @returns {object} a dictionary of [order book structures]{@link https://
|
|
1028
|
+
* @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol
|
|
1029
1029
|
*/
|
|
1030
1030
|
await this.loadMarkets();
|
|
1031
1031
|
let ids = undefined;
|
|
@@ -1104,7 +1104,7 @@ export default class exmo extends Exchange {
|
|
|
1104
1104
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
1105
1105
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1106
1106
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1107
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
1107
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1108
1108
|
*/
|
|
1109
1109
|
await this.loadMarkets();
|
|
1110
1110
|
symbols = this.marketSymbols(symbols);
|
|
@@ -1142,7 +1142,7 @@ export default class exmo extends Exchange {
|
|
|
1142
1142
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1143
1143
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1144
1144
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1145
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
1145
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1146
1146
|
*/
|
|
1147
1147
|
await this.loadMarkets();
|
|
1148
1148
|
const response = await this.publicGetTicker(params);
|
|
@@ -1248,7 +1248,7 @@ export default class exmo extends Exchange {
|
|
|
1248
1248
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1249
1249
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1250
1250
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1251
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1251
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1252
1252
|
*/
|
|
1253
1253
|
await this.loadMarkets();
|
|
1254
1254
|
const market = this.market(symbol);
|
|
@@ -1295,9 +1295,11 @@ export default class exmo extends Exchange {
|
|
|
1295
1295
|
*
|
|
1296
1296
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
1297
1297
|
* @param {int} [params.offset] last deal offset, default = 0
|
|
1298
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
1298
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1299
1299
|
*/
|
|
1300
|
-
|
|
1300
|
+
if (symbol === undefined) {
|
|
1301
|
+
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
1302
|
+
}
|
|
1301
1303
|
let marginMode = undefined;
|
|
1302
1304
|
[marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
|
|
1303
1305
|
if (marginMode === 'cross') {
|
|
@@ -1399,7 +1401,7 @@ export default class exmo extends Exchange {
|
|
|
1399
1401
|
* @param {float} [params.stopPrice] the price at which a trigger order is triggered at
|
|
1400
1402
|
* @param {string} [params.timeInForce] *spot only* 'fok', 'ioc' or 'post_only'
|
|
1401
1403
|
* @param {boolean} [params.postOnly] *spot only* true for post only orders
|
|
1402
|
-
* @returns {object} an [order structure]{@link https://
|
|
1404
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1403
1405
|
*/
|
|
1404
1406
|
await this.loadMarkets();
|
|
1405
1407
|
const market = this.market(symbol);
|
|
@@ -1511,7 +1513,7 @@ export default class exmo extends Exchange {
|
|
|
1511
1513
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1512
1514
|
* @param {boolean} [params.trigger] true to cancel a trigger order
|
|
1513
1515
|
* @param {string} [params.marginMode] set to 'cross' or 'isolated' to cancel a margin order
|
|
1514
|
-
* @returns {object} An [order structure]{@link https://
|
|
1516
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1515
1517
|
*/
|
|
1516
1518
|
await this.loadMarkets();
|
|
1517
1519
|
const request = {};
|
|
@@ -1559,7 +1561,7 @@ export default class exmo extends Exchange {
|
|
|
1559
1561
|
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#cf27781e-28e5-4b39-a52d-3110f5d22459 // spot
|
|
1560
1562
|
* @param {string} symbol not used by exmo fetchOrder
|
|
1561
1563
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1562
|
-
* @returns {object} An [order structure]{@link https://
|
|
1564
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1563
1565
|
*/
|
|
1564
1566
|
await this.loadMarkets();
|
|
1565
1567
|
const request = {
|
|
@@ -1604,7 +1606,7 @@ export default class exmo extends Exchange {
|
|
|
1604
1606
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
1605
1607
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1606
1608
|
* @param {string} [params.marginMode] set to "isolated" to fetch trades for a margin order
|
|
1607
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
1609
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1608
1610
|
*/
|
|
1609
1611
|
let marginMode = undefined;
|
|
1610
1612
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOrderTrades', params);
|
|
@@ -1681,7 +1683,7 @@ export default class exmo extends Exchange {
|
|
|
1681
1683
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1682
1684
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1683
1685
|
* @param {string} [params.marginMode] set to "isolated" for margin orders
|
|
1684
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1686
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1685
1687
|
*/
|
|
1686
1688
|
await this.loadMarkets();
|
|
1687
1689
|
let market = undefined;
|
|
@@ -1945,7 +1947,7 @@ export default class exmo extends Exchange {
|
|
|
1945
1947
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
1946
1948
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
1947
1949
|
* @param {string} [params.marginMode] set to "isolated" for margin orders
|
|
1948
|
-
* @returns {object} a list of [order structures]{@link https://
|
|
1950
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1949
1951
|
*/
|
|
1950
1952
|
await this.loadMarkets();
|
|
1951
1953
|
let marginMode = undefined;
|
|
@@ -2050,7 +2052,7 @@ export default class exmo extends Exchange {
|
|
|
2050
2052
|
* @param {int} [params.distance] distance for trailing stop orders
|
|
2051
2053
|
* @param {int} [params.expire] expiration timestamp in UTC timezone for the order. order will not be expired if expire is 0
|
|
2052
2054
|
* @param {string} [params.comment] optional comment for order. up to 50 latin symbols, whitespaces, underscores
|
|
2053
|
-
* @returns {object} an [order structure]{@link https://
|
|
2055
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2054
2056
|
*/
|
|
2055
2057
|
await this.loadMarkets();
|
|
2056
2058
|
const market = this.market(symbol);
|
|
@@ -2083,7 +2085,7 @@ export default class exmo extends Exchange {
|
|
|
2083
2085
|
* @description fetch the deposit address for a currency associated with this account
|
|
2084
2086
|
* @param {string} code unified currency code
|
|
2085
2087
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2086
|
-
* @returns {object} an [address structure]{@link https://
|
|
2088
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2087
2089
|
*/
|
|
2088
2090
|
await this.loadMarkets();
|
|
2089
2091
|
const response = await this.privatePostDepositAddress(params);
|
|
@@ -2132,7 +2134,7 @@ export default class exmo extends Exchange {
|
|
|
2132
2134
|
* @param {string} address the address to withdraw to
|
|
2133
2135
|
* @param {string} tag
|
|
2134
2136
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2135
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2137
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2136
2138
|
*/
|
|
2137
2139
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2138
2140
|
await this.loadMarkets();
|
|
@@ -2310,7 +2312,7 @@ export default class exmo extends Exchange {
|
|
|
2310
2312
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
2311
2313
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
2312
2314
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2313
|
-
* @returns {object} a list of [transaction structure]{@link https://
|
|
2315
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2314
2316
|
*/
|
|
2315
2317
|
await this.loadMarkets();
|
|
2316
2318
|
const request = {};
|
|
@@ -2363,7 +2365,7 @@ export default class exmo extends Exchange {
|
|
|
2363
2365
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2364
2366
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2365
2367
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2366
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2368
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2367
2369
|
*/
|
|
2368
2370
|
await this.loadMarkets();
|
|
2369
2371
|
let currency = undefined;
|
|
@@ -2415,7 +2417,7 @@ export default class exmo extends Exchange {
|
|
|
2415
2417
|
* @param {string} id withdrawal id
|
|
2416
2418
|
* @param {string} code unified currency code of the currency withdrawn, default is undefined
|
|
2417
2419
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2418
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2420
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2419
2421
|
*/
|
|
2420
2422
|
await this.loadMarkets();
|
|
2421
2423
|
let currency = undefined;
|
|
@@ -2466,7 +2468,7 @@ export default class exmo extends Exchange {
|
|
|
2466
2468
|
* @param {string} id deposit id
|
|
2467
2469
|
* @param {string} code unified currency code, default is undefined
|
|
2468
2470
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2469
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
2471
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2470
2472
|
*/
|
|
2471
2473
|
await this.loadMarkets();
|
|
2472
2474
|
let currency = undefined;
|
|
@@ -2518,7 +2520,7 @@ export default class exmo extends Exchange {
|
|
|
2518
2520
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2519
2521
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2520
2522
|
* @param {object} [params] extra parameters specific to the exmo api endpoint
|
|
2521
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
2523
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2522
2524
|
*/
|
|
2523
2525
|
await this.loadMarkets();
|
|
2524
2526
|
let currency = undefined;
|