ccxt 4.2.30 → 4.2.34
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/.gitattributes +1 -0
- package/CONTRIBUTING.md +20 -1
- package/README.md +9 -9
- package/build.sh +9 -2
- package/cleanup.sh +3 -0
- package/dist/ccxt.browser.js +1136 -561
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +3 -2
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +66 -24
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/binance.js +6 -5
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +12 -0
- package/dist/cjs/src/bitfinex2.js +415 -41
- package/dist/cjs/src/bitforex.js +3 -0
- package/dist/cjs/src/bitget.js +3 -3
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitrue.js +3 -3
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/coinbase.js +12 -2
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/cryptocom.js +10 -10
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/gate.js +34 -29
- package/dist/cjs/src/htx.js +1 -1
- package/dist/cjs/src/kraken.js +42 -1
- package/dist/cjs/src/krakenfutures.js +3 -0
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/lbank.js +27 -26
- package/dist/cjs/src/mexc.js +2 -1
- package/dist/cjs/src/okx.js +20 -5
- package/dist/cjs/src/phemex.js +8 -8
- package/dist/cjs/src/poloniexfutures.js +3 -0
- package/dist/cjs/src/pro/alpaca.js +8 -4
- package/dist/cjs/src/pro/ascendex.js +1 -2
- package/dist/cjs/src/pro/binance.js +14 -10
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +21 -24
- package/dist/cjs/src/pro/bitfinex2.js +13 -17
- package/dist/cjs/src/pro/bitget.js +3 -1
- package/dist/cjs/src/pro/bitmart.js +3 -8
- package/dist/cjs/src/pro/bitmex.js +4 -7
- package/dist/cjs/src/pro/bitopro.js +2 -5
- package/dist/cjs/src/pro/bitrue.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +2 -3
- package/dist/cjs/src/pro/bitvavo.js +12 -5
- package/dist/cjs/src/pro/blockchaincom.js +22 -23
- package/dist/cjs/src/pro/bybit.js +5 -5
- package/dist/cjs/src/pro/cex.js +7 -7
- package/dist/cjs/src/pro/coinbase.js +3 -2
- package/dist/cjs/src/pro/coinbasepro.js +1 -1
- package/dist/cjs/src/pro/coinex.js +15 -13
- package/dist/cjs/src/pro/currencycom.js +5 -7
- package/dist/cjs/src/pro/deribit.js +4 -4
- package/dist/cjs/src/pro/exmo.js +15 -13
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/gemini.js +4 -2
- package/dist/cjs/src/pro/hitbtc.js +9 -8
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/htx.js +6 -7
- package/dist/cjs/src/pro/huobijp.js +3 -5
- package/dist/cjs/src/pro/idex.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +14 -13
- package/dist/cjs/src/pro/kraken.js +10 -16
- package/dist/cjs/src/pro/krakenfutures.js +10 -6
- package/dist/cjs/src/pro/kucoin.js +10 -11
- package/dist/cjs/src/pro/kucoinfutures.js +12 -11
- package/dist/cjs/src/pro/lbank.js +10 -10
- package/dist/cjs/src/pro/luno.js +12 -14
- package/dist/cjs/src/pro/mexc.js +3 -2
- package/dist/cjs/src/pro/ndax.js +7 -13
- package/dist/cjs/src/pro/okcoin.js +7 -12
- package/dist/cjs/src/pro/okx.js +6 -11
- package/dist/cjs/src/pro/onetrading.js +16 -15
- package/dist/cjs/src/pro/p2b.js +5 -3
- package/dist/cjs/src/pro/phemex.js +16 -11
- package/dist/cjs/src/pro/poloniex.js +6 -4
- package/dist/cjs/src/pro/poloniexfutures.js +14 -9
- package/dist/cjs/src/pro/probit.js +15 -11
- package/dist/cjs/src/pro/upbit.js +8 -8
- package/dist/cjs/src/pro/wazirx.js +6 -3
- package/dist/cjs/src/pro/woo.js +8 -6
- package/dist/cjs/src/probit.js +3 -3
- package/dist/cjs/src/timex.js +1 -1
- package/dist/cjs/src/tokocrypto.js +2 -2
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/dist/cjs/src/whitebit.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/yobit.js +39 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinbase.d.ts +10 -0
- package/js/src/abstract/okx.d.ts +12 -1
- package/js/src/ace.d.ts +1 -1
- package/js/src/ace.js +3 -2
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/ascendex.d.ts +5 -15
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +88 -79
- package/js/src/base/Exchange.js +66 -24
- package/js/src/base/types.d.ts +90 -6
- package/js/src/bigone.d.ts +5 -15
- package/js/src/bigone.js +21 -1
- package/js/src/binance.d.ts +13 -23
- package/js/src/binance.js +6 -5
- package/js/src/bingx.d.ts +6 -16
- package/js/src/bingx.js +4 -3
- package/js/src/bit2c.d.ts +1 -1
- package/js/src/bit2c.js +12 -0
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +1 -1
- package/js/src/bitfinex.d.ts +5 -5
- package/js/src/bitfinex2.d.ts +11 -16
- package/js/src/bitfinex2.js +415 -41
- package/js/src/bitflyer.d.ts +5 -5
- package/js/src/bitforex.d.ts +1 -1
- package/js/src/bitforex.js +3 -0
- package/js/src/bitget.d.ts +8 -38
- package/js/src/bitget.js +3 -3
- package/js/src/bithumb.d.ts +2 -2
- package/js/src/bitmart.d.ts +10 -21
- package/js/src/bitmart.js +1 -1
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitrue.d.ts +5 -15
- package/js/src/bitrue.js +3 -3
- package/js/src/bitso.d.ts +4 -4
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitteam.d.ts +1 -1
- package/js/src/bitvavo.d.ts +3 -3
- package/js/src/bl3p.d.ts +1 -1
- package/js/src/blockchaincom.d.ts +2 -2
- package/js/src/blockchaincom.js +1 -1
- package/js/src/btcalpha.d.ts +1 -1
- package/js/src/btcbox.d.ts +1 -1
- package/js/src/btcmarkets.d.ts +3 -3
- package/js/src/btcturk.d.ts +1 -1
- package/js/src/bybit.d.ts +8 -8
- package/js/src/bybit.js +1 -1
- package/js/src/cex.d.ts +1 -1
- package/js/src/coinbase.d.ts +6 -50
- package/js/src/coinbase.js +12 -2
- package/js/src/coinbasepro.d.ts +2 -2
- package/js/src/coincheck.d.ts +1 -1
- package/js/src/coinex.d.ts +8 -8
- package/js/src/coinex.js +1 -1
- package/js/src/coinlist.d.ts +4 -14
- package/js/src/coinmate.d.ts +2 -2
- package/js/src/coinmetro.d.ts +2 -2
- package/js/src/coinone.d.ts +1 -1
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinspot.d.ts +1 -1
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/cryptocom.js +10 -10
- package/js/src/currencycom.d.ts +2 -2
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +4 -14
- package/js/src/deribit.js +1 -0
- package/js/src/digifinex.d.ts +10 -38
- package/js/src/exmo.d.ts +2 -2
- package/js/src/gate.d.ts +8 -18
- package/js/src/gate.js +34 -29
- package/js/src/gemini.d.ts +2 -2
- package/js/src/hitbtc.d.ts +6 -16
- package/js/src/hollaex.d.ts +2 -2
- package/js/src/htx.d.ts +11 -21
- package/js/src/htx.js +1 -1
- package/js/src/huobijp.d.ts +4 -4
- package/js/src/idex.d.ts +3 -3
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/kraken.d.ts +5 -5
- package/js/src/kraken.js +42 -1
- package/js/src/krakenfutures.d.ts +7 -7
- package/js/src/krakenfutures.js +3 -0
- package/js/src/kucoin.d.ts +8 -29
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.d.ts +4 -4
- package/js/src/kuna.d.ts +2 -2
- package/js/src/latoken.d.ts +4 -14
- package/js/src/lbank.d.ts +3 -6
- package/js/src/lbank.js +27 -26
- package/js/src/luno.d.ts +1 -1
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mexc.d.ts +6 -6
- package/js/src/mexc.js +2 -1
- package/js/src/ndax.d.ts +2 -2
- package/js/src/novadax.d.ts +4 -15
- package/js/src/oceanex.d.ts +1 -1
- package/js/src/okcoin.d.ts +5 -15
- package/js/src/okx.d.ts +8 -18
- package/js/src/okx.js +20 -5
- package/js/src/onetrading.d.ts +2 -2
- package/js/src/p2b.d.ts +1 -1
- package/js/src/paymium.d.ts +3 -13
- package/js/src/phemex.d.ts +5 -5
- package/js/src/phemex.js +8 -8
- package/js/src/poloniex.d.ts +4 -14
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +3 -0
- package/js/src/pro/alpaca.d.ts +2 -2
- package/js/src/pro/alpaca.js +8 -4
- package/js/src/pro/ascendex.d.ts +2 -2
- package/js/src/pro/ascendex.js +1 -2
- package/js/src/pro/binance.d.ts +3 -3
- package/js/src/pro/binance.js +14 -10
- package/js/src/pro/bingx.d.ts +1 -1
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.d.ts +2 -2
- package/js/src/pro/bitfinex.js +21 -24
- package/js/src/pro/bitfinex2.d.ts +2 -2
- package/js/src/pro/bitfinex2.js +13 -17
- package/js/src/pro/bitget.js +3 -1
- package/js/src/pro/bitmart.d.ts +3 -3
- package/js/src/pro/bitmart.js +3 -8
- package/js/src/pro/bitmex.d.ts +1 -1
- package/js/src/pro/bitmex.js +4 -7
- package/js/src/pro/bitopro.d.ts +1 -1
- package/js/src/pro/bitopro.js +2 -5
- package/js/src/pro/bitrue.js +1 -1
- package/js/src/pro/bitstamp.d.ts +1 -1
- package/js/src/pro/bitstamp.js +2 -3
- package/js/src/pro/bitvavo.d.ts +3 -3
- package/js/src/pro/bitvavo.js +12 -5
- package/js/src/pro/blockchaincom.d.ts +8 -8
- package/js/src/pro/blockchaincom.js +22 -23
- package/js/src/pro/bybit.d.ts +2 -2
- package/js/src/pro/bybit.js +5 -5
- package/js/src/pro/cex.d.ts +1 -1
- package/js/src/pro/cex.js +7 -7
- package/js/src/pro/coinbase.d.ts +1 -1
- package/js/src/pro/coinbase.js +3 -2
- package/js/src/pro/coinbasepro.d.ts +1 -1
- package/js/src/pro/coinbasepro.js +1 -1
- package/js/src/pro/coinex.d.ts +2 -2
- package/js/src/pro/coinex.js +15 -13
- package/js/src/pro/currencycom.d.ts +1 -1
- package/js/src/pro/currencycom.js +5 -7
- package/js/src/pro/deribit.d.ts +2 -2
- package/js/src/pro/deribit.js +4 -4
- package/js/src/pro/exmo.d.ts +2 -2
- package/js/src/pro/exmo.js +15 -13
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/gemini.d.ts +1 -1
- package/js/src/pro/gemini.js +4 -2
- package/js/src/pro/hitbtc.d.ts +2 -2
- package/js/src/pro/hitbtc.js +9 -8
- package/js/src/pro/hollaex.d.ts +2 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/htx.d.ts +2 -2
- package/js/src/pro/htx.js +6 -7
- package/js/src/pro/huobijp.d.ts +1 -1
- package/js/src/pro/huobijp.js +3 -5
- package/js/src/pro/idex.js +1 -1
- package/js/src/pro/independentreserve.d.ts +1 -1
- package/js/src/pro/independentreserve.js +14 -13
- package/js/src/pro/kraken.d.ts +2 -2
- package/js/src/pro/kraken.js +10 -16
- package/js/src/pro/krakenfutures.d.ts +1 -1
- package/js/src/pro/krakenfutures.js +10 -6
- package/js/src/pro/kucoin.d.ts +3 -3
- package/js/src/pro/kucoin.js +10 -11
- package/js/src/pro/kucoinfutures.d.ts +3 -3
- package/js/src/pro/kucoinfutures.js +12 -11
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/lbank.js +10 -10
- package/js/src/pro/luno.d.ts +2 -2
- package/js/src/pro/luno.js +12 -14
- package/js/src/pro/mexc.d.ts +2 -2
- package/js/src/pro/mexc.js +3 -2
- package/js/src/pro/ndax.d.ts +3 -3
- package/js/src/pro/ndax.js +7 -13
- package/js/src/pro/okcoin.d.ts +1 -1
- package/js/src/pro/okcoin.js +7 -12
- package/js/src/pro/okx.d.ts +1 -1
- package/js/src/pro/okx.js +6 -11
- package/js/src/pro/onetrading.d.ts +1 -1
- package/js/src/pro/onetrading.js +16 -15
- package/js/src/pro/p2b.d.ts +1 -1
- package/js/src/pro/p2b.js +5 -3
- package/js/src/pro/phemex.d.ts +3 -3
- package/js/src/pro/phemex.js +16 -11
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -4
- package/js/src/pro/poloniexfutures.d.ts +4 -4
- package/js/src/pro/poloniexfutures.js +13 -10
- package/js/src/pro/probit.d.ts +1 -1
- package/js/src/pro/probit.js +14 -12
- package/js/src/pro/upbit.js +8 -8
- package/js/src/pro/wazirx.d.ts +1 -1
- package/js/src/pro/wazirx.js +6 -3
- package/js/src/pro/woo.d.ts +3 -3
- package/js/src/pro/woo.js +8 -6
- package/js/src/probit.d.ts +3 -3
- package/js/src/probit.js +3 -3
- package/js/src/timex.d.ts +1 -1
- package/js/src/timex.js +1 -1
- package/js/src/tokocrypto.d.ts +3 -3
- package/js/src/tokocrypto.js +2 -2
- package/js/src/upbit.d.ts +2 -2
- package/js/src/wavesexchange.d.ts +3 -4
- package/js/src/wavesexchange.js +2 -1
- package/js/src/wazirx.d.ts +1 -1
- package/js/src/whitebit.d.ts +5 -15
- package/js/src/whitebit.js +1 -1
- package/js/src/woo.d.ts +5 -15
- package/js/src/woo.js +1 -1
- package/js/src/yobit.d.ts +21 -6
- package/js/src/yobit.js +39 -0
- package/js/src/zaif.d.ts +2 -2
- package/js/src/zonda.d.ts +4 -14
- package/package.json +22 -8
- package/skip-tests.json +9 -1
- package/tests-manager.sh +1 -2
package/dist/ccxt.browser.js
CHANGED
|
@@ -2484,8 +2484,9 @@ class ace extends _abstract_ace_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
2484
2484
|
const feedback = this.id + ' ' + body;
|
|
2485
2485
|
const status = this.safeNumber(response, 'status', 200);
|
|
2486
2486
|
if (status > 200) {
|
|
2487
|
-
|
|
2488
|
-
this.
|
|
2487
|
+
const statusStr = status.toString();
|
|
2488
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], statusStr, feedback);
|
|
2489
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], statusStr, feedback);
|
|
2489
2490
|
}
|
|
2490
2491
|
return undefined;
|
|
2491
2492
|
}
|
|
@@ -6767,7 +6768,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
6767
6768
|
* @method
|
|
6768
6769
|
* @name ascendex#transfer
|
|
6769
6770
|
* @description transfer currency internally between wallets on the same account
|
|
6770
|
-
* @param {string} code unified currency
|
|
6771
|
+
* @param {string} code unified currency codeåå
|
|
6771
6772
|
* @param {float} amount amount to transfer
|
|
6772
6773
|
* @param {string} fromAccount account to transfer from
|
|
6773
6774
|
* @param {string} toAccount account to transfer to
|
|
@@ -7043,6 +7044,7 @@ const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sor
|
|
|
7043
7044
|
*/
|
|
7044
7045
|
class Exchange {
|
|
7045
7046
|
constructor(userConfig = {}) {
|
|
7047
|
+
this.throttleProp = undefined;
|
|
7046
7048
|
this.api = undefined;
|
|
7047
7049
|
this.userAgent = undefined;
|
|
7048
7050
|
this.user_agent = undefined;
|
|
@@ -7124,6 +7126,7 @@ class Exchange {
|
|
|
7124
7126
|
this.clients = {};
|
|
7125
7127
|
this.newUpdates = true;
|
|
7126
7128
|
this.streaming = {};
|
|
7129
|
+
this.alias = false;
|
|
7127
7130
|
this.deepExtend = deepExtend;
|
|
7128
7131
|
this.isNode = isNode;
|
|
7129
7132
|
this.keys = _functions_js__WEBPACK_IMPORTED_MODULE_1__/* .keys */ .XP;
|
|
@@ -7705,7 +7708,7 @@ class Exchange {
|
|
|
7705
7708
|
// @ts-ignore
|
|
7706
7709
|
this.httpProxyAgentModule = await import(/* webpackIgnore: true */ 'https-proxy-agent');
|
|
7707
7710
|
}
|
|
7708
|
-
catch { }
|
|
7711
|
+
catch (e) { }
|
|
7709
7712
|
}
|
|
7710
7713
|
if (this.socksProxyAgentModuleChecked === false) {
|
|
7711
7714
|
this.socksProxyAgentModuleChecked = true;
|
|
@@ -7967,7 +7970,7 @@ class Exchange {
|
|
|
7967
7970
|
const markets = await this.fetchMarkets(params);
|
|
7968
7971
|
return this.setMarkets(markets, currencies);
|
|
7969
7972
|
}
|
|
7970
|
-
loadMarkets(reload = false, params = {}) {
|
|
7973
|
+
async loadMarkets(reload = false, params = {}) {
|
|
7971
7974
|
// this method is async, it returns a promise
|
|
7972
7975
|
if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
|
|
7973
7976
|
this.reloadingMarkets = true;
|
|
@@ -7981,28 +7984,28 @@ class Exchange {
|
|
|
7981
7984
|
}
|
|
7982
7985
|
return this.marketsLoading;
|
|
7983
7986
|
}
|
|
7984
|
-
fetchCurrencies(params = {}) {
|
|
7987
|
+
async fetchCurrencies(params = {}) {
|
|
7985
7988
|
// markets are returned as a list
|
|
7986
7989
|
// currencies are returned as a dict
|
|
7987
7990
|
// this is for historical reasons
|
|
7988
7991
|
// and may be changed for consistency later
|
|
7989
7992
|
return new Promise((resolve, reject) => resolve(this.currencies));
|
|
7990
7993
|
}
|
|
7991
|
-
fetchCurrenciesWs(params = {}) {
|
|
7994
|
+
async fetchCurrenciesWs(params = {}) {
|
|
7992
7995
|
// markets are returned as a list
|
|
7993
7996
|
// currencies are returned as a dict
|
|
7994
7997
|
// this is for historical reasons
|
|
7995
7998
|
// and may be changed for consistency later
|
|
7996
7999
|
return new Promise((resolve, reject) => resolve(this.currencies));
|
|
7997
8000
|
}
|
|
7998
|
-
fetchMarkets(params = {}) {
|
|
8001
|
+
async fetchMarkets(params = {}) {
|
|
7999
8002
|
// markets are returned as a list
|
|
8000
8003
|
// currencies are returned as a dict
|
|
8001
8004
|
// this is for historical reasons
|
|
8002
8005
|
// and may be changed for consistency later
|
|
8003
8006
|
return new Promise((resolve, reject) => resolve(Object.values(this.markets)));
|
|
8004
8007
|
}
|
|
8005
|
-
fetchMarketsWs(params = {}) {
|
|
8008
|
+
async fetchMarketsWs(params = {}) {
|
|
8006
8009
|
// markets are returned as a list
|
|
8007
8010
|
// currencies are returned as a dict
|
|
8008
8011
|
// this is for historical reasons
|
|
@@ -8077,6 +8080,9 @@ class Exchange {
|
|
|
8077
8080
|
}
|
|
8078
8081
|
handleMessage(client, message) { } // stub to override
|
|
8079
8082
|
// ping (client) {} // stub to override
|
|
8083
|
+
ping(client) {
|
|
8084
|
+
return undefined;
|
|
8085
|
+
}
|
|
8080
8086
|
client(url) {
|
|
8081
8087
|
this.clients = this.clients || {};
|
|
8082
8088
|
if (!this.clients[url]) {
|
|
@@ -8693,7 +8699,7 @@ class Exchange {
|
|
|
8693
8699
|
}
|
|
8694
8700
|
return result;
|
|
8695
8701
|
}
|
|
8696
|
-
filterByLimit(array, limit = undefined, key = 'timestamp') {
|
|
8702
|
+
filterByLimit(array, limit = undefined, key = 'timestamp', fromStart = false) {
|
|
8697
8703
|
if (this.valueIsDefined(limit)) {
|
|
8698
8704
|
const arrayLength = array.length;
|
|
8699
8705
|
if (arrayLength > 0) {
|
|
@@ -8705,7 +8711,15 @@ class Exchange {
|
|
|
8705
8711
|
ascending = first <= last; // true if array is sorted in ascending order based on 'timestamp'
|
|
8706
8712
|
}
|
|
8707
8713
|
}
|
|
8708
|
-
|
|
8714
|
+
if (fromStart) {
|
|
8715
|
+
if (limit > arrayLength) {
|
|
8716
|
+
limit = arrayLength;
|
|
8717
|
+
}
|
|
8718
|
+
array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
|
|
8719
|
+
}
|
|
8720
|
+
else {
|
|
8721
|
+
array = ascending ? this.arraySlice(array, -limit) : this.arraySlice(array, 0, limit);
|
|
8722
|
+
}
|
|
8709
8723
|
}
|
|
8710
8724
|
}
|
|
8711
8725
|
return array;
|
|
@@ -8727,7 +8741,10 @@ class Exchange {
|
|
|
8727
8741
|
if (tail && limit !== undefined) {
|
|
8728
8742
|
return this.arraySlice(result, -limit);
|
|
8729
8743
|
}
|
|
8730
|
-
|
|
8744
|
+
// if the user provided a 'since' argument
|
|
8745
|
+
// we want to limit the result starting from the 'since'
|
|
8746
|
+
const shouldFilterFromStart = !tail && sinceIsDefined;
|
|
8747
|
+
return this.filterByLimit(result, limit, key, shouldFilterFromStart);
|
|
8731
8748
|
}
|
|
8732
8749
|
filterByValueSinceLimit(array, field, value = undefined, since = undefined, limit = undefined, key = 'timestamp', tail = false) {
|
|
8733
8750
|
const valueIsDefined = this.valueIsDefined(value);
|
|
@@ -8752,7 +8769,7 @@ class Exchange {
|
|
|
8752
8769
|
if (tail && limit !== undefined) {
|
|
8753
8770
|
return this.arraySlice(result, -limit);
|
|
8754
8771
|
}
|
|
8755
|
-
return this.filterByLimit(result, limit, key);
|
|
8772
|
+
return this.filterByLimit(result, limit, key, sinceIsDefined);
|
|
8756
8773
|
}
|
|
8757
8774
|
setSandboxMode(enabled) {
|
|
8758
8775
|
if (enabled) {
|
|
@@ -8926,6 +8943,18 @@ class Exchange {
|
|
|
8926
8943
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
8927
8944
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setLeverage() is not supported yet');
|
|
8928
8945
|
}
|
|
8946
|
+
async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
|
|
8947
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterestHistory() is not supported yet');
|
|
8948
|
+
}
|
|
8949
|
+
async fetchOpenInterest(symbol, params = {}) {
|
|
8950
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
|
|
8951
|
+
}
|
|
8952
|
+
async signIn(params = {}) {
|
|
8953
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' signIn() is not supported yet');
|
|
8954
|
+
}
|
|
8955
|
+
async fetchPaymentMethods(params = {}) {
|
|
8956
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchPaymentMethods() is not supported yet');
|
|
8957
|
+
}
|
|
8929
8958
|
parseToInt(number) {
|
|
8930
8959
|
// Solve Common parseInt misuse ex: parseInt ((since / 1000).toString ())
|
|
8931
8960
|
// using a number as parameter which is not valid in ts
|
|
@@ -10536,6 +10565,15 @@ class Exchange {
|
|
|
10536
10565
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
10537
10566
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBidsAsks() is not supported yet');
|
|
10538
10567
|
}
|
|
10568
|
+
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
10569
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBorrowInterest() is not supported yet');
|
|
10570
|
+
}
|
|
10571
|
+
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
10572
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchLedger() is not supported yet');
|
|
10573
|
+
}
|
|
10574
|
+
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
10575
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
|
|
10576
|
+
}
|
|
10539
10577
|
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
10540
10578
|
const price = this.safeNumber(bidask, priceKey);
|
|
10541
10579
|
const amount = this.safeNumber(bidask, amountKey);
|
|
@@ -10836,6 +10874,9 @@ class Exchange {
|
|
|
10836
10874
|
return this.handleOptionAndParams(params, methodName, 'marginMode', defaultValue);
|
|
10837
10875
|
}
|
|
10838
10876
|
throwExactlyMatchedException(exact, string, message) {
|
|
10877
|
+
if (string === undefined) {
|
|
10878
|
+
return;
|
|
10879
|
+
}
|
|
10839
10880
|
if (string in exact) {
|
|
10840
10881
|
throw new exact[string](message);
|
|
10841
10882
|
}
|
|
@@ -11259,21 +11300,18 @@ class Exchange {
|
|
|
11259
11300
|
*/
|
|
11260
11301
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
|
|
11261
11302
|
}
|
|
11262
|
-
async fetchDeposits(
|
|
11303
|
+
async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11263
11304
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDeposits() is not supported yet');
|
|
11264
11305
|
}
|
|
11306
|
+
async fetchWithdrawals(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11307
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
|
|
11308
|
+
}
|
|
11265
11309
|
async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11266
11310
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
|
|
11267
11311
|
}
|
|
11268
|
-
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11269
|
-
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
|
|
11270
|
-
}
|
|
11271
11312
|
async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11272
11313
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
|
|
11273
11314
|
}
|
|
11274
|
-
async fetchOpenInterest(symbol, params = {}) {
|
|
11275
|
-
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
|
|
11276
|
-
}
|
|
11277
11315
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11278
11316
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
|
|
11279
11317
|
}
|
|
@@ -11361,7 +11399,7 @@ class Exchange {
|
|
|
11361
11399
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
|
|
11362
11400
|
}
|
|
11363
11401
|
handleWithdrawTagAndParams(tag, params) {
|
|
11364
|
-
if (typeof tag === 'object') {
|
|
11402
|
+
if ((tag !== undefined) && (typeof tag === 'object')) {
|
|
11365
11403
|
params = this.extend(tag, params);
|
|
11366
11404
|
tag = undefined;
|
|
11367
11405
|
}
|
|
@@ -11495,14 +11533,14 @@ class Exchange {
|
|
|
11495
11533
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchMarketLeverageTiers() is not supported yet');
|
|
11496
11534
|
}
|
|
11497
11535
|
}
|
|
11498
|
-
async createPostOnlyOrder(symbol, type, side, amount, price, params = {}) {
|
|
11536
|
+
async createPostOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
11499
11537
|
if (!this.has['createPostOnlyOrder']) {
|
|
11500
11538
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createPostOnlyOrder() is not supported yet');
|
|
11501
11539
|
}
|
|
11502
11540
|
const query = this.extend(params, { 'postOnly': true });
|
|
11503
11541
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
11504
11542
|
}
|
|
11505
|
-
async createReduceOnlyOrder(symbol, type, side, amount, price, params = {}) {
|
|
11543
|
+
async createReduceOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
11506
11544
|
if (!this.has['createReduceOnlyOrder']) {
|
|
11507
11545
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createReduceOnlyOrder() is not supported yet');
|
|
11508
11546
|
}
|
|
@@ -12125,7 +12163,8 @@ class Exchange {
|
|
|
12125
12163
|
const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
|
|
12126
12164
|
const responseLength = response.length;
|
|
12127
12165
|
if (this.verbose) {
|
|
12128
|
-
|
|
12166
|
+
const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
|
|
12167
|
+
this.log(backwardMessage);
|
|
12129
12168
|
}
|
|
12130
12169
|
if (responseLength === 0) {
|
|
12131
12170
|
break;
|
|
@@ -12143,7 +12182,8 @@ class Exchange {
|
|
|
12143
12182
|
const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
|
|
12144
12183
|
const responseLength = response.length;
|
|
12145
12184
|
if (this.verbose) {
|
|
12146
|
-
|
|
12185
|
+
const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
|
|
12186
|
+
this.log(forwardMessage);
|
|
12147
12187
|
}
|
|
12148
12188
|
if (responseLength === 0) {
|
|
12149
12189
|
break;
|
|
@@ -12189,6 +12229,7 @@ class Exchange {
|
|
|
12189
12229
|
throw e;
|
|
12190
12230
|
}
|
|
12191
12231
|
}
|
|
12232
|
+
return undefined;
|
|
12192
12233
|
}
|
|
12193
12234
|
async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
|
|
12194
12235
|
let maxCalls = undefined;
|
|
@@ -12253,7 +12294,8 @@ class Exchange {
|
|
|
12253
12294
|
errors = 0;
|
|
12254
12295
|
const responseLength = response.length;
|
|
12255
12296
|
if (this.verbose) {
|
|
12256
|
-
|
|
12297
|
+
const cursorMessage = 'Cursor pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength + ' cursor ' + cursorValue;
|
|
12298
|
+
this.log(cursorMessage);
|
|
12257
12299
|
}
|
|
12258
12300
|
if (responseLength === 0) {
|
|
12259
12301
|
break;
|
|
@@ -12297,7 +12339,8 @@ class Exchange {
|
|
|
12297
12339
|
errors = 0;
|
|
12298
12340
|
const responseLength = response.length;
|
|
12299
12341
|
if (this.verbose) {
|
|
12300
|
-
|
|
12342
|
+
const incrementalMessage = 'Incremental pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength;
|
|
12343
|
+
this.log(incrementalMessage);
|
|
12301
12344
|
}
|
|
12302
12345
|
if (responseLength === 0) {
|
|
12303
12346
|
break;
|
|
@@ -16173,6 +16216,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16173
16216
|
* @method
|
|
16174
16217
|
* @name bigone#fetchMarkets
|
|
16175
16218
|
* @description retrieves data on all markets for bigone
|
|
16219
|
+
* @see https://open.big.one/docs/spot_asset_pair.html
|
|
16176
16220
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16177
16221
|
* @returns {object[]} an array of objects representing market data
|
|
16178
16222
|
*/
|
|
@@ -16435,6 +16479,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16435
16479
|
* @method
|
|
16436
16480
|
* @name bigone#fetchTicker
|
|
16437
16481
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
16482
|
+
* @see https://open.big.one/docs/spot_tickers.html
|
|
16438
16483
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
16439
16484
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16440
16485
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -16477,6 +16522,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16477
16522
|
* @method
|
|
16478
16523
|
* @name bigone#fetchTickers
|
|
16479
16524
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
16525
|
+
* @see https://open.big.one/docs/spot_tickers.html
|
|
16480
16526
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
16481
16527
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16482
16528
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -16564,6 +16610,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16564
16610
|
* @method
|
|
16565
16611
|
* @name bigone#fetchTime
|
|
16566
16612
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
16613
|
+
* @see https://open.big.one/docs/spot_ping.html
|
|
16567
16614
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16568
16615
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
16569
16616
|
*/
|
|
@@ -16584,6 +16631,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16584
16631
|
* @method
|
|
16585
16632
|
* @name bigone#fetchOrderBook
|
|
16586
16633
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
16634
|
+
* @see https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot
|
|
16587
16635
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
16588
16636
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
16589
16637
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -16826,6 +16874,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16826
16874
|
* @method
|
|
16827
16875
|
* @name bigone#fetchTrades
|
|
16828
16876
|
* @description get the list of most recent trades for a particular symbol
|
|
16877
|
+
* @see https://open.big.one/docs/spot_asset_pair_trade.html
|
|
16829
16878
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
16830
16879
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
16831
16880
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -16890,6 +16939,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16890
16939
|
* @method
|
|
16891
16940
|
* @name bigone#fetchOHLCV
|
|
16892
16941
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
16942
|
+
* @see https://open.big.one/docs/spot_asset_pair_candle.html
|
|
16893
16943
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
16894
16944
|
* @param {string} timeframe the length of time each candle represents
|
|
16895
16945
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -16966,6 +17016,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16966
17016
|
* @method
|
|
16967
17017
|
* @name bigone#fetchBalance
|
|
16968
17018
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
17019
|
+
* @see https://open.big.one/docs/fund_accounts.html
|
|
17020
|
+
* @see https://open.big.one/docs/spot_accounts.html
|
|
16969
17021
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16970
17022
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
16971
17023
|
*/
|
|
@@ -17211,6 +17263,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17211
17263
|
* @method
|
|
17212
17264
|
* @name bigone#cancelOrder
|
|
17213
17265
|
* @description cancels an open order
|
|
17266
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-order
|
|
17214
17267
|
* @param {string} id order id
|
|
17215
17268
|
* @param {string} symbol Not used by bigone cancelOrder ()
|
|
17216
17269
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -17239,6 +17292,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17239
17292
|
* @method
|
|
17240
17293
|
* @name bigone#cancelAllOrders
|
|
17241
17294
|
* @description cancel all open orders
|
|
17295
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-all-orders
|
|
17242
17296
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
17243
17297
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17244
17298
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -17268,6 +17322,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17268
17322
|
* @method
|
|
17269
17323
|
* @name bigone#fetchOrder
|
|
17270
17324
|
* @description fetches information on an order made by the user
|
|
17325
|
+
* @see https://open.big.one/docs/spot_orders.html#get-one-order
|
|
17271
17326
|
* @param {string} symbol not used by bigone fetchOrder
|
|
17272
17327
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17273
17328
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -17283,6 +17338,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17283
17338
|
* @method
|
|
17284
17339
|
* @name bigone#fetchOrders
|
|
17285
17340
|
* @description fetches information on multiple orders made by the user
|
|
17341
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
17286
17342
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
17287
17343
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
17288
17344
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -17333,6 +17389,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17333
17389
|
* @method
|
|
17334
17390
|
* @name bigone#fetchMyTrades
|
|
17335
17391
|
* @description fetch all trades made by the user
|
|
17392
|
+
* @see https://open.big.one/docs/spot_trade.html#trades-of-user
|
|
17336
17393
|
* @param {string} symbol unified market symbol
|
|
17337
17394
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
17338
17395
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -17402,6 +17459,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17402
17459
|
* @method
|
|
17403
17460
|
* @name bigone#fetchOpenOrders
|
|
17404
17461
|
* @description fetch all unfilled currently open orders
|
|
17462
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
17405
17463
|
* @param {string} symbol unified market symbol
|
|
17406
17464
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
17407
17465
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -17418,6 +17476,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17418
17476
|
* @method
|
|
17419
17477
|
* @name bigone#fetchClosedOrders
|
|
17420
17478
|
* @description fetches information on multiple closed orders made by the user
|
|
17479
|
+
* @see https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
|
17421
17480
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
17422
17481
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
17423
17482
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -17472,6 +17531,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17472
17531
|
* @method
|
|
17473
17532
|
* @name bigone#fetchDepositAddress
|
|
17474
17533
|
* @description fetch the deposit address for a currency associated with this account
|
|
17534
|
+
* @see https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
|
|
17475
17535
|
* @param {string} code unified currency code
|
|
17476
17536
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17477
17537
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -17622,6 +17682,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17622
17682
|
* @method
|
|
17623
17683
|
* @name bigone#fetchDeposits
|
|
17624
17684
|
* @description fetch all deposits made to an account
|
|
17685
|
+
* @see https://open.big.one/docs/spot_deposit.html#deposit-of-user
|
|
17625
17686
|
* @param {string} code unified currency code
|
|
17626
17687
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
17627
17688
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -17673,6 +17734,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17673
17734
|
* @method
|
|
17674
17735
|
* @name bigone#fetchWithdrawals
|
|
17675
17736
|
* @description fetch all withdrawals made from an account
|
|
17737
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
|
|
17676
17738
|
* @param {string} code unified currency code
|
|
17677
17739
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
17678
17740
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -17778,7 +17840,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17778
17840
|
'id': undefined,
|
|
17779
17841
|
'timestamp': undefined,
|
|
17780
17842
|
'datetime': undefined,
|
|
17781
|
-
'currency':
|
|
17843
|
+
'currency': undefined,
|
|
17782
17844
|
'amount': undefined,
|
|
17783
17845
|
'fromAccount': undefined,
|
|
17784
17846
|
'toAccount': undefined,
|
|
@@ -17796,6 +17858,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17796
17858
|
* @method
|
|
17797
17859
|
* @name bigone#withdraw
|
|
17798
17860
|
* @description make a withdrawal
|
|
17861
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
|
|
17799
17862
|
* @param {string} code unified currency code
|
|
17800
17863
|
* @param {float} amount the amount to withdraw
|
|
17801
17864
|
* @param {string} address the address to withdraw to
|
|
@@ -21018,7 +21081,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
21018
21081
|
account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(debt, interest);
|
|
21019
21082
|
return account;
|
|
21020
21083
|
}
|
|
21021
|
-
|
|
21084
|
+
parseBalanceCustom(response, type = undefined, marginMode = undefined) {
|
|
21022
21085
|
const result = {
|
|
21023
21086
|
'info': response,
|
|
21024
21087
|
};
|
|
@@ -21361,7 +21424,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
21361
21424
|
// }
|
|
21362
21425
|
// ]
|
|
21363
21426
|
//
|
|
21364
|
-
return this.
|
|
21427
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
21365
21428
|
}
|
|
21366
21429
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
21367
21430
|
/**
|
|
@@ -23133,7 +23196,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
23133
23196
|
const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
|
|
23134
23197
|
const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
|
|
23135
23198
|
const trailingDelta = this.safeValue(params, 'trailingDelta');
|
|
23136
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
|
|
23199
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
23137
23200
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
23138
23201
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
23139
23202
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
@@ -23735,7 +23798,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
23735
23798
|
params = this.omit(params, 'type');
|
|
23736
23799
|
const orders = await this.fetchOrders(symbol, since, undefined, params);
|
|
23737
23800
|
const filteredOrders = this.filterBy(orders, 'status', 'canceled');
|
|
23738
|
-
return this.
|
|
23801
|
+
return this.filterBySinceLimit(filteredOrders, since, limit);
|
|
23739
23802
|
}
|
|
23740
23803
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
23741
23804
|
/**
|
|
@@ -27466,7 +27529,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
27466
27529
|
}
|
|
27467
27530
|
return this.safeValue(config, 'cost', 1);
|
|
27468
27531
|
}
|
|
27469
|
-
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}
|
|
27532
|
+
async request(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined, config = {}) {
|
|
27470
27533
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
27471
27534
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
27472
27535
|
if (api === 'private') {
|
|
@@ -28099,6 +28162,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
28099
28162
|
else {
|
|
28100
28163
|
return this.parseOpenInterest(response, market);
|
|
28101
28164
|
}
|
|
28165
|
+
return undefined;
|
|
28102
28166
|
}
|
|
28103
28167
|
parseOpenInterest(interest, market = undefined) {
|
|
28104
28168
|
const timestamp = this.safeInteger2(interest, 'timestamp', 'time');
|
|
@@ -30652,6 +30716,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30652
30716
|
}
|
|
30653
30717
|
}
|
|
30654
30718
|
if (isStopLoss || isTakeProfit) {
|
|
30719
|
+
const stringifiedAmount = this.numberToString(amount);
|
|
30655
30720
|
if (isStopLoss) {
|
|
30656
30721
|
const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
|
|
30657
30722
|
const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
|
|
@@ -30665,7 +30730,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30665
30730
|
if (slPrice !== undefined) {
|
|
30666
30731
|
slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
30667
30732
|
}
|
|
30668
|
-
const slQuantity = this.safeString(stopLoss, 'quantity',
|
|
30733
|
+
const slQuantity = this.safeString(stopLoss, 'quantity', stringifiedAmount);
|
|
30669
30734
|
slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
|
|
30670
30735
|
request['stopLoss'] = this.json(slRequest);
|
|
30671
30736
|
}
|
|
@@ -30682,7 +30747,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30682
30747
|
if (slPrice !== undefined) {
|
|
30683
30748
|
tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
30684
30749
|
}
|
|
30685
|
-
const tkQuantity = this.safeString(takeProfit, 'quantity',
|
|
30750
|
+
const tkQuantity = this.safeString(takeProfit, 'quantity', stringifiedAmount);
|
|
30686
30751
|
tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
|
|
30687
30752
|
request['takeProfit'] = this.json(tpRequest);
|
|
30688
30753
|
}
|
|
@@ -32368,7 +32433,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32368
32433
|
// "id":"1197073063359000577"
|
|
32369
32434
|
// }
|
|
32370
32435
|
// }
|
|
32371
|
-
this.parseTransaction(data);
|
|
32436
|
+
return this.parseTransaction(data);
|
|
32372
32437
|
}
|
|
32373
32438
|
parseParams(params) {
|
|
32374
32439
|
const sortedParams = this.keysort(params);
|
|
@@ -32902,6 +32967,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32902
32967
|
* @method
|
|
32903
32968
|
* @name bit2c#fetchBalance
|
|
32904
32969
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
32970
|
+
* @see https://bit2c.co.il/home/api#balance
|
|
32905
32971
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
32906
32972
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
32907
32973
|
*/
|
|
@@ -32956,6 +33022,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32956
33022
|
* @method
|
|
32957
33023
|
* @name bit2c#fetchOrderBook
|
|
32958
33024
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
33025
|
+
* @see https://bit2c.co.il/home/api#orderb
|
|
32959
33026
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
32960
33027
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
32961
33028
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -33002,6 +33069,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33002
33069
|
* @method
|
|
33003
33070
|
* @name bit2c#fetchTicker
|
|
33004
33071
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
33072
|
+
* @see https://bit2c.co.il/home/api#ticker
|
|
33005
33073
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
33006
33074
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33007
33075
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -33019,6 +33087,8 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33019
33087
|
* @method
|
|
33020
33088
|
* @name bit2c#fetchTrades
|
|
33021
33089
|
* @description get the list of most recent trades for a particular symbol
|
|
33090
|
+
* @see https://bit2c.co.il/home/api#transactions
|
|
33091
|
+
* @see https://bit2c.co.il/home/api#trades
|
|
33022
33092
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
33023
33093
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
33024
33094
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -33061,6 +33131,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33061
33131
|
* @method
|
|
33062
33132
|
* @name bit2c#fetchTradingFees
|
|
33063
33133
|
* @description fetch the trading fees for multiple markets
|
|
33134
|
+
* @see https://bit2c.co.il/home/api#balance
|
|
33064
33135
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33065
33136
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
33066
33137
|
*/
|
|
@@ -33109,6 +33180,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33109
33180
|
* @method
|
|
33110
33181
|
* @name bit2c#createOrder
|
|
33111
33182
|
* @description create a trade order
|
|
33183
|
+
* @see https://bit2c.co.il/home/api#addo
|
|
33112
33184
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
33113
33185
|
* @param {string} type 'market' or 'limit'
|
|
33114
33186
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -33142,6 +33214,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33142
33214
|
* @method
|
|
33143
33215
|
* @name bit2c#cancelOrder
|
|
33144
33216
|
* @description cancels an open order
|
|
33217
|
+
* @see https://bit2c.co.il/home/api#cancelo
|
|
33145
33218
|
* @param {string} id order id
|
|
33146
33219
|
* @param {string} symbol Not used by bit2c cancelOrder ()
|
|
33147
33220
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -33157,6 +33230,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33157
33230
|
* @method
|
|
33158
33231
|
* @name bit2c#fetchOpenOrders
|
|
33159
33232
|
* @description fetch all unfilled currently open orders
|
|
33233
|
+
* @see https://bit2c.co.il/home/api#geto
|
|
33160
33234
|
* @param {string} symbol unified market symbol
|
|
33161
33235
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
33162
33236
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -33182,6 +33256,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33182
33256
|
* @method
|
|
33183
33257
|
* @name bit2c#fetchOrder
|
|
33184
33258
|
* @description fetches information on an order made by the user
|
|
33259
|
+
* @see https://bit2c.co.il/home/api#getoid
|
|
33185
33260
|
* @param {string} symbol unified market symbol
|
|
33186
33261
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33187
33262
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -33334,6 +33409,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33334
33409
|
* @method
|
|
33335
33410
|
* @name bit2c#fetchMyTrades
|
|
33336
33411
|
* @description fetch all trades made by the user
|
|
33412
|
+
* @see https://bit2c.co.il/home/api#orderh
|
|
33337
33413
|
* @param {string} symbol unified market symbol
|
|
33338
33414
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
33339
33415
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -33514,6 +33590,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33514
33590
|
* @method
|
|
33515
33591
|
* @name bit2c#fetchDepositAddress
|
|
33516
33592
|
* @description fetch the deposit address for a currency associated with this account
|
|
33593
|
+
* @see https://bit2c.co.il/home/api#addc
|
|
33517
33594
|
* @param {string} code unified currency code
|
|
33518
33595
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33519
33596
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -37614,11 +37691,13 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
37614
37691
|
'CORS': undefined,
|
|
37615
37692
|
'spot': true,
|
|
37616
37693
|
'margin': undefined,
|
|
37617
|
-
'swap':
|
|
37694
|
+
'swap': true,
|
|
37618
37695
|
'future': undefined,
|
|
37619
37696
|
'option': undefined,
|
|
37697
|
+
'addMargin': false,
|
|
37620
37698
|
'cancelAllOrders': true,
|
|
37621
37699
|
'cancelOrder': true,
|
|
37700
|
+
'cancelOrders': true,
|
|
37622
37701
|
'createDepositAddress': true,
|
|
37623
37702
|
'createLimitOrder': true,
|
|
37624
37703
|
'createMarketOrder': true,
|
|
@@ -37627,23 +37706,27 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
37627
37706
|
'createStopLimitOrder': true,
|
|
37628
37707
|
'createStopMarketOrder': true,
|
|
37629
37708
|
'createStopOrder': true,
|
|
37630
|
-
'createTriggerOrder': true,
|
|
37631
37709
|
'createTrailingAmountOrder': true,
|
|
37632
37710
|
'createTrailingPercentOrder': false,
|
|
37633
|
-
'
|
|
37711
|
+
'createTriggerOrder': true,
|
|
37712
|
+
'editOrder': true,
|
|
37634
37713
|
'fetchBalance': true,
|
|
37635
37714
|
'fetchClosedOrder': true,
|
|
37636
37715
|
'fetchClosedOrders': true,
|
|
37637
37716
|
'fetchCurrencies': true,
|
|
37638
37717
|
'fetchDepositAddress': true,
|
|
37639
37718
|
'fetchDepositsWithdrawals': true,
|
|
37719
|
+
'fetchFundingHistory': false,
|
|
37640
37720
|
'fetchFundingRate': true,
|
|
37641
37721
|
'fetchFundingRateHistory': true,
|
|
37642
37722
|
'fetchFundingRates': true,
|
|
37643
37723
|
'fetchIndexOHLCV': false,
|
|
37644
37724
|
'fetchLedger': true,
|
|
37725
|
+
'fetchLeverage': false,
|
|
37726
|
+
'fetchLeverageTiers': false,
|
|
37645
37727
|
'fetchLiquidations': true,
|
|
37646
37728
|
'fetchMarginMode': false,
|
|
37729
|
+
'fetchMarketLeverageTiers': false,
|
|
37647
37730
|
'fetchMarkOHLCV': false,
|
|
37648
37731
|
'fetchMyTrades': true,
|
|
37649
37732
|
'fetchOHLCV': true,
|
|
@@ -37653,7 +37736,10 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
37653
37736
|
'fetchOpenOrders': true,
|
|
37654
37737
|
'fetchOrder': true,
|
|
37655
37738
|
'fetchOrderTrades': true,
|
|
37739
|
+
'fetchPosition': false,
|
|
37656
37740
|
'fetchPositionMode': false,
|
|
37741
|
+
'fetchPositions': true,
|
|
37742
|
+
'fetchPremiumIndexOHLCV': false,
|
|
37657
37743
|
'fetchStatus': true,
|
|
37658
37744
|
'fetchTickers': true,
|
|
37659
37745
|
'fetchTime': false,
|
|
@@ -37661,7 +37747,11 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
37661
37747
|
'fetchTradingFees': true,
|
|
37662
37748
|
'fetchTransactionFees': undefined,
|
|
37663
37749
|
'fetchTransactions': 'emulated',
|
|
37750
|
+
'reduceMargin': false,
|
|
37751
|
+
'setLeverage': false,
|
|
37664
37752
|
'setMargin': true,
|
|
37753
|
+
'setMarginMode': false,
|
|
37754
|
+
'setPositionMode': false,
|
|
37665
37755
|
'withdraw': true,
|
|
37666
37756
|
},
|
|
37667
37757
|
'timeframes': {
|
|
@@ -37929,6 +38019,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
37929
38019
|
'margin': 'margin',
|
|
37930
38020
|
'derivatives': 'margin',
|
|
37931
38021
|
'future': 'margin',
|
|
38022
|
+
'swap': 'margin',
|
|
37932
38023
|
},
|
|
37933
38024
|
'withdraw': {
|
|
37934
38025
|
'includeFee': false,
|
|
@@ -38585,7 +38676,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
38585
38676
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
38586
38677
|
* @see https://docs.bitfinex.com/reference/rest-public-book
|
|
38587
38678
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
38588
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
38679
|
+
* @param {int} [limit] the maximum amount of order book entries to return, bitfinex only allows 1, 25, or 100
|
|
38589
38680
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
38590
38681
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
38591
38682
|
*/
|
|
@@ -38597,7 +38688,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
38597
38688
|
'precision': precision,
|
|
38598
38689
|
};
|
|
38599
38690
|
if (limit !== undefined) {
|
|
38600
|
-
request['len'] = limit;
|
|
38691
|
+
request['len'] = limit;
|
|
38601
38692
|
}
|
|
38602
38693
|
const fullRequest = this.extend(request, params);
|
|
38603
38694
|
const orderbook = await this.publicGetBookSymbolPrecision(fullRequest);
|
|
@@ -38869,9 +38960,9 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
38869
38960
|
* @see https://docs.bitfinex.com/reference/rest-public-trades
|
|
38870
38961
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
38871
38962
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
38872
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
38963
|
+
* @param {int} [limit] the maximum amount of trades to fetch, default 120, max 10000
|
|
38873
38964
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
38874
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
38965
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
38875
38966
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
38876
38967
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
38877
38968
|
*/
|
|
@@ -38918,11 +39009,11 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
38918
39009
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
38919
39010
|
* @param {string} timeframe the length of time each candle represents
|
|
38920
39011
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
38921
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
39012
|
+
* @param {int} [limit] the maximum amount of candles to fetch, default 100 max 10000
|
|
38922
39013
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
38923
39014
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
38924
39015
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
38925
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
39016
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
38926
39017
|
*/
|
|
38927
39018
|
await this.loadMarkets();
|
|
38928
39019
|
let paginate = false;
|
|
@@ -38932,7 +39023,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
38932
39023
|
}
|
|
38933
39024
|
const market = this.market(symbol);
|
|
38934
39025
|
if (limit === undefined) {
|
|
38935
|
-
limit = 10000;
|
|
39026
|
+
limit = 10000;
|
|
38936
39027
|
}
|
|
38937
39028
|
let request = {
|
|
38938
39029
|
'symbol': market['id'],
|
|
@@ -39080,30 +39171,20 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39080
39171
|
'trades': undefined,
|
|
39081
39172
|
}, market);
|
|
39082
39173
|
}
|
|
39083
|
-
|
|
39174
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
39084
39175
|
/**
|
|
39085
39176
|
* @method
|
|
39086
|
-
* @
|
|
39087
|
-
* @
|
|
39088
|
-
* @
|
|
39089
|
-
* @param {string} symbol unified
|
|
39090
|
-
* @param {string} type '
|
|
39177
|
+
* @ignore
|
|
39178
|
+
* @name bitfinex2#createOrderRequest
|
|
39179
|
+
* @description helper function to build an order request
|
|
39180
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
39181
|
+
* @param {string} type 'market' or 'limit'
|
|
39091
39182
|
* @param {string} side 'buy' or 'sell'
|
|
39092
|
-
* @param {float} amount
|
|
39093
|
-
* @param {float} [price] price of the order
|
|
39183
|
+
* @param {float} amount how much you want to trade in units of the base currency
|
|
39184
|
+
* @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
|
|
39094
39185
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39095
|
-
* @
|
|
39096
|
-
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
39097
|
-
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
39098
|
-
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
39099
|
-
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
39100
|
-
* @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
|
|
39101
|
-
* @param {string} [params.price_aux_limit] order price for stop limit orders
|
|
39102
|
-
* @param {string} [params.price_oco_stop] OCO stop price
|
|
39103
|
-
* @param {string} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
39104
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39186
|
+
* @returns {object} request to be sent to the exchange
|
|
39105
39187
|
*/
|
|
39106
|
-
await this.loadMarkets();
|
|
39107
39188
|
const market = this.market(symbol);
|
|
39108
39189
|
let amountString = this.amountToPrecision(symbol, amount);
|
|
39109
39190
|
amountString = (side === 'buy') ? amountString : _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(amountString);
|
|
@@ -39117,7 +39198,6 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39117
39198
|
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
39118
39199
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
39119
39200
|
const clientOrderId = this.safeValue2(params, 'cid', 'clientOrderId');
|
|
39120
|
-
params = this.omit(params, ['triggerPrice', 'stopPrice', 'timeInForce', 'postOnly', 'reduceOnly', 'trailingAmount', 'clientOrderId']);
|
|
39121
39201
|
let orderType = type.toUpperCase();
|
|
39122
39202
|
if (trailingAmount !== undefined) {
|
|
39123
39203
|
orderType = 'TRAILING STOP';
|
|
@@ -39173,7 +39253,36 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39173
39253
|
if (clientOrderId !== undefined) {
|
|
39174
39254
|
request['cid'] = clientOrderId;
|
|
39175
39255
|
}
|
|
39176
|
-
|
|
39256
|
+
params = this.omit(params, ['triggerPrice', 'stopPrice', 'timeInForce', 'postOnly', 'reduceOnly', 'trailingAmount', 'clientOrderId']);
|
|
39257
|
+
return this.extend(request, params);
|
|
39258
|
+
}
|
|
39259
|
+
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
39260
|
+
/**
|
|
39261
|
+
* @method
|
|
39262
|
+
* @name bitfinex2#createOrder
|
|
39263
|
+
* @description create an order on the exchange
|
|
39264
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-submit-order
|
|
39265
|
+
* @param {string} symbol unified CCXT market symbol
|
|
39266
|
+
* @param {string} type 'limit' or 'market'
|
|
39267
|
+
* @param {string} side 'buy' or 'sell'
|
|
39268
|
+
* @param {float} amount the amount of currency to trade
|
|
39269
|
+
* @param {float} [price] price of the order
|
|
39270
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39271
|
+
* @param {float} [params.stopPrice] the price that triggers a trigger order
|
|
39272
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
39273
|
+
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
39274
|
+
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
39275
|
+
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
39276
|
+
* @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
|
|
39277
|
+
* @param {string} [params.price_aux_limit] order price for stop limit orders
|
|
39278
|
+
* @param {string} [params.price_oco_stop] OCO stop price
|
|
39279
|
+
* @param {string} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
39280
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39281
|
+
*/
|
|
39282
|
+
await this.loadMarkets();
|
|
39283
|
+
const market = this.market(symbol);
|
|
39284
|
+
const request = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
39285
|
+
const response = await this.privatePostAuthWOrderSubmit(request);
|
|
39177
39286
|
//
|
|
39178
39287
|
// [
|
|
39179
39288
|
// 1653325121, // Timestamp in milliseconds
|
|
@@ -39231,6 +39340,67 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39231
39340
|
const order = this.safeList(orders, 0);
|
|
39232
39341
|
return this.parseOrder(order, market);
|
|
39233
39342
|
}
|
|
39343
|
+
async createOrders(orders, params = {}) {
|
|
39344
|
+
/**
|
|
39345
|
+
* @method
|
|
39346
|
+
* @name bitfinex2#createOrders
|
|
39347
|
+
* @description create a list of trade orders
|
|
39348
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-order-multi
|
|
39349
|
+
* @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
|
|
39350
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39351
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39352
|
+
*/
|
|
39353
|
+
await this.loadMarkets();
|
|
39354
|
+
const ordersRequests = [];
|
|
39355
|
+
for (let i = 0; i < orders.length; i++) {
|
|
39356
|
+
const rawOrder = orders[i];
|
|
39357
|
+
const symbol = this.safeString(rawOrder, 'symbol');
|
|
39358
|
+
const type = this.safeString(rawOrder, 'type');
|
|
39359
|
+
const side = this.safeString(rawOrder, 'side');
|
|
39360
|
+
const amount = this.safeNumber(rawOrder, 'amount');
|
|
39361
|
+
const price = this.safeNumber(rawOrder, 'price');
|
|
39362
|
+
const orderParams = this.safeDict(rawOrder, 'params', {});
|
|
39363
|
+
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, orderParams);
|
|
39364
|
+
ordersRequests.push(['on', orderRequest]);
|
|
39365
|
+
}
|
|
39366
|
+
const request = {
|
|
39367
|
+
'ops': ordersRequests,
|
|
39368
|
+
};
|
|
39369
|
+
const response = await this.privatePostAuthWOrderMulti(request);
|
|
39370
|
+
//
|
|
39371
|
+
// [
|
|
39372
|
+
// 1706762515553,
|
|
39373
|
+
// "ox_multi-req",
|
|
39374
|
+
// null,
|
|
39375
|
+
// null,
|
|
39376
|
+
// [
|
|
39377
|
+
// [
|
|
39378
|
+
// 1706762515,
|
|
39379
|
+
// "on-req",
|
|
39380
|
+
// null,
|
|
39381
|
+
// null,
|
|
39382
|
+
// [
|
|
39383
|
+
// [139567428547,null,1706762515551,"tBTCUST",1706762515551,1706762515551,0.0001,0.0001,"EXCHANGE LIMIT",null,null,null,0,"ACTIVE",null,null,35000,0,0,0,null,null,null,0,0,null,null,null,"API>BFX",null,null,{}]
|
|
39384
|
+
// ],
|
|
39385
|
+
// null,
|
|
39386
|
+
// "SUCCESS",
|
|
39387
|
+
// "Submitting 1 orders."
|
|
39388
|
+
// ],
|
|
39389
|
+
// ],
|
|
39390
|
+
// null,
|
|
39391
|
+
// "SUCCESS",
|
|
39392
|
+
// "Submitting 2 order operations."
|
|
39393
|
+
// ]
|
|
39394
|
+
//
|
|
39395
|
+
const results = [];
|
|
39396
|
+
const data = this.safeList(response, 4, []);
|
|
39397
|
+
for (let i = 0; i < data.length; i++) {
|
|
39398
|
+
const entry = data[i];
|
|
39399
|
+
const individualOrder = entry[4];
|
|
39400
|
+
results.push(individualOrder[0]);
|
|
39401
|
+
}
|
|
39402
|
+
return this.parseOrders(results);
|
|
39403
|
+
}
|
|
39234
39404
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
39235
39405
|
/**
|
|
39236
39406
|
* @method
|
|
@@ -39241,6 +39411,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39241
39411
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39242
39412
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39243
39413
|
*/
|
|
39414
|
+
await this.loadMarkets();
|
|
39244
39415
|
const request = {
|
|
39245
39416
|
'all': 1,
|
|
39246
39417
|
};
|
|
@@ -39259,6 +39430,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39259
39430
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39260
39431
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39261
39432
|
*/
|
|
39433
|
+
await this.loadMarkets();
|
|
39262
39434
|
const cid = this.safeValue2(params, 'cid', 'clientOrderId'); // client order id
|
|
39263
39435
|
let request = undefined;
|
|
39264
39436
|
if (cid !== undefined) {
|
|
@@ -39281,6 +39453,82 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
39281
39453
|
const order = this.safeValue(response, 4);
|
|
39282
39454
|
return this.parseOrder(order);
|
|
39283
39455
|
}
|
|
39456
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
39457
|
+
/**
|
|
39458
|
+
* @method
|
|
39459
|
+
* @name bitfinex2#cancelOrders
|
|
39460
|
+
* @description cancel multiple orders at the same time
|
|
39461
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple
|
|
39462
|
+
* @param {string[]} ids order ids
|
|
39463
|
+
* @param {string} symbol unified market symbol, default is undefined
|
|
39464
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
39465
|
+
* @returns {object} an array of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
39466
|
+
*/
|
|
39467
|
+
await this.loadMarkets();
|
|
39468
|
+
for (let i = 0; i < ids.length; i++) {
|
|
39469
|
+
ids[i] = this.parseToNumeric(ids[i]);
|
|
39470
|
+
}
|
|
39471
|
+
const request = {
|
|
39472
|
+
'id': ids,
|
|
39473
|
+
};
|
|
39474
|
+
let market = undefined;
|
|
39475
|
+
if (symbol !== undefined) {
|
|
39476
|
+
market = this.market(symbol);
|
|
39477
|
+
}
|
|
39478
|
+
const response = await this.privatePostAuthWOrderCancelMulti(this.extend(request, params));
|
|
39479
|
+
//
|
|
39480
|
+
// [
|
|
39481
|
+
// 1706740198811,
|
|
39482
|
+
// "oc_multi-req",
|
|
39483
|
+
// null,
|
|
39484
|
+
// null,
|
|
39485
|
+
// [
|
|
39486
|
+
// [
|
|
39487
|
+
// 139530205057,
|
|
39488
|
+
// null,
|
|
39489
|
+
// 1706740132275,
|
|
39490
|
+
// "tBTCF0:USTF0",
|
|
39491
|
+
// 1706740132276,
|
|
39492
|
+
// 1706740132276,
|
|
39493
|
+
// 0.0001,
|
|
39494
|
+
// 0.0001,
|
|
39495
|
+
// "LIMIT",
|
|
39496
|
+
// null,
|
|
39497
|
+
// null,
|
|
39498
|
+
// null,
|
|
39499
|
+
// 0,
|
|
39500
|
+
// "ACTIVE",
|
|
39501
|
+
// null,
|
|
39502
|
+
// null,
|
|
39503
|
+
// 39000,
|
|
39504
|
+
// 0,
|
|
39505
|
+
// 0,
|
|
39506
|
+
// 0,
|
|
39507
|
+
// null,
|
|
39508
|
+
// null,
|
|
39509
|
+
// null,
|
|
39510
|
+
// 0,
|
|
39511
|
+
// 0,
|
|
39512
|
+
// null,
|
|
39513
|
+
// null,
|
|
39514
|
+
// null,
|
|
39515
|
+
// "API>BFX",
|
|
39516
|
+
// null,
|
|
39517
|
+
// null,
|
|
39518
|
+
// {
|
|
39519
|
+
// "lev": 10,
|
|
39520
|
+
// "$F33": 10
|
|
39521
|
+
// }
|
|
39522
|
+
// ],
|
|
39523
|
+
// ],
|
|
39524
|
+
// null,
|
|
39525
|
+
// "SUCCESS",
|
|
39526
|
+
// "Submitting 2 order cancellations."
|
|
39527
|
+
// ]
|
|
39528
|
+
//
|
|
39529
|
+
const orders = this.safeList(response, 4, []);
|
|
39530
|
+
return this.parseOrders(orders, market);
|
|
39531
|
+
}
|
|
39284
39532
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
39285
39533
|
/**
|
|
39286
39534
|
* @method
|
|
@@ -40290,14 +40538,13 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40290
40538
|
* @see https://docs.bitfinex.com/reference/rest-auth-ledgers
|
|
40291
40539
|
* @param {string} code unified currency code, default is undefined
|
|
40292
40540
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
40293
|
-
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
40541
|
+
* @param {int} [limit] max number of ledger entrys to return, default is undefined max is 2500
|
|
40294
40542
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
40295
40543
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
40296
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
40544
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
40297
40545
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
40298
40546
|
*/
|
|
40299
40547
|
await this.loadMarkets();
|
|
40300
|
-
await this.loadMarkets();
|
|
40301
40548
|
let paginate = false;
|
|
40302
40549
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
40303
40550
|
if (paginate) {
|
|
@@ -40309,7 +40556,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40309
40556
|
request['start'] = since;
|
|
40310
40557
|
}
|
|
40311
40558
|
if (limit !== undefined) {
|
|
40312
|
-
request['limit'] = limit;
|
|
40559
|
+
request['limit'] = limit;
|
|
40313
40560
|
}
|
|
40314
40561
|
[request, params] = this.handleUntilOption('end', request, params);
|
|
40315
40562
|
let response = undefined;
|
|
@@ -40341,7 +40588,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40341
40588
|
async fetchFundingRate(symbol, params = {}) {
|
|
40342
40589
|
/**
|
|
40343
40590
|
* @method
|
|
40344
|
-
* @name
|
|
40591
|
+
* @name bitfinex2#fetchFundingRate
|
|
40345
40592
|
* @description fetch the current funding rate
|
|
40346
40593
|
* @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
|
|
40347
40594
|
* @param {string} symbol unified market symbol
|
|
@@ -40353,7 +40600,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40353
40600
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
40354
40601
|
/**
|
|
40355
40602
|
* @method
|
|
40356
|
-
* @name
|
|
40603
|
+
* @name bitfinex2#fetchFundingRate
|
|
40357
40604
|
* @description fetch the current funding rate
|
|
40358
40605
|
* @see https://docs.bitfinex.com/reference/rest-public-derivatives-status
|
|
40359
40606
|
* @param {string[]} symbols list of unified market symbols
|
|
@@ -40404,13 +40651,15 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40404
40651
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
40405
40652
|
/**
|
|
40406
40653
|
* @method
|
|
40407
|
-
* @name
|
|
40654
|
+
* @name bitfinex2#fetchFundingRateHistory
|
|
40408
40655
|
* @description fetches historical funding rate prices
|
|
40409
40656
|
* @see https://docs.bitfinex.com/reference/rest-public-derivatives-status-history
|
|
40410
40657
|
* @param {string} symbol unified market symbol
|
|
40658
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate entry
|
|
40659
|
+
* @param {int} [limit] max number of funding rate entrys to return
|
|
40411
40660
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
40412
40661
|
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
40413
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
40662
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
40414
40663
|
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
40415
40664
|
*/
|
|
40416
40665
|
if (symbol === undefined) {
|
|
@@ -40467,7 +40716,15 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40467
40716
|
const rate = this.parseFundingRateHistory(fr, market);
|
|
40468
40717
|
rates.push(rate);
|
|
40469
40718
|
}
|
|
40470
|
-
|
|
40719
|
+
const reversedArray = [];
|
|
40720
|
+
const rawRates = this.filterBySymbolSinceLimit(rates, symbol, since, limit);
|
|
40721
|
+
const rawRatesLength = rawRates.length;
|
|
40722
|
+
const ratesLength = Math.max(rawRatesLength - 1, 0);
|
|
40723
|
+
for (let i = ratesLength; i >= 0; i--) {
|
|
40724
|
+
const valueAtIndex = rawRates[i];
|
|
40725
|
+
reversedArray.push(valueAtIndex);
|
|
40726
|
+
}
|
|
40727
|
+
return reversedArray;
|
|
40471
40728
|
}
|
|
40472
40729
|
parseFundingRate(contract, market = undefined) {
|
|
40473
40730
|
//
|
|
@@ -40617,7 +40874,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40617
40874
|
// ]
|
|
40618
40875
|
// ]
|
|
40619
40876
|
//
|
|
40620
|
-
|
|
40877
|
+
const oi = this.safeList(response, 0);
|
|
40878
|
+
return this.parseOpenInterest(oi, market);
|
|
40621
40879
|
}
|
|
40622
40880
|
async fetchOpenInterestHistory(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
40623
40881
|
/**
|
|
@@ -40888,6 +41146,199 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40888
41146
|
'status': marginStatus,
|
|
40889
41147
|
};
|
|
40890
41148
|
}
|
|
41149
|
+
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
41150
|
+
/**
|
|
41151
|
+
* @method
|
|
41152
|
+
* @name bitfinex2#fetchOrder
|
|
41153
|
+
* @description fetches information on an order made by the user
|
|
41154
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
|
|
41155
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
|
|
41156
|
+
* @param {string} id the order id
|
|
41157
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
41158
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
41159
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
41160
|
+
*/
|
|
41161
|
+
await this.loadMarkets();
|
|
41162
|
+
const request = {
|
|
41163
|
+
'id': [this.parseToNumeric(id)],
|
|
41164
|
+
};
|
|
41165
|
+
let market = undefined;
|
|
41166
|
+
let response = undefined;
|
|
41167
|
+
if (symbol === undefined) {
|
|
41168
|
+
response = await this.privatePostAuthROrders(this.extend(request, params));
|
|
41169
|
+
}
|
|
41170
|
+
else {
|
|
41171
|
+
market = this.market(symbol);
|
|
41172
|
+
request['symbol'] = market['id'];
|
|
41173
|
+
response = await this.privatePostAuthROrdersSymbol(this.extend(request, params));
|
|
41174
|
+
}
|
|
41175
|
+
//
|
|
41176
|
+
// [
|
|
41177
|
+
// [
|
|
41178
|
+
// 139658969116,
|
|
41179
|
+
// null,
|
|
41180
|
+
// 1706843908637,
|
|
41181
|
+
// "tBTCUST",
|
|
41182
|
+
// 1706843908637,
|
|
41183
|
+
// 1706843908638,
|
|
41184
|
+
// 0.0001,
|
|
41185
|
+
// 0.0001,
|
|
41186
|
+
// "EXCHANGE LIMIT",
|
|
41187
|
+
// null,
|
|
41188
|
+
// null,
|
|
41189
|
+
// null,
|
|
41190
|
+
// 0,
|
|
41191
|
+
// "ACTIVE",
|
|
41192
|
+
// null,
|
|
41193
|
+
// null,
|
|
41194
|
+
// 35000,
|
|
41195
|
+
// 0,
|
|
41196
|
+
// 0,
|
|
41197
|
+
// 0,
|
|
41198
|
+
// null,
|
|
41199
|
+
// null,
|
|
41200
|
+
// null,
|
|
41201
|
+
// 0,
|
|
41202
|
+
// 0,
|
|
41203
|
+
// null,
|
|
41204
|
+
// null,
|
|
41205
|
+
// null,
|
|
41206
|
+
// "API>BFX",
|
|
41207
|
+
// null,
|
|
41208
|
+
// null,
|
|
41209
|
+
// {}
|
|
41210
|
+
// ]
|
|
41211
|
+
// ]
|
|
41212
|
+
//
|
|
41213
|
+
const order = this.safeList(response, 0);
|
|
41214
|
+
return this.parseOrder(order, market);
|
|
41215
|
+
}
|
|
41216
|
+
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
41217
|
+
/**
|
|
41218
|
+
* @method
|
|
41219
|
+
* @name bitfinex2#editOrder
|
|
41220
|
+
* @description edit a trade order
|
|
41221
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-update-order
|
|
41222
|
+
* @param {string} id edit order id
|
|
41223
|
+
* @param {string} symbol unified symbol of the market to edit an order in
|
|
41224
|
+
* @param {string} type 'market' or 'limit'
|
|
41225
|
+
* @param {string} side 'buy' or 'sell'
|
|
41226
|
+
* @param {float} amount how much you want to trade in units of the base currency
|
|
41227
|
+
* @param {float} [price] the price that the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
41228
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
41229
|
+
* @param {float} [params.stopPrice] the price that triggers a trigger order
|
|
41230
|
+
* @param {boolean} [params.postOnly] set to true if you want to make a post only order
|
|
41231
|
+
* @param {boolean} [params.reduceOnly] indicates that the order is to reduce the size of a position
|
|
41232
|
+
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
41233
|
+
* @param {int} [params.leverage] leverage for a derivative order, supported by derivative symbol orders only, the value should be between 1 and 100 inclusive
|
|
41234
|
+
* @param {int} [params.clientOrderId] a unique client order id for the order
|
|
41235
|
+
* @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
41236
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
41237
|
+
*/
|
|
41238
|
+
await this.loadMarkets();
|
|
41239
|
+
const market = this.market(symbol);
|
|
41240
|
+
const request = {
|
|
41241
|
+
'id': this.parseToNumeric(id),
|
|
41242
|
+
};
|
|
41243
|
+
if (amount !== undefined) {
|
|
41244
|
+
let amountString = this.amountToPrecision(symbol, amount);
|
|
41245
|
+
amountString = (side === 'buy') ? amountString : _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(amountString);
|
|
41246
|
+
request['amount'] = amountString;
|
|
41247
|
+
}
|
|
41248
|
+
const stopPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
41249
|
+
const trailingAmount = this.safeString(params, 'trailingAmount');
|
|
41250
|
+
const timeInForce = this.safeString(params, 'timeInForce');
|
|
41251
|
+
const postOnlyParam = this.safeBool(params, 'postOnly', false);
|
|
41252
|
+
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
41253
|
+
const clientOrderId = this.safeInteger2(params, 'cid', 'clientOrderId');
|
|
41254
|
+
if (trailingAmount !== undefined) {
|
|
41255
|
+
request['price_trailing'] = trailingAmount;
|
|
41256
|
+
}
|
|
41257
|
+
else if (stopPrice !== undefined) {
|
|
41258
|
+
// request['price'] is taken as stopPrice for stop orders
|
|
41259
|
+
request['price'] = this.priceToPrecision(symbol, stopPrice);
|
|
41260
|
+
if (type === 'limit') {
|
|
41261
|
+
request['price_aux_limit'] = this.priceToPrecision(symbol, price);
|
|
41262
|
+
}
|
|
41263
|
+
}
|
|
41264
|
+
const postOnly = (postOnlyParam || (timeInForce === 'PO'));
|
|
41265
|
+
if ((type !== 'market') && (stopPrice === undefined)) {
|
|
41266
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
41267
|
+
}
|
|
41268
|
+
// flag values may be summed to combine flags
|
|
41269
|
+
let flags = 0;
|
|
41270
|
+
if (postOnly) {
|
|
41271
|
+
flags = this.sum(flags, 4096);
|
|
41272
|
+
}
|
|
41273
|
+
if (reduceOnly) {
|
|
41274
|
+
flags = this.sum(flags, 1024);
|
|
41275
|
+
}
|
|
41276
|
+
if (flags !== 0) {
|
|
41277
|
+
request['flags'] = flags;
|
|
41278
|
+
}
|
|
41279
|
+
if (clientOrderId !== undefined) {
|
|
41280
|
+
request['cid'] = clientOrderId;
|
|
41281
|
+
}
|
|
41282
|
+
const leverage = this.safeInteger2(params, 'leverage', 'lev');
|
|
41283
|
+
if (leverage !== undefined) {
|
|
41284
|
+
request['lev'] = leverage;
|
|
41285
|
+
}
|
|
41286
|
+
params = this.omit(params, ['triggerPrice', 'stopPrice', 'timeInForce', 'postOnly', 'reduceOnly', 'trailingAmount', 'clientOrderId', 'leverage']);
|
|
41287
|
+
const response = await this.privatePostAuthWOrderUpdate(this.extend(request, params));
|
|
41288
|
+
//
|
|
41289
|
+
// [
|
|
41290
|
+
// 1706845376402,
|
|
41291
|
+
// "ou-req",
|
|
41292
|
+
// null,
|
|
41293
|
+
// null,
|
|
41294
|
+
// [
|
|
41295
|
+
// 139658969116,
|
|
41296
|
+
// null,
|
|
41297
|
+
// 1706843908637,
|
|
41298
|
+
// "tBTCUST",
|
|
41299
|
+
// 1706843908637,
|
|
41300
|
+
// 1706843908638,
|
|
41301
|
+
// 0.0002,
|
|
41302
|
+
// 0.0002,
|
|
41303
|
+
// "EXCHANGE LIMIT",
|
|
41304
|
+
// null,
|
|
41305
|
+
// null,
|
|
41306
|
+
// null,
|
|
41307
|
+
// 0,
|
|
41308
|
+
// "ACTIVE",
|
|
41309
|
+
// null,
|
|
41310
|
+
// null,
|
|
41311
|
+
// 35000,
|
|
41312
|
+
// 0,
|
|
41313
|
+
// 0,
|
|
41314
|
+
// 0,
|
|
41315
|
+
// null,
|
|
41316
|
+
// null,
|
|
41317
|
+
// null,
|
|
41318
|
+
// 0,
|
|
41319
|
+
// 0,
|
|
41320
|
+
// null,
|
|
41321
|
+
// null,
|
|
41322
|
+
// null,
|
|
41323
|
+
// "API>BFX",
|
|
41324
|
+
// null,
|
|
41325
|
+
// null,
|
|
41326
|
+
// {}
|
|
41327
|
+
// ],
|
|
41328
|
+
// null,
|
|
41329
|
+
// "SUCCESS",
|
|
41330
|
+
// "Submitting update to exchange limit buy order for 0.0002 BTC."
|
|
41331
|
+
// ]
|
|
41332
|
+
//
|
|
41333
|
+
const status = this.safeString(response, 6);
|
|
41334
|
+
if (status !== 'SUCCESS') {
|
|
41335
|
+
const errorCode = response[5];
|
|
41336
|
+
const errorText = response[7];
|
|
41337
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + response[6] + ': ' + errorText + ' (#' + errorCode + ')');
|
|
41338
|
+
}
|
|
41339
|
+
const order = this.safeList(response, 4, []);
|
|
41340
|
+
return this.parseOrder(order, market);
|
|
41341
|
+
}
|
|
40891
41342
|
}
|
|
40892
41343
|
|
|
40893
41344
|
|
|
@@ -41999,6 +42450,9 @@ class bitforex extends _abstract_bitforex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
41999
42450
|
'fetchClosedOrders': true,
|
|
42000
42451
|
'fetchCrossBorrowRate': false,
|
|
42001
42452
|
'fetchCrossBorrowRates': false,
|
|
42453
|
+
'fetchDepositAddress': false,
|
|
42454
|
+
'fetchDepositAddresses': false,
|
|
42455
|
+
'fetchDepositAddressesByNetwork': false,
|
|
42002
42456
|
'fetchFundingHistory': false,
|
|
42003
42457
|
'fetchFundingRate': false,
|
|
42004
42458
|
'fetchFundingRateHistory': false,
|
|
@@ -46984,7 +47438,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
46984
47438
|
const isTakeProfit = takeProfit !== undefined;
|
|
46985
47439
|
const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
|
|
46986
47440
|
const isStopLossOrTakeProfit = isStopLoss || isTakeProfit;
|
|
46987
|
-
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
|
|
47441
|
+
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
|
|
46988
47442
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
|
|
46989
47443
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
46990
47444
|
if (this.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1) {
|
|
@@ -49807,7 +50261,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
49807
50261
|
* @name bitget#setLeverage
|
|
49808
50262
|
* @description set the level of leverage for a market
|
|
49809
50263
|
* @see https://www.bitget.com/api-doc/contract/account/Change-Leverage
|
|
49810
|
-
* @param {
|
|
50264
|
+
* @param {int} leverage the rate of leverage
|
|
49811
50265
|
* @param {string} symbol unified market symbol
|
|
49812
50266
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
49813
50267
|
* @param {string} [params.holdSide] *isolated only* position direction, 'long' or 'short'
|
|
@@ -49831,7 +50285,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
49831
50285
|
const request = {
|
|
49832
50286
|
'symbol': market['id'],
|
|
49833
50287
|
'marginCoin': market['settleId'],
|
|
49834
|
-
'leverage': leverage,
|
|
50288
|
+
'leverage': this.numberToString(leverage),
|
|
49835
50289
|
'productType': productType,
|
|
49836
50290
|
// 'holdSide': 'long',
|
|
49837
50291
|
};
|
|
@@ -54697,7 +55151,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54697
55151
|
}
|
|
54698
55152
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
|
|
54699
55153
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
54700
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', price);
|
|
55154
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', this.numberToString(price));
|
|
54701
55155
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
|
|
54702
55156
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
54703
55157
|
if (isLimitOrder) {
|
|
@@ -63368,9 +63822,9 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
63368
63822
|
const amountString = this.numberToString(amount);
|
|
63369
63823
|
const priceString = this.numberToString(price);
|
|
63370
63824
|
const quoteAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
|
|
63371
|
-
|
|
63372
|
-
request['amount'] = this.costToPrecision(symbol,
|
|
63373
|
-
request['volume'] = this.costToPrecision(symbol,
|
|
63825
|
+
const requestAmount = (cost !== undefined) ? cost : quoteAmount;
|
|
63826
|
+
request['amount'] = this.costToPrecision(symbol, requestAmount);
|
|
63827
|
+
request['volume'] = this.costToPrecision(symbol, requestAmount);
|
|
63374
63828
|
}
|
|
63375
63829
|
}
|
|
63376
63830
|
else {
|
|
@@ -74003,7 +74457,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
|
|
|
74003
74457
|
'remaining': remaining,
|
|
74004
74458
|
'cost': undefined,
|
|
74005
74459
|
'trades': [],
|
|
74006
|
-
'fees':
|
|
74460
|
+
'fees': [],
|
|
74007
74461
|
'info': order,
|
|
74008
74462
|
});
|
|
74009
74463
|
return result;
|
|
@@ -82043,7 +82497,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
82043
82497
|
const takeProfitTriggerPrice = this.safeValue(params, 'takeProfitPrice');
|
|
82044
82498
|
const stopLoss = this.safeValue(params, 'stopLoss');
|
|
82045
82499
|
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
82046
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', price);
|
|
82500
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', this.numberToString(price));
|
|
82047
82501
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
|
|
82048
82502
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
82049
82503
|
const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
|
|
@@ -87932,6 +88386,13 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
87932
88386
|
'brokerage/best_bid_ask',
|
|
87933
88387
|
'brokerage/convert/trade/{trade_id}',
|
|
87934
88388
|
'brokerage/time',
|
|
88389
|
+
'brokerage/cfm/balance_summary',
|
|
88390
|
+
'brokerage/cfm/positions',
|
|
88391
|
+
'brokerage/cfm/positions/{product_id}',
|
|
88392
|
+
'brokerage/cfm/sweeps',
|
|
88393
|
+
'brokerage/intx/portfolio/{portfolio_uuid}',
|
|
88394
|
+
'brokerage/intx/positions/{portfolio_uuid}',
|
|
88395
|
+
'brokerage/intx/positions/{portfolio_uuid}/{symbol}',
|
|
87935
88396
|
],
|
|
87936
88397
|
'post': [
|
|
87937
88398
|
'brokerage/orders',
|
|
@@ -87942,12 +88403,15 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
87942
88403
|
'brokerage/portfolios/move_funds',
|
|
87943
88404
|
'brokerage/convert/quote',
|
|
87944
88405
|
'brokerage/convert/trade/{trade_id}',
|
|
88406
|
+
'brokerage/cfm/sweeps/schedule',
|
|
88407
|
+
'brokerage/intx/allocate',
|
|
87945
88408
|
],
|
|
87946
88409
|
'put': [
|
|
87947
88410
|
'brokerage/portfolios/{portfolio_uuid}',
|
|
87948
88411
|
],
|
|
87949
88412
|
'delete': [
|
|
87950
88413
|
'brokerage/portfolios/{portfolio_uuid}',
|
|
88414
|
+
'brokerage/cfm/sweeps',
|
|
87951
88415
|
],
|
|
87952
88416
|
},
|
|
87953
88417
|
},
|
|
@@ -89340,7 +89804,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
89340
89804
|
'info': ticker,
|
|
89341
89805
|
}, market);
|
|
89342
89806
|
}
|
|
89343
|
-
|
|
89807
|
+
parseCustomBalance(response, params = {}) {
|
|
89344
89808
|
const balances = this.safeValue2(response, 'data', 'accounts', []);
|
|
89345
89809
|
const accounts = this.safeValue(params, 'type', this.options['accounts']);
|
|
89346
89810
|
const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
|
|
@@ -89491,7 +89955,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
89491
89955
|
// "size": 9
|
|
89492
89956
|
// }
|
|
89493
89957
|
//
|
|
89494
|
-
return this.
|
|
89958
|
+
return this.parseCustomBalance(response, params);
|
|
89495
89959
|
}
|
|
89496
89960
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
89497
89961
|
/**
|
|
@@ -98275,7 +98739,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
98275
98739
|
const request = {
|
|
98276
98740
|
'coin_type': currency['id'],
|
|
98277
98741
|
'coin_address': address,
|
|
98278
|
-
'actual_amount': parseFloat(amount),
|
|
98742
|
+
'actual_amount': parseFloat(this.numberToString(amount)),
|
|
98279
98743
|
'transfer_method': 'onchain', // onchain, local
|
|
98280
98744
|
};
|
|
98281
98745
|
if (networkCode !== undefined) {
|
|
@@ -109411,10 +109875,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109411
109875
|
const isTakeProfitTrigger = (takeProfitPrice !== undefined);
|
|
109412
109876
|
if (isTrigger) {
|
|
109413
109877
|
request['ref_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
109414
|
-
|
|
109878
|
+
const priceString = this.numberToString(price);
|
|
109415
109879
|
if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
|
|
109416
109880
|
if (side === 'buy') {
|
|
109417
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
109881
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109418
109882
|
request['type'] = 'TAKE_PROFIT_LIMIT';
|
|
109419
109883
|
}
|
|
109420
109884
|
else {
|
|
@@ -109422,7 +109886,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109422
109886
|
}
|
|
109423
109887
|
}
|
|
109424
109888
|
else {
|
|
109425
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
109889
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109426
109890
|
request['type'] = 'STOP_LIMIT';
|
|
109427
109891
|
}
|
|
109428
109892
|
else {
|
|
@@ -109432,7 +109896,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109432
109896
|
}
|
|
109433
109897
|
else {
|
|
109434
109898
|
if (side === 'buy') {
|
|
109435
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
109899
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109436
109900
|
request['type'] = 'TAKE_PROFIT';
|
|
109437
109901
|
}
|
|
109438
109902
|
else {
|
|
@@ -109440,7 +109904,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109440
109904
|
}
|
|
109441
109905
|
}
|
|
109442
109906
|
else {
|
|
109443
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
109907
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109444
109908
|
request['type'] = 'STOP_LOSS';
|
|
109445
109909
|
}
|
|
109446
109910
|
else {
|
|
@@ -109631,10 +110095,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109631
110095
|
const isStopLossTrigger = (stopLossPrice !== undefined);
|
|
109632
110096
|
const isTakeProfitTrigger = (takeProfitPrice !== undefined);
|
|
109633
110097
|
if (isTrigger) {
|
|
109634
|
-
|
|
110098
|
+
const priceString = this.numberToString(price);
|
|
109635
110099
|
if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
|
|
109636
110100
|
if (side === 'buy') {
|
|
109637
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
110101
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109638
110102
|
request['type'] = 'TAKE_PROFIT_LIMIT';
|
|
109639
110103
|
}
|
|
109640
110104
|
else {
|
|
@@ -109642,7 +110106,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109642
110106
|
}
|
|
109643
110107
|
}
|
|
109644
110108
|
else {
|
|
109645
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
110109
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109646
110110
|
request['type'] = 'STOP_LIMIT';
|
|
109647
110111
|
}
|
|
109648
110112
|
else {
|
|
@@ -109652,7 +110116,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109652
110116
|
}
|
|
109653
110117
|
else {
|
|
109654
110118
|
if (side === 'buy') {
|
|
109655
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
110119
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109656
110120
|
request['type'] = 'TAKE_PROFIT';
|
|
109657
110121
|
}
|
|
109658
110122
|
else {
|
|
@@ -109660,7 +110124,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109660
110124
|
}
|
|
109661
110125
|
}
|
|
109662
110126
|
else {
|
|
109663
|
-
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(
|
|
110127
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(priceString, triggerPrice)) {
|
|
109664
110128
|
request['type'] = 'STOP_LOSS';
|
|
109665
110129
|
}
|
|
109666
110130
|
else {
|
|
@@ -117984,6 +118448,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
117984
118448
|
request['end_timestamp'] = now;
|
|
117985
118449
|
}
|
|
117986
118450
|
else {
|
|
118451
|
+
since = Math.max(since - 1, 0);
|
|
117987
118452
|
request['start_timestamp'] = since;
|
|
117988
118453
|
if (limit === undefined) {
|
|
117989
118454
|
request['end_timestamp'] = now;
|
|
@@ -128792,32 +129257,34 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
128792
129257
|
let withdrawAvailable = this.safeValue(result[code], 'withdraw');
|
|
128793
129258
|
withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
|
|
128794
129259
|
const networks = this.safeValue(result[code], 'networks', {});
|
|
128795
|
-
|
|
128796
|
-
|
|
128797
|
-
|
|
128798
|
-
|
|
128799
|
-
|
|
128800
|
-
|
|
128801
|
-
|
|
128802
|
-
|
|
128803
|
-
|
|
128804
|
-
|
|
128805
|
-
|
|
128806
|
-
|
|
128807
|
-
'
|
|
128808
|
-
'
|
|
128809
|
-
|
|
128810
|
-
|
|
128811
|
-
|
|
128812
|
-
'
|
|
128813
|
-
|
|
128814
|
-
|
|
128815
|
-
|
|
128816
|
-
'
|
|
128817
|
-
|
|
129260
|
+
if (networkCode !== undefined) {
|
|
129261
|
+
networks[networkCode] = {
|
|
129262
|
+
'info': entry,
|
|
129263
|
+
'id': networkId,
|
|
129264
|
+
'network': networkCode,
|
|
129265
|
+
'currencyId': currencyId,
|
|
129266
|
+
'lowerCaseCurrencyId': currencyIdLower,
|
|
129267
|
+
'deposit': depositEnabled,
|
|
129268
|
+
'withdraw': withdrawEnabled,
|
|
129269
|
+
'active': active,
|
|
129270
|
+
'fee': undefined,
|
|
129271
|
+
'precision': this.parseNumber('1e-4'),
|
|
129272
|
+
'limits': {
|
|
129273
|
+
'amount': {
|
|
129274
|
+
'min': undefined,
|
|
129275
|
+
'max': undefined,
|
|
129276
|
+
},
|
|
129277
|
+
'withdraw': {
|
|
129278
|
+
'min': undefined,
|
|
129279
|
+
'max': undefined,
|
|
129280
|
+
},
|
|
129281
|
+
'deposit': {
|
|
129282
|
+
'min': undefined,
|
|
129283
|
+
'max': undefined,
|
|
129284
|
+
},
|
|
128818
129285
|
},
|
|
128819
|
-
}
|
|
128820
|
-
}
|
|
129286
|
+
};
|
|
129287
|
+
}
|
|
128821
129288
|
result[code]['networks'] = networks;
|
|
128822
129289
|
const info = this.safeValue(result[code], 'info', []);
|
|
128823
129290
|
info.push(entry);
|
|
@@ -129773,6 +130240,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129773
130240
|
const [type, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
|
129774
130241
|
const [request, requestParams] = this.prepareRequest(undefined, type, query);
|
|
129775
130242
|
let response = undefined;
|
|
130243
|
+
request['timezone'] = 'utc0'; // default to utc
|
|
129776
130244
|
if (type === 'spot' || type === 'margin') {
|
|
129777
130245
|
response = await this.publicSpotGetTickers(this.extend(request, requestParams));
|
|
129778
130246
|
}
|
|
@@ -129790,7 +130258,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129790
130258
|
response = await this.publicOptionsGetTickers(this.extend(request, requestParams));
|
|
129791
130259
|
}
|
|
129792
130260
|
else {
|
|
129793
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTickers() not support this market type');
|
|
130261
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTickers() not support this market type, provide symbols or set params["defaultType"] to one from spot/margin/swap/future/option');
|
|
129794
130262
|
}
|
|
129795
130263
|
return this.parseTickers(response, symbols);
|
|
129796
130264
|
}
|
|
@@ -132361,16 +132829,17 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
132361
132829
|
const defaultMarginMode = this.safeString2(this.options, 'marginMode', 'defaultMarginMode');
|
|
132362
132830
|
const crossLeverageLimit = this.safeString(query, 'cross_leverage_limit');
|
|
132363
132831
|
let marginMode = this.safeString(query, 'marginMode', defaultMarginMode);
|
|
132832
|
+
let stringifiedMargin = this.numberToString(leverage);
|
|
132364
132833
|
if (crossLeverageLimit !== undefined) {
|
|
132365
132834
|
marginMode = 'cross';
|
|
132366
|
-
|
|
132835
|
+
stringifiedMargin = crossLeverageLimit;
|
|
132367
132836
|
}
|
|
132368
132837
|
if (marginMode === 'cross' || marginMode === 'cross_margin') {
|
|
132369
|
-
request['cross_leverage_limit'] =
|
|
132838
|
+
request['cross_leverage_limit'] = stringifiedMargin;
|
|
132370
132839
|
request['leverage'] = '0';
|
|
132371
132840
|
}
|
|
132372
132841
|
else {
|
|
132373
|
-
request['leverage'] =
|
|
132842
|
+
request['leverage'] = stringifiedMargin;
|
|
132374
132843
|
}
|
|
132375
132844
|
let response = undefined;
|
|
132376
132845
|
if (market['swap']) {
|
|
@@ -134105,6 +134574,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
134105
134574
|
return this.parseGreeks(entry, market);
|
|
134106
134575
|
}
|
|
134107
134576
|
}
|
|
134577
|
+
return undefined;
|
|
134108
134578
|
}
|
|
134109
134579
|
parseGreeks(greeks, market = undefined) {
|
|
134110
134580
|
//
|
|
@@ -146630,7 +147100,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
146630
147100
|
const marketId = this.safeString2(order, 'contract_code', 'symbol');
|
|
146631
147101
|
market = this.safeMarket(marketId, market);
|
|
146632
147102
|
const timestamp = this.safeIntegerN(order, ['created_at', 'created-at', 'create_date']);
|
|
146633
|
-
const clientOrderId = this.safeString2(order, 'client_order_id', 'client-
|
|
147103
|
+
const clientOrderId = this.safeString2(order, 'client_order_id', 'client-or' + 'der-id'); // transpiler regex trick for php issue
|
|
146634
147104
|
let cost = undefined;
|
|
146635
147105
|
let amount = undefined;
|
|
146636
147106
|
if ((type !== undefined) && (type.indexOf('market') >= 0)) {
|
|
@@ -157365,7 +157835,9 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
157365
157835
|
request['interval'] = timeframe;
|
|
157366
157836
|
}
|
|
157367
157837
|
if (since !== undefined) {
|
|
157368
|
-
|
|
157838
|
+
// contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
|
|
157839
|
+
// the adding of '000000' is copied from the fetchTrades function
|
|
157840
|
+
request['since'] = this.numberToString(since) + '000000'; // expected to be in nanoseconds
|
|
157369
157841
|
}
|
|
157370
157842
|
const response = await this.publicGetOHLC(this.extend(request, params));
|
|
157371
157843
|
//
|
|
@@ -157897,6 +158369,41 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
157897
158369
|
// "txid": "OTI672-HJFAO-XOIPPK"
|
|
157898
158370
|
// }
|
|
157899
158371
|
//
|
|
158372
|
+
// {
|
|
158373
|
+
// "error": [],
|
|
158374
|
+
// "result": {
|
|
158375
|
+
// "open": {
|
|
158376
|
+
// "OXVPSU-Q726F-L3SDEP": {
|
|
158377
|
+
// "refid": null,
|
|
158378
|
+
// "userref": 0,
|
|
158379
|
+
// "status": "open",
|
|
158380
|
+
// "opentm": 1706893367.4656649,
|
|
158381
|
+
// "starttm": 0,
|
|
158382
|
+
// "expiretm": 0,
|
|
158383
|
+
// "descr": {
|
|
158384
|
+
// "pair": "XRPEUR",
|
|
158385
|
+
// "type": "sell",
|
|
158386
|
+
// "ordertype": "trailing-stop",
|
|
158387
|
+
// "price": "+50.0000%",
|
|
158388
|
+
// "price2": "0",
|
|
158389
|
+
// "leverage": "none",
|
|
158390
|
+
// "order": "sell 10.00000000 XRPEUR @ trailing stop +50.0000%",
|
|
158391
|
+
// "close": ""
|
|
158392
|
+
// },
|
|
158393
|
+
// "vol": "10.00000000",
|
|
158394
|
+
// "vol_exec": "0.00000000",
|
|
158395
|
+
// "cost": "0.00000000",
|
|
158396
|
+
// "fee": "0.00000000",
|
|
158397
|
+
// "price": "0.00000000",
|
|
158398
|
+
// "stopprice": "0.23424000",
|
|
158399
|
+
// "limitprice": "0.46847000",
|
|
158400
|
+
// "misc": "",
|
|
158401
|
+
// "oflags": "fciq",
|
|
158402
|
+
// "trigger": "index"
|
|
158403
|
+
// }
|
|
158404
|
+
// }
|
|
158405
|
+
// }
|
|
158406
|
+
//
|
|
157900
158407
|
const description = this.safeValue(order, 'descr', {});
|
|
157901
158408
|
const orderDescription = this.safeString(description, 'order', description);
|
|
157902
158409
|
let side = undefined;
|
|
@@ -157938,6 +158445,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
157938
158445
|
// kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
|
157939
158446
|
// const cost = this.safeString (order, 'cost');
|
|
157940
158447
|
price = this.safeString(description, 'price', price);
|
|
158448
|
+
// when type = trailling stop returns price = '+50.0000%'
|
|
158449
|
+
if ((price !== undefined) && price.endsWith('%')) {
|
|
158450
|
+
price = undefined; // this is not the price we want
|
|
158451
|
+
}
|
|
157941
158452
|
if ((price === undefined) || _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringEquals(price, '0')) {
|
|
157942
158453
|
price = this.safeString(description, 'price2');
|
|
157943
158454
|
}
|
|
@@ -159335,6 +159846,9 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
159335
159846
|
'fetchClosedOrders': undefined,
|
|
159336
159847
|
'fetchCrossBorrowRate': false,
|
|
159337
159848
|
'fetchCrossBorrowRates': false,
|
|
159849
|
+
'fetchDepositAddress': false,
|
|
159850
|
+
'fetchDepositAddresses': false,
|
|
159851
|
+
'fetchDepositAddressesByNetwork': false,
|
|
159338
159852
|
'fetchFundingHistory': undefined,
|
|
159339
159853
|
'fetchFundingRate': 'emulated',
|
|
159340
159854
|
'fetchFundingRateHistory': true,
|
|
@@ -166132,7 +166646,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
166132
166646
|
let endpart = '';
|
|
166133
166647
|
headers = (headers !== undefined) ? headers : {};
|
|
166134
166648
|
let url = this.urls['api'][api];
|
|
166135
|
-
if (
|
|
166649
|
+
if (!this.isEmpty(query)) {
|
|
166136
166650
|
if ((method === 'GET') || (method === 'DELETE')) {
|
|
166137
166651
|
endpoint += '?' + this.rawencode(query);
|
|
166138
166652
|
}
|
|
@@ -172467,7 +172981,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
172467
172981
|
|
|
172468
172982
|
// ---------------------------------------------------------------------------
|
|
172469
172983
|
/**
|
|
172470
|
-
* @class
|
|
172984
|
+
* @class lbank
|
|
172471
172985
|
* @augments Exchange
|
|
172472
172986
|
*/
|
|
172473
172987
|
class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
@@ -172505,6 +173019,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
172505
173019
|
'fetchClosedOrders': false,
|
|
172506
173020
|
'fetchCrossBorrowRate': false,
|
|
172507
173021
|
'fetchCrossBorrowRates': false,
|
|
173022
|
+
'fetchDepositAddress': true,
|
|
172508
173023
|
'fetchDepositWithdrawFee': 'emulated',
|
|
172509
173024
|
'fetchDepositWithdrawFees': true,
|
|
172510
173025
|
'fetchFundingHistory': false,
|
|
@@ -172753,7 +173268,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
172753
173268
|
async fetchTime(params = {}) {
|
|
172754
173269
|
/**
|
|
172755
173270
|
* @method
|
|
172756
|
-
* @name
|
|
173271
|
+
* @name lbank#fetchTime
|
|
172757
173272
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
172758
173273
|
* @see https://www.lbank.com/en-US/docs/index.html#get-timestamp
|
|
172759
173274
|
* @see https://www.lbank.com/en-US/docs/contract.html#get-the-current-time
|
|
@@ -172794,8 +173309,8 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
172794
173309
|
async fetchMarkets(params = {}) {
|
|
172795
173310
|
/**
|
|
172796
173311
|
* @method
|
|
172797
|
-
* @name
|
|
172798
|
-
* @description retrieves data on all markets for
|
|
173312
|
+
* @name lbank#fetchMarkets
|
|
173313
|
+
* @description retrieves data on all markets for lbank
|
|
172799
173314
|
* @see https://www.lbank.com/en-US/docs/index.html#trading-pairs
|
|
172800
173315
|
* @see https://www.lbank.com/en-US/docs/contract.html#query-contract-information-list
|
|
172801
173316
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -173048,7 +173563,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173048
173563
|
async fetchTicker(symbol, params = {}) {
|
|
173049
173564
|
/**
|
|
173050
173565
|
* @method
|
|
173051
|
-
* @name
|
|
173566
|
+
* @name lbank#fetchTicker
|
|
173052
173567
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
173053
173568
|
* @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
|
|
173054
173569
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
@@ -173093,7 +173608,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173093
173608
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
173094
173609
|
/**
|
|
173095
173610
|
* @method
|
|
173096
|
-
* @name
|
|
173611
|
+
* @name lbank#fetchTickers
|
|
173097
173612
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
173098
173613
|
* @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
|
|
173099
173614
|
* @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
|
@@ -173173,7 +173688,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173173
173688
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
173174
173689
|
/**
|
|
173175
173690
|
* @method
|
|
173176
|
-
* @name
|
|
173691
|
+
* @name lbank#fetchOrderBook
|
|
173177
173692
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
173178
173693
|
* @see https://www.lbank.com/en-US/docs/index.html#query-market-depth
|
|
173179
173694
|
* @see https://www.lbank.com/en-US/docs/contract.html#get-handicap
|
|
@@ -173362,7 +173877,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173362
173877
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
173363
173878
|
/**
|
|
173364
173879
|
* @method
|
|
173365
|
-
* @name
|
|
173880
|
+
* @name lbank#fetchTrades
|
|
173366
173881
|
* @description get the list of most recent trades for a particular symbol
|
|
173367
173882
|
* @see https://www.lbank.com/en-US/docs/index.html#query-historical-transactions
|
|
173368
173883
|
* @see https://www.lbank.com/en-US/docs/index.html#recent-transactions-list
|
|
@@ -173439,7 +173954,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173439
173954
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
173440
173955
|
/**
|
|
173441
173956
|
* @method
|
|
173442
|
-
* @name
|
|
173957
|
+
* @name lbank#fetchOHLCV
|
|
173443
173958
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
173444
173959
|
* @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
|
|
173445
173960
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
@@ -173624,7 +174139,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173624
174139
|
async fetchBalance(params = {}) {
|
|
173625
174140
|
/**
|
|
173626
174141
|
* @method
|
|
173627
|
-
* @name
|
|
174142
|
+
* @name lbank#fetchBalance
|
|
173628
174143
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
173629
174144
|
* @see https://www.lbank.com/en-US/docs/index.html#asset-information
|
|
173630
174145
|
* @see https://www.lbank.com/en-US/docs/index.html#account-information
|
|
@@ -173698,7 +174213,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173698
174213
|
async fetchTradingFee(symbol, params = {}) {
|
|
173699
174214
|
/**
|
|
173700
174215
|
* @method
|
|
173701
|
-
* @name
|
|
174216
|
+
* @name lbank#fetchTradingFee
|
|
173702
174217
|
* @description fetch the trading fees for a market
|
|
173703
174218
|
* @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
|
|
173704
174219
|
* @param {string} symbol unified market symbol
|
|
@@ -173712,7 +174227,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173712
174227
|
async fetchTradingFees(params = {}) {
|
|
173713
174228
|
/**
|
|
173714
174229
|
* @method
|
|
173715
|
-
* @name
|
|
174230
|
+
* @name lbank#fetchTradingFees
|
|
173716
174231
|
* @description fetch the trading fees for multiple markets
|
|
173717
174232
|
* @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
|
|
173718
174233
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -173753,7 +174268,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173753
174268
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
173754
174269
|
/**
|
|
173755
174270
|
* @method
|
|
173756
|
-
* @name
|
|
174271
|
+
* @name lbank#createOrder
|
|
173757
174272
|
* @description create a trade order
|
|
173758
174273
|
* @see https://www.lbank.com/en-US/docs/index.html#place-order
|
|
173759
174274
|
* @see https://www.lbank.com/en-US/docs/index.html#place-an-order
|
|
@@ -173997,7 +174512,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
173997
174512
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
173998
174513
|
/**
|
|
173999
174514
|
* @method
|
|
174000
|
-
* @name
|
|
174515
|
+
* @name lbank#fetchOrder
|
|
174001
174516
|
* @description fetches information on an order made by the user
|
|
174002
174517
|
* @see https://www.lbank.com/en-US/docs/index.html#query-order
|
|
174003
174518
|
* @see https://www.lbank.com/en-US/docs/index.html#query-order-new
|
|
@@ -174101,7 +174616,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174101
174616
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
174102
174617
|
/**
|
|
174103
174618
|
* @method
|
|
174104
|
-
* @name
|
|
174619
|
+
* @name lbank#fetchMyTrades
|
|
174105
174620
|
* @description fetch all trades made by the user
|
|
174106
174621
|
* @see https://www.lbank.com/en-US/docs/index.html#past-transaction-details
|
|
174107
174622
|
* @param {string} symbol unified market symbol
|
|
@@ -174160,7 +174675,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174160
174675
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
174161
174676
|
/**
|
|
174162
174677
|
* @method
|
|
174163
|
-
* @name
|
|
174678
|
+
* @name lbank#fetchOrders
|
|
174164
174679
|
* @description fetches information on multiple orders made by the user
|
|
174165
174680
|
* @see https://www.lbank.com/en-US/docs/index.html#query-all-orders
|
|
174166
174681
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
@@ -174220,7 +174735,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174220
174735
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
174221
174736
|
/**
|
|
174222
174737
|
* @method
|
|
174223
|
-
* @name
|
|
174738
|
+
* @name lbank#fetchOpenOrders
|
|
174224
174739
|
* @description fetch all unfilled currently open orders
|
|
174225
174740
|
* @see https://www.lbank.com/en-US/docs/index.html#current-pending-order
|
|
174226
174741
|
* @param {string} symbol unified market symbol
|
|
@@ -174277,7 +174792,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174277
174792
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
174278
174793
|
/**
|
|
174279
174794
|
* @method
|
|
174280
|
-
* @name
|
|
174795
|
+
* @name lbank#cancelOrder
|
|
174281
174796
|
* @description cancels an open order
|
|
174282
174797
|
* @see https://www.lbank.com/en-US/docs/index.html#cancel-order-new
|
|
174283
174798
|
* @param {string} id order id
|
|
@@ -174319,7 +174834,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174319
174834
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
174320
174835
|
/**
|
|
174321
174836
|
* @method
|
|
174322
|
-
* @name
|
|
174837
|
+
* @name lbank#cancelAllOrders
|
|
174323
174838
|
* @description cancel all open orders in a market
|
|
174324
174839
|
* @see https://www.lbank.com/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
|
|
174325
174840
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
@@ -174366,7 +174881,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174366
174881
|
async fetchDepositAddress(code, params = {}) {
|
|
174367
174882
|
/**
|
|
174368
174883
|
* @method
|
|
174369
|
-
* @name
|
|
174884
|
+
* @name lbank#fetchDepositAddress
|
|
174370
174885
|
* @description fetch the deposit address for a currency associated with this account
|
|
174371
174886
|
* @see https://www.lbank.com/en-US/docs/index.html#get-deposit-address
|
|
174372
174887
|
* @see https://www.lbank.com/en-US/docs/index.html#the-user-obtains-the-deposit-address
|
|
@@ -174470,7 +174985,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174470
174985
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
174471
174986
|
/**
|
|
174472
174987
|
* @method
|
|
174473
|
-
* @name
|
|
174988
|
+
* @name lbank#withdraw
|
|
174474
174989
|
* @description make a withdrawal
|
|
174475
174990
|
* @see https://www.lbank.com/en-US/docs/index.html#withdrawal
|
|
174476
174991
|
* @param {string} code unified currency code
|
|
@@ -174636,7 +175151,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174636
175151
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
174637
175152
|
/**
|
|
174638
175153
|
* @method
|
|
174639
|
-
* @name
|
|
175154
|
+
* @name lbank#fetchDeposits
|
|
174640
175155
|
* @description fetch all deposits made to an account
|
|
174641
175156
|
* @see https://www.lbank.com/en-US/docs/index.html#get-recharge-history
|
|
174642
175157
|
* @param {string} code unified currency code
|
|
@@ -174689,7 +175204,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174689
175204
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
174690
175205
|
/**
|
|
174691
175206
|
* @method
|
|
174692
|
-
* @name
|
|
175207
|
+
* @name lbank#fetchWithdrawals
|
|
174693
175208
|
* @description fetch all withdrawals made from an account
|
|
174694
175209
|
* @see https://www.lbank.com/en-US/docs/index.html#get-withdrawal-history
|
|
174695
175210
|
* @param {string} code unified currency code
|
|
@@ -174746,10 +175261,10 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174746
175261
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
174747
175262
|
/**
|
|
174748
175263
|
* @method
|
|
174749
|
-
* @name
|
|
175264
|
+
* @name lbank#fetchTransactionFees
|
|
174750
175265
|
* @deprecated
|
|
174751
175266
|
* @description please use fetchDepositWithdrawFees instead
|
|
174752
|
-
* @param {string[]|undefined} codes not used by
|
|
175267
|
+
* @param {string[]|undefined} codes not used by lbank fetchTransactionFees ()
|
|
174753
175268
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
174754
175269
|
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
174755
175270
|
*/
|
|
@@ -174895,7 +175410,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174895
175410
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
174896
175411
|
/**
|
|
174897
175412
|
* @method
|
|
174898
|
-
* @name
|
|
175413
|
+
* @name lbank#fetchDepositWithdrawFees
|
|
174899
175414
|
* @description when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying this.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
|
|
174900
175415
|
* @see https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
|
|
174901
175416
|
* @see https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
|
|
@@ -180026,7 +180541,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
180026
180541
|
}
|
|
180027
180542
|
return orderbook;
|
|
180028
180543
|
}
|
|
180029
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1,
|
|
180544
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
180545
|
+
const countKey = 2;
|
|
180030
180546
|
const price = this.safeNumber(bidask, priceKey);
|
|
180031
180547
|
const amount = this.safeNumber(bidask, amountKey);
|
|
180032
180548
|
const count = this.safeNumber(bidask, countKey);
|
|
@@ -192563,9 +193079,11 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
192563
193079
|
'tradingBot/grid/sub-orders': 1,
|
|
192564
193080
|
'tradingBot/grid/positions': 1,
|
|
192565
193081
|
'tradingBot/grid/ai-param': 1,
|
|
192566
|
-
'tradingBot/
|
|
193082
|
+
'tradingBot/signal/signals': 1,
|
|
192567
193083
|
'tradingBot/signal/orders-algo-details': 1,
|
|
193084
|
+
'tradingBot/signal/orders-algo-history': 1,
|
|
192568
193085
|
'tradingBot/signal/positions': 1,
|
|
193086
|
+
'tradingBot/signal/positions-history': 1,
|
|
192569
193087
|
'tradingBot/signal/sub-orders': 1,
|
|
192570
193088
|
'tradingBot/signal/event-history': 1,
|
|
192571
193089
|
'tradingBot/recurring/orders-algo-pending': 1,
|
|
@@ -192685,6 +193203,15 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
192685
193203
|
'tradingBot/grid/compute-margin-balance': 1,
|
|
192686
193204
|
'tradingBot/grid/margin-balance': 1,
|
|
192687
193205
|
'tradingBot/grid/min-investment': 1,
|
|
193206
|
+
'tradingBot/signal/create-signal': 1,
|
|
193207
|
+
'tradingBot/signal/order-algo': 1,
|
|
193208
|
+
'tradingBot/signal/stop-order-algo': 1,
|
|
193209
|
+
'tradingBot/signal/margin-balance': 1,
|
|
193210
|
+
'tradingBot/signal/amendTPSL': 1,
|
|
193211
|
+
'tradingBot/signal/set-instruments': 1,
|
|
193212
|
+
'tradingBot/signal/close-position': 1,
|
|
193213
|
+
'tradingBot/signal/sub-order': 1,
|
|
193214
|
+
'tradingBot/signal/cancel-sub-order': 1,
|
|
192688
193215
|
'tradingBot/recurring/order-algo': 1,
|
|
192689
193216
|
'tradingBot/recurring/amend-order-algo': 1,
|
|
192690
193217
|
'tradingBot/recurring/stop-order-algo': 1,
|
|
@@ -193732,8 +194259,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
193732
194259
|
// "msg": ""
|
|
193733
194260
|
// }
|
|
193734
194261
|
//
|
|
193735
|
-
const
|
|
193736
|
-
return this.parseMarkets(
|
|
194262
|
+
const dataResponse = this.safeValue(response, 'data', []);
|
|
194263
|
+
return this.parseMarkets(dataResponse);
|
|
193737
194264
|
}
|
|
193738
194265
|
safeNetwork(networkId) {
|
|
193739
194266
|
const networksById = {
|
|
@@ -195360,7 +195887,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
195360
195887
|
* @param {string[]|string} ids order ids
|
|
195361
195888
|
* @returns {string[]} list of order ids
|
|
195362
195889
|
*/
|
|
195363
|
-
if (typeof ids === 'string') {
|
|
195890
|
+
if ((ids !== undefined) && typeof ids === 'string') {
|
|
195364
195891
|
return ids.split(',');
|
|
195365
195892
|
}
|
|
195366
195893
|
else {
|
|
@@ -196425,10 +196952,13 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
196425
196952
|
market = this.market(symbol);
|
|
196426
196953
|
request['instId'] = market['id'];
|
|
196427
196954
|
}
|
|
196955
|
+
if (since !== undefined) {
|
|
196956
|
+
request['begin'] = since;
|
|
196957
|
+
}
|
|
196428
196958
|
[request, params] = this.handleUntilOption('end', request, params);
|
|
196429
196959
|
const [type, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
|
|
196430
196960
|
request['instType'] = this.convertToInstrumentType(type);
|
|
196431
|
-
if (limit !== undefined) {
|
|
196961
|
+
if ((limit !== undefined) && (since === undefined)) { // let limit = n, okx will return the n most recent results, instead of the n results after limit, so limit should only be sent when since is undefined
|
|
196432
196962
|
request['limit'] = limit; // default 100, max 100
|
|
196433
196963
|
}
|
|
196434
196964
|
const response = await this.privateGetTradeFillsHistory(this.extend(request, query));
|
|
@@ -199436,6 +199966,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
199436
199966
|
return this.parseGreeks(entry, market);
|
|
199437
199967
|
}
|
|
199438
199968
|
}
|
|
199969
|
+
return undefined;
|
|
199439
199970
|
}
|
|
199440
199971
|
parseGreeks(greeks, market = undefined) {
|
|
199441
199972
|
//
|
|
@@ -204610,7 +205141,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
204610
205141
|
return orderbook;
|
|
204611
205142
|
}
|
|
204612
205143
|
toEn(n, scale) {
|
|
204613
|
-
const stringN =
|
|
205144
|
+
const stringN = this.numberToString(n);
|
|
204614
205145
|
const precise = new _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O(stringN);
|
|
204615
205146
|
precise.decimals = precise.decimals - scale;
|
|
204616
205147
|
precise.reduce();
|
|
@@ -206003,11 +206534,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
206003
206534
|
}
|
|
206004
206535
|
}
|
|
206005
206536
|
cost = (cost === undefined) ? amount : cost;
|
|
206006
|
-
const costString =
|
|
206537
|
+
const costString = this.numberToString(cost);
|
|
206007
206538
|
request['quoteQtyEv'] = this.toEv(costString, market);
|
|
206008
206539
|
}
|
|
206009
206540
|
else {
|
|
206010
|
-
const amountString =
|
|
206541
|
+
const amountString = this.numberToString(amount);
|
|
206011
206542
|
request['baseQtyEv'] = this.toEv(amountString, market);
|
|
206012
206543
|
}
|
|
206013
206544
|
}
|
|
@@ -206025,7 +206556,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
206025
206556
|
request['orderQtyRq'] = amount;
|
|
206026
206557
|
}
|
|
206027
206558
|
else {
|
|
206028
|
-
request['orderQty'] =
|
|
206559
|
+
request['orderQty'] = this.parseToInt(amount);
|
|
206029
206560
|
}
|
|
206030
206561
|
if (stopPrice !== undefined) {
|
|
206031
206562
|
const triggerType = this.safeString(params, 'triggerType', 'ByMarkPrice');
|
|
@@ -207822,10 +208353,10 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
207822
208353
|
request['leverageRr'] = leverage;
|
|
207823
208354
|
}
|
|
207824
208355
|
else {
|
|
207825
|
-
const
|
|
207826
|
-
const
|
|
207827
|
-
request['longLeverageRr'] =
|
|
207828
|
-
request['shortLeverageRr'] =
|
|
208356
|
+
const longVar = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
|
|
208357
|
+
const shortVar = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
|
|
208358
|
+
request['longLeverageRr'] = longVar;
|
|
208359
|
+
request['shortLeverageRr'] = shortVar;
|
|
207829
208360
|
}
|
|
207830
208361
|
response = await this.privatePutGPositionsLeverage(this.extend(request, params));
|
|
207831
208362
|
}
|
|
@@ -210629,6 +211160,9 @@ class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MOD
|
|
|
210629
211160
|
'fetchBalance': true,
|
|
210630
211161
|
'fetchClosedOrders': true,
|
|
210631
211162
|
'fetchCurrencies': false,
|
|
211163
|
+
'fetchDepositAddress': false,
|
|
211164
|
+
'fetchDepositAddresses': false,
|
|
211165
|
+
'fetchDepositAddressesByNetwork': false,
|
|
210632
211166
|
'fetchFundingRate': true,
|
|
210633
211167
|
'fetchFundingRateHistory': false,
|
|
210634
211168
|
'fetchL3OrderBook': true,
|
|
@@ -213010,13 +213544,16 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
213010
213544
|
const T = this.safeString(data, 'T');
|
|
213011
213545
|
const msg = this.safeValue(data, 'msg', {});
|
|
213012
213546
|
if (T === 'subscription') {
|
|
213013
|
-
|
|
213547
|
+
this.handleSubscription(client, data);
|
|
213548
|
+
return;
|
|
213014
213549
|
}
|
|
213015
213550
|
if (T === 'success' && msg === 'connected') {
|
|
213016
|
-
|
|
213551
|
+
this.handleConnected(client, data);
|
|
213552
|
+
return;
|
|
213017
213553
|
}
|
|
213018
213554
|
if (T === 'success' && msg === 'authenticated') {
|
|
213019
|
-
|
|
213555
|
+
this.handleAuthenticate(client, data);
|
|
213556
|
+
return;
|
|
213020
213557
|
}
|
|
213021
213558
|
const methods = {
|
|
213022
213559
|
'error': this.handleErrorMessage,
|
|
@@ -213045,7 +213582,8 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
213045
213582
|
}
|
|
213046
213583
|
handleMessage(client, message) {
|
|
213047
213584
|
if (Array.isArray(message)) {
|
|
213048
|
-
|
|
213585
|
+
this.handleCryptoMessage(client, message);
|
|
213586
|
+
return;
|
|
213049
213587
|
}
|
|
213050
213588
|
this.handleTradingMessage(client, message);
|
|
213051
213589
|
}
|
|
@@ -214007,7 +214545,6 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
214007
214545
|
this.handleBalance(client, message);
|
|
214008
214546
|
}
|
|
214009
214547
|
}
|
|
214010
|
-
return message;
|
|
214011
214548
|
}
|
|
214012
214549
|
handleSubscriptionStatus(client, message) {
|
|
214013
214550
|
//
|
|
@@ -214047,7 +214584,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
214047
214584
|
handlePing(client, message) {
|
|
214048
214585
|
this.spawn(this.pong, client, message);
|
|
214049
214586
|
}
|
|
214050
|
-
authenticate(url, params = {}) {
|
|
214587
|
+
async authenticate(url, params = {}) {
|
|
214051
214588
|
this.checkRequiredCredentials();
|
|
214052
214589
|
const messageHash = 'authenticated';
|
|
214053
214590
|
const client = this.client(url);
|
|
@@ -214673,7 +215210,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
214673
215210
|
*/
|
|
214674
215211
|
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
214675
215212
|
}
|
|
214676
|
-
|
|
215213
|
+
parseWsTrade(trade, market = undefined) {
|
|
214677
215214
|
//
|
|
214678
215215
|
// public watchTrades
|
|
214679
215216
|
//
|
|
@@ -214781,7 +215318,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
214781
215318
|
const executionType = this.safeString(trade, 'x');
|
|
214782
215319
|
const isTradeExecution = (executionType === 'TRADE');
|
|
214783
215320
|
if (!isTradeExecution) {
|
|
214784
|
-
return
|
|
215321
|
+
return this.parseTrade(trade, market);
|
|
214785
215322
|
}
|
|
214786
215323
|
const id = this.safeString2(trade, 't', 'a');
|
|
214787
215324
|
const timestamp = this.safeInteger(trade, 'T');
|
|
@@ -214846,7 +215383,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
214846
215383
|
const lowerCaseId = this.safeStringLower(message, 's');
|
|
214847
215384
|
const event = this.safeString(message, 'e');
|
|
214848
215385
|
const messageHash = lowerCaseId + '@' + event;
|
|
214849
|
-
const trade = this.
|
|
215386
|
+
const trade = this.parseWsTrade(message, market);
|
|
214850
215387
|
let tradesArray = this.safeValue(this.trades, symbol);
|
|
214851
215388
|
if (tradesArray === undefined) {
|
|
214852
215389
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
@@ -215396,14 +215933,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215396
215933
|
for (let j = 0; j < subscriptionKeys.length; j++) {
|
|
215397
215934
|
const subscribeType = subscriptionKeys[j];
|
|
215398
215935
|
if (subscribeType === type) {
|
|
215399
|
-
|
|
215936
|
+
this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
|
|
215937
|
+
return;
|
|
215400
215938
|
}
|
|
215401
215939
|
}
|
|
215402
215940
|
}
|
|
215403
215941
|
}
|
|
215404
215942
|
setBalanceCache(client, type) {
|
|
215405
215943
|
if (type in client.subscriptions) {
|
|
215406
|
-
return
|
|
215944
|
+
return;
|
|
215407
215945
|
}
|
|
215408
215946
|
const options = this.safeValue(this.options, 'watchBalance');
|
|
215409
215947
|
const fetchBalanceSnapshot = this.safeBool(options, 'fetchBalanceSnapshot', false);
|
|
@@ -215504,7 +216042,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215504
216042
|
//
|
|
215505
216043
|
const messageHash = this.safeString(message, 'id');
|
|
215506
216044
|
const result = this.safeValue(message, 'result', {});
|
|
215507
|
-
const parsedBalances = this.parseBalance(result
|
|
216045
|
+
const parsedBalances = this.parseBalance(result);
|
|
215508
216046
|
client.resolve(parsedBalances, messageHash);
|
|
215509
216047
|
}
|
|
215510
216048
|
async watchBalance(params = {}) {
|
|
@@ -216877,13 +217415,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
216877
217415
|
const status = this.safeString(message, 'status');
|
|
216878
217416
|
const error = this.safeValue(message, 'error');
|
|
216879
217417
|
if ((error !== undefined) || (status !== undefined && status !== '200')) {
|
|
216880
|
-
|
|
217418
|
+
this.handleWsError(client, message);
|
|
217419
|
+
return;
|
|
216881
217420
|
}
|
|
216882
217421
|
const id = this.safeString(message, 'id');
|
|
216883
217422
|
const subscriptions = this.safeValue(client.subscriptions, id);
|
|
216884
217423
|
let method = this.safeValue(subscriptions, 'method');
|
|
216885
217424
|
if (method !== undefined) {
|
|
216886
|
-
|
|
217425
|
+
method.call(this, client, message);
|
|
217426
|
+
return;
|
|
216887
217427
|
}
|
|
216888
217428
|
// handle other APIs
|
|
216889
217429
|
const methods = {
|
|
@@ -216913,7 +217453,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
216913
217453
|
if (method === undefined) {
|
|
216914
217454
|
const requestId = this.safeString(message, 'id');
|
|
216915
217455
|
if (requestId !== undefined) {
|
|
216916
|
-
|
|
217456
|
+
this.handleSubscriptionStatus(client, message);
|
|
217457
|
+
return;
|
|
216917
217458
|
}
|
|
216918
217459
|
// special case for the real-time bookTicker, since it comes without an event identifier
|
|
216919
217460
|
//
|
|
@@ -216932,7 +217473,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
216932
217473
|
}
|
|
216933
217474
|
}
|
|
216934
217475
|
else {
|
|
216935
|
-
|
|
217476
|
+
method.call(this, client, message);
|
|
216936
217477
|
}
|
|
216937
217478
|
}
|
|
216938
217479
|
}
|
|
@@ -217803,7 +218344,7 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
217803
218344
|
}
|
|
217804
218345
|
setBalanceCache(client, type, subscriptionHash, params) {
|
|
217805
218346
|
if (subscriptionHash in client.subscriptions) {
|
|
217806
|
-
return
|
|
218347
|
+
return;
|
|
217807
218348
|
}
|
|
217808
218349
|
const fetchBalanceSnapshot = this.handleOptionAndParams(params, 'watchBalance', 'fetchBalanceSnapshot', true);
|
|
217809
218350
|
if (fetchBalanceSnapshot) {
|
|
@@ -218367,7 +218908,6 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218367
218908
|
stored.append(trade);
|
|
218368
218909
|
}
|
|
218369
218910
|
client.resolve(stored, messageHash);
|
|
218370
|
-
return message;
|
|
218371
218911
|
}
|
|
218372
218912
|
parseTrade(trade, market = undefined) {
|
|
218373
218913
|
//
|
|
@@ -218557,8 +219097,9 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218557
219097
|
const delta = deltas[i];
|
|
218558
219098
|
const id = this.safeString(delta, 0);
|
|
218559
219099
|
const price = this.safeFloat(delta, 1);
|
|
218560
|
-
const
|
|
218561
|
-
const
|
|
219100
|
+
const delta2Value = delta[2];
|
|
219101
|
+
const size = (delta2Value < 0) ? -delta2Value : delta2Value;
|
|
219102
|
+
const side = (delta2Value < 0) ? 'asks' : 'bids';
|
|
218562
219103
|
const bookside = orderbook[side];
|
|
218563
219104
|
bookside.store(price, size, id);
|
|
218564
219105
|
}
|
|
@@ -218567,10 +219108,11 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218567
219108
|
const deltas = message[1];
|
|
218568
219109
|
for (let i = 0; i < deltas.length; i++) {
|
|
218569
219110
|
const delta = deltas[i];
|
|
218570
|
-
const
|
|
218571
|
-
const
|
|
218572
|
-
const
|
|
218573
|
-
|
|
219111
|
+
const delta2 = delta[2];
|
|
219112
|
+
const size = (delta2 < 0) ? -delta2 : delta2;
|
|
219113
|
+
const side = (delta2 < 0) ? 'asks' : 'bids';
|
|
219114
|
+
const countedBookSide = orderbook[side];
|
|
219115
|
+
countedBookSide.store(delta[0], size, delta[1]);
|
|
218574
219116
|
}
|
|
218575
219117
|
}
|
|
218576
219118
|
client.resolve(orderbook, messageHash);
|
|
@@ -218580,18 +219122,20 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218580
219122
|
if (isRaw) {
|
|
218581
219123
|
const id = this.safeString(message, 1);
|
|
218582
219124
|
const price = this.safeString(message, 2);
|
|
218583
|
-
const
|
|
218584
|
-
const
|
|
219125
|
+
const message3 = message[3];
|
|
219126
|
+
const size = (message3 < 0) ? -message3 : message3;
|
|
219127
|
+
const side = (message3 < 0) ? 'asks' : 'bids';
|
|
218585
219128
|
const bookside = orderbook[side];
|
|
218586
219129
|
// price = 0 means that you have to remove the order from your book
|
|
218587
219130
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
|
|
218588
219131
|
bookside.store(this.parseNumber(price), this.parseNumber(amount), id);
|
|
218589
219132
|
}
|
|
218590
219133
|
else {
|
|
218591
|
-
const
|
|
218592
|
-
const
|
|
218593
|
-
const
|
|
218594
|
-
|
|
219134
|
+
const message3Value = message[3];
|
|
219135
|
+
const size = (message3Value < 0) ? -message3Value : message3Value;
|
|
219136
|
+
const side = (message3Value < 0) ? 'asks' : 'bids';
|
|
219137
|
+
const countedBookSide = orderbook[side];
|
|
219138
|
+
countedBookSide.store(message[1], size, message[2]);
|
|
218595
219139
|
}
|
|
218596
219140
|
client.resolve(orderbook, messageHash);
|
|
218597
219141
|
}
|
|
@@ -218852,7 +219396,7 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218852
219396
|
// ]
|
|
218853
219397
|
//
|
|
218854
219398
|
if (message[1] === 'hb') {
|
|
218855
|
-
return
|
|
219399
|
+
return; // skip heartbeats within subscription channels for now
|
|
218856
219400
|
}
|
|
218857
219401
|
const subscription = this.safeValue(client.subscriptions, channelId, {});
|
|
218858
219402
|
const channel = this.safeString(subscription, 'channel');
|
|
@@ -218867,11 +219411,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218867
219411
|
'oc': this.handleOrders,
|
|
218868
219412
|
};
|
|
218869
219413
|
const method = this.safeValue2(methods, channel, name);
|
|
218870
|
-
if (method
|
|
218871
|
-
|
|
218872
|
-
}
|
|
218873
|
-
else {
|
|
218874
|
-
return method.call(this, client, message, subscription);
|
|
219414
|
+
if (method !== undefined) {
|
|
219415
|
+
method.call(this, client, message, subscription);
|
|
218875
219416
|
}
|
|
218876
219417
|
}
|
|
218877
219418
|
else {
|
|
@@ -218893,11 +219434,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218893
219434
|
'auth': this.handleAuthenticationMessage,
|
|
218894
219435
|
};
|
|
218895
219436
|
const method = this.safeValue(methods, event);
|
|
218896
|
-
if (method
|
|
218897
|
-
|
|
218898
|
-
}
|
|
218899
|
-
else {
|
|
218900
|
-
return method.call(this, client, message);
|
|
219437
|
+
if (method !== undefined) {
|
|
219438
|
+
method.call(this, client, message);
|
|
218901
219439
|
}
|
|
218902
219440
|
}
|
|
218903
219441
|
}
|
|
@@ -219256,7 +219794,6 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219256
219794
|
stored.append(parsed);
|
|
219257
219795
|
}
|
|
219258
219796
|
client.resolve(stored, messageHash);
|
|
219259
|
-
return message;
|
|
219260
219797
|
}
|
|
219261
219798
|
parseWsTrade(trade, market = undefined) {
|
|
219262
219799
|
//
|
|
@@ -219508,8 +220045,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219508
220045
|
const deltas = message[1];
|
|
219509
220046
|
for (let i = 0; i < deltas.length; i++) {
|
|
219510
220047
|
const delta = deltas[i];
|
|
219511
|
-
const
|
|
219512
|
-
const
|
|
220048
|
+
const delta2 = delta[2];
|
|
220049
|
+
const size = (delta2 < 0) ? -delta2 : delta2;
|
|
220050
|
+
const side = (delta2 < 0) ? 'asks' : 'bids';
|
|
219513
220051
|
const bookside = orderbook[side];
|
|
219514
220052
|
const idString = this.safeString(delta, 0);
|
|
219515
220053
|
const price = this.safeFloat(delta, 1);
|
|
@@ -219537,8 +220075,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219537
220075
|
const orderbookItem = this.orderbooks[symbol];
|
|
219538
220076
|
if (isRaw) {
|
|
219539
220077
|
const price = this.safeString(deltas, 1);
|
|
219540
|
-
const
|
|
219541
|
-
const
|
|
220078
|
+
const deltas2 = deltas[2];
|
|
220079
|
+
const size = (deltas2 < 0) ? -deltas2 : deltas2;
|
|
220080
|
+
const side = (deltas2 < 0) ? 'asks' : 'bids';
|
|
219542
220081
|
const bookside = orderbookItem[side];
|
|
219543
220082
|
// price = 0 means that you have to remove the order from your book
|
|
219544
220083
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
|
|
@@ -219586,7 +220125,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219586
220125
|
}
|
|
219587
220126
|
if (ask !== undefined) {
|
|
219588
220127
|
stringArray.push(this.numberToString(asks[i][idToCheck]));
|
|
219589
|
-
|
|
220128
|
+
const aski1 = asks[i][1];
|
|
220129
|
+
stringArray.push(this.numberToString(-aski1));
|
|
219590
220130
|
}
|
|
219591
220131
|
}
|
|
219592
220132
|
const payload = stringArray.join(':');
|
|
@@ -220018,7 +220558,7 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220018
220558
|
//
|
|
220019
220559
|
if (Array.isArray(message)) {
|
|
220020
220560
|
if (message[1] === 'hb') {
|
|
220021
|
-
return
|
|
220561
|
+
return; // skip heartbeats within subscription channels for now
|
|
220022
220562
|
}
|
|
220023
220563
|
const subscription = this.safeValue(client.subscriptions, channelId, {});
|
|
220024
220564
|
const channel = this.safeString(subscription, 'channel');
|
|
@@ -220046,11 +220586,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220046
220586
|
else {
|
|
220047
220587
|
method = this.safeValue2(publicMethods, name, channel);
|
|
220048
220588
|
}
|
|
220049
|
-
if (method
|
|
220050
|
-
|
|
220051
|
-
}
|
|
220052
|
-
else {
|
|
220053
|
-
return method.call(this, client, message, subscription);
|
|
220589
|
+
if (method !== undefined) {
|
|
220590
|
+
method.call(this, client, message, subscription);
|
|
220054
220591
|
}
|
|
220055
220592
|
}
|
|
220056
220593
|
else {
|
|
@@ -220062,11 +220599,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220062
220599
|
'auth': this.handleAuthenticationMessage,
|
|
220063
220600
|
};
|
|
220064
220601
|
const method = this.safeValue(methods, event);
|
|
220065
|
-
if (method
|
|
220066
|
-
|
|
220067
|
-
}
|
|
220068
|
-
else {
|
|
220069
|
-
return method.call(this, client, message);
|
|
220602
|
+
if (method !== undefined) {
|
|
220603
|
+
method.call(this, client, message);
|
|
220070
220604
|
}
|
|
220071
220605
|
}
|
|
220072
220606
|
}
|
|
@@ -220181,7 +220715,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
220181
220715
|
else {
|
|
220182
220716
|
instType = 'SPOT';
|
|
220183
220717
|
}
|
|
220184
|
-
|
|
220718
|
+
let instypeAux = undefined;
|
|
220719
|
+
[instypeAux, params] = this.handleOptionAndParams(params, 'getInstType', 'instType', instType);
|
|
220720
|
+
instType = instypeAux;
|
|
220185
220721
|
return [instType, params];
|
|
220186
220722
|
}
|
|
220187
220723
|
async watchTicker(symbol, params = {}) {
|
|
@@ -222645,7 +223181,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
222645
223181
|
messageHash += ':' + this.safeString(data[0], 'symbol');
|
|
222646
223182
|
}
|
|
222647
223183
|
client.resolve(stored, messageHash);
|
|
222648
|
-
return message;
|
|
222649
223184
|
}
|
|
222650
223185
|
parseWsTrade(trade, market = undefined) {
|
|
222651
223186
|
// spot
|
|
@@ -222747,7 +223282,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
222747
223282
|
client.resolve(ticker, 'tickers::swap');
|
|
222748
223283
|
this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
|
|
222749
223284
|
}
|
|
222750
|
-
return message;
|
|
222751
223285
|
}
|
|
222752
223286
|
resolveMessageHashesForSymbol(client, symbol, result, prexif) {
|
|
222753
223287
|
const prefixSeparator = '::';
|
|
@@ -223281,11 +223815,8 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223281
223815
|
'subscribe': this.handleSubscriptionStatus,
|
|
223282
223816
|
};
|
|
223283
223817
|
const method = this.safeValue(methods, event);
|
|
223284
|
-
if (method
|
|
223285
|
-
|
|
223286
|
-
}
|
|
223287
|
-
else {
|
|
223288
|
-
return method.call(this, client, message);
|
|
223818
|
+
if (method !== undefined) {
|
|
223819
|
+
method.call(this, client, message);
|
|
223289
223820
|
}
|
|
223290
223821
|
}
|
|
223291
223822
|
}
|
|
@@ -223305,7 +223836,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223305
223836
|
const key = keys[i];
|
|
223306
223837
|
if (channel.indexOf(key) >= 0) {
|
|
223307
223838
|
const method = this.safeValue(methods, key);
|
|
223308
|
-
|
|
223839
|
+
method.call(this, client, message);
|
|
223309
223840
|
}
|
|
223310
223841
|
}
|
|
223311
223842
|
}
|
|
@@ -224848,7 +225379,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
224848
225379
|
//
|
|
224849
225380
|
// { "error": "Rate limit exceeded, retry in 29 seconds." }
|
|
224850
225381
|
//
|
|
224851
|
-
const error = this.
|
|
225382
|
+
const error = this.safeString(message, 'error');
|
|
224852
225383
|
if (error !== undefined) {
|
|
224853
225384
|
const request = this.safeValue(message, 'request', {});
|
|
224854
225385
|
const args = this.safeValue(request, 'args', []);
|
|
@@ -224859,7 +225390,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
224859
225390
|
const broadKey = this.findBroadlyMatchedKey(broad, error);
|
|
224860
225391
|
let exception = undefined;
|
|
224861
225392
|
if (broadKey === undefined) {
|
|
224862
|
-
exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(error);
|
|
225393
|
+
exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(error); // c# requirement for now
|
|
224863
225394
|
}
|
|
224864
225395
|
else {
|
|
224865
225396
|
exception = new broad[broadKey](error);
|
|
@@ -224927,14 +225458,11 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
224927
225458
|
const request = this.safeValue(message, 'request', {});
|
|
224928
225459
|
const op = this.safeValue(request, 'op');
|
|
224929
225460
|
if (op === 'authKeyExpires') {
|
|
224930
|
-
|
|
224931
|
-
}
|
|
224932
|
-
else {
|
|
224933
|
-
return message;
|
|
225461
|
+
this.handleAuthenticationMessage(client, message);
|
|
224934
225462
|
}
|
|
224935
225463
|
}
|
|
224936
225464
|
else {
|
|
224937
|
-
|
|
225465
|
+
method.call(this, client, message);
|
|
224938
225466
|
}
|
|
224939
225467
|
}
|
|
224940
225468
|
}
|
|
@@ -225416,11 +225944,8 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
225416
225944
|
};
|
|
225417
225945
|
const event = this.safeString(message, 'event');
|
|
225418
225946
|
const method = this.safeValue(methods, event);
|
|
225419
|
-
if (method
|
|
225420
|
-
|
|
225421
|
-
}
|
|
225422
|
-
else {
|
|
225423
|
-
return method.call(this, client, message);
|
|
225947
|
+
if (method !== undefined) {
|
|
225948
|
+
method.call(this, client, message);
|
|
225424
225949
|
}
|
|
225425
225950
|
}
|
|
225426
225951
|
}
|
|
@@ -225876,7 +226401,7 @@ class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
225876
226401
|
catch (error) {
|
|
225877
226402
|
this.options['listenKey'] = undefined;
|
|
225878
226403
|
this.options['listenKeyUrl'] = undefined;
|
|
225879
|
-
return;
|
|
226404
|
+
return undefined;
|
|
225880
226405
|
}
|
|
225881
226406
|
//
|
|
225882
226407
|
// {
|
|
@@ -226430,10 +226955,10 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
226430
226955
|
//
|
|
226431
226956
|
const event = this.safeString(message, 'event');
|
|
226432
226957
|
if (event === 'bts:subscription_succeeded') {
|
|
226433
|
-
|
|
226958
|
+
this.handleSubscriptionStatus(client, message);
|
|
226434
226959
|
}
|
|
226435
226960
|
else {
|
|
226436
|
-
|
|
226961
|
+
this.handleSubject(client, message);
|
|
226437
226962
|
}
|
|
226438
226963
|
}
|
|
226439
226964
|
async authenticate(params = {}) {
|
|
@@ -226456,7 +226981,6 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
226456
226981
|
this.options['expiresIn'] = this.sum(time, validity);
|
|
226457
226982
|
this.options['userId'] = userId;
|
|
226458
226983
|
this.options['wsSessionToken'] = sessionToken;
|
|
226459
|
-
return response;
|
|
226460
226984
|
}
|
|
226461
226985
|
}
|
|
226462
226986
|
}
|
|
@@ -226900,7 +227424,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
226900
227424
|
//
|
|
226901
227425
|
const response = this.safeValue(message, 'response');
|
|
226902
227426
|
if (response === undefined) {
|
|
226903
|
-
return
|
|
227427
|
+
return;
|
|
226904
227428
|
}
|
|
226905
227429
|
const marketId = this.safeString(response, 'market');
|
|
226906
227430
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
@@ -227682,7 +228206,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
227682
228206
|
}
|
|
227683
228207
|
return message;
|
|
227684
228208
|
}
|
|
227685
|
-
authenticate(params = {}) {
|
|
228209
|
+
async authenticate(params = {}) {
|
|
227686
228210
|
const url = this.urls['api']['ws'];
|
|
227687
228211
|
const client = this.client(url);
|
|
227688
228212
|
const messageHash = 'authenticated';
|
|
@@ -227827,9 +228351,16 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
227827
228351
|
'getCandles': this.handleFetchOHLCV,
|
|
227828
228352
|
'getMarkets': this.handleMarkets,
|
|
227829
228353
|
};
|
|
227830
|
-
const event = this.
|
|
227831
|
-
|
|
227832
|
-
if (method
|
|
228354
|
+
const event = this.safeString(message, 'event');
|
|
228355
|
+
let method = this.safeValue(methods, event);
|
|
228356
|
+
if (method === undefined) {
|
|
228357
|
+
const action = this.safeString(message, 'action');
|
|
228358
|
+
method = this.safeValue(methods, action);
|
|
228359
|
+
if (method !== undefined) {
|
|
228360
|
+
method.call(this, client, message);
|
|
228361
|
+
}
|
|
228362
|
+
}
|
|
228363
|
+
else {
|
|
227833
228364
|
method.call(this, client, message);
|
|
227834
228365
|
}
|
|
227835
228366
|
}
|
|
@@ -227945,7 +228476,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
227945
228476
|
//
|
|
227946
228477
|
const event = this.safeString(message, 'event');
|
|
227947
228478
|
if (event === 'subscribed') {
|
|
227948
|
-
return
|
|
228479
|
+
return;
|
|
227949
228480
|
}
|
|
227950
228481
|
const result = { 'info': message };
|
|
227951
228482
|
const balances = this.safeValue(message, 'balances', []);
|
|
@@ -228015,11 +228546,9 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228015
228546
|
// }
|
|
228016
228547
|
//
|
|
228017
228548
|
const event = this.safeString(message, 'event');
|
|
228018
|
-
if (event === '
|
|
228019
|
-
|
|
228020
|
-
|
|
228021
|
-
else if (event === 'rejected') {
|
|
228022
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + this.json(message));
|
|
228549
|
+
if (event === 'rejected') {
|
|
228550
|
+
const jsonMessage = this.json(message);
|
|
228551
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + jsonMessage);
|
|
228023
228552
|
}
|
|
228024
228553
|
else if (event === 'updated') {
|
|
228025
228554
|
const marketId = this.safeString(message, 'symbol');
|
|
@@ -228039,7 +228568,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228039
228568
|
stored.append(ohlcv);
|
|
228040
228569
|
client.resolve(stored, messageHash);
|
|
228041
228570
|
}
|
|
228042
|
-
else {
|
|
228571
|
+
else if (event !== 'subscribed') {
|
|
228043
228572
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' ' + this.json(message));
|
|
228044
228573
|
}
|
|
228045
228574
|
}
|
|
@@ -228101,7 +228630,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228101
228630
|
const symbol = market['symbol'];
|
|
228102
228631
|
let ticker = undefined;
|
|
228103
228632
|
if (event === 'subscribed') {
|
|
228104
|
-
return
|
|
228633
|
+
return;
|
|
228105
228634
|
}
|
|
228106
228635
|
else if (event === 'snapshot') {
|
|
228107
228636
|
ticker = this.parseTicker(message, market);
|
|
@@ -228200,7 +228729,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228200
228729
|
//
|
|
228201
228730
|
const event = this.safeString(message, 'event');
|
|
228202
228731
|
if (event !== 'updated') {
|
|
228203
|
-
return
|
|
228732
|
+
return;
|
|
228204
228733
|
}
|
|
228205
228734
|
const marketId = this.safeString(message, 'symbol');
|
|
228206
228735
|
const symbol = this.safeSymbol(marketId);
|
|
@@ -228362,7 +228891,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228362
228891
|
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
228363
228892
|
}
|
|
228364
228893
|
if (event === 'subscribed') {
|
|
228365
|
-
return
|
|
228894
|
+
return;
|
|
228366
228895
|
}
|
|
228367
228896
|
else if (event === 'rejected') {
|
|
228368
228897
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + this.json(message));
|
|
@@ -228532,30 +229061,30 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228532
229061
|
const messageHash = 'orderbook:' + symbol + ':' + type;
|
|
228533
229062
|
const datetime = this.safeString(message, 'timestamp');
|
|
228534
229063
|
const timestamp = this.parse8601(datetime);
|
|
228535
|
-
let
|
|
228536
|
-
if (
|
|
228537
|
-
|
|
228538
|
-
this.orderbooks[symbol] =
|
|
229064
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
229065
|
+
if (orderbook === undefined) {
|
|
229066
|
+
orderbook = this.countedOrderBook({});
|
|
229067
|
+
this.orderbooks[symbol] = orderbook;
|
|
228539
229068
|
}
|
|
228540
229069
|
if (event === 'subscribed') {
|
|
228541
|
-
return
|
|
229070
|
+
return;
|
|
228542
229071
|
}
|
|
228543
229072
|
else if (event === 'snapshot') {
|
|
228544
229073
|
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'px', 'qty', 'num');
|
|
228545
|
-
|
|
229074
|
+
orderbook.reset(snapshot);
|
|
228546
229075
|
}
|
|
228547
229076
|
else if (event === 'updated') {
|
|
228548
229077
|
const asks = this.safeValue(message, 'asks', []);
|
|
228549
229078
|
const bids = this.safeValue(message, 'bids', []);
|
|
228550
|
-
this.handleDeltas(
|
|
228551
|
-
this.handleDeltas(
|
|
228552
|
-
|
|
228553
|
-
|
|
229079
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
229080
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
229081
|
+
orderbook['timestamp'] = timestamp;
|
|
229082
|
+
orderbook['datetime'] = datetime;
|
|
228554
229083
|
}
|
|
228555
229084
|
else {
|
|
228556
229085
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() does not support ' + event + ' yet');
|
|
228557
229086
|
}
|
|
228558
|
-
client.resolve(
|
|
229087
|
+
client.resolve(orderbook, messageHash);
|
|
228559
229088
|
}
|
|
228560
229089
|
handleDelta(bookside, delta) {
|
|
228561
229090
|
const bookArray = this.parseBidAsk(delta, 'px', 'qty', 'num');
|
|
@@ -228596,7 +229125,8 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228596
229125
|
};
|
|
228597
229126
|
const handler = this.safeValue(handlers, channel);
|
|
228598
229127
|
if (handler !== undefined) {
|
|
228599
|
-
|
|
229128
|
+
handler.call(this, client, message);
|
|
229129
|
+
return;
|
|
228600
229130
|
}
|
|
228601
229131
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
|
|
228602
229132
|
}
|
|
@@ -228618,7 +229148,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228618
229148
|
future.resolve(true);
|
|
228619
229149
|
}
|
|
228620
229150
|
}
|
|
228621
|
-
authenticate(params = {}) {
|
|
229151
|
+
async authenticate(params = {}) {
|
|
228622
229152
|
const url = this.urls['api']['ws'];
|
|
228623
229153
|
const client = this.client(url);
|
|
228624
229154
|
const messageHash = 'authenticated';
|
|
@@ -229555,7 +230085,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
229555
230085
|
* @name bybit#watchPositions
|
|
229556
230086
|
* @see https://bybit-exchange.github.io/docs/v5/websocket/private/position
|
|
229557
230087
|
* @description watch all open positions
|
|
229558
|
-
* @param {string[]
|
|
230088
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
229559
230089
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
229560
230090
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
229561
230091
|
*/
|
|
@@ -229588,7 +230118,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
229588
230118
|
}
|
|
229589
230119
|
setPositionsCache(client, symbols = undefined) {
|
|
229590
230120
|
if (this.positions !== undefined) {
|
|
229591
|
-
return
|
|
230121
|
+
return;
|
|
229592
230122
|
}
|
|
229593
230123
|
const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
|
|
229594
230124
|
if (fetchPositionsSnapshot) {
|
|
@@ -229721,7 +230251,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
229721
230251
|
}
|
|
229722
230252
|
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
229723
230253
|
}
|
|
229724
|
-
handleOrder(client, message
|
|
230254
|
+
handleOrder(client, message) {
|
|
229725
230255
|
//
|
|
229726
230256
|
// spot
|
|
229727
230257
|
// {
|
|
@@ -230287,7 +230817,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230287
230817
|
const authenticated = this.safeValue(client.subscriptions, messageHash);
|
|
230288
230818
|
if (authenticated === undefined) {
|
|
230289
230819
|
const expiresInt = this.milliseconds() + 10000;
|
|
230290
|
-
const expires =
|
|
230820
|
+
const expires = this.numberToString(expiresInt);
|
|
230291
230821
|
const path = 'GET/realtime';
|
|
230292
230822
|
const auth = path + expires;
|
|
230293
230823
|
const signature = this.hmac(this.encode(auth), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_3__/* .sha256 */ .J, 'hex');
|
|
@@ -230300,7 +230830,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230300
230830
|
const message = this.extend(request, params);
|
|
230301
230831
|
this.watch(url, messageHash, message, messageHash);
|
|
230302
230832
|
}
|
|
230303
|
-
return future;
|
|
230833
|
+
return await future;
|
|
230304
230834
|
}
|
|
230305
230835
|
handleErrorMessage(client, message) {
|
|
230306
230836
|
//
|
|
@@ -231462,15 +231992,15 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
231462
231992
|
const messageHash = 'orderbook:' + symbol;
|
|
231463
231993
|
const timestamp = this.safeInteger2(data, 'timestamp_ms', 'timestamp');
|
|
231464
231994
|
const incrementalId = this.safeNumber(data, 'id');
|
|
231465
|
-
const
|
|
231995
|
+
const orderbook = this.orderBook({});
|
|
231466
231996
|
const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks');
|
|
231467
231997
|
snapshot['nonce'] = incrementalId;
|
|
231468
|
-
|
|
231998
|
+
orderbook.reset(snapshot);
|
|
231469
231999
|
this.options['orderbook'][symbol] = {
|
|
231470
232000
|
'incrementalId': incrementalId,
|
|
231471
232001
|
};
|
|
231472
|
-
this.orderbooks[symbol] =
|
|
231473
|
-
client.resolve(
|
|
232002
|
+
this.orderbooks[symbol] = orderbook;
|
|
232003
|
+
client.resolve(orderbook, messageHash);
|
|
231474
232004
|
}
|
|
231475
232005
|
pairToSymbol(pair) {
|
|
231476
232006
|
const parts = pair.split(':');
|
|
@@ -231936,7 +232466,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
231936
232466
|
handleMessage(client, message) {
|
|
231937
232467
|
const ok = this.safeString(message, 'ok');
|
|
231938
232468
|
if (ok === 'error') {
|
|
231939
|
-
|
|
232469
|
+
this.handleErrorMessage(client, message);
|
|
232470
|
+
return;
|
|
231940
232471
|
}
|
|
231941
232472
|
const event = this.safeString(message, 'e');
|
|
231942
232473
|
const handlers = {
|
|
@@ -231964,9 +232495,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
231964
232495
|
};
|
|
231965
232496
|
const handler = this.safeValue(handlers, event);
|
|
231966
232497
|
if (handler !== undefined) {
|
|
231967
|
-
|
|
232498
|
+
handler.call(this, client, message);
|
|
231968
232499
|
}
|
|
231969
|
-
return message;
|
|
231970
232500
|
}
|
|
231971
232501
|
handleAuthenticationMessage(client, message) {
|
|
231972
232502
|
//
|
|
@@ -232482,7 +233012,8 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
232482
233012
|
const side = this.safeString(this.options['sides'], sideId);
|
|
232483
233013
|
const price = this.safeNumber(trade, 'price_level');
|
|
232484
233014
|
const amount = this.safeNumber(trade, 'new_quantity');
|
|
232485
|
-
orderbook[side]
|
|
233015
|
+
const orderbookSide = orderbook[side];
|
|
233016
|
+
orderbookSide.store(price, amount);
|
|
232486
233017
|
}
|
|
232487
233018
|
}
|
|
232488
233019
|
handleOrderBook(client, message) {
|
|
@@ -232575,7 +233106,7 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
232575
233106
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ExchangeError(errorMessage);
|
|
232576
233107
|
}
|
|
232577
233108
|
const method = this.safeValue(methods, channel);
|
|
232578
|
-
|
|
233109
|
+
method.call(this, client, message);
|
|
232579
233110
|
}
|
|
232580
233111
|
}
|
|
232581
233112
|
|
|
@@ -233551,7 +234082,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
233551
234082
|
}
|
|
233552
234083
|
}
|
|
233553
234084
|
else {
|
|
233554
|
-
|
|
234085
|
+
method.call(this, client, message);
|
|
233555
234086
|
}
|
|
233556
234087
|
}
|
|
233557
234088
|
}
|
|
@@ -234439,29 +234970,29 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234439
234970
|
//
|
|
234440
234971
|
const params = this.safeValue(message, 'params', []);
|
|
234441
234972
|
const fullOrderBook = this.safeValue(params, 0);
|
|
234442
|
-
let
|
|
234973
|
+
let orderbook = this.safeValue(params, 1);
|
|
234443
234974
|
const marketId = this.safeString(params, 2);
|
|
234444
234975
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
234445
234976
|
const market = this.safeMarket(marketId, undefined, undefined, defaultType);
|
|
234446
234977
|
const symbol = market['symbol'];
|
|
234447
234978
|
const name = 'orderbook';
|
|
234448
234979
|
const messageHash = name + ':' + symbol;
|
|
234449
|
-
const timestamp = this.safeInteger(
|
|
234980
|
+
const timestamp = this.safeInteger(orderbook, 'time');
|
|
234450
234981
|
const currentOrderBook = this.safeValue(this.orderbooks, symbol);
|
|
234451
234982
|
if (fullOrderBook) {
|
|
234452
|
-
const snapshot = this.parseOrderBook(
|
|
234983
|
+
const snapshot = this.parseOrderBook(orderbook, symbol, timestamp);
|
|
234453
234984
|
if (currentOrderBook === undefined) {
|
|
234454
|
-
|
|
234455
|
-
this.orderbooks[symbol] =
|
|
234985
|
+
orderbook = this.orderBook(snapshot);
|
|
234986
|
+
this.orderbooks[symbol] = orderbook;
|
|
234456
234987
|
}
|
|
234457
234988
|
else {
|
|
234458
|
-
|
|
234459
|
-
|
|
234989
|
+
orderbook = this.orderbooks[symbol];
|
|
234990
|
+
orderbook.reset(snapshot);
|
|
234460
234991
|
}
|
|
234461
234992
|
}
|
|
234462
234993
|
else {
|
|
234463
|
-
const asks = this.safeValue(
|
|
234464
|
-
const bids = this.safeValue(
|
|
234994
|
+
const asks = this.safeValue(orderbook, 'asks', []);
|
|
234995
|
+
const bids = this.safeValue(orderbook, 'bids', []);
|
|
234465
234996
|
this.handleDeltas(currentOrderBook['asks'], asks);
|
|
234466
234997
|
this.handleDeltas(currentOrderBook['bids'], bids);
|
|
234467
234998
|
currentOrderBook['nonce'] = timestamp;
|
|
@@ -234782,9 +235313,10 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234782
235313
|
};
|
|
234783
235314
|
const handler = this.safeValue(handlers, method);
|
|
234784
235315
|
if (handler !== undefined) {
|
|
234785
|
-
|
|
235316
|
+
handler.call(this, client, message);
|
|
235317
|
+
return;
|
|
234786
235318
|
}
|
|
234787
|
-
|
|
235319
|
+
this.handleSubscriptionStatus(client, message);
|
|
234788
235320
|
}
|
|
234789
235321
|
handleAuthenticationMessage(client, message) {
|
|
234790
235322
|
//
|
|
@@ -234808,7 +235340,8 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234808
235340
|
if (subscription !== undefined) {
|
|
234809
235341
|
const futureIndex = this.safeString(subscription, 'future');
|
|
234810
235342
|
if (futureIndex === 'ohlcv') {
|
|
234811
|
-
|
|
235343
|
+
this.handleOHLCV(client, message);
|
|
235344
|
+
return;
|
|
234812
235345
|
}
|
|
234813
235346
|
const future = this.safeValue(client.futures, futureIndex);
|
|
234814
235347
|
if (future !== undefined) {
|
|
@@ -234817,7 +235350,7 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234817
235350
|
delete client.subscriptions[id];
|
|
234818
235351
|
}
|
|
234819
235352
|
}
|
|
234820
|
-
authenticate(params = {}) {
|
|
235353
|
+
async authenticate(params = {}) {
|
|
234821
235354
|
let type = undefined;
|
|
234822
235355
|
[type, params] = this.handleMarketTypeAndParams('authenticate', undefined, params);
|
|
234823
235356
|
const url = this.urls['api']['ws'][type];
|
|
@@ -236870,10 +237403,11 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
236870
237403
|
};
|
|
236871
237404
|
const method = this.safeValue(methods, subscriptionDestination);
|
|
236872
237405
|
if (method === undefined) {
|
|
236873
|
-
return
|
|
237406
|
+
return;
|
|
236874
237407
|
}
|
|
236875
237408
|
else {
|
|
236876
|
-
|
|
237409
|
+
method.call(this, client, message, subscription);
|
|
237410
|
+
return;
|
|
236877
237411
|
}
|
|
236878
237412
|
}
|
|
236879
237413
|
}
|
|
@@ -236888,11 +237422,8 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
236888
237422
|
'ping': this.handlePong,
|
|
236889
237423
|
};
|
|
236890
237424
|
const method = this.safeValue(methods, destination);
|
|
236891
|
-
if (method
|
|
236892
|
-
|
|
236893
|
-
}
|
|
236894
|
-
else {
|
|
236895
|
-
return method.call(this, client, message);
|
|
237425
|
+
if (method !== undefined) {
|
|
237426
|
+
method.call(this, client, message);
|
|
236896
237427
|
}
|
|
236897
237428
|
}
|
|
236898
237429
|
}
|
|
@@ -237669,16 +238200,16 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
237669
238200
|
};
|
|
237670
238201
|
const handler = this.safeValue(handlers, channelId);
|
|
237671
238202
|
if (handler !== undefined) {
|
|
237672
|
-
|
|
238203
|
+
handler.call(this, client, message);
|
|
238204
|
+
return;
|
|
237673
238205
|
}
|
|
237674
238206
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
|
|
237675
238207
|
}
|
|
237676
238208
|
const result = this.safeValue(message, 'result', {});
|
|
237677
238209
|
const accessToken = this.safeString(result, 'access_token');
|
|
237678
238210
|
if (accessToken !== undefined) {
|
|
237679
|
-
|
|
238211
|
+
this.handleAuthenticationMessage(client, message);
|
|
237680
238212
|
}
|
|
237681
|
-
return message;
|
|
237682
238213
|
}
|
|
237683
238214
|
handleAuthenticationMessage(client, message) {
|
|
237684
238215
|
//
|
|
@@ -237702,7 +238233,7 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
237702
238233
|
client.resolve(message, messageHash);
|
|
237703
238234
|
return message;
|
|
237704
238235
|
}
|
|
237705
|
-
authenticate(params = {}) {
|
|
238236
|
+
async authenticate(params = {}) {
|
|
237706
238237
|
const url = this.urls['api']['ws'];
|
|
237707
238238
|
const client = this.client(url);
|
|
237708
238239
|
const time = this.milliseconds();
|
|
@@ -238258,25 +238789,25 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238258
238789
|
const orderBook = this.safeValue(message, 'data', {});
|
|
238259
238790
|
const messageHash = 'orderbook:' + symbol;
|
|
238260
238791
|
const timestamp = this.safeInteger(message, 'ts');
|
|
238261
|
-
let
|
|
238262
|
-
if (
|
|
238263
|
-
|
|
238264
|
-
this.orderbooks[symbol] =
|
|
238792
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
238793
|
+
if (orderbook === undefined) {
|
|
238794
|
+
orderbook = this.orderBook({});
|
|
238795
|
+
this.orderbooks[symbol] = orderbook;
|
|
238265
238796
|
}
|
|
238266
238797
|
const event = this.safeString(message, 'event');
|
|
238267
238798
|
if (event === 'snapshot') {
|
|
238268
238799
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bid', 'ask');
|
|
238269
|
-
|
|
238800
|
+
orderbook.reset(snapshot);
|
|
238270
238801
|
}
|
|
238271
238802
|
else {
|
|
238272
238803
|
const asks = this.safeValue(orderBook, 'ask', []);
|
|
238273
238804
|
const bids = this.safeValue(orderBook, 'bid', []);
|
|
238274
|
-
this.handleDeltas(
|
|
238275
|
-
this.handleDeltas(
|
|
238276
|
-
|
|
238277
|
-
|
|
238805
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
238806
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
238807
|
+
orderbook['timestamp'] = timestamp;
|
|
238808
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
238278
238809
|
}
|
|
238279
|
-
client.resolve(
|
|
238810
|
+
client.resolve(orderbook, messageHash);
|
|
238280
238811
|
}
|
|
238281
238812
|
handleDelta(bookside, delta) {
|
|
238282
238813
|
const bidAsk = this.parseBidAsk(delta, 0, 1);
|
|
@@ -238311,7 +238842,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238311
238842
|
};
|
|
238312
238843
|
const eventHandler = this.safeValue(events, event);
|
|
238313
238844
|
if (eventHandler !== undefined) {
|
|
238314
|
-
|
|
238845
|
+
eventHandler.call(this, client, message);
|
|
238846
|
+
return;
|
|
238315
238847
|
}
|
|
238316
238848
|
if ((event === 'update') || (event === 'snapshot')) {
|
|
238317
238849
|
const topic = this.safeString(message, 'topic');
|
|
@@ -238333,7 +238865,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238333
238865
|
};
|
|
238334
238866
|
const handler = this.safeValue(handlers, channel);
|
|
238335
238867
|
if (handler !== undefined) {
|
|
238336
|
-
|
|
238868
|
+
handler.call(this, client, message);
|
|
238869
|
+
return;
|
|
238337
238870
|
}
|
|
238338
238871
|
}
|
|
238339
238872
|
}
|
|
@@ -238374,7 +238907,7 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238374
238907
|
const messageHash = 'authenticated';
|
|
238375
238908
|
client.resolve(message, messageHash);
|
|
238376
238909
|
}
|
|
238377
|
-
authenticate(params = {}) {
|
|
238910
|
+
async authenticate(params = {}) {
|
|
238378
238911
|
const messageHash = 'authenticated';
|
|
238379
238912
|
const [type, query] = this.handleMarketTypeAndParams('authenticate', undefined, params);
|
|
238380
238913
|
const url = this.urls['api']['ws'][type];
|
|
@@ -238620,7 +239153,7 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238620
239153
|
// max limit is 100
|
|
238621
239154
|
const subscription = client.subscriptions[messageHash];
|
|
238622
239155
|
const limit = this.safeInteger(subscription, 'limit');
|
|
238623
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
239156
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {}); // needed for c#, number of args needs to match
|
|
238624
239157
|
}
|
|
238625
239158
|
storedOrderBook.cache.push(delta);
|
|
238626
239159
|
return;
|
|
@@ -240348,7 +240881,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240348
240881
|
//
|
|
240349
240882
|
const isArray = Array.isArray(message);
|
|
240350
240883
|
if (isArray) {
|
|
240351
|
-
|
|
240884
|
+
this.handleOrder(client, message);
|
|
240885
|
+
return;
|
|
240352
240886
|
}
|
|
240353
240887
|
const reason = this.safeString(message, 'reason');
|
|
240354
240888
|
if (reason === 'error') {
|
|
@@ -240362,7 +240896,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240362
240896
|
};
|
|
240363
240897
|
const type = this.safeString(message, 'type', '');
|
|
240364
240898
|
if (type.indexOf('candles') >= 0) {
|
|
240365
|
-
|
|
240899
|
+
this.handleOHLCV(client, message);
|
|
240900
|
+
return;
|
|
240366
240901
|
}
|
|
240367
240902
|
const method = this.safeValue(methods, type);
|
|
240368
240903
|
if (method !== undefined) {
|
|
@@ -240533,7 +241068,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240533
241068
|
}
|
|
240534
241069
|
return future;
|
|
240535
241070
|
}
|
|
240536
|
-
async subscribePublic(name, symbols = undefined, params = {}) {
|
|
241071
|
+
async subscribePublic(name, messageHashPrefix, symbols = undefined, params = {}) {
|
|
240537
241072
|
/**
|
|
240538
241073
|
* @ignore
|
|
240539
241074
|
* @method
|
|
@@ -240543,7 +241078,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240543
241078
|
*/
|
|
240544
241079
|
await this.loadMarkets();
|
|
240545
241080
|
const url = this.urls['api']['ws']['public'];
|
|
240546
|
-
let messageHash =
|
|
241081
|
+
let messageHash = messageHashPrefix;
|
|
240547
241082
|
if (symbols !== undefined) {
|
|
240548
241083
|
messageHash = messageHash + '::' + symbols.join(',');
|
|
240549
241084
|
}
|
|
@@ -240638,7 +241173,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240638
241173
|
'symbols': [market['id']],
|
|
240639
241174
|
},
|
|
240640
241175
|
};
|
|
240641
|
-
const orderbook = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241176
|
+
const orderbook = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
240642
241177
|
return orderbook.limit();
|
|
240643
241178
|
}
|
|
240644
241179
|
handleOrderBook(client, message) {
|
|
@@ -240731,7 +241266,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240731
241266
|
'symbols': [market['id']],
|
|
240732
241267
|
},
|
|
240733
241268
|
};
|
|
240734
|
-
const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241269
|
+
const result = await this.subscribePublic(name, 'ticker', [symbol], this.deepExtend(request, params));
|
|
240735
241270
|
return this.safeValue(result, symbol);
|
|
240736
241271
|
}
|
|
240737
241272
|
async watchTickers(symbols = undefined, params = {}) {
|
|
@@ -240767,7 +241302,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240767
241302
|
'symbols': marketIds,
|
|
240768
241303
|
},
|
|
240769
241304
|
};
|
|
240770
|
-
const tickers = await this.subscribePublic(name, symbols, this.deepExtend(request, params));
|
|
241305
|
+
const tickers = await this.subscribePublic(name, 'tickers', symbols, this.deepExtend(request, params));
|
|
240771
241306
|
if (this.newUpdates) {
|
|
240772
241307
|
return tickers;
|
|
240773
241308
|
}
|
|
@@ -240826,7 +241361,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240826
241361
|
const messageHash = channel + '::' + symbol;
|
|
240827
241362
|
client.resolve(newTickers, messageHash);
|
|
240828
241363
|
}
|
|
240829
|
-
const messageHashes = this.findMessageHashes(client,
|
|
241364
|
+
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
240830
241365
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
240831
241366
|
const messageHash = messageHashes[i];
|
|
240832
241367
|
const parts = messageHash.split('::');
|
|
@@ -240919,7 +241454,8 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240919
241454
|
if (limit !== undefined) {
|
|
240920
241455
|
request['limit'] = limit;
|
|
240921
241456
|
}
|
|
240922
|
-
const
|
|
241457
|
+
const name = 'trades';
|
|
241458
|
+
const trades = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
240923
241459
|
if (this.newUpdates) {
|
|
240924
241460
|
limit = trades.getLimit(symbol, limit);
|
|
240925
241461
|
}
|
|
@@ -241048,7 +241584,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241048
241584
|
if (limit !== undefined) {
|
|
241049
241585
|
request['params']['limit'] = limit;
|
|
241050
241586
|
}
|
|
241051
|
-
const ohlcv = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241587
|
+
const ohlcv = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
241052
241588
|
if (this.newUpdates) {
|
|
241053
241589
|
limit = ohlcv.getLimit(symbol, limit);
|
|
241054
241590
|
}
|
|
@@ -241945,7 +242481,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
241945
242481
|
// when the user does not have any trades yet
|
|
241946
242482
|
const dataLength = rawTrades.length;
|
|
241947
242483
|
if (dataLength === 0) {
|
|
241948
|
-
return
|
|
242484
|
+
return;
|
|
241949
242485
|
}
|
|
241950
242486
|
if (this.myTrades === undefined) {
|
|
241951
242487
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
@@ -242059,7 +242595,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
242059
242595
|
// usually the first message is an empty array
|
|
242060
242596
|
const dataLength = data.length;
|
|
242061
242597
|
if (dataLength === 0) {
|
|
242062
|
-
return
|
|
242598
|
+
return;
|
|
242063
242599
|
}
|
|
242064
242600
|
if (this.orders === undefined) {
|
|
242065
242601
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
@@ -242802,6 +243338,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
242802
243338
|
delete client.subscriptions[messageHash];
|
|
242803
243339
|
client.reject(e, messageHash);
|
|
242804
243340
|
}
|
|
243341
|
+
return undefined;
|
|
242805
243342
|
}
|
|
242806
243343
|
handleDelta(bookside, delta) {
|
|
242807
243344
|
const price = this.safeFloat(delta, 0);
|
|
@@ -244022,14 +244559,14 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
244022
244559
|
if (subscription !== undefined) {
|
|
244023
244560
|
const method = this.safeValue(subscription, 'method');
|
|
244024
244561
|
if (method !== undefined) {
|
|
244025
|
-
|
|
244562
|
+
method.call(this, client, message, subscription);
|
|
244563
|
+
return;
|
|
244026
244564
|
}
|
|
244027
244565
|
// clean up
|
|
244028
244566
|
if (id in client.subscriptions) {
|
|
244029
244567
|
delete client.subscriptions[id];
|
|
244030
244568
|
}
|
|
244031
244569
|
}
|
|
244032
|
-
return message;
|
|
244033
244570
|
}
|
|
244034
244571
|
handleSystemStatus(client, message) {
|
|
244035
244572
|
//
|
|
@@ -244138,11 +244675,9 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
244138
244675
|
'kline': this.handleOHLCV,
|
|
244139
244676
|
};
|
|
244140
244677
|
const method = this.safeValue(methods, methodName);
|
|
244141
|
-
if (method
|
|
244142
|
-
|
|
244143
|
-
|
|
244144
|
-
else {
|
|
244145
|
-
return method.call(this, client, message);
|
|
244678
|
+
if (method !== undefined) {
|
|
244679
|
+
method.call(this, client, message);
|
|
244680
|
+
return;
|
|
244146
244681
|
}
|
|
244147
244682
|
}
|
|
244148
244683
|
// private spot subjects
|
|
@@ -245112,6 +245647,7 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
245112
245647
|
delete client.subscriptions[messageHash];
|
|
245113
245648
|
client.reject(e, messageHash);
|
|
245114
245649
|
}
|
|
245650
|
+
return undefined;
|
|
245115
245651
|
}
|
|
245116
245652
|
handleDelta(bookside, delta) {
|
|
245117
245653
|
const price = this.safeFloat(delta, 0);
|
|
@@ -245277,11 +245813,8 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
245277
245813
|
// ...
|
|
245278
245814
|
};
|
|
245279
245815
|
const method = this.safeValue(methods, methodName);
|
|
245280
|
-
if (method
|
|
245281
|
-
|
|
245282
|
-
}
|
|
245283
|
-
else {
|
|
245284
|
-
return method.call(this, client, message);
|
|
245816
|
+
if (method !== undefined) {
|
|
245817
|
+
method.call(this, client, message);
|
|
245285
245818
|
}
|
|
245286
245819
|
}
|
|
245287
245820
|
}
|
|
@@ -245690,7 +246223,7 @@ class idex extends _idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
245690
246223
|
const symbol = this.safeSymbol(marketId);
|
|
245691
246224
|
if (!(symbol in this.orderbooks)) {
|
|
245692
246225
|
const orderbook = this.countedOrderBook({});
|
|
245693
|
-
orderbook.cache = [];
|
|
246226
|
+
// orderbook.cache = []; // cache is never used?
|
|
245694
246227
|
this.orderbooks[symbol] = orderbook;
|
|
245695
246228
|
}
|
|
245696
246229
|
this.spawn(this.fetchOrderBookSnapshot, client, symbol);
|
|
@@ -246266,28 +246799,28 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246266
246799
|
const subscription = this.safeValue(client.subscriptions, messageHash, {});
|
|
246267
246800
|
const receivedSnapshot = this.safeBool(subscription, 'receivedSnapshot', false);
|
|
246268
246801
|
const timestamp = this.safeInteger(message, 'Time');
|
|
246269
|
-
let
|
|
246270
|
-
if (
|
|
246271
|
-
|
|
246272
|
-
this.orderbooks[symbol] =
|
|
246802
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
246803
|
+
if (orderbook === undefined) {
|
|
246804
|
+
orderbook = this.orderBook({});
|
|
246805
|
+
this.orderbooks[symbol] = orderbook;
|
|
246273
246806
|
}
|
|
246274
246807
|
if (event === 'OrderBookSnapshot') {
|
|
246275
246808
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'Bids', 'Offers', 'Price', 'Volume');
|
|
246276
|
-
|
|
246809
|
+
orderbook.reset(snapshot);
|
|
246277
246810
|
subscription['receivedSnapshot'] = true;
|
|
246278
246811
|
}
|
|
246279
246812
|
else {
|
|
246280
246813
|
const asks = this.safeValue(orderBook, 'Offers', []);
|
|
246281
246814
|
const bids = this.safeValue(orderBook, 'Bids', []);
|
|
246282
|
-
this.handleDeltas(
|
|
246283
|
-
this.handleDeltas(
|
|
246284
|
-
|
|
246285
|
-
|
|
246815
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
246816
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
246817
|
+
orderbook['timestamp'] = timestamp;
|
|
246818
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
246286
246819
|
}
|
|
246287
246820
|
const checksum = this.safeValue(this.options, 'checksum', true);
|
|
246288
246821
|
if (checksum && receivedSnapshot) {
|
|
246289
|
-
const storedAsks =
|
|
246290
|
-
const storedBids =
|
|
246822
|
+
const storedAsks = orderbook['asks'];
|
|
246823
|
+
const storedBids = orderbook['bids'];
|
|
246291
246824
|
const asksLength = storedAsks.length;
|
|
246292
246825
|
const bidsLength = storedBids.length;
|
|
246293
246826
|
let payload = '';
|
|
@@ -246309,7 +246842,7 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246309
246842
|
}
|
|
246310
246843
|
}
|
|
246311
246844
|
if (receivedSnapshot) {
|
|
246312
|
-
client.resolve(
|
|
246845
|
+
client.resolve(orderbook, messageHash);
|
|
246313
246846
|
}
|
|
246314
246847
|
}
|
|
246315
246848
|
valueToChecksum(value) {
|
|
@@ -246359,7 +246892,8 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246359
246892
|
};
|
|
246360
246893
|
const handler = this.safeValue(handlers, event);
|
|
246361
246894
|
if (handler !== undefined) {
|
|
246362
|
-
|
|
246895
|
+
handler.call(this, client, message);
|
|
246896
|
+
return;
|
|
246363
246897
|
}
|
|
246364
246898
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
|
|
246365
246899
|
}
|
|
@@ -247033,7 +247567,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247033
247567
|
const side = sides[key];
|
|
247034
247568
|
const bookside = orderbook[side];
|
|
247035
247569
|
const deltas = this.safeValue(message[1], key, []);
|
|
247036
|
-
timestamp = this.
|
|
247570
|
+
timestamp = this.customHandleDeltas(bookside, deltas, timestamp);
|
|
247037
247571
|
}
|
|
247038
247572
|
orderbook['symbol'] = symbol;
|
|
247039
247573
|
orderbook['timestamp'] = timestamp;
|
|
@@ -247065,11 +247599,11 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247065
247599
|
const storedBids = orderbook['bids'];
|
|
247066
247600
|
let example = undefined;
|
|
247067
247601
|
if (a !== undefined) {
|
|
247068
|
-
timestamp = this.
|
|
247602
|
+
timestamp = this.customHandleDeltas(storedAsks, a, timestamp);
|
|
247069
247603
|
example = this.safeValue(a, 0);
|
|
247070
247604
|
}
|
|
247071
247605
|
if (b !== undefined) {
|
|
247072
|
-
timestamp = this.
|
|
247606
|
+
timestamp = this.customHandleDeltas(storedBids, b, timestamp);
|
|
247073
247607
|
example = this.safeValue(b, 0);
|
|
247074
247608
|
}
|
|
247075
247609
|
// don't remove this line or I will poop on your face
|
|
@@ -247124,7 +247658,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247124
247658
|
return joined;
|
|
247125
247659
|
}
|
|
247126
247660
|
}
|
|
247127
|
-
|
|
247661
|
+
customHandleDeltas(bookside, deltas, timestamp = undefined) {
|
|
247128
247662
|
for (let j = 0; j < deltas.length; j++) {
|
|
247129
247663
|
const delta = deltas[j];
|
|
247130
247664
|
const price = this.parseNumber(delta[0]);
|
|
@@ -247669,7 +248203,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247669
248203
|
// "subscription": { name: "ticker" }
|
|
247670
248204
|
// }
|
|
247671
248205
|
//
|
|
247672
|
-
const errorMessage = this.
|
|
248206
|
+
const errorMessage = this.safeString(message, 'errorMessage');
|
|
247673
248207
|
if (errorMessage !== undefined) {
|
|
247674
248208
|
const requestId = this.safeValue(message, 'reqid');
|
|
247675
248209
|
if (requestId !== undefined) {
|
|
@@ -247677,7 +248211,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247677
248211
|
const broadKey = this.findBroadlyMatchedKey(broad, errorMessage);
|
|
247678
248212
|
let exception = undefined;
|
|
247679
248213
|
if (broadKey === undefined) {
|
|
247680
|
-
exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(errorMessage);
|
|
248214
|
+
exception = new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(errorMessage); // c# requirement to convert the errorMessage to string
|
|
247681
248215
|
}
|
|
247682
248216
|
else {
|
|
247683
248217
|
exception = new broad[broadKey](errorMessage);
|
|
@@ -247707,11 +248241,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247707
248241
|
'ownTrades': this.handleMyTrades,
|
|
247708
248242
|
};
|
|
247709
248243
|
const method = this.safeValue2(methods, name, channelName);
|
|
247710
|
-
if (method
|
|
247711
|
-
|
|
247712
|
-
}
|
|
247713
|
-
else {
|
|
247714
|
-
return method.call(this, client, message, subscription);
|
|
248244
|
+
if (method !== undefined) {
|
|
248245
|
+
method.call(this, client, message, subscription);
|
|
247715
248246
|
}
|
|
247716
248247
|
}
|
|
247717
248248
|
else {
|
|
@@ -247727,11 +248258,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247727
248258
|
'cancelAllStatus': this.handleCancelAllOrders,
|
|
247728
248259
|
};
|
|
247729
248260
|
const method = this.safeValue(methods, event);
|
|
247730
|
-
if (method
|
|
247731
|
-
|
|
247732
|
-
}
|
|
247733
|
-
else {
|
|
247734
|
-
return method.call(this, client, message);
|
|
248261
|
+
if (method !== undefined) {
|
|
248262
|
+
method.call(this, client, message);
|
|
247735
248263
|
}
|
|
247736
248264
|
}
|
|
247737
248265
|
}
|
|
@@ -248816,13 +249344,15 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
248816
249344
|
const bid = bids[i];
|
|
248817
249345
|
const price = this.safeNumber(bid, 'price');
|
|
248818
249346
|
const qty = this.safeNumber(bid, 'qty');
|
|
248819
|
-
orderbook['bids']
|
|
249347
|
+
const bidsSide = orderbook['bids'];
|
|
249348
|
+
bidsSide.store(price, qty);
|
|
248820
249349
|
}
|
|
248821
249350
|
for (let i = 0; i < asks.length; i++) {
|
|
248822
249351
|
const ask = asks[i];
|
|
248823
249352
|
const price = this.safeNumber(ask, 'price');
|
|
248824
249353
|
const qty = this.safeNumber(ask, 'qty');
|
|
248825
|
-
orderbook['asks']
|
|
249354
|
+
const asksSide = orderbook['asks'];
|
|
249355
|
+
asksSide.store(price, qty);
|
|
248826
249356
|
}
|
|
248827
249357
|
orderbook['timestamp'] = timestamp;
|
|
248828
249358
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -248851,10 +249381,12 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
248851
249381
|
const qty = this.safeNumber(message, 'qty');
|
|
248852
249382
|
const timestamp = this.safeInteger(message, 'timestamp');
|
|
248853
249383
|
if (side === 'sell') {
|
|
248854
|
-
orderbook['asks']
|
|
249384
|
+
const asks = orderbook['asks'];
|
|
249385
|
+
asks.store(price, qty);
|
|
248855
249386
|
}
|
|
248856
249387
|
else {
|
|
248857
|
-
orderbook['bids']
|
|
249388
|
+
const bids = orderbook['bids'];
|
|
249389
|
+
bids.store(price, qty);
|
|
248858
249390
|
}
|
|
248859
249391
|
orderbook['timestamp'] = timestamp;
|
|
248860
249392
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -249190,7 +249722,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249190
249722
|
this.handleAuthenticate(client, message);
|
|
249191
249723
|
}
|
|
249192
249724
|
else if (event === 'alert') {
|
|
249193
|
-
|
|
249725
|
+
this.handleErrorMessage(client, message);
|
|
249194
249726
|
}
|
|
249195
249727
|
else if (event === 'pong') {
|
|
249196
249728
|
client.lastPong = this.milliseconds();
|
|
@@ -249217,7 +249749,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249217
249749
|
};
|
|
249218
249750
|
const method = this.safeValue(methods, feed);
|
|
249219
249751
|
if (method !== undefined) {
|
|
249220
|
-
|
|
249752
|
+
method.call(this, client, message);
|
|
249221
249753
|
}
|
|
249222
249754
|
}
|
|
249223
249755
|
}
|
|
@@ -249313,19 +249845,20 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
249313
249845
|
},
|
|
249314
249846
|
});
|
|
249315
249847
|
}
|
|
249316
|
-
negotiate(privateChannel, params = {}) {
|
|
249848
|
+
async negotiate(privateChannel, params = {}) {
|
|
249317
249849
|
const connectId = privateChannel ? 'private' : 'public';
|
|
249318
249850
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
249319
249851
|
const spawaned = this.safeValue(urls, connectId);
|
|
249320
249852
|
if (spawaned !== undefined) {
|
|
249321
|
-
return spawaned;
|
|
249853
|
+
return await spawaned;
|
|
249322
249854
|
}
|
|
249323
249855
|
// we store an awaitable to the url
|
|
249324
249856
|
// so that multiple calls don't asynchronously
|
|
249325
249857
|
// fetch different urls and overwrite each other
|
|
249326
249858
|
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
|
|
249327
249859
|
this.options['urls'] = urls;
|
|
249328
|
-
|
|
249860
|
+
const future = urls[connectId];
|
|
249861
|
+
return await future;
|
|
249329
249862
|
}
|
|
249330
249863
|
async negotiateHelper(privateChannel, params = {}) {
|
|
249331
249864
|
let response = undefined;
|
|
@@ -249811,7 +250344,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
249811
250344
|
const limit = this.safeInteger(subscription, 'limit');
|
|
249812
250345
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
249813
250346
|
if (cacheLength === snapshotDelay) {
|
|
249814
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
250347
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
249815
250348
|
}
|
|
249816
250349
|
storedOrderBook.cache.push(data);
|
|
249817
250350
|
return;
|
|
@@ -250253,7 +250786,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250253
250786
|
//
|
|
250254
250787
|
const topic = this.safeString(message, 'topic');
|
|
250255
250788
|
if (topic === '/market/ticker:all') {
|
|
250256
|
-
|
|
250789
|
+
this.handleTicker(client, message);
|
|
250790
|
+
return;
|
|
250257
250791
|
}
|
|
250258
250792
|
const subject = this.safeString(message, 'subject');
|
|
250259
250793
|
const methods = {
|
|
@@ -250268,11 +250802,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250268
250802
|
'stopOrder': this.handleOrder,
|
|
250269
250803
|
};
|
|
250270
250804
|
const method = this.safeValue(methods, subject);
|
|
250271
|
-
if (method
|
|
250272
|
-
|
|
250273
|
-
}
|
|
250274
|
-
else {
|
|
250275
|
-
return method.call(this, client, message);
|
|
250805
|
+
if (method !== undefined) {
|
|
250806
|
+
method.call(this, client, message);
|
|
250276
250807
|
}
|
|
250277
250808
|
}
|
|
250278
250809
|
ping(client) {
|
|
@@ -250320,7 +250851,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250320
250851
|
};
|
|
250321
250852
|
const method = this.safeValue(methods, type);
|
|
250322
250853
|
if (method !== undefined) {
|
|
250323
|
-
|
|
250854
|
+
method.call(this, client, message);
|
|
250324
250855
|
}
|
|
250325
250856
|
}
|
|
250326
250857
|
}
|
|
@@ -250393,19 +250924,20 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
250393
250924
|
},
|
|
250394
250925
|
});
|
|
250395
250926
|
}
|
|
250396
|
-
negotiate(privateChannel, params = {}) {
|
|
250927
|
+
async negotiate(privateChannel, params = {}) {
|
|
250397
250928
|
const connectId = privateChannel ? 'private' : 'public';
|
|
250398
250929
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
250399
250930
|
const spawaned = this.safeValue(urls, connectId);
|
|
250400
250931
|
if (spawaned !== undefined) {
|
|
250401
|
-
return spawaned;
|
|
250932
|
+
return await spawaned;
|
|
250402
250933
|
}
|
|
250403
250934
|
// we store an awaitable to the url
|
|
250404
250935
|
// so that multiple calls don't asynchronously
|
|
250405
250936
|
// fetch different urls and overwrite each other
|
|
250406
|
-
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
|
|
250937
|
+
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params); // we have to wait here otherwsie in c# will not work
|
|
250407
250938
|
this.options['urls'] = urls;
|
|
250408
|
-
|
|
250939
|
+
const future = urls[connectId];
|
|
250940
|
+
return await future;
|
|
250409
250941
|
}
|
|
250410
250942
|
async negotiateHelper(privateChannel, params = {}) {
|
|
250411
250943
|
let response = undefined;
|
|
@@ -250918,6 +251450,9 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
250918
251450
|
const messageHash = 'orderbook:' + symbol;
|
|
250919
251451
|
const storedOrderBook = this.safeValue(this.orderbooks, symbol);
|
|
250920
251452
|
const nonce = this.safeInteger(storedOrderBook, 'nonce');
|
|
251453
|
+
if (storedOrderBook === undefined) {
|
|
251454
|
+
return; // this shouldn't be needed, but for some reason sometimes this runs before handleOrderBookSubscription in c#
|
|
251455
|
+
}
|
|
250921
251456
|
const deltaEnd = this.safeInteger(data, 'sequence');
|
|
250922
251457
|
if (nonce === undefined) {
|
|
250923
251458
|
const cacheLength = storedOrderBook.cache.length;
|
|
@@ -250936,7 +251471,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
250936
251471
|
const limit = this.safeInteger(subscription, 'limit');
|
|
250937
251472
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
250938
251473
|
if (cacheLength === snapshotDelay) {
|
|
250939
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
251474
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
250940
251475
|
}
|
|
250941
251476
|
storedOrderBook.cache.push(data);
|
|
250942
251477
|
return;
|
|
@@ -251264,11 +251799,8 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251264
251799
|
'position.adjustRiskLimit': this.handlePosition,
|
|
251265
251800
|
};
|
|
251266
251801
|
const method = this.safeValue(methods, subject);
|
|
251267
|
-
if (method
|
|
251268
|
-
|
|
251269
|
-
}
|
|
251270
|
-
else {
|
|
251271
|
-
return method.call(this, client, message);
|
|
251802
|
+
if (method !== undefined) {
|
|
251803
|
+
method.call(this, client, message);
|
|
251272
251804
|
}
|
|
251273
251805
|
}
|
|
251274
251806
|
ping(client) {
|
|
@@ -251317,7 +251849,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251317
251849
|
};
|
|
251318
251850
|
const method = this.safeValue(methods, type);
|
|
251319
251851
|
if (method !== undefined) {
|
|
251320
|
-
|
|
251852
|
+
method.call(this, client, message);
|
|
251321
251853
|
}
|
|
251322
251854
|
}
|
|
251323
251855
|
}
|
|
@@ -252109,17 +252641,17 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252109
252641
|
const orderBook = this.safeValue(message, 'depth', message);
|
|
252110
252642
|
const datetime = this.safeString(message, 'TS');
|
|
252111
252643
|
const timestamp = this.parse8601(datetime);
|
|
252112
|
-
let
|
|
252113
|
-
if (
|
|
252114
|
-
|
|
252115
|
-
this.orderbooks[symbol] =
|
|
252644
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
252645
|
+
if (orderbook === undefined) {
|
|
252646
|
+
orderbook = this.orderBook({});
|
|
252647
|
+
this.orderbooks[symbol] = orderbook;
|
|
252116
252648
|
}
|
|
252117
252649
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks');
|
|
252118
|
-
|
|
252650
|
+
orderbook.reset(snapshot);
|
|
252119
252651
|
let messageHash = 'orderbook:' + symbol;
|
|
252120
|
-
client.resolve(
|
|
252652
|
+
client.resolve(orderbook, messageHash);
|
|
252121
252653
|
messageHash = 'fetchOrderbook:' + symbol;
|
|
252122
|
-
client.resolve(
|
|
252654
|
+
client.resolve(orderbook, messageHash);
|
|
252123
252655
|
}
|
|
252124
252656
|
handleErrorMessage(client, message) {
|
|
252125
252657
|
//
|
|
@@ -252147,7 +252679,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252147
252679
|
handleMessage(client, message) {
|
|
252148
252680
|
const status = this.safeString(message, 'status');
|
|
252149
252681
|
if (status === 'error') {
|
|
252150
|
-
|
|
252682
|
+
this.handleErrorMessage(client, message);
|
|
252683
|
+
return;
|
|
252151
252684
|
}
|
|
252152
252685
|
const type = this.safeString2(message, 'type', 'action');
|
|
252153
252686
|
if (type === 'ping') {
|
|
@@ -252163,9 +252696,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252163
252696
|
};
|
|
252164
252697
|
const handler = this.safeValue(handlers, type);
|
|
252165
252698
|
if (handler !== undefined) {
|
|
252166
|
-
|
|
252699
|
+
handler.call(this, client, message);
|
|
252167
252700
|
}
|
|
252168
|
-
return message;
|
|
252169
252701
|
}
|
|
252170
252702
|
async authenticate(params = {}) {
|
|
252171
252703
|
// when we implement more private streams, we need to refactor the authentication
|
|
@@ -252412,24 +252944,24 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252412
252944
|
const symbol = subscription['symbol'];
|
|
252413
252945
|
const messageHash = 'orderbook:' + symbol;
|
|
252414
252946
|
const timestamp = this.safeString(message, 'timestamp');
|
|
252415
|
-
let
|
|
252416
|
-
if (
|
|
252417
|
-
|
|
252418
|
-
this.orderbooks[symbol] =
|
|
252947
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
252948
|
+
if (orderbook === undefined) {
|
|
252949
|
+
orderbook = this.indexedOrderBook({});
|
|
252950
|
+
this.orderbooks[symbol] = orderbook;
|
|
252419
252951
|
}
|
|
252420
252952
|
const asks = this.safeValue(message, 'asks');
|
|
252421
252953
|
if (asks !== undefined) {
|
|
252422
252954
|
const snapshot = this.customParseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'price', 'volume', 'id');
|
|
252423
|
-
|
|
252955
|
+
orderbook.reset(snapshot);
|
|
252424
252956
|
}
|
|
252425
252957
|
else {
|
|
252426
|
-
this.handleDelta(
|
|
252427
|
-
|
|
252428
|
-
|
|
252958
|
+
this.handleDelta(orderbook, message);
|
|
252959
|
+
orderbook['timestamp'] = timestamp;
|
|
252960
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
252429
252961
|
}
|
|
252430
252962
|
const nonce = this.safeInteger(message, 'sequence');
|
|
252431
|
-
|
|
252432
|
-
client.resolve(
|
|
252963
|
+
orderbook['nonce'] = nonce;
|
|
252964
|
+
client.resolve(orderbook, messageHash);
|
|
252433
252965
|
}
|
|
252434
252966
|
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
|
|
252435
252967
|
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
@@ -252521,10 +253053,9 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252521
253053
|
const deleteUpdate = this.safeValue(message, 'delete_update');
|
|
252522
253054
|
if (deleteUpdate !== undefined) {
|
|
252523
253055
|
const orderId = this.safeString(deleteUpdate, 'order_id');
|
|
252524
|
-
asksOrderSide.storeArray(0, 0, orderId);
|
|
252525
|
-
bidsOrderSide.storeArray(0, 0, orderId);
|
|
253056
|
+
asksOrderSide.storeArray([0, 0, orderId]);
|
|
253057
|
+
bidsOrderSide.storeArray([0, 0, orderId]);
|
|
252526
253058
|
}
|
|
252527
|
-
return message;
|
|
252528
253059
|
}
|
|
252529
253060
|
handleMessage(client, message) {
|
|
252530
253061
|
if (message === '') {
|
|
@@ -252536,7 +253067,6 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252536
253067
|
const handler = handlers[j];
|
|
252537
253068
|
handler.call(this, client, message, subscriptions[0]);
|
|
252538
253069
|
}
|
|
252539
|
-
return message;
|
|
252540
253070
|
}
|
|
252541
253071
|
}
|
|
252542
253072
|
|
|
@@ -253658,7 +254188,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
253658
254188
|
//
|
|
253659
254189
|
const msg = this.safeString(message, 'msg');
|
|
253660
254190
|
if (msg === 'PONG') {
|
|
253661
|
-
|
|
254191
|
+
this.handlePong(client, message);
|
|
253662
254192
|
}
|
|
253663
254193
|
else if (msg.indexOf('@') > -1) {
|
|
253664
254194
|
const parts = msg.split('@');
|
|
@@ -253681,7 +254211,8 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
253681
254211
|
return;
|
|
253682
254212
|
}
|
|
253683
254213
|
if ('msg' in message) {
|
|
253684
|
-
|
|
254214
|
+
this.handleSubscriptionStatus(client, message);
|
|
254215
|
+
return;
|
|
253685
254216
|
}
|
|
253686
254217
|
const c = this.safeString(message, 'c');
|
|
253687
254218
|
let channel = undefined;
|
|
@@ -254114,13 +254645,13 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254114
254645
|
const firstBidAsk = this.safeValue(payload, 0, []);
|
|
254115
254646
|
const marketId = this.safeString(firstBidAsk, 7);
|
|
254116
254647
|
if (marketId === undefined) {
|
|
254117
|
-
return
|
|
254648
|
+
return;
|
|
254118
254649
|
}
|
|
254119
254650
|
const market = this.safeMarket(marketId);
|
|
254120
254651
|
const symbol = market['symbol'];
|
|
254121
254652
|
const orderbook = this.safeValue(this.orderbooks, symbol);
|
|
254122
254653
|
if (orderbook === undefined) {
|
|
254123
|
-
return
|
|
254654
|
+
return;
|
|
254124
254655
|
}
|
|
254125
254656
|
let timestamp = undefined;
|
|
254126
254657
|
let nonce = undefined;
|
|
@@ -254214,11 +254745,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254214
254745
|
const subscription = this.safeValue(subscriptionsById, id);
|
|
254215
254746
|
if (subscription !== undefined) {
|
|
254216
254747
|
const method = this.safeValue(subscription, 'method');
|
|
254217
|
-
if (method
|
|
254218
|
-
|
|
254219
|
-
}
|
|
254220
|
-
else {
|
|
254221
|
-
return method.call(this, client, message, subscription);
|
|
254748
|
+
if (method !== undefined) {
|
|
254749
|
+
method.call(this, client, message, subscription);
|
|
254222
254750
|
}
|
|
254223
254751
|
}
|
|
254224
254752
|
}
|
|
@@ -254247,7 +254775,7 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254247
254775
|
//
|
|
254248
254776
|
const payload = this.safeString(message, 'o');
|
|
254249
254777
|
if (payload === undefined) {
|
|
254250
|
-
return
|
|
254778
|
+
return;
|
|
254251
254779
|
}
|
|
254252
254780
|
message['o'] = JSON.parse(payload);
|
|
254253
254781
|
const methods = {
|
|
@@ -254262,11 +254790,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254262
254790
|
};
|
|
254263
254791
|
const event = this.safeString(message, 'n');
|
|
254264
254792
|
const method = this.safeValue(methods, event);
|
|
254265
|
-
if (method
|
|
254266
|
-
|
|
254267
|
-
}
|
|
254268
|
-
else {
|
|
254269
|
-
return method.call(this, client, message);
|
|
254793
|
+
if (method !== undefined) {
|
|
254794
|
+
method.call(this, client, message);
|
|
254270
254795
|
}
|
|
254271
254796
|
}
|
|
254272
254797
|
}
|
|
@@ -254758,7 +255283,7 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
254758
255283
|
};
|
|
254759
255284
|
this.spawn(this.watch, url, messageHash, request, messageHash, future);
|
|
254760
255285
|
}
|
|
254761
|
-
return
|
|
255286
|
+
return future;
|
|
254762
255287
|
}
|
|
254763
255288
|
async watchBalance(params = {}) {
|
|
254764
255289
|
/**
|
|
@@ -254991,7 +255516,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
254991
255516
|
// }
|
|
254992
255517
|
//
|
|
254993
255518
|
if (message === 'pong') {
|
|
254994
|
-
|
|
255519
|
+
this.handlePong(client, message);
|
|
255520
|
+
return;
|
|
254995
255521
|
}
|
|
254996
255522
|
const table = this.safeString(message, 'table');
|
|
254997
255523
|
if (table === undefined) {
|
|
@@ -255004,11 +255530,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255004
255530
|
'subscribe': this.handleSubscriptionStatus,
|
|
255005
255531
|
};
|
|
255006
255532
|
const method = this.safeValue(methods, event);
|
|
255007
|
-
if (method
|
|
255008
|
-
|
|
255009
|
-
}
|
|
255010
|
-
else {
|
|
255011
|
-
return method.call(this, client, message);
|
|
255533
|
+
if (method !== undefined) {
|
|
255534
|
+
method.call(this, client, message);
|
|
255012
255535
|
}
|
|
255013
255536
|
}
|
|
255014
255537
|
}
|
|
@@ -255030,11 +255553,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255030
255553
|
if (name.indexOf('candle') >= 0) {
|
|
255031
255554
|
method = this.handleOHLCV;
|
|
255032
255555
|
}
|
|
255033
|
-
if (method
|
|
255034
|
-
|
|
255035
|
-
}
|
|
255036
|
-
else {
|
|
255037
|
-
return method.call(this, client, message);
|
|
255556
|
+
if (method !== undefined) {
|
|
255557
|
+
method.call(this, client, message);
|
|
255038
255558
|
}
|
|
255039
255559
|
}
|
|
255040
255560
|
}
|
|
@@ -255807,7 +256327,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
255807
256327
|
const message = this.extend(request, params);
|
|
255808
256328
|
this.watch(url, messageHash, message, messageHash);
|
|
255809
256329
|
}
|
|
255810
|
-
return future;
|
|
256330
|
+
return await future;
|
|
255811
256331
|
}
|
|
255812
256332
|
async watchBalance(params = {}) {
|
|
255813
256333
|
/**
|
|
@@ -256613,7 +257133,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
256613
257133
|
//
|
|
256614
257134
|
//
|
|
256615
257135
|
if (message === 'pong') {
|
|
256616
|
-
|
|
257136
|
+
this.handlePong(client, message);
|
|
257137
|
+
return;
|
|
256617
257138
|
}
|
|
256618
257139
|
// const table = this.safeString (message, 'table');
|
|
256619
257140
|
// if (table === undefined) {
|
|
@@ -256632,11 +257153,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
256632
257153
|
'mass-cancel': this.handleCancelAllOrders,
|
|
256633
257154
|
};
|
|
256634
257155
|
const method = this.safeValue(methods, event);
|
|
256635
|
-
if (method
|
|
256636
|
-
|
|
256637
|
-
}
|
|
256638
|
-
else {
|
|
256639
|
-
return method.call(this, client, message);
|
|
257156
|
+
if (method !== undefined) {
|
|
257157
|
+
method.call(this, client, message);
|
|
256640
257158
|
}
|
|
256641
257159
|
}
|
|
256642
257160
|
else {
|
|
@@ -256664,12 +257182,9 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
256664
257182
|
if (channel.indexOf('candle') === 0) {
|
|
256665
257183
|
this.handleOHLCV(client, message);
|
|
256666
257184
|
}
|
|
256667
|
-
else {
|
|
256668
|
-
return message;
|
|
256669
|
-
}
|
|
256670
257185
|
}
|
|
256671
257186
|
else {
|
|
256672
|
-
|
|
257187
|
+
method.call(this, client, message);
|
|
256673
257188
|
}
|
|
256674
257189
|
}
|
|
256675
257190
|
}
|
|
@@ -257048,26 +257563,26 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
257048
257563
|
const dateTime = this.safeString(message, 'time');
|
|
257049
257564
|
const timestamp = this.parse8601(dateTime);
|
|
257050
257565
|
const channel = 'book:' + symbol;
|
|
257051
|
-
let
|
|
257052
|
-
if (
|
|
257053
|
-
|
|
257566
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
257567
|
+
if (orderbook === undefined) {
|
|
257568
|
+
orderbook = this.orderBook({});
|
|
257054
257569
|
}
|
|
257055
257570
|
if (type === 'ORDER_BOOK_SNAPSHOT') {
|
|
257056
257571
|
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks');
|
|
257057
|
-
|
|
257572
|
+
orderbook.reset(snapshot);
|
|
257058
257573
|
}
|
|
257059
257574
|
else if (type === 'ORDER_BOOK_UPDATE') {
|
|
257060
257575
|
const changes = this.safeValue(message, 'changes', []);
|
|
257061
|
-
this.handleDeltas(
|
|
257576
|
+
this.handleDeltas(orderbook, changes);
|
|
257062
257577
|
}
|
|
257063
257578
|
else {
|
|
257064
257579
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() did not recognize message type ' + type);
|
|
257065
257580
|
}
|
|
257066
|
-
|
|
257067
|
-
|
|
257068
|
-
|
|
257069
|
-
this.orderbooks[symbol] =
|
|
257070
|
-
client.resolve(
|
|
257581
|
+
orderbook['nonce'] = timestamp;
|
|
257582
|
+
orderbook['timestamp'] = timestamp;
|
|
257583
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
257584
|
+
this.orderbooks[symbol] = orderbook;
|
|
257585
|
+
client.resolve(orderbook, channel);
|
|
257071
257586
|
}
|
|
257072
257587
|
handleDelta(orderbook, delta) {
|
|
257073
257588
|
//
|
|
@@ -257653,13 +258168,14 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
257653
258168
|
if (updateType === 'ORDER_CLOSED' && filled === 0) {
|
|
257654
258169
|
status = 'canceled';
|
|
257655
258170
|
}
|
|
257656
|
-
|
|
258171
|
+
const orderObject = {
|
|
257657
258172
|
'id': orderId,
|
|
257658
258173
|
'symbol': symbol,
|
|
257659
258174
|
'status': status,
|
|
257660
258175
|
'timestamp': this.parse8601(datetime),
|
|
257661
258176
|
'datetime': datetime,
|
|
257662
|
-
}
|
|
258177
|
+
};
|
|
258178
|
+
orders.append(orderObject);
|
|
257663
258179
|
}
|
|
257664
258180
|
else {
|
|
257665
258181
|
const parsed = this.parseOrder(update);
|
|
@@ -257896,7 +258412,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
257896
258412
|
handleMessage(client, message) {
|
|
257897
258413
|
const error = this.safeValue(message, 'error');
|
|
257898
258414
|
if (error !== undefined) {
|
|
257899
|
-
|
|
258415
|
+
this.handleErrorMessage(client, message);
|
|
258416
|
+
return;
|
|
257900
258417
|
}
|
|
257901
258418
|
const type = this.safeValue(message, 'type');
|
|
257902
258419
|
const handlers = {
|
|
@@ -257927,9 +258444,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
257927
258444
|
};
|
|
257928
258445
|
const handler = this.safeValue(handlers, type);
|
|
257929
258446
|
if (handler !== undefined) {
|
|
257930
|
-
|
|
258447
|
+
handler.call(this, client, message);
|
|
257931
258448
|
}
|
|
257932
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
|
|
257933
258449
|
}
|
|
257934
258450
|
handlePricePointUpdates(client, message) {
|
|
257935
258451
|
//
|
|
@@ -258394,7 +258910,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258394
258910
|
const bid = this.safeValue(bids, i);
|
|
258395
258911
|
const price = this.safeNumber(bid, 0);
|
|
258396
258912
|
const amount = this.safeNumber(bid, 1);
|
|
258397
|
-
orderbook['bids']
|
|
258913
|
+
const bookSide = orderbook['bids'];
|
|
258914
|
+
bookSide.store(price, amount);
|
|
258398
258915
|
}
|
|
258399
258916
|
}
|
|
258400
258917
|
if (asks !== undefined) {
|
|
@@ -258402,7 +258919,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258402
258919
|
const ask = this.safeValue(asks, i);
|
|
258403
258920
|
const price = this.safeNumber(ask, 0);
|
|
258404
258921
|
const amount = this.safeNumber(ask, 1);
|
|
258405
|
-
orderbook['asks']
|
|
258922
|
+
const bookside = orderbook['asks'];
|
|
258923
|
+
bookside.store(price, amount);
|
|
258406
258924
|
}
|
|
258407
258925
|
}
|
|
258408
258926
|
orderbook['symbol'] = symbol;
|
|
@@ -258427,7 +258945,7 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258427
258945
|
};
|
|
258428
258946
|
const endpoint = this.safeValue(methods, method);
|
|
258429
258947
|
if (endpoint !== undefined) {
|
|
258430
|
-
|
|
258948
|
+
endpoint.call(this, client, message);
|
|
258431
258949
|
}
|
|
258432
258950
|
}
|
|
258433
258951
|
handleErrorMessage(client, message) {
|
|
@@ -259104,13 +259622,13 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259104
259622
|
}
|
|
259105
259623
|
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
259106
259624
|
}
|
|
259107
|
-
|
|
259625
|
+
customHandleDelta(bookside, delta, market = undefined) {
|
|
259108
259626
|
const bidAsk = this.customParseBidAsk(delta, 0, 1, market);
|
|
259109
259627
|
bookside.storeArray(bidAsk);
|
|
259110
259628
|
}
|
|
259111
|
-
|
|
259629
|
+
customHandleDeltas(bookside, deltas, market = undefined) {
|
|
259112
259630
|
for (let i = 0; i < deltas.length; i++) {
|
|
259113
|
-
this.
|
|
259631
|
+
this.customHandleDelta(bookside, deltas[i], market);
|
|
259114
259632
|
}
|
|
259115
259633
|
}
|
|
259116
259634
|
handleOrderBook(client, message) {
|
|
@@ -259180,8 +259698,8 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259180
259698
|
const changes = this.safeValue2(message, 'book', 'orderbook_p', {});
|
|
259181
259699
|
const asks = this.safeValue(changes, 'asks', []);
|
|
259182
259700
|
const bids = this.safeValue(changes, 'bids', []);
|
|
259183
|
-
this.
|
|
259184
|
-
this.
|
|
259701
|
+
this.customHandleDeltas(orderbook['asks'], asks, market);
|
|
259702
|
+
this.customHandleDeltas(orderbook['bids'], bids, market);
|
|
259185
259703
|
orderbook['nonce'] = nonce;
|
|
259186
259704
|
orderbook['timestamp'] = timestamp;
|
|
259187
259705
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -259877,21 +260395,26 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259877
260395
|
const method = client.subscriptions[id];
|
|
259878
260396
|
delete client.subscriptions[id];
|
|
259879
260397
|
if (method !== true) {
|
|
259880
|
-
|
|
260398
|
+
method.call(this, client, message);
|
|
260399
|
+
return;
|
|
259881
260400
|
}
|
|
259882
260401
|
}
|
|
259883
260402
|
const methodName = this.safeString(message, 'method', '');
|
|
259884
260403
|
if (('market24h' in message) || ('spot_market24h' in message) || (methodName.indexOf('perp_market24h_pack_p') >= 0)) {
|
|
259885
|
-
|
|
260404
|
+
this.handleTicker(client, message);
|
|
260405
|
+
return;
|
|
259886
260406
|
}
|
|
259887
260407
|
else if (('trades' in message) || ('trades_p' in message)) {
|
|
259888
|
-
|
|
260408
|
+
this.handleTrades(client, message);
|
|
260409
|
+
return;
|
|
259889
260410
|
}
|
|
259890
260411
|
else if (('kline' in message) || ('kline_p' in message)) {
|
|
259891
|
-
|
|
260412
|
+
this.handleOHLCV(client, message);
|
|
260413
|
+
return;
|
|
259892
260414
|
}
|
|
259893
260415
|
else if (('book' in message) || ('orderbook_p' in message)) {
|
|
259894
|
-
|
|
260416
|
+
this.handleOrderBook(client, message);
|
|
260417
|
+
return;
|
|
259895
260418
|
}
|
|
259896
260419
|
if (('orders' in message) || ('orders_p' in message)) {
|
|
259897
260420
|
const orders = this.safeValue2(message, 'orders', 'orders_p', {});
|
|
@@ -259978,7 +260501,7 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259978
260501
|
future = this.watch(url, messageHash, message);
|
|
259979
260502
|
client.subscriptions[messageHash] = future;
|
|
259980
260503
|
}
|
|
259981
|
-
return
|
|
260504
|
+
return future;
|
|
259982
260505
|
}
|
|
259983
260506
|
}
|
|
259984
260507
|
|
|
@@ -261034,7 +261557,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261034
261557
|
const bid = this.safeValue(bids, j);
|
|
261035
261558
|
const price = this.safeNumber(bid, 0);
|
|
261036
261559
|
const amount = this.safeNumber(bid, 1);
|
|
261037
|
-
orderbook['bids']
|
|
261560
|
+
const bidsSide = orderbook['bids'];
|
|
261561
|
+
bidsSide.store(price, amount);
|
|
261038
261562
|
}
|
|
261039
261563
|
}
|
|
261040
261564
|
if (asks !== undefined) {
|
|
@@ -261042,7 +261566,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261042
261566
|
const ask = this.safeValue(asks, j);
|
|
261043
261567
|
const price = this.safeNumber(ask, 0);
|
|
261044
261568
|
const amount = this.safeNumber(ask, 1);
|
|
261045
|
-
orderbook['asks']
|
|
261569
|
+
const asksSide = orderbook['asks'];
|
|
261570
|
+
asksSide.store(price, amount);
|
|
261046
261571
|
}
|
|
261047
261572
|
}
|
|
261048
261573
|
orderbook['symbol'] = symbol;
|
|
@@ -261176,14 +261701,14 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261176
261701
|
this.handleErrorMessage(client, item);
|
|
261177
261702
|
}
|
|
261178
261703
|
else {
|
|
261179
|
-
|
|
261704
|
+
this.handleOrderRequest(client, message);
|
|
261180
261705
|
}
|
|
261181
261706
|
}
|
|
261182
261707
|
else {
|
|
261183
261708
|
const data = this.safeValue(message, 'data', []);
|
|
261184
261709
|
const dataLength = data.length;
|
|
261185
261710
|
if (dataLength > 0) {
|
|
261186
|
-
|
|
261711
|
+
method.call(this, client, message);
|
|
261187
261712
|
}
|
|
261188
261713
|
}
|
|
261189
261714
|
}
|
|
@@ -261257,7 +261782,6 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261257
261782
|
/* harmony import */ var _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6877);
|
|
261258
261783
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
261259
261784
|
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
|
|
261260
|
-
|
|
261261
261785
|
// ---------------------------------------------------------------------------
|
|
261262
261786
|
|
|
261263
261787
|
|
|
@@ -261317,18 +261841,21 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
261317
261841
|
},
|
|
261318
261842
|
});
|
|
261319
261843
|
}
|
|
261320
|
-
negotiate(privateChannel, params = {}) {
|
|
261844
|
+
async negotiate(privateChannel, params = {}) {
|
|
261321
261845
|
const connectId = privateChannel ? 'private' : 'public';
|
|
261322
261846
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
261323
261847
|
if (connectId in urls) {
|
|
261324
|
-
return urls[connectId];
|
|
261848
|
+
// return urls[connectId];
|
|
261849
|
+
const storedFuture = urls[connectId];
|
|
261850
|
+
return await storedFuture;
|
|
261325
261851
|
}
|
|
261326
261852
|
// we store an awaitable to the url
|
|
261327
261853
|
// so that multiple calls don't asynchronously
|
|
261328
261854
|
// fetch different urls and overwrite each other
|
|
261329
261855
|
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
|
|
261330
261856
|
this.options['urls'] = urls;
|
|
261331
|
-
|
|
261857
|
+
const future = urls[connectId];
|
|
261858
|
+
return await future;
|
|
261332
261859
|
}
|
|
261333
261860
|
async negotiateHelper(privateChannel, params = {}) {
|
|
261334
261861
|
let response = undefined;
|
|
@@ -261966,7 +262493,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
261966
262493
|
const messageHash = this.safeString(message, 'topic');
|
|
261967
262494
|
const subject = this.safeString(message, 'subject');
|
|
261968
262495
|
if (subject === 'received') {
|
|
261969
|
-
return
|
|
262496
|
+
return;
|
|
261970
262497
|
}
|
|
261971
262498
|
// At the time of writting this, there is no implementation to easily convert each order into the orderbook so raw messages are returned
|
|
261972
262499
|
client.resolve(message, messageHash);
|
|
@@ -261985,9 +262512,10 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
261985
262512
|
const topic = this.safeString(message, 'topic');
|
|
261986
262513
|
const isSnapshot = topic.indexOf('Depth') >= 0;
|
|
261987
262514
|
if (isSnapshot) {
|
|
261988
|
-
|
|
262515
|
+
this.handeL2Snapshot(client, message);
|
|
262516
|
+
return;
|
|
261989
262517
|
}
|
|
261990
|
-
|
|
262518
|
+
this.handleL2OrderBook(client, message);
|
|
261991
262519
|
}
|
|
261992
262520
|
handleL2OrderBook(client, message) {
|
|
261993
262521
|
//
|
|
@@ -262024,7 +262552,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262024
262552
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
262025
262553
|
if (cacheLength === snapshotDelay) {
|
|
262026
262554
|
const limit = 0;
|
|
262027
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
262555
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
262028
262556
|
}
|
|
262029
262557
|
orderBook.cache.push(data);
|
|
262030
262558
|
return;
|
|
@@ -262212,7 +262740,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262212
262740
|
};
|
|
262213
262741
|
const method = this.safeValue(methods, subject);
|
|
262214
262742
|
if (method !== undefined) {
|
|
262215
|
-
|
|
262743
|
+
method.call(this, client, message);
|
|
262216
262744
|
}
|
|
262217
262745
|
}
|
|
262218
262746
|
ping(client) {
|
|
@@ -262248,7 +262776,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262248
262776
|
};
|
|
262249
262777
|
const method = this.safeValue(methods, type);
|
|
262250
262778
|
if (method !== undefined) {
|
|
262251
|
-
|
|
262779
|
+
method.call(this, client, message);
|
|
262252
262780
|
}
|
|
262253
262781
|
}
|
|
262254
262782
|
handleAuthenticate(client, message) {
|
|
@@ -262289,7 +262817,6 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262289
262817
|
/* harmony import */ var _probit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3657);
|
|
262290
262818
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
262291
262819
|
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
|
|
262292
|
-
|
|
262293
262820
|
// ---------------------------------------------------------------------------
|
|
262294
262821
|
|
|
262295
262822
|
|
|
@@ -262739,20 +263266,20 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
262739
263266
|
const symbol = this.safeSymbol(marketId);
|
|
262740
263267
|
const dataBySide = this.groupBy(orderBook, 'side');
|
|
262741
263268
|
const messageHash = 'orderbook:' + symbol;
|
|
262742
|
-
let
|
|
262743
|
-
if (
|
|
262744
|
-
|
|
262745
|
-
this.orderbooks[symbol] =
|
|
263269
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
263270
|
+
if (orderbook === undefined) {
|
|
263271
|
+
orderbook = this.orderBook({});
|
|
263272
|
+
this.orderbooks[symbol] = orderbook;
|
|
262746
263273
|
}
|
|
262747
263274
|
const reset = this.safeBool(message, 'reset', false);
|
|
262748
263275
|
if (reset) {
|
|
262749
263276
|
const snapshot = this.parseOrderBook(dataBySide, symbol, undefined, 'buy', 'sell', 'price', 'quantity');
|
|
262750
|
-
|
|
263277
|
+
orderbook.reset(snapshot);
|
|
262751
263278
|
}
|
|
262752
263279
|
else {
|
|
262753
|
-
this.handleDelta(
|
|
263280
|
+
this.handleDelta(orderbook, dataBySide);
|
|
262754
263281
|
}
|
|
262755
|
-
client.resolve(
|
|
263282
|
+
client.resolve(orderbook, messageHash);
|
|
262756
263283
|
}
|
|
262757
263284
|
handleBidAsks(bookSide, bidAsks) {
|
|
262758
263285
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
@@ -262825,11 +263352,13 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
262825
263352
|
//
|
|
262826
263353
|
const errorCode = this.safeString(message, 'errorCode');
|
|
262827
263354
|
if (errorCode !== undefined) {
|
|
262828
|
-
|
|
263355
|
+
this.handleErrorMessage(client, message);
|
|
263356
|
+
return;
|
|
262829
263357
|
}
|
|
262830
263358
|
const type = this.safeString(message, 'type');
|
|
262831
263359
|
if (type === 'authorization') {
|
|
262832
|
-
|
|
263360
|
+
this.handleAuthenticate(client, message);
|
|
263361
|
+
return;
|
|
262833
263362
|
}
|
|
262834
263363
|
const handlers = {
|
|
262835
263364
|
'marketdata': this.handleMarketData,
|
|
@@ -262841,7 +263370,8 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
262841
263370
|
const channel = this.safeString(message, 'channel');
|
|
262842
263371
|
const handler = this.safeValue(handlers, channel);
|
|
262843
263372
|
if (handler !== undefined) {
|
|
262844
|
-
|
|
263373
|
+
handler.call(this, client, message);
|
|
263374
|
+
return;
|
|
262845
263375
|
}
|
|
262846
263376
|
const error = new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' handleMessage: unknown message: ' + this.json(message));
|
|
262847
263377
|
client.reject(error);
|
|
@@ -262869,7 +263399,7 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
262869
263399
|
future = this.watch(url, messageHash, this.extend(request, params));
|
|
262870
263400
|
client.subscriptions[messageHash] = future;
|
|
262871
263401
|
}
|
|
262872
|
-
return
|
|
263402
|
+
return future;
|
|
262873
263403
|
}
|
|
262874
263404
|
}
|
|
262875
263405
|
|
|
@@ -263046,15 +263576,15 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
263046
263576
|
if (type === 'SNAPSHOT') {
|
|
263047
263577
|
this.orderbooks[symbol] = this.orderBook({}, limit);
|
|
263048
263578
|
}
|
|
263049
|
-
const
|
|
263579
|
+
const orderbook = this.orderbooks[symbol];
|
|
263050
263580
|
// upbit always returns a snapshot of 15 topmost entries
|
|
263051
263581
|
// the "REALTIME" deltas are not incremental
|
|
263052
263582
|
// therefore we reset the orderbook on each update
|
|
263053
263583
|
// and reinitialize it again with new bidasks
|
|
263054
|
-
|
|
263055
|
-
|
|
263056
|
-
const bids =
|
|
263057
|
-
const asks =
|
|
263584
|
+
orderbook.reset({});
|
|
263585
|
+
orderbook['symbol'] = symbol;
|
|
263586
|
+
const bids = orderbook['bids'];
|
|
263587
|
+
const asks = orderbook['asks'];
|
|
263058
263588
|
const data = this.safeValue(message, 'orderbook_units', []);
|
|
263059
263589
|
for (let i = 0; i < data.length; i++) {
|
|
263060
263590
|
const entry = data[i];
|
|
@@ -263067,10 +263597,10 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
263067
263597
|
}
|
|
263068
263598
|
const timestamp = this.safeInteger(message, 'timestamp');
|
|
263069
263599
|
const datetime = this.iso8601(timestamp);
|
|
263070
|
-
|
|
263071
|
-
|
|
263600
|
+
orderbook['timestamp'] = timestamp;
|
|
263601
|
+
orderbook['datetime'] = datetime;
|
|
263072
263602
|
const messageHash = 'orderbook:' + marketId;
|
|
263073
|
-
client.resolve(
|
|
263603
|
+
client.resolve(orderbook, messageHash);
|
|
263074
263604
|
}
|
|
263075
263605
|
handleTrades(client, message) {
|
|
263076
263606
|
// { type: "trade",
|
|
@@ -263845,7 +264375,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263845
264375
|
handleMessage(client, message) {
|
|
263846
264376
|
const status = this.safeString(message, 'status');
|
|
263847
264377
|
if (status === 'error') {
|
|
263848
|
-
|
|
264378
|
+
this.handleError(client, message);
|
|
264379
|
+
return;
|
|
263849
264380
|
}
|
|
263850
264381
|
const event = this.safeString(message, 'event');
|
|
263851
264382
|
const eventHandlers = {
|
|
@@ -263855,7 +264386,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263855
264386
|
};
|
|
263856
264387
|
const eventHandler = this.safeValue(eventHandlers, event);
|
|
263857
264388
|
if (eventHandler !== undefined) {
|
|
263858
|
-
|
|
264389
|
+
eventHandler.call(this, client, message);
|
|
264390
|
+
return;
|
|
263859
264391
|
}
|
|
263860
264392
|
const stream = this.safeString(message, 'stream', '');
|
|
263861
264393
|
const streamHandlers = {
|
|
@@ -263871,7 +264403,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263871
264403
|
for (let i = 0; i < streams.length; i++) {
|
|
263872
264404
|
if (this.inArray(streams[i], stream)) {
|
|
263873
264405
|
const handler = streamHandlers[streams[i]];
|
|
263874
|
-
|
|
264406
|
+
handler.call(this, client, message);
|
|
264407
|
+
return;
|
|
263875
264408
|
}
|
|
263876
264409
|
}
|
|
263877
264410
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' this message type is not supported yet. Message: ' + this.json(message));
|
|
@@ -265257,7 +265790,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
265257
265790
|
}
|
|
265258
265791
|
return true;
|
|
265259
265792
|
}
|
|
265260
|
-
authenticate(params = {}) {
|
|
265793
|
+
async authenticate(params = {}) {
|
|
265261
265794
|
this.checkRequiredCredentials();
|
|
265262
265795
|
const url = this.urls['api']['ws']['private'] + '/' + this.uid;
|
|
265263
265796
|
const client = this.client(url);
|
|
@@ -265663,13 +266196,15 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
265663
266196
|
const event = this.safeString(message, 'event');
|
|
265664
266197
|
let method = this.safeValue(methods, event);
|
|
265665
266198
|
if (method !== undefined) {
|
|
265666
|
-
|
|
266199
|
+
method.call(this, client, message);
|
|
266200
|
+
return;
|
|
265667
266201
|
}
|
|
265668
266202
|
const topic = this.safeString(message, 'topic');
|
|
265669
266203
|
if (topic !== undefined) {
|
|
265670
266204
|
method = this.safeValue(methods, topic);
|
|
265671
266205
|
if (method !== undefined) {
|
|
265672
|
-
|
|
266206
|
+
method.call(this, client, message);
|
|
266207
|
+
return;
|
|
265673
266208
|
}
|
|
265674
266209
|
const splitTopic = topic.split('@');
|
|
265675
266210
|
const splitLength = splitTopic.length;
|
|
@@ -265677,19 +266212,19 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
265677
266212
|
const name = this.safeString(splitTopic, 1);
|
|
265678
266213
|
method = this.safeValue(methods, name);
|
|
265679
266214
|
if (method !== undefined) {
|
|
265680
|
-
|
|
266215
|
+
method.call(this, client, message);
|
|
266216
|
+
return;
|
|
265681
266217
|
}
|
|
265682
266218
|
const splitName = name.split('_');
|
|
265683
266219
|
const splitNameLength = splitTopic.length;
|
|
265684
266220
|
if (splitNameLength === 2) {
|
|
265685
266221
|
method = this.safeValue(methods, this.safeString(splitName, 0));
|
|
265686
266222
|
if (method !== undefined) {
|
|
265687
|
-
|
|
266223
|
+
method.call(this, client, message);
|
|
265688
266224
|
}
|
|
265689
266225
|
}
|
|
265690
266226
|
}
|
|
265691
266227
|
}
|
|
265692
|
-
return message;
|
|
265693
266228
|
}
|
|
265694
266229
|
ping(client) {
|
|
265695
266230
|
return { 'event': 'ping' };
|
|
@@ -266173,8 +266708,8 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
266173
266708
|
const networkList = {};
|
|
266174
266709
|
for (let j = 0; j < platformsByPriority.length; j++) {
|
|
266175
266710
|
const network = platformsByPriority[j];
|
|
266176
|
-
const
|
|
266177
|
-
const networkCode = this.networkIdToCode(
|
|
266711
|
+
const idInner = this.safeString(network, 'id');
|
|
266712
|
+
const networkCode = this.networkIdToCode(idInner);
|
|
266178
266713
|
const currentDepositSuspended = this.safeValue(network, 'deposit_suspended');
|
|
266179
266714
|
const currentWithdrawalSuspended = this.safeValue(network, 'withdrawal_suspended');
|
|
266180
266715
|
const currentDeposit = !currentDepositSuspended;
|
|
@@ -266195,7 +266730,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
266195
266730
|
}
|
|
266196
266731
|
}
|
|
266197
266732
|
networkList[networkCode] = {
|
|
266198
|
-
'id':
|
|
266733
|
+
'id': idInner,
|
|
266199
266734
|
'network': networkCode,
|
|
266200
266735
|
'active': currentActive,
|
|
266201
266736
|
'deposit': currentDeposit,
|
|
@@ -276653,7 +277188,7 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
276653
277188
|
'rest': 'https://plasma-relay-backend.timex.io',
|
|
276654
277189
|
},
|
|
276655
277190
|
'www': 'https://timex.io',
|
|
276656
|
-
'doc': 'https://
|
|
277191
|
+
'doc': 'https://plasma-relay-backend.timex.io/swagger-ui/index.html',
|
|
276657
277192
|
'referral': 'https://timex.io/?refcode=1x27vNkTbP1uwkCck',
|
|
276658
277193
|
},
|
|
276659
277194
|
'api': {
|
|
@@ -279492,9 +280027,9 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
279492
280027
|
// "timestamp":1659666786943
|
|
279493
280028
|
// }
|
|
279494
280029
|
//
|
|
279495
|
-
return this.
|
|
280030
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
279496
280031
|
}
|
|
279497
|
-
|
|
280032
|
+
parseBalanceCustom(response, type = undefined, marginMode = undefined) {
|
|
279498
280033
|
const timestamp = this.safeInteger(response, 'updateTime');
|
|
279499
280034
|
const result = {
|
|
279500
280035
|
'info': response,
|
|
@@ -283801,7 +284336,8 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
|
|
|
283801
284336
|
// precise.decimals should be integer
|
|
283802
284337
|
precise.decimals = this.parseToInt(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringSub(this.numberToString(precise.decimals), this.numberToString(scale)));
|
|
283803
284338
|
precise.reduce();
|
|
283804
|
-
|
|
284339
|
+
const stringValue = precise.toString();
|
|
284340
|
+
return stringValue;
|
|
283805
284341
|
}
|
|
283806
284342
|
currencyFromPrecision(currency, amount) {
|
|
283807
284343
|
const scale = this.currencies[currency]['precision'];
|
|
@@ -286147,7 +286683,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
286147
286683
|
'name': 'WhiteBit',
|
|
286148
286684
|
'version': 'v4',
|
|
286149
286685
|
'countries': ['EE'],
|
|
286150
|
-
'rateLimit':
|
|
286686
|
+
'rateLimit': 50,
|
|
286151
286687
|
'pro': true,
|
|
286152
286688
|
'has': {
|
|
286153
286689
|
'CORS': undefined,
|
|
@@ -289304,7 +289840,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
289304
289840
|
const stopLoss = this.safeValue(params, 'stopLoss');
|
|
289305
289841
|
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
289306
289842
|
const algoType = this.safeString(params, 'algoType');
|
|
289307
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', price);
|
|
289843
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
|
|
289308
289844
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
|
|
289309
289845
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
289310
289846
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
@@ -292404,11 +292940,29 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
292404
292940
|
const address = this.safeString(response['return'], 'address');
|
|
292405
292941
|
this.checkAddress(address);
|
|
292406
292942
|
return {
|
|
292943
|
+
'id': undefined,
|
|
292407
292944
|
'currency': code,
|
|
292408
292945
|
'address': address,
|
|
292409
292946
|
'tag': undefined,
|
|
292410
292947
|
'network': undefined,
|
|
292411
292948
|
'info': response,
|
|
292949
|
+
'txid': undefined,
|
|
292950
|
+
'type': undefined,
|
|
292951
|
+
'amount': undefined,
|
|
292952
|
+
'status': undefined,
|
|
292953
|
+
'timestamp': undefined,
|
|
292954
|
+
'datetime': undefined,
|
|
292955
|
+
'addressFrom': undefined,
|
|
292956
|
+
'addressTo': undefined,
|
|
292957
|
+
'tagFrom': undefined,
|
|
292958
|
+
'tagTo': undefined,
|
|
292959
|
+
'updated': undefined,
|
|
292960
|
+
'comment': undefined,
|
|
292961
|
+
'fee': {
|
|
292962
|
+
'currency': undefined,
|
|
292963
|
+
'cost': undefined,
|
|
292964
|
+
'rate': undefined,
|
|
292965
|
+
},
|
|
292412
292966
|
};
|
|
292413
292967
|
}
|
|
292414
292968
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
@@ -292441,6 +292995,27 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
292441
292995
|
return {
|
|
292442
292996
|
'info': response,
|
|
292443
292997
|
'id': undefined,
|
|
292998
|
+
'txid': undefined,
|
|
292999
|
+
'type': undefined,
|
|
293000
|
+
'currency': undefined,
|
|
293001
|
+
'network': undefined,
|
|
293002
|
+
'amount': undefined,
|
|
293003
|
+
'status': undefined,
|
|
293004
|
+
'timestamp': undefined,
|
|
293005
|
+
'datetime': undefined,
|
|
293006
|
+
'address': undefined,
|
|
293007
|
+
'addressFrom': undefined,
|
|
293008
|
+
'addressTo': undefined,
|
|
293009
|
+
'tag': undefined,
|
|
293010
|
+
'tagFrom': undefined,
|
|
293011
|
+
'tagTo': undefined,
|
|
293012
|
+
'updated': undefined,
|
|
293013
|
+
'comment': undefined,
|
|
293014
|
+
'fee': {
|
|
293015
|
+
'currency': undefined,
|
|
293016
|
+
'cost': undefined,
|
|
293017
|
+
'rate': undefined,
|
|
293018
|
+
},
|
|
292444
293019
|
};
|
|
292445
293020
|
}
|
|
292446
293021
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
@@ -300742,7 +301317,7 @@ SOFTWARE.
|
|
|
300742
301317
|
|
|
300743
301318
|
//-----------------------------------------------------------------------------
|
|
300744
301319
|
// this is updated by vss.js when building
|
|
300745
|
-
const version = '4.2.
|
|
301320
|
+
const version = '4.2.34';
|
|
300746
301321
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
300747
301322
|
//-----------------------------------------------------------------------------
|
|
300748
301323
|
|