ccxt 4.2.31 → 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 +8 -7
- package/build.sh +9 -2
- package/cleanup.sh +3 -0
- package/dist/ccxt.browser.js +639 -483
- 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 +54 -20
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/binance.js +5 -4
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +12 -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 +2 -2
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/cryptocom.js +10 -10
- package/dist/cjs/src/gate.js +34 -29
- package/dist/cjs/src/kraken.js +39 -0
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/mexc.js +2 -1
- package/dist/cjs/src/okx.js +4 -3
- package/dist/cjs/src/phemex.js +8 -8
- 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/tokocrypto.js +2 -2
- package/dist/cjs/src/wavesexchange.js +2 -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/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 +87 -78
- package/js/src/base/Exchange.js +54 -20
- 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 +5 -4
- 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 +7 -17
- package/js/src/bitflyer.d.ts +5 -5
- package/js/src/bitforex.d.ts +1 -1
- 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 +2 -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/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/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 +39 -0
- package/js/src/krakenfutures.d.ts +7 -7
- 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 +2 -5
- 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 +4 -3
- 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/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/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/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]) {
|
|
@@ -8706,6 +8712,9 @@ class Exchange {
|
|
|
8706
8712
|
}
|
|
8707
8713
|
}
|
|
8708
8714
|
if (fromStart) {
|
|
8715
|
+
if (limit > arrayLength) {
|
|
8716
|
+
limit = arrayLength;
|
|
8717
|
+
}
|
|
8709
8718
|
array = ascending ? this.arraySlice(array, 0, limit) : this.arraySlice(array, -limit);
|
|
8710
8719
|
}
|
|
8711
8720
|
else {
|
|
@@ -8934,6 +8943,18 @@ class Exchange {
|
|
|
8934
8943
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
8935
8944
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setLeverage() is not supported yet');
|
|
8936
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
|
+
}
|
|
8937
8958
|
parseToInt(number) {
|
|
8938
8959
|
// Solve Common parseInt misuse ex: parseInt ((since / 1000).toString ())
|
|
8939
8960
|
// using a number as parameter which is not valid in ts
|
|
@@ -10544,6 +10565,15 @@ class Exchange {
|
|
|
10544
10565
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
10545
10566
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBidsAsks() is not supported yet');
|
|
10546
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
|
+
}
|
|
10547
10577
|
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
10548
10578
|
const price = this.safeNumber(bidask, priceKey);
|
|
10549
10579
|
const amount = this.safeNumber(bidask, amountKey);
|
|
@@ -10844,6 +10874,9 @@ class Exchange {
|
|
|
10844
10874
|
return this.handleOptionAndParams(params, methodName, 'marginMode', defaultValue);
|
|
10845
10875
|
}
|
|
10846
10876
|
throwExactlyMatchedException(exact, string, message) {
|
|
10877
|
+
if (string === undefined) {
|
|
10878
|
+
return;
|
|
10879
|
+
}
|
|
10847
10880
|
if (string in exact) {
|
|
10848
10881
|
throw new exact[string](message);
|
|
10849
10882
|
}
|
|
@@ -11267,21 +11300,18 @@ class Exchange {
|
|
|
11267
11300
|
*/
|
|
11268
11301
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWithdrawals() is not supported yet');
|
|
11269
11302
|
}
|
|
11270
|
-
async fetchDeposits(
|
|
11303
|
+
async fetchDeposits(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11271
11304
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDeposits() is not supported yet');
|
|
11272
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
|
+
}
|
|
11273
11309
|
async fetchDepositsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11274
11310
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositsWs() is not supported yet');
|
|
11275
11311
|
}
|
|
11276
|
-
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11277
|
-
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawals() is not supported yet');
|
|
11278
|
-
}
|
|
11279
11312
|
async fetchWithdrawalsWs(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11280
11313
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchWithdrawalsWs() is not supported yet');
|
|
11281
11314
|
}
|
|
11282
|
-
async fetchOpenInterest(symbol, params = {}) {
|
|
11283
|
-
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
|
|
11284
|
-
}
|
|
11285
11315
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11286
11316
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
|
|
11287
11317
|
}
|
|
@@ -11369,7 +11399,7 @@ class Exchange {
|
|
|
11369
11399
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
|
|
11370
11400
|
}
|
|
11371
11401
|
handleWithdrawTagAndParams(tag, params) {
|
|
11372
|
-
if (typeof tag === 'object') {
|
|
11402
|
+
if ((tag !== undefined) && (typeof tag === 'object')) {
|
|
11373
11403
|
params = this.extend(tag, params);
|
|
11374
11404
|
tag = undefined;
|
|
11375
11405
|
}
|
|
@@ -11503,14 +11533,14 @@ class Exchange {
|
|
|
11503
11533
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchMarketLeverageTiers() is not supported yet');
|
|
11504
11534
|
}
|
|
11505
11535
|
}
|
|
11506
|
-
async createPostOnlyOrder(symbol, type, side, amount, price, params = {}) {
|
|
11536
|
+
async createPostOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
11507
11537
|
if (!this.has['createPostOnlyOrder']) {
|
|
11508
11538
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createPostOnlyOrder() is not supported yet');
|
|
11509
11539
|
}
|
|
11510
11540
|
const query = this.extend(params, { 'postOnly': true });
|
|
11511
11541
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
11512
11542
|
}
|
|
11513
|
-
async createReduceOnlyOrder(symbol, type, side, amount, price, params = {}) {
|
|
11543
|
+
async createReduceOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
11514
11544
|
if (!this.has['createReduceOnlyOrder']) {
|
|
11515
11545
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + 'createReduceOnlyOrder() is not supported yet');
|
|
11516
11546
|
}
|
|
@@ -12133,7 +12163,8 @@ class Exchange {
|
|
|
12133
12163
|
const response = await this[method](symbol, undefined, maxEntriesPerRequest, params);
|
|
12134
12164
|
const responseLength = response.length;
|
|
12135
12165
|
if (this.verbose) {
|
|
12136
|
-
|
|
12166
|
+
const backwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
|
|
12167
|
+
this.log(backwardMessage);
|
|
12137
12168
|
}
|
|
12138
12169
|
if (responseLength === 0) {
|
|
12139
12170
|
break;
|
|
@@ -12151,7 +12182,8 @@ class Exchange {
|
|
|
12151
12182
|
const response = await this[method](symbol, paginationTimestamp, maxEntriesPerRequest, params);
|
|
12152
12183
|
const responseLength = response.length;
|
|
12153
12184
|
if (this.verbose) {
|
|
12154
|
-
|
|
12185
|
+
const forwardMessage = 'Dynamic pagination call ' + calls + ' method ' + method + ' response length ' + responseLength + ' timestamp ' + paginationTimestamp;
|
|
12186
|
+
this.log(forwardMessage);
|
|
12155
12187
|
}
|
|
12156
12188
|
if (responseLength === 0) {
|
|
12157
12189
|
break;
|
|
@@ -12197,6 +12229,7 @@ class Exchange {
|
|
|
12197
12229
|
throw e;
|
|
12198
12230
|
}
|
|
12199
12231
|
}
|
|
12232
|
+
return undefined;
|
|
12200
12233
|
}
|
|
12201
12234
|
async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
|
|
12202
12235
|
let maxCalls = undefined;
|
|
@@ -12261,7 +12294,8 @@ class Exchange {
|
|
|
12261
12294
|
errors = 0;
|
|
12262
12295
|
const responseLength = response.length;
|
|
12263
12296
|
if (this.verbose) {
|
|
12264
|
-
|
|
12297
|
+
const cursorMessage = 'Cursor pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength + ' cursor ' + cursorValue;
|
|
12298
|
+
this.log(cursorMessage);
|
|
12265
12299
|
}
|
|
12266
12300
|
if (responseLength === 0) {
|
|
12267
12301
|
break;
|
|
@@ -12305,7 +12339,8 @@ class Exchange {
|
|
|
12305
12339
|
errors = 0;
|
|
12306
12340
|
const responseLength = response.length;
|
|
12307
12341
|
if (this.verbose) {
|
|
12308
|
-
|
|
12342
|
+
const incrementalMessage = 'Incremental pagination call ' + i + 1 + ' method ' + method + ' response length ' + responseLength;
|
|
12343
|
+
this.log(incrementalMessage);
|
|
12309
12344
|
}
|
|
12310
12345
|
if (responseLength === 0) {
|
|
12311
12346
|
break;
|
|
@@ -16181,6 +16216,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16181
16216
|
* @method
|
|
16182
16217
|
* @name bigone#fetchMarkets
|
|
16183
16218
|
* @description retrieves data on all markets for bigone
|
|
16219
|
+
* @see https://open.big.one/docs/spot_asset_pair.html
|
|
16184
16220
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16185
16221
|
* @returns {object[]} an array of objects representing market data
|
|
16186
16222
|
*/
|
|
@@ -16443,6 +16479,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16443
16479
|
* @method
|
|
16444
16480
|
* @name bigone#fetchTicker
|
|
16445
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
|
|
16446
16483
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
16447
16484
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16448
16485
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -16485,6 +16522,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16485
16522
|
* @method
|
|
16486
16523
|
* @name bigone#fetchTickers
|
|
16487
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
|
|
16488
16526
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
16489
16527
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16490
16528
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -16572,6 +16610,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16572
16610
|
* @method
|
|
16573
16611
|
* @name bigone#fetchTime
|
|
16574
16612
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
16613
|
+
* @see https://open.big.one/docs/spot_ping.html
|
|
16575
16614
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16576
16615
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
16577
16616
|
*/
|
|
@@ -16592,6 +16631,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16592
16631
|
* @method
|
|
16593
16632
|
* @name bigone#fetchOrderBook
|
|
16594
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
|
|
16595
16635
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
16596
16636
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
16597
16637
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -16834,6 +16874,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16834
16874
|
* @method
|
|
16835
16875
|
* @name bigone#fetchTrades
|
|
16836
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
|
|
16837
16878
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
16838
16879
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
16839
16880
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -16898,6 +16939,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16898
16939
|
* @method
|
|
16899
16940
|
* @name bigone#fetchOHLCV
|
|
16900
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
|
|
16901
16943
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
16902
16944
|
* @param {string} timeframe the length of time each candle represents
|
|
16903
16945
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -16974,6 +17016,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16974
17016
|
* @method
|
|
16975
17017
|
* @name bigone#fetchBalance
|
|
16976
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
|
|
16977
17021
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
16978
17022
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
16979
17023
|
*/
|
|
@@ -17219,6 +17263,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17219
17263
|
* @method
|
|
17220
17264
|
* @name bigone#cancelOrder
|
|
17221
17265
|
* @description cancels an open order
|
|
17266
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-order
|
|
17222
17267
|
* @param {string} id order id
|
|
17223
17268
|
* @param {string} symbol Not used by bigone cancelOrder ()
|
|
17224
17269
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -17247,6 +17292,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17247
17292
|
* @method
|
|
17248
17293
|
* @name bigone#cancelAllOrders
|
|
17249
17294
|
* @description cancel all open orders
|
|
17295
|
+
* @see https://open.big.one/docs/spot_orders.html#cancel-all-orders
|
|
17250
17296
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
17251
17297
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17252
17298
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -17276,6 +17322,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17276
17322
|
* @method
|
|
17277
17323
|
* @name bigone#fetchOrder
|
|
17278
17324
|
* @description fetches information on an order made by the user
|
|
17325
|
+
* @see https://open.big.one/docs/spot_orders.html#get-one-order
|
|
17279
17326
|
* @param {string} symbol not used by bigone fetchOrder
|
|
17280
17327
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17281
17328
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -17291,6 +17338,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17291
17338
|
* @method
|
|
17292
17339
|
* @name bigone#fetchOrders
|
|
17293
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
|
|
17294
17342
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
17295
17343
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
17296
17344
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -17341,6 +17389,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17341
17389
|
* @method
|
|
17342
17390
|
* @name bigone#fetchMyTrades
|
|
17343
17391
|
* @description fetch all trades made by the user
|
|
17392
|
+
* @see https://open.big.one/docs/spot_trade.html#trades-of-user
|
|
17344
17393
|
* @param {string} symbol unified market symbol
|
|
17345
17394
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
17346
17395
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -17410,6 +17459,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17410
17459
|
* @method
|
|
17411
17460
|
* @name bigone#fetchOpenOrders
|
|
17412
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
|
|
17413
17463
|
* @param {string} symbol unified market symbol
|
|
17414
17464
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
17415
17465
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -17426,6 +17476,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17426
17476
|
* @method
|
|
17427
17477
|
* @name bigone#fetchClosedOrders
|
|
17428
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
|
|
17429
17480
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
17430
17481
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
17431
17482
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -17480,6 +17531,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17480
17531
|
* @method
|
|
17481
17532
|
* @name bigone#fetchDepositAddress
|
|
17482
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
|
|
17483
17535
|
* @param {string} code unified currency code
|
|
17484
17536
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
17485
17537
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -17630,6 +17682,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17630
17682
|
* @method
|
|
17631
17683
|
* @name bigone#fetchDeposits
|
|
17632
17684
|
* @description fetch all deposits made to an account
|
|
17685
|
+
* @see https://open.big.one/docs/spot_deposit.html#deposit-of-user
|
|
17633
17686
|
* @param {string} code unified currency code
|
|
17634
17687
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
17635
17688
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -17681,6 +17734,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17681
17734
|
* @method
|
|
17682
17735
|
* @name bigone#fetchWithdrawals
|
|
17683
17736
|
* @description fetch all withdrawals made from an account
|
|
17737
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
|
|
17684
17738
|
* @param {string} code unified currency code
|
|
17685
17739
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
17686
17740
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -17786,7 +17840,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17786
17840
|
'id': undefined,
|
|
17787
17841
|
'timestamp': undefined,
|
|
17788
17842
|
'datetime': undefined,
|
|
17789
|
-
'currency':
|
|
17843
|
+
'currency': undefined,
|
|
17790
17844
|
'amount': undefined,
|
|
17791
17845
|
'fromAccount': undefined,
|
|
17792
17846
|
'toAccount': undefined,
|
|
@@ -17804,6 +17858,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17804
17858
|
* @method
|
|
17805
17859
|
* @name bigone#withdraw
|
|
17806
17860
|
* @description make a withdrawal
|
|
17861
|
+
* @see https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
|
|
17807
17862
|
* @param {string} code unified currency code
|
|
17808
17863
|
* @param {float} amount the amount to withdraw
|
|
17809
17864
|
* @param {string} address the address to withdraw to
|
|
@@ -21026,7 +21081,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
21026
21081
|
account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(debt, interest);
|
|
21027
21082
|
return account;
|
|
21028
21083
|
}
|
|
21029
|
-
|
|
21084
|
+
parseBalanceCustom(response, type = undefined, marginMode = undefined) {
|
|
21030
21085
|
const result = {
|
|
21031
21086
|
'info': response,
|
|
21032
21087
|
};
|
|
@@ -21369,7 +21424,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
21369
21424
|
// }
|
|
21370
21425
|
// ]
|
|
21371
21426
|
//
|
|
21372
|
-
return this.
|
|
21427
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
21373
21428
|
}
|
|
21374
21429
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
21375
21430
|
/**
|
|
@@ -23141,7 +23196,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
23141
23196
|
const stopLossPrice = this.safeValue(params, 'stopLossPrice', triggerPrice); // fallback to stopLoss
|
|
23142
23197
|
const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
|
|
23143
23198
|
const trailingDelta = this.safeValue(params, 'trailingDelta');
|
|
23144
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', price);
|
|
23199
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
23145
23200
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
23146
23201
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
23147
23202
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
@@ -27474,7 +27529,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
27474
27529
|
}
|
|
27475
27530
|
return this.safeValue(config, 'cost', 1);
|
|
27476
27531
|
}
|
|
27477
|
-
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 = {}) {
|
|
27478
27533
|
const response = await this.fetch2(path, api, method, params, headers, body, config);
|
|
27479
27534
|
// a workaround for {"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}
|
|
27480
27535
|
if (api === 'private') {
|
|
@@ -28107,6 +28162,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
28107
28162
|
else {
|
|
28108
28163
|
return this.parseOpenInterest(response, market);
|
|
28109
28164
|
}
|
|
28165
|
+
return undefined;
|
|
28110
28166
|
}
|
|
28111
28167
|
parseOpenInterest(interest, market = undefined) {
|
|
28112
28168
|
const timestamp = this.safeInteger2(interest, 'timestamp', 'time');
|
|
@@ -30660,6 +30716,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30660
30716
|
}
|
|
30661
30717
|
}
|
|
30662
30718
|
if (isStopLoss || isTakeProfit) {
|
|
30719
|
+
const stringifiedAmount = this.numberToString(amount);
|
|
30663
30720
|
if (isStopLoss) {
|
|
30664
30721
|
const slTriggerPrice = this.safeString2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
|
|
30665
30722
|
const slWorkingType = this.safeString(stopLoss, 'workingType', 'MARK_PRICE');
|
|
@@ -30673,7 +30730,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30673
30730
|
if (slPrice !== undefined) {
|
|
30674
30731
|
slRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
30675
30732
|
}
|
|
30676
|
-
const slQuantity = this.safeString(stopLoss, 'quantity',
|
|
30733
|
+
const slQuantity = this.safeString(stopLoss, 'quantity', stringifiedAmount);
|
|
30677
30734
|
slRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, slQuantity));
|
|
30678
30735
|
request['stopLoss'] = this.json(slRequest);
|
|
30679
30736
|
}
|
|
@@ -30690,7 +30747,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30690
30747
|
if (slPrice !== undefined) {
|
|
30691
30748
|
tpRequest['price'] = this.parseToNumeric(this.priceToPrecision(symbol, slPrice));
|
|
30692
30749
|
}
|
|
30693
|
-
const tkQuantity = this.safeString(takeProfit, 'quantity',
|
|
30750
|
+
const tkQuantity = this.safeString(takeProfit, 'quantity', stringifiedAmount);
|
|
30694
30751
|
tpRequest['quantity'] = this.parseToNumeric(this.amountToPrecision(symbol, tkQuantity));
|
|
30695
30752
|
request['takeProfit'] = this.json(tpRequest);
|
|
30696
30753
|
}
|
|
@@ -32376,7 +32433,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32376
32433
|
// "id":"1197073063359000577"
|
|
32377
32434
|
// }
|
|
32378
32435
|
// }
|
|
32379
|
-
this.parseTransaction(data);
|
|
32436
|
+
return this.parseTransaction(data);
|
|
32380
32437
|
}
|
|
32381
32438
|
parseParams(params) {
|
|
32382
32439
|
const sortedParams = this.keysort(params);
|
|
@@ -32910,6 +32967,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32910
32967
|
* @method
|
|
32911
32968
|
* @name bit2c#fetchBalance
|
|
32912
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
|
|
32913
32971
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
32914
32972
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
32915
32973
|
*/
|
|
@@ -32964,6 +33022,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32964
33022
|
* @method
|
|
32965
33023
|
* @name bit2c#fetchOrderBook
|
|
32966
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
|
|
32967
33026
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
32968
33027
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
32969
33028
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -33010,6 +33069,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33010
33069
|
* @method
|
|
33011
33070
|
* @name bit2c#fetchTicker
|
|
33012
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
|
|
33013
33073
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
33014
33074
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33015
33075
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -33027,6 +33087,8 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33027
33087
|
* @method
|
|
33028
33088
|
* @name bit2c#fetchTrades
|
|
33029
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
|
|
33030
33092
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
33031
33093
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
33032
33094
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -33069,6 +33131,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33069
33131
|
* @method
|
|
33070
33132
|
* @name bit2c#fetchTradingFees
|
|
33071
33133
|
* @description fetch the trading fees for multiple markets
|
|
33134
|
+
* @see https://bit2c.co.il/home/api#balance
|
|
33072
33135
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33073
33136
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
33074
33137
|
*/
|
|
@@ -33117,6 +33180,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33117
33180
|
* @method
|
|
33118
33181
|
* @name bit2c#createOrder
|
|
33119
33182
|
* @description create a trade order
|
|
33183
|
+
* @see https://bit2c.co.il/home/api#addo
|
|
33120
33184
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
33121
33185
|
* @param {string} type 'market' or 'limit'
|
|
33122
33186
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -33150,6 +33214,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33150
33214
|
* @method
|
|
33151
33215
|
* @name bit2c#cancelOrder
|
|
33152
33216
|
* @description cancels an open order
|
|
33217
|
+
* @see https://bit2c.co.il/home/api#cancelo
|
|
33153
33218
|
* @param {string} id order id
|
|
33154
33219
|
* @param {string} symbol Not used by bit2c cancelOrder ()
|
|
33155
33220
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -33165,6 +33230,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33165
33230
|
* @method
|
|
33166
33231
|
* @name bit2c#fetchOpenOrders
|
|
33167
33232
|
* @description fetch all unfilled currently open orders
|
|
33233
|
+
* @see https://bit2c.co.il/home/api#geto
|
|
33168
33234
|
* @param {string} symbol unified market symbol
|
|
33169
33235
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
33170
33236
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -33190,6 +33256,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33190
33256
|
* @method
|
|
33191
33257
|
* @name bit2c#fetchOrder
|
|
33192
33258
|
* @description fetches information on an order made by the user
|
|
33259
|
+
* @see https://bit2c.co.il/home/api#getoid
|
|
33193
33260
|
* @param {string} symbol unified market symbol
|
|
33194
33261
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33195
33262
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -33342,6 +33409,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33342
33409
|
* @method
|
|
33343
33410
|
* @name bit2c#fetchMyTrades
|
|
33344
33411
|
* @description fetch all trades made by the user
|
|
33412
|
+
* @see https://bit2c.co.il/home/api#orderh
|
|
33345
33413
|
* @param {string} symbol unified market symbol
|
|
33346
33414
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
33347
33415
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -33522,6 +33590,7 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33522
33590
|
* @method
|
|
33523
33591
|
* @name bit2c#fetchDepositAddress
|
|
33524
33592
|
* @description fetch the deposit address for a currency associated with this account
|
|
33593
|
+
* @see https://bit2c.co.il/home/api#addc
|
|
33525
33594
|
* @param {string} code unified currency code
|
|
33526
33595
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
33527
33596
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -47369,7 +47438,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
47369
47438
|
const isTakeProfit = takeProfit !== undefined;
|
|
47370
47439
|
const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
|
|
47371
47440
|
const isStopLossOrTakeProfit = isStopLoss || isTakeProfit;
|
|
47372
|
-
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
|
|
47441
|
+
const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
|
|
47373
47442
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
|
|
47374
47443
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
47375
47444
|
if (this.sum(isTriggerOrder, isStopLossTriggerOrder, isTakeProfitTriggerOrder, isTrailingPercentOrder) > 1) {
|
|
@@ -50192,7 +50261,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
50192
50261
|
* @name bitget#setLeverage
|
|
50193
50262
|
* @description set the level of leverage for a market
|
|
50194
50263
|
* @see https://www.bitget.com/api-doc/contract/account/Change-Leverage
|
|
50195
|
-
* @param {
|
|
50264
|
+
* @param {int} leverage the rate of leverage
|
|
50196
50265
|
* @param {string} symbol unified market symbol
|
|
50197
50266
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
50198
50267
|
* @param {string} [params.holdSide] *isolated only* position direction, 'long' or 'short'
|
|
@@ -50216,7 +50285,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
50216
50285
|
const request = {
|
|
50217
50286
|
'symbol': market['id'],
|
|
50218
50287
|
'marginCoin': market['settleId'],
|
|
50219
|
-
'leverage': leverage,
|
|
50288
|
+
'leverage': this.numberToString(leverage),
|
|
50220
50289
|
'productType': productType,
|
|
50221
50290
|
// 'holdSide': 'long',
|
|
50222
50291
|
};
|
|
@@ -55082,7 +55151,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
55082
55151
|
}
|
|
55083
55152
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'trigger_price']);
|
|
55084
55153
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
55085
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', price);
|
|
55154
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activation_price', this.numberToString(price));
|
|
55086
55155
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callback_rate');
|
|
55087
55156
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
55088
55157
|
if (isLimitOrder) {
|
|
@@ -63753,9 +63822,9 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
63753
63822
|
const amountString = this.numberToString(amount);
|
|
63754
63823
|
const priceString = this.numberToString(price);
|
|
63755
63824
|
const quoteAmount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amountString, priceString);
|
|
63756
|
-
|
|
63757
|
-
request['amount'] = this.costToPrecision(symbol,
|
|
63758
|
-
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);
|
|
63759
63828
|
}
|
|
63760
63829
|
}
|
|
63761
63830
|
else {
|
|
@@ -74388,7 +74457,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
|
|
|
74388
74457
|
'remaining': remaining,
|
|
74389
74458
|
'cost': undefined,
|
|
74390
74459
|
'trades': [],
|
|
74391
|
-
'fees':
|
|
74460
|
+
'fees': [],
|
|
74392
74461
|
'info': order,
|
|
74393
74462
|
});
|
|
74394
74463
|
return result;
|
|
@@ -82428,7 +82497,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
82428
82497
|
const takeProfitTriggerPrice = this.safeValue(params, 'takeProfitPrice');
|
|
82429
82498
|
const stopLoss = this.safeValue(params, 'stopLoss');
|
|
82430
82499
|
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
82431
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', price);
|
|
82500
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activePrice', this.numberToString(price));
|
|
82432
82501
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
|
|
82433
82502
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
82434
82503
|
const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
|
|
@@ -89735,7 +89804,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
89735
89804
|
'info': ticker,
|
|
89736
89805
|
}, market);
|
|
89737
89806
|
}
|
|
89738
|
-
|
|
89807
|
+
parseCustomBalance(response, params = {}) {
|
|
89739
89808
|
const balances = this.safeValue2(response, 'data', 'accounts', []);
|
|
89740
89809
|
const accounts = this.safeValue(params, 'type', this.options['accounts']);
|
|
89741
89810
|
const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
|
|
@@ -89886,7 +89955,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
89886
89955
|
// "size": 9
|
|
89887
89956
|
// }
|
|
89888
89957
|
//
|
|
89889
|
-
return this.
|
|
89958
|
+
return this.parseCustomBalance(response, params);
|
|
89890
89959
|
}
|
|
89891
89960
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
89892
89961
|
/**
|
|
@@ -98670,7 +98739,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
98670
98739
|
const request = {
|
|
98671
98740
|
'coin_type': currency['id'],
|
|
98672
98741
|
'coin_address': address,
|
|
98673
|
-
'actual_amount': parseFloat(amount),
|
|
98742
|
+
'actual_amount': parseFloat(this.numberToString(amount)),
|
|
98674
98743
|
'transfer_method': 'onchain', // onchain, local
|
|
98675
98744
|
};
|
|
98676
98745
|
if (networkCode !== undefined) {
|
|
@@ -109806,10 +109875,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109806
109875
|
const isTakeProfitTrigger = (takeProfitPrice !== undefined);
|
|
109807
109876
|
if (isTrigger) {
|
|
109808
109877
|
request['ref_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
109809
|
-
|
|
109878
|
+
const priceString = this.numberToString(price);
|
|
109810
109879
|
if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
|
|
109811
109880
|
if (side === 'buy') {
|
|
109812
|
-
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)) {
|
|
109813
109882
|
request['type'] = 'TAKE_PROFIT_LIMIT';
|
|
109814
109883
|
}
|
|
109815
109884
|
else {
|
|
@@ -109817,7 +109886,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109817
109886
|
}
|
|
109818
109887
|
}
|
|
109819
109888
|
else {
|
|
109820
|
-
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)) {
|
|
109821
109890
|
request['type'] = 'STOP_LIMIT';
|
|
109822
109891
|
}
|
|
109823
109892
|
else {
|
|
@@ -109827,7 +109896,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109827
109896
|
}
|
|
109828
109897
|
else {
|
|
109829
109898
|
if (side === 'buy') {
|
|
109830
|
-
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)) {
|
|
109831
109900
|
request['type'] = 'TAKE_PROFIT';
|
|
109832
109901
|
}
|
|
109833
109902
|
else {
|
|
@@ -109835,7 +109904,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
109835
109904
|
}
|
|
109836
109905
|
}
|
|
109837
109906
|
else {
|
|
109838
|
-
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)) {
|
|
109839
109908
|
request['type'] = 'STOP_LOSS';
|
|
109840
109909
|
}
|
|
109841
109910
|
else {
|
|
@@ -110026,10 +110095,10 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
110026
110095
|
const isStopLossTrigger = (stopLossPrice !== undefined);
|
|
110027
110096
|
const isTakeProfitTrigger = (takeProfitPrice !== undefined);
|
|
110028
110097
|
if (isTrigger) {
|
|
110029
|
-
|
|
110098
|
+
const priceString = this.numberToString(price);
|
|
110030
110099
|
if ((uppercaseType === 'LIMIT') || (uppercaseType === 'STOP_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
|
|
110031
110100
|
if (side === 'buy') {
|
|
110032
|
-
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)) {
|
|
110033
110102
|
request['type'] = 'TAKE_PROFIT_LIMIT';
|
|
110034
110103
|
}
|
|
110035
110104
|
else {
|
|
@@ -110037,7 +110106,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
110037
110106
|
}
|
|
110038
110107
|
}
|
|
110039
110108
|
else {
|
|
110040
|
-
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)) {
|
|
110041
110110
|
request['type'] = 'STOP_LIMIT';
|
|
110042
110111
|
}
|
|
110043
110112
|
else {
|
|
@@ -110047,7 +110116,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
110047
110116
|
}
|
|
110048
110117
|
else {
|
|
110049
110118
|
if (side === 'buy') {
|
|
110050
|
-
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)) {
|
|
110051
110120
|
request['type'] = 'TAKE_PROFIT';
|
|
110052
110121
|
}
|
|
110053
110122
|
else {
|
|
@@ -110055,7 +110124,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
110055
110124
|
}
|
|
110056
110125
|
}
|
|
110057
110126
|
else {
|
|
110058
|
-
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)) {
|
|
110059
110128
|
request['type'] = 'STOP_LOSS';
|
|
110060
110129
|
}
|
|
110061
110130
|
else {
|
|
@@ -129188,32 +129257,34 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129188
129257
|
let withdrawAvailable = this.safeValue(result[code], 'withdraw');
|
|
129189
129258
|
withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
|
|
129190
129259
|
const networks = this.safeValue(result[code], 'networks', {});
|
|
129191
|
-
|
|
129192
|
-
|
|
129193
|
-
|
|
129194
|
-
|
|
129195
|
-
|
|
129196
|
-
|
|
129197
|
-
|
|
129198
|
-
|
|
129199
|
-
|
|
129200
|
-
|
|
129201
|
-
|
|
129202
|
-
|
|
129203
|
-
'
|
|
129204
|
-
'
|
|
129205
|
-
|
|
129206
|
-
|
|
129207
|
-
|
|
129208
|
-
'
|
|
129209
|
-
|
|
129210
|
-
|
|
129211
|
-
|
|
129212
|
-
'
|
|
129213
|
-
|
|
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
|
+
},
|
|
129214
129285
|
},
|
|
129215
|
-
}
|
|
129216
|
-
}
|
|
129286
|
+
};
|
|
129287
|
+
}
|
|
129217
129288
|
result[code]['networks'] = networks;
|
|
129218
129289
|
const info = this.safeValue(result[code], 'info', []);
|
|
129219
129290
|
info.push(entry);
|
|
@@ -130169,6 +130240,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
130169
130240
|
const [type, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
|
130170
130241
|
const [request, requestParams] = this.prepareRequest(undefined, type, query);
|
|
130171
130242
|
let response = undefined;
|
|
130243
|
+
request['timezone'] = 'utc0'; // default to utc
|
|
130172
130244
|
if (type === 'spot' || type === 'margin') {
|
|
130173
130245
|
response = await this.publicSpotGetTickers(this.extend(request, requestParams));
|
|
130174
130246
|
}
|
|
@@ -130186,7 +130258,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
130186
130258
|
response = await this.publicOptionsGetTickers(this.extend(request, requestParams));
|
|
130187
130259
|
}
|
|
130188
130260
|
else {
|
|
130189
|
-
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');
|
|
130190
130262
|
}
|
|
130191
130263
|
return this.parseTickers(response, symbols);
|
|
130192
130264
|
}
|
|
@@ -132757,16 +132829,17 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
132757
132829
|
const defaultMarginMode = this.safeString2(this.options, 'marginMode', 'defaultMarginMode');
|
|
132758
132830
|
const crossLeverageLimit = this.safeString(query, 'cross_leverage_limit');
|
|
132759
132831
|
let marginMode = this.safeString(query, 'marginMode', defaultMarginMode);
|
|
132832
|
+
let stringifiedMargin = this.numberToString(leverage);
|
|
132760
132833
|
if (crossLeverageLimit !== undefined) {
|
|
132761
132834
|
marginMode = 'cross';
|
|
132762
|
-
|
|
132835
|
+
stringifiedMargin = crossLeverageLimit;
|
|
132763
132836
|
}
|
|
132764
132837
|
if (marginMode === 'cross' || marginMode === 'cross_margin') {
|
|
132765
|
-
request['cross_leverage_limit'] =
|
|
132838
|
+
request['cross_leverage_limit'] = stringifiedMargin;
|
|
132766
132839
|
request['leverage'] = '0';
|
|
132767
132840
|
}
|
|
132768
132841
|
else {
|
|
132769
|
-
request['leverage'] =
|
|
132842
|
+
request['leverage'] = stringifiedMargin;
|
|
132770
132843
|
}
|
|
132771
132844
|
let response = undefined;
|
|
132772
132845
|
if (market['swap']) {
|
|
@@ -134501,6 +134574,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
134501
134574
|
return this.parseGreeks(entry, market);
|
|
134502
134575
|
}
|
|
134503
134576
|
}
|
|
134577
|
+
return undefined;
|
|
134504
134578
|
}
|
|
134505
134579
|
parseGreeks(greeks, market = undefined) {
|
|
134506
134580
|
//
|
|
@@ -158295,6 +158369,41 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
158295
158369
|
// "txid": "OTI672-HJFAO-XOIPPK"
|
|
158296
158370
|
// }
|
|
158297
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
|
+
//
|
|
158298
158407
|
const description = this.safeValue(order, 'descr', {});
|
|
158299
158408
|
const orderDescription = this.safeString(description, 'order', description);
|
|
158300
158409
|
let side = undefined;
|
|
@@ -158336,6 +158445,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
158336
158445
|
// kraken truncates the cost in the api response so we will ignore it and calculate it from average & filled
|
|
158337
158446
|
// const cost = this.safeString (order, 'cost');
|
|
158338
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
|
+
}
|
|
158339
158452
|
if ((price === undefined) || _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringEquals(price, '0')) {
|
|
158340
158453
|
price = this.safeString(description, 'price2');
|
|
158341
158454
|
}
|
|
@@ -166533,7 +166646,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
166533
166646
|
let endpart = '';
|
|
166534
166647
|
headers = (headers !== undefined) ? headers : {};
|
|
166535
166648
|
let url = this.urls['api'][api];
|
|
166536
|
-
if (
|
|
166649
|
+
if (!this.isEmpty(query)) {
|
|
166537
166650
|
if ((method === 'GET') || (method === 'DELETE')) {
|
|
166538
166651
|
endpoint += '?' + this.rawencode(query);
|
|
166539
166652
|
}
|
|
@@ -180428,7 +180541,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
180428
180541
|
}
|
|
180429
180542
|
return orderbook;
|
|
180430
180543
|
}
|
|
180431
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1,
|
|
180544
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
180545
|
+
const countKey = 2;
|
|
180432
180546
|
const price = this.safeNumber(bidask, priceKey);
|
|
180433
180547
|
const amount = this.safeNumber(bidask, amountKey);
|
|
180434
180548
|
const count = this.safeNumber(bidask, countKey);
|
|
@@ -194145,8 +194259,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
194145
194259
|
// "msg": ""
|
|
194146
194260
|
// }
|
|
194147
194261
|
//
|
|
194148
|
-
const
|
|
194149
|
-
return this.parseMarkets(
|
|
194262
|
+
const dataResponse = this.safeValue(response, 'data', []);
|
|
194263
|
+
return this.parseMarkets(dataResponse);
|
|
194150
194264
|
}
|
|
194151
194265
|
safeNetwork(networkId) {
|
|
194152
194266
|
const networksById = {
|
|
@@ -195773,7 +195887,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
195773
195887
|
* @param {string[]|string} ids order ids
|
|
195774
195888
|
* @returns {string[]} list of order ids
|
|
195775
195889
|
*/
|
|
195776
|
-
if (typeof ids === 'string') {
|
|
195890
|
+
if ((ids !== undefined) && typeof ids === 'string') {
|
|
195777
195891
|
return ids.split(',');
|
|
195778
195892
|
}
|
|
195779
195893
|
else {
|
|
@@ -199852,6 +199966,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
199852
199966
|
return this.parseGreeks(entry, market);
|
|
199853
199967
|
}
|
|
199854
199968
|
}
|
|
199969
|
+
return undefined;
|
|
199855
199970
|
}
|
|
199856
199971
|
parseGreeks(greeks, market = undefined) {
|
|
199857
199972
|
//
|
|
@@ -205026,7 +205141,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
205026
205141
|
return orderbook;
|
|
205027
205142
|
}
|
|
205028
205143
|
toEn(n, scale) {
|
|
205029
|
-
const stringN =
|
|
205144
|
+
const stringN = this.numberToString(n);
|
|
205030
205145
|
const precise = new _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O(stringN);
|
|
205031
205146
|
precise.decimals = precise.decimals - scale;
|
|
205032
205147
|
precise.reduce();
|
|
@@ -206419,11 +206534,11 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
206419
206534
|
}
|
|
206420
206535
|
}
|
|
206421
206536
|
cost = (cost === undefined) ? amount : cost;
|
|
206422
|
-
const costString =
|
|
206537
|
+
const costString = this.numberToString(cost);
|
|
206423
206538
|
request['quoteQtyEv'] = this.toEv(costString, market);
|
|
206424
206539
|
}
|
|
206425
206540
|
else {
|
|
206426
|
-
const amountString =
|
|
206541
|
+
const amountString = this.numberToString(amount);
|
|
206427
206542
|
request['baseQtyEv'] = this.toEv(amountString, market);
|
|
206428
206543
|
}
|
|
206429
206544
|
}
|
|
@@ -206441,7 +206556,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
206441
206556
|
request['orderQtyRq'] = amount;
|
|
206442
206557
|
}
|
|
206443
206558
|
else {
|
|
206444
|
-
request['orderQty'] =
|
|
206559
|
+
request['orderQty'] = this.parseToInt(amount);
|
|
206445
206560
|
}
|
|
206446
206561
|
if (stopPrice !== undefined) {
|
|
206447
206562
|
const triggerType = this.safeString(params, 'triggerType', 'ByMarkPrice');
|
|
@@ -208238,10 +208353,10 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
208238
208353
|
request['leverageRr'] = leverage;
|
|
208239
208354
|
}
|
|
208240
208355
|
else {
|
|
208241
|
-
const
|
|
208242
|
-
const
|
|
208243
|
-
request['longLeverageRr'] =
|
|
208244
|
-
request['shortLeverageRr'] =
|
|
208356
|
+
const longVar = (longLeverageRr !== undefined) ? longLeverageRr : leverage;
|
|
208357
|
+
const shortVar = (shortLeverageRr !== undefined) ? shortLeverageRr : leverage;
|
|
208358
|
+
request['longLeverageRr'] = longVar;
|
|
208359
|
+
request['shortLeverageRr'] = shortVar;
|
|
208245
208360
|
}
|
|
208246
208361
|
response = await this.privatePutGPositionsLeverage(this.extend(request, params));
|
|
208247
208362
|
}
|
|
@@ -213429,13 +213544,16 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
213429
213544
|
const T = this.safeString(data, 'T');
|
|
213430
213545
|
const msg = this.safeValue(data, 'msg', {});
|
|
213431
213546
|
if (T === 'subscription') {
|
|
213432
|
-
|
|
213547
|
+
this.handleSubscription(client, data);
|
|
213548
|
+
return;
|
|
213433
213549
|
}
|
|
213434
213550
|
if (T === 'success' && msg === 'connected') {
|
|
213435
|
-
|
|
213551
|
+
this.handleConnected(client, data);
|
|
213552
|
+
return;
|
|
213436
213553
|
}
|
|
213437
213554
|
if (T === 'success' && msg === 'authenticated') {
|
|
213438
|
-
|
|
213555
|
+
this.handleAuthenticate(client, data);
|
|
213556
|
+
return;
|
|
213439
213557
|
}
|
|
213440
213558
|
const methods = {
|
|
213441
213559
|
'error': this.handleErrorMessage,
|
|
@@ -213464,7 +213582,8 @@ class alpaca extends _alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
213464
213582
|
}
|
|
213465
213583
|
handleMessage(client, message) {
|
|
213466
213584
|
if (Array.isArray(message)) {
|
|
213467
|
-
|
|
213585
|
+
this.handleCryptoMessage(client, message);
|
|
213586
|
+
return;
|
|
213468
213587
|
}
|
|
213469
213588
|
this.handleTradingMessage(client, message);
|
|
213470
213589
|
}
|
|
@@ -214426,7 +214545,6 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
214426
214545
|
this.handleBalance(client, message);
|
|
214427
214546
|
}
|
|
214428
214547
|
}
|
|
214429
|
-
return message;
|
|
214430
214548
|
}
|
|
214431
214549
|
handleSubscriptionStatus(client, message) {
|
|
214432
214550
|
//
|
|
@@ -214466,7 +214584,7 @@ class ascendex extends _ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
214466
214584
|
handlePing(client, message) {
|
|
214467
214585
|
this.spawn(this.pong, client, message);
|
|
214468
214586
|
}
|
|
214469
|
-
authenticate(url, params = {}) {
|
|
214587
|
+
async authenticate(url, params = {}) {
|
|
214470
214588
|
this.checkRequiredCredentials();
|
|
214471
214589
|
const messageHash = 'authenticated';
|
|
214472
214590
|
const client = this.client(url);
|
|
@@ -215092,7 +215210,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215092
215210
|
*/
|
|
215093
215211
|
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
215094
215212
|
}
|
|
215095
|
-
|
|
215213
|
+
parseWsTrade(trade, market = undefined) {
|
|
215096
215214
|
//
|
|
215097
215215
|
// public watchTrades
|
|
215098
215216
|
//
|
|
@@ -215200,7 +215318,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215200
215318
|
const executionType = this.safeString(trade, 'x');
|
|
215201
215319
|
const isTradeExecution = (executionType === 'TRADE');
|
|
215202
215320
|
if (!isTradeExecution) {
|
|
215203
|
-
return
|
|
215321
|
+
return this.parseTrade(trade, market);
|
|
215204
215322
|
}
|
|
215205
215323
|
const id = this.safeString2(trade, 't', 'a');
|
|
215206
215324
|
const timestamp = this.safeInteger(trade, 'T');
|
|
@@ -215265,7 +215383,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215265
215383
|
const lowerCaseId = this.safeStringLower(message, 's');
|
|
215266
215384
|
const event = this.safeString(message, 'e');
|
|
215267
215385
|
const messageHash = lowerCaseId + '@' + event;
|
|
215268
|
-
const trade = this.
|
|
215386
|
+
const trade = this.parseWsTrade(message, market);
|
|
215269
215387
|
let tradesArray = this.safeValue(this.trades, symbol);
|
|
215270
215388
|
if (tradesArray === undefined) {
|
|
215271
215389
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
@@ -215815,14 +215933,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215815
215933
|
for (let j = 0; j < subscriptionKeys.length; j++) {
|
|
215816
215934
|
const subscribeType = subscriptionKeys[j];
|
|
215817
215935
|
if (subscribeType === type) {
|
|
215818
|
-
|
|
215936
|
+
this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
|
|
215937
|
+
return;
|
|
215819
215938
|
}
|
|
215820
215939
|
}
|
|
215821
215940
|
}
|
|
215822
215941
|
}
|
|
215823
215942
|
setBalanceCache(client, type) {
|
|
215824
215943
|
if (type in client.subscriptions) {
|
|
215825
|
-
return
|
|
215944
|
+
return;
|
|
215826
215945
|
}
|
|
215827
215946
|
const options = this.safeValue(this.options, 'watchBalance');
|
|
215828
215947
|
const fetchBalanceSnapshot = this.safeBool(options, 'fetchBalanceSnapshot', false);
|
|
@@ -215923,7 +216042,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
215923
216042
|
//
|
|
215924
216043
|
const messageHash = this.safeString(message, 'id');
|
|
215925
216044
|
const result = this.safeValue(message, 'result', {});
|
|
215926
|
-
const parsedBalances = this.parseBalance(result
|
|
216045
|
+
const parsedBalances = this.parseBalance(result);
|
|
215927
216046
|
client.resolve(parsedBalances, messageHash);
|
|
215928
216047
|
}
|
|
215929
216048
|
async watchBalance(params = {}) {
|
|
@@ -217296,13 +217415,15 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217296
217415
|
const status = this.safeString(message, 'status');
|
|
217297
217416
|
const error = this.safeValue(message, 'error');
|
|
217298
217417
|
if ((error !== undefined) || (status !== undefined && status !== '200')) {
|
|
217299
|
-
|
|
217418
|
+
this.handleWsError(client, message);
|
|
217419
|
+
return;
|
|
217300
217420
|
}
|
|
217301
217421
|
const id = this.safeString(message, 'id');
|
|
217302
217422
|
const subscriptions = this.safeValue(client.subscriptions, id);
|
|
217303
217423
|
let method = this.safeValue(subscriptions, 'method');
|
|
217304
217424
|
if (method !== undefined) {
|
|
217305
|
-
|
|
217425
|
+
method.call(this, client, message);
|
|
217426
|
+
return;
|
|
217306
217427
|
}
|
|
217307
217428
|
// handle other APIs
|
|
217308
217429
|
const methods = {
|
|
@@ -217332,7 +217453,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217332
217453
|
if (method === undefined) {
|
|
217333
217454
|
const requestId = this.safeString(message, 'id');
|
|
217334
217455
|
if (requestId !== undefined) {
|
|
217335
|
-
|
|
217456
|
+
this.handleSubscriptionStatus(client, message);
|
|
217457
|
+
return;
|
|
217336
217458
|
}
|
|
217337
217459
|
// special case for the real-time bookTicker, since it comes without an event identifier
|
|
217338
217460
|
//
|
|
@@ -217351,7 +217473,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217351
217473
|
}
|
|
217352
217474
|
}
|
|
217353
217475
|
else {
|
|
217354
|
-
|
|
217476
|
+
method.call(this, client, message);
|
|
217355
217477
|
}
|
|
217356
217478
|
}
|
|
217357
217479
|
}
|
|
@@ -218222,7 +218344,7 @@ class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
218222
218344
|
}
|
|
218223
218345
|
setBalanceCache(client, type, subscriptionHash, params) {
|
|
218224
218346
|
if (subscriptionHash in client.subscriptions) {
|
|
218225
|
-
return
|
|
218347
|
+
return;
|
|
218226
218348
|
}
|
|
218227
218349
|
const fetchBalanceSnapshot = this.handleOptionAndParams(params, 'watchBalance', 'fetchBalanceSnapshot', true);
|
|
218228
218350
|
if (fetchBalanceSnapshot) {
|
|
@@ -218786,7 +218908,6 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218786
218908
|
stored.append(trade);
|
|
218787
218909
|
}
|
|
218788
218910
|
client.resolve(stored, messageHash);
|
|
218789
|
-
return message;
|
|
218790
218911
|
}
|
|
218791
218912
|
parseTrade(trade, market = undefined) {
|
|
218792
218913
|
//
|
|
@@ -218976,8 +219097,9 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218976
219097
|
const delta = deltas[i];
|
|
218977
219098
|
const id = this.safeString(delta, 0);
|
|
218978
219099
|
const price = this.safeFloat(delta, 1);
|
|
218979
|
-
const
|
|
218980
|
-
const
|
|
219100
|
+
const delta2Value = delta[2];
|
|
219101
|
+
const size = (delta2Value < 0) ? -delta2Value : delta2Value;
|
|
219102
|
+
const side = (delta2Value < 0) ? 'asks' : 'bids';
|
|
218981
219103
|
const bookside = orderbook[side];
|
|
218982
219104
|
bookside.store(price, size, id);
|
|
218983
219105
|
}
|
|
@@ -218986,10 +219108,11 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218986
219108
|
const deltas = message[1];
|
|
218987
219109
|
for (let i = 0; i < deltas.length; i++) {
|
|
218988
219110
|
const delta = deltas[i];
|
|
218989
|
-
const
|
|
218990
|
-
const
|
|
218991
|
-
const
|
|
218992
|
-
|
|
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]);
|
|
218993
219116
|
}
|
|
218994
219117
|
}
|
|
218995
219118
|
client.resolve(orderbook, messageHash);
|
|
@@ -218999,18 +219122,20 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
218999
219122
|
if (isRaw) {
|
|
219000
219123
|
const id = this.safeString(message, 1);
|
|
219001
219124
|
const price = this.safeString(message, 2);
|
|
219002
|
-
const
|
|
219003
|
-
const
|
|
219125
|
+
const message3 = message[3];
|
|
219126
|
+
const size = (message3 < 0) ? -message3 : message3;
|
|
219127
|
+
const side = (message3 < 0) ? 'asks' : 'bids';
|
|
219004
219128
|
const bookside = orderbook[side];
|
|
219005
219129
|
// price = 0 means that you have to remove the order from your book
|
|
219006
219130
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
|
|
219007
219131
|
bookside.store(this.parseNumber(price), this.parseNumber(amount), id);
|
|
219008
219132
|
}
|
|
219009
219133
|
else {
|
|
219010
|
-
const
|
|
219011
|
-
const
|
|
219012
|
-
const
|
|
219013
|
-
|
|
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]);
|
|
219014
219139
|
}
|
|
219015
219140
|
client.resolve(orderbook, messageHash);
|
|
219016
219141
|
}
|
|
@@ -219271,7 +219396,7 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
219271
219396
|
// ]
|
|
219272
219397
|
//
|
|
219273
219398
|
if (message[1] === 'hb') {
|
|
219274
|
-
return
|
|
219399
|
+
return; // skip heartbeats within subscription channels for now
|
|
219275
219400
|
}
|
|
219276
219401
|
const subscription = this.safeValue(client.subscriptions, channelId, {});
|
|
219277
219402
|
const channel = this.safeString(subscription, 'channel');
|
|
@@ -219286,11 +219411,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
219286
219411
|
'oc': this.handleOrders,
|
|
219287
219412
|
};
|
|
219288
219413
|
const method = this.safeValue2(methods, channel, name);
|
|
219289
|
-
if (method
|
|
219290
|
-
|
|
219291
|
-
}
|
|
219292
|
-
else {
|
|
219293
|
-
return method.call(this, client, message, subscription);
|
|
219414
|
+
if (method !== undefined) {
|
|
219415
|
+
method.call(this, client, message, subscription);
|
|
219294
219416
|
}
|
|
219295
219417
|
}
|
|
219296
219418
|
else {
|
|
@@ -219312,11 +219434,8 @@ class bitfinex extends _bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
219312
219434
|
'auth': this.handleAuthenticationMessage,
|
|
219313
219435
|
};
|
|
219314
219436
|
const method = this.safeValue(methods, event);
|
|
219315
|
-
if (method
|
|
219316
|
-
|
|
219317
|
-
}
|
|
219318
|
-
else {
|
|
219319
|
-
return method.call(this, client, message);
|
|
219437
|
+
if (method !== undefined) {
|
|
219438
|
+
method.call(this, client, message);
|
|
219320
219439
|
}
|
|
219321
219440
|
}
|
|
219322
219441
|
}
|
|
@@ -219675,7 +219794,6 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219675
219794
|
stored.append(parsed);
|
|
219676
219795
|
}
|
|
219677
219796
|
client.resolve(stored, messageHash);
|
|
219678
|
-
return message;
|
|
219679
219797
|
}
|
|
219680
219798
|
parseWsTrade(trade, market = undefined) {
|
|
219681
219799
|
//
|
|
@@ -219927,8 +220045,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219927
220045
|
const deltas = message[1];
|
|
219928
220046
|
for (let i = 0; i < deltas.length; i++) {
|
|
219929
220047
|
const delta = deltas[i];
|
|
219930
|
-
const
|
|
219931
|
-
const
|
|
220048
|
+
const delta2 = delta[2];
|
|
220049
|
+
const size = (delta2 < 0) ? -delta2 : delta2;
|
|
220050
|
+
const side = (delta2 < 0) ? 'asks' : 'bids';
|
|
219932
220051
|
const bookside = orderbook[side];
|
|
219933
220052
|
const idString = this.safeString(delta, 0);
|
|
219934
220053
|
const price = this.safeFloat(delta, 1);
|
|
@@ -219956,8 +220075,9 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
219956
220075
|
const orderbookItem = this.orderbooks[symbol];
|
|
219957
220076
|
if (isRaw) {
|
|
219958
220077
|
const price = this.safeString(deltas, 1);
|
|
219959
|
-
const
|
|
219960
|
-
const
|
|
220078
|
+
const deltas2 = deltas[2];
|
|
220079
|
+
const size = (deltas2 < 0) ? -deltas2 : deltas2;
|
|
220080
|
+
const side = (deltas2 < 0) ? 'asks' : 'bids';
|
|
219961
220081
|
const bookside = orderbookItem[side];
|
|
219962
220082
|
// price = 0 means that you have to remove the order from your book
|
|
219963
220083
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringGt(price, '0') ? size : '0';
|
|
@@ -220005,7 +220125,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220005
220125
|
}
|
|
220006
220126
|
if (ask !== undefined) {
|
|
220007
220127
|
stringArray.push(this.numberToString(asks[i][idToCheck]));
|
|
220008
|
-
|
|
220128
|
+
const aski1 = asks[i][1];
|
|
220129
|
+
stringArray.push(this.numberToString(-aski1));
|
|
220009
220130
|
}
|
|
220010
220131
|
}
|
|
220011
220132
|
const payload = stringArray.join(':');
|
|
@@ -220437,7 +220558,7 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220437
220558
|
//
|
|
220438
220559
|
if (Array.isArray(message)) {
|
|
220439
220560
|
if (message[1] === 'hb') {
|
|
220440
|
-
return
|
|
220561
|
+
return; // skip heartbeats within subscription channels for now
|
|
220441
220562
|
}
|
|
220442
220563
|
const subscription = this.safeValue(client.subscriptions, channelId, {});
|
|
220443
220564
|
const channel = this.safeString(subscription, 'channel');
|
|
@@ -220465,11 +220586,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220465
220586
|
else {
|
|
220466
220587
|
method = this.safeValue2(publicMethods, name, channel);
|
|
220467
220588
|
}
|
|
220468
|
-
if (method
|
|
220469
|
-
|
|
220470
|
-
}
|
|
220471
|
-
else {
|
|
220472
|
-
return method.call(this, client, message, subscription);
|
|
220589
|
+
if (method !== undefined) {
|
|
220590
|
+
method.call(this, client, message, subscription);
|
|
220473
220591
|
}
|
|
220474
220592
|
}
|
|
220475
220593
|
else {
|
|
@@ -220481,11 +220599,8 @@ class bitfinex2 extends _bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
220481
220599
|
'auth': this.handleAuthenticationMessage,
|
|
220482
220600
|
};
|
|
220483
220601
|
const method = this.safeValue(methods, event);
|
|
220484
|
-
if (method
|
|
220485
|
-
|
|
220486
|
-
}
|
|
220487
|
-
else {
|
|
220488
|
-
return method.call(this, client, message);
|
|
220602
|
+
if (method !== undefined) {
|
|
220603
|
+
method.call(this, client, message);
|
|
220489
220604
|
}
|
|
220490
220605
|
}
|
|
220491
220606
|
}
|
|
@@ -220600,7 +220715,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
220600
220715
|
else {
|
|
220601
220716
|
instType = 'SPOT';
|
|
220602
220717
|
}
|
|
220603
|
-
|
|
220718
|
+
let instypeAux = undefined;
|
|
220719
|
+
[instypeAux, params] = this.handleOptionAndParams(params, 'getInstType', 'instType', instType);
|
|
220720
|
+
instType = instypeAux;
|
|
220604
220721
|
return [instType, params];
|
|
220605
220722
|
}
|
|
220606
220723
|
async watchTicker(symbol, params = {}) {
|
|
@@ -223064,7 +223181,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223064
223181
|
messageHash += ':' + this.safeString(data[0], 'symbol');
|
|
223065
223182
|
}
|
|
223066
223183
|
client.resolve(stored, messageHash);
|
|
223067
|
-
return message;
|
|
223068
223184
|
}
|
|
223069
223185
|
parseWsTrade(trade, market = undefined) {
|
|
223070
223186
|
// spot
|
|
@@ -223166,7 +223282,6 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223166
223282
|
client.resolve(ticker, 'tickers::swap');
|
|
223167
223283
|
this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
|
|
223168
223284
|
}
|
|
223169
|
-
return message;
|
|
223170
223285
|
}
|
|
223171
223286
|
resolveMessageHashesForSymbol(client, symbol, result, prexif) {
|
|
223172
223287
|
const prefixSeparator = '::';
|
|
@@ -223700,11 +223815,8 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223700
223815
|
'subscribe': this.handleSubscriptionStatus,
|
|
223701
223816
|
};
|
|
223702
223817
|
const method = this.safeValue(methods, event);
|
|
223703
|
-
if (method
|
|
223704
|
-
|
|
223705
|
-
}
|
|
223706
|
-
else {
|
|
223707
|
-
return method.call(this, client, message);
|
|
223818
|
+
if (method !== undefined) {
|
|
223819
|
+
method.call(this, client, message);
|
|
223708
223820
|
}
|
|
223709
223821
|
}
|
|
223710
223822
|
}
|
|
@@ -223724,7 +223836,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223724
223836
|
const key = keys[i];
|
|
223725
223837
|
if (channel.indexOf(key) >= 0) {
|
|
223726
223838
|
const method = this.safeValue(methods, key);
|
|
223727
|
-
|
|
223839
|
+
method.call(this, client, message);
|
|
223728
223840
|
}
|
|
223729
223841
|
}
|
|
223730
223842
|
}
|
|
@@ -225267,7 +225379,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
225267
225379
|
//
|
|
225268
225380
|
// { "error": "Rate limit exceeded, retry in 29 seconds." }
|
|
225269
225381
|
//
|
|
225270
|
-
const error = this.
|
|
225382
|
+
const error = this.safeString(message, 'error');
|
|
225271
225383
|
if (error !== undefined) {
|
|
225272
225384
|
const request = this.safeValue(message, 'request', {});
|
|
225273
225385
|
const args = this.safeValue(request, 'args', []);
|
|
@@ -225278,7 +225390,7 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
225278
225390
|
const broadKey = this.findBroadlyMatchedKey(broad, error);
|
|
225279
225391
|
let exception = undefined;
|
|
225280
225392
|
if (broadKey === undefined) {
|
|
225281
|
-
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
|
|
225282
225394
|
}
|
|
225283
225395
|
else {
|
|
225284
225396
|
exception = new broad[broadKey](error);
|
|
@@ -225346,14 +225458,11 @@ class bitmex extends _bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
225346
225458
|
const request = this.safeValue(message, 'request', {});
|
|
225347
225459
|
const op = this.safeValue(request, 'op');
|
|
225348
225460
|
if (op === 'authKeyExpires') {
|
|
225349
|
-
|
|
225350
|
-
}
|
|
225351
|
-
else {
|
|
225352
|
-
return message;
|
|
225461
|
+
this.handleAuthenticationMessage(client, message);
|
|
225353
225462
|
}
|
|
225354
225463
|
}
|
|
225355
225464
|
else {
|
|
225356
|
-
|
|
225465
|
+
method.call(this, client, message);
|
|
225357
225466
|
}
|
|
225358
225467
|
}
|
|
225359
225468
|
}
|
|
@@ -225835,11 +225944,8 @@ class bitopro extends _bitopro_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
225835
225944
|
};
|
|
225836
225945
|
const event = this.safeString(message, 'event');
|
|
225837
225946
|
const method = this.safeValue(methods, event);
|
|
225838
|
-
if (method
|
|
225839
|
-
|
|
225840
|
-
}
|
|
225841
|
-
else {
|
|
225842
|
-
return method.call(this, client, message);
|
|
225947
|
+
if (method !== undefined) {
|
|
225948
|
+
method.call(this, client, message);
|
|
225843
225949
|
}
|
|
225844
225950
|
}
|
|
225845
225951
|
}
|
|
@@ -226295,7 +226401,7 @@ class bitrue extends _bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
226295
226401
|
catch (error) {
|
|
226296
226402
|
this.options['listenKey'] = undefined;
|
|
226297
226403
|
this.options['listenKeyUrl'] = undefined;
|
|
226298
|
-
return;
|
|
226404
|
+
return undefined;
|
|
226299
226405
|
}
|
|
226300
226406
|
//
|
|
226301
226407
|
// {
|
|
@@ -226849,10 +226955,10 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
226849
226955
|
//
|
|
226850
226956
|
const event = this.safeString(message, 'event');
|
|
226851
226957
|
if (event === 'bts:subscription_succeeded') {
|
|
226852
|
-
|
|
226958
|
+
this.handleSubscriptionStatus(client, message);
|
|
226853
226959
|
}
|
|
226854
226960
|
else {
|
|
226855
|
-
|
|
226961
|
+
this.handleSubject(client, message);
|
|
226856
226962
|
}
|
|
226857
226963
|
}
|
|
226858
226964
|
async authenticate(params = {}) {
|
|
@@ -226875,7 +226981,6 @@ class bitstamp extends _bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
226875
226981
|
this.options['expiresIn'] = this.sum(time, validity);
|
|
226876
226982
|
this.options['userId'] = userId;
|
|
226877
226983
|
this.options['wsSessionToken'] = sessionToken;
|
|
226878
|
-
return response;
|
|
226879
226984
|
}
|
|
226880
226985
|
}
|
|
226881
226986
|
}
|
|
@@ -227319,7 +227424,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
227319
227424
|
//
|
|
227320
227425
|
const response = this.safeValue(message, 'response');
|
|
227321
227426
|
if (response === undefined) {
|
|
227322
|
-
return
|
|
227427
|
+
return;
|
|
227323
227428
|
}
|
|
227324
227429
|
const marketId = this.safeString(response, 'market');
|
|
227325
227430
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
@@ -228101,7 +228206,7 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
228101
228206
|
}
|
|
228102
228207
|
return message;
|
|
228103
228208
|
}
|
|
228104
|
-
authenticate(params = {}) {
|
|
228209
|
+
async authenticate(params = {}) {
|
|
228105
228210
|
const url = this.urls['api']['ws'];
|
|
228106
228211
|
const client = this.client(url);
|
|
228107
228212
|
const messageHash = 'authenticated';
|
|
@@ -228246,9 +228351,16 @@ class bitvavo extends _bitvavo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
228246
228351
|
'getCandles': this.handleFetchOHLCV,
|
|
228247
228352
|
'getMarkets': this.handleMarkets,
|
|
228248
228353
|
};
|
|
228249
|
-
const event = this.
|
|
228250
|
-
|
|
228251
|
-
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 {
|
|
228252
228364
|
method.call(this, client, message);
|
|
228253
228365
|
}
|
|
228254
228366
|
}
|
|
@@ -228364,7 +228476,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228364
228476
|
//
|
|
228365
228477
|
const event = this.safeString(message, 'event');
|
|
228366
228478
|
if (event === 'subscribed') {
|
|
228367
|
-
return
|
|
228479
|
+
return;
|
|
228368
228480
|
}
|
|
228369
228481
|
const result = { 'info': message };
|
|
228370
228482
|
const balances = this.safeValue(message, 'balances', []);
|
|
@@ -228434,11 +228546,9 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228434
228546
|
// }
|
|
228435
228547
|
//
|
|
228436
228548
|
const event = this.safeString(message, 'event');
|
|
228437
|
-
if (event === '
|
|
228438
|
-
|
|
228439
|
-
|
|
228440
|
-
else if (event === 'rejected') {
|
|
228441
|
-
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);
|
|
228442
228552
|
}
|
|
228443
228553
|
else if (event === 'updated') {
|
|
228444
228554
|
const marketId = this.safeString(message, 'symbol');
|
|
@@ -228458,7 +228568,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228458
228568
|
stored.append(ohlcv);
|
|
228459
228569
|
client.resolve(stored, messageHash);
|
|
228460
228570
|
}
|
|
228461
|
-
else {
|
|
228571
|
+
else if (event !== 'subscribed') {
|
|
228462
228572
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' ' + this.json(message));
|
|
228463
228573
|
}
|
|
228464
228574
|
}
|
|
@@ -228520,7 +228630,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228520
228630
|
const symbol = market['symbol'];
|
|
228521
228631
|
let ticker = undefined;
|
|
228522
228632
|
if (event === 'subscribed') {
|
|
228523
|
-
return
|
|
228633
|
+
return;
|
|
228524
228634
|
}
|
|
228525
228635
|
else if (event === 'snapshot') {
|
|
228526
228636
|
ticker = this.parseTicker(message, market);
|
|
@@ -228619,7 +228729,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228619
228729
|
//
|
|
228620
228730
|
const event = this.safeString(message, 'event');
|
|
228621
228731
|
if (event !== 'updated') {
|
|
228622
|
-
return
|
|
228732
|
+
return;
|
|
228623
228733
|
}
|
|
228624
228734
|
const marketId = this.safeString(message, 'symbol');
|
|
228625
228735
|
const symbol = this.safeSymbol(marketId);
|
|
@@ -228781,7 +228891,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228781
228891
|
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
228782
228892
|
}
|
|
228783
228893
|
if (event === 'subscribed') {
|
|
228784
|
-
return
|
|
228894
|
+
return;
|
|
228785
228895
|
}
|
|
228786
228896
|
else if (event === 'rejected') {
|
|
228787
228897
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + this.json(message));
|
|
@@ -228951,30 +229061,30 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
228951
229061
|
const messageHash = 'orderbook:' + symbol + ':' + type;
|
|
228952
229062
|
const datetime = this.safeString(message, 'timestamp');
|
|
228953
229063
|
const timestamp = this.parse8601(datetime);
|
|
228954
|
-
let
|
|
228955
|
-
if (
|
|
228956
|
-
|
|
228957
|
-
this.orderbooks[symbol] =
|
|
229064
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
229065
|
+
if (orderbook === undefined) {
|
|
229066
|
+
orderbook = this.countedOrderBook({});
|
|
229067
|
+
this.orderbooks[symbol] = orderbook;
|
|
228958
229068
|
}
|
|
228959
229069
|
if (event === 'subscribed') {
|
|
228960
|
-
return
|
|
229070
|
+
return;
|
|
228961
229071
|
}
|
|
228962
229072
|
else if (event === 'snapshot') {
|
|
228963
229073
|
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'px', 'qty', 'num');
|
|
228964
|
-
|
|
229074
|
+
orderbook.reset(snapshot);
|
|
228965
229075
|
}
|
|
228966
229076
|
else if (event === 'updated') {
|
|
228967
229077
|
const asks = this.safeValue(message, 'asks', []);
|
|
228968
229078
|
const bids = this.safeValue(message, 'bids', []);
|
|
228969
|
-
this.handleDeltas(
|
|
228970
|
-
this.handleDeltas(
|
|
228971
|
-
|
|
228972
|
-
|
|
229079
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
229080
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
229081
|
+
orderbook['timestamp'] = timestamp;
|
|
229082
|
+
orderbook['datetime'] = datetime;
|
|
228973
229083
|
}
|
|
228974
229084
|
else {
|
|
228975
229085
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() does not support ' + event + ' yet');
|
|
228976
229086
|
}
|
|
228977
|
-
client.resolve(
|
|
229087
|
+
client.resolve(orderbook, messageHash);
|
|
228978
229088
|
}
|
|
228979
229089
|
handleDelta(bookside, delta) {
|
|
228980
229090
|
const bookArray = this.parseBidAsk(delta, 'px', 'qty', 'num');
|
|
@@ -229015,7 +229125,8 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
229015
229125
|
};
|
|
229016
229126
|
const handler = this.safeValue(handlers, channel);
|
|
229017
229127
|
if (handler !== undefined) {
|
|
229018
|
-
|
|
229128
|
+
handler.call(this, client, message);
|
|
229129
|
+
return;
|
|
229019
229130
|
}
|
|
229020
229131
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
|
|
229021
229132
|
}
|
|
@@ -229037,7 +229148,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
229037
229148
|
future.resolve(true);
|
|
229038
229149
|
}
|
|
229039
229150
|
}
|
|
229040
|
-
authenticate(params = {}) {
|
|
229151
|
+
async authenticate(params = {}) {
|
|
229041
229152
|
const url = this.urls['api']['ws'];
|
|
229042
229153
|
const client = this.client(url);
|
|
229043
229154
|
const messageHash = 'authenticated';
|
|
@@ -229974,7 +230085,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
229974
230085
|
* @name bybit#watchPositions
|
|
229975
230086
|
* @see https://bybit-exchange.github.io/docs/v5/websocket/private/position
|
|
229976
230087
|
* @description watch all open positions
|
|
229977
|
-
* @param {string[]
|
|
230088
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
229978
230089
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
229979
230090
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
229980
230091
|
*/
|
|
@@ -230007,7 +230118,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230007
230118
|
}
|
|
230008
230119
|
setPositionsCache(client, symbols = undefined) {
|
|
230009
230120
|
if (this.positions !== undefined) {
|
|
230010
|
-
return
|
|
230121
|
+
return;
|
|
230011
230122
|
}
|
|
230012
230123
|
const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
|
|
230013
230124
|
if (fetchPositionsSnapshot) {
|
|
@@ -230140,7 +230251,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230140
230251
|
}
|
|
230141
230252
|
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
230142
230253
|
}
|
|
230143
|
-
handleOrder(client, message
|
|
230254
|
+
handleOrder(client, message) {
|
|
230144
230255
|
//
|
|
230145
230256
|
// spot
|
|
230146
230257
|
// {
|
|
@@ -230706,7 +230817,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230706
230817
|
const authenticated = this.safeValue(client.subscriptions, messageHash);
|
|
230707
230818
|
if (authenticated === undefined) {
|
|
230708
230819
|
const expiresInt = this.milliseconds() + 10000;
|
|
230709
|
-
const expires =
|
|
230820
|
+
const expires = this.numberToString(expiresInt);
|
|
230710
230821
|
const path = 'GET/realtime';
|
|
230711
230822
|
const auth = path + expires;
|
|
230712
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');
|
|
@@ -230719,7 +230830,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230719
230830
|
const message = this.extend(request, params);
|
|
230720
230831
|
this.watch(url, messageHash, message, messageHash);
|
|
230721
230832
|
}
|
|
230722
|
-
return future;
|
|
230833
|
+
return await future;
|
|
230723
230834
|
}
|
|
230724
230835
|
handleErrorMessage(client, message) {
|
|
230725
230836
|
//
|
|
@@ -231881,15 +231992,15 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
231881
231992
|
const messageHash = 'orderbook:' + symbol;
|
|
231882
231993
|
const timestamp = this.safeInteger2(data, 'timestamp_ms', 'timestamp');
|
|
231883
231994
|
const incrementalId = this.safeNumber(data, 'id');
|
|
231884
|
-
const
|
|
231995
|
+
const orderbook = this.orderBook({});
|
|
231885
231996
|
const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks');
|
|
231886
231997
|
snapshot['nonce'] = incrementalId;
|
|
231887
|
-
|
|
231998
|
+
orderbook.reset(snapshot);
|
|
231888
231999
|
this.options['orderbook'][symbol] = {
|
|
231889
232000
|
'incrementalId': incrementalId,
|
|
231890
232001
|
};
|
|
231891
|
-
this.orderbooks[symbol] =
|
|
231892
|
-
client.resolve(
|
|
232002
|
+
this.orderbooks[symbol] = orderbook;
|
|
232003
|
+
client.resolve(orderbook, messageHash);
|
|
231893
232004
|
}
|
|
231894
232005
|
pairToSymbol(pair) {
|
|
231895
232006
|
const parts = pair.split(':');
|
|
@@ -232355,7 +232466,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
232355
232466
|
handleMessage(client, message) {
|
|
232356
232467
|
const ok = this.safeString(message, 'ok');
|
|
232357
232468
|
if (ok === 'error') {
|
|
232358
|
-
|
|
232469
|
+
this.handleErrorMessage(client, message);
|
|
232470
|
+
return;
|
|
232359
232471
|
}
|
|
232360
232472
|
const event = this.safeString(message, 'e');
|
|
232361
232473
|
const handlers = {
|
|
@@ -232383,9 +232495,8 @@ class cex extends _cex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
232383
232495
|
};
|
|
232384
232496
|
const handler = this.safeValue(handlers, event);
|
|
232385
232497
|
if (handler !== undefined) {
|
|
232386
|
-
|
|
232498
|
+
handler.call(this, client, message);
|
|
232387
232499
|
}
|
|
232388
|
-
return message;
|
|
232389
232500
|
}
|
|
232390
232501
|
handleAuthenticationMessage(client, message) {
|
|
232391
232502
|
//
|
|
@@ -232901,7 +233012,8 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
232901
233012
|
const side = this.safeString(this.options['sides'], sideId);
|
|
232902
233013
|
const price = this.safeNumber(trade, 'price_level');
|
|
232903
233014
|
const amount = this.safeNumber(trade, 'new_quantity');
|
|
232904
|
-
orderbook[side]
|
|
233015
|
+
const orderbookSide = orderbook[side];
|
|
233016
|
+
orderbookSide.store(price, amount);
|
|
232905
233017
|
}
|
|
232906
233018
|
}
|
|
232907
233019
|
handleOrderBook(client, message) {
|
|
@@ -232994,7 +233106,7 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
232994
233106
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_3__.ExchangeError(errorMessage);
|
|
232995
233107
|
}
|
|
232996
233108
|
const method = this.safeValue(methods, channel);
|
|
232997
|
-
|
|
233109
|
+
method.call(this, client, message);
|
|
232998
233110
|
}
|
|
232999
233111
|
}
|
|
233000
233112
|
|
|
@@ -233970,7 +234082,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
233970
234082
|
}
|
|
233971
234083
|
}
|
|
233972
234084
|
else {
|
|
233973
|
-
|
|
234085
|
+
method.call(this, client, message);
|
|
233974
234086
|
}
|
|
233975
234087
|
}
|
|
233976
234088
|
}
|
|
@@ -234858,29 +234970,29 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234858
234970
|
//
|
|
234859
234971
|
const params = this.safeValue(message, 'params', []);
|
|
234860
234972
|
const fullOrderBook = this.safeValue(params, 0);
|
|
234861
|
-
let
|
|
234973
|
+
let orderbook = this.safeValue(params, 1);
|
|
234862
234974
|
const marketId = this.safeString(params, 2);
|
|
234863
234975
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
234864
234976
|
const market = this.safeMarket(marketId, undefined, undefined, defaultType);
|
|
234865
234977
|
const symbol = market['symbol'];
|
|
234866
234978
|
const name = 'orderbook';
|
|
234867
234979
|
const messageHash = name + ':' + symbol;
|
|
234868
|
-
const timestamp = this.safeInteger(
|
|
234980
|
+
const timestamp = this.safeInteger(orderbook, 'time');
|
|
234869
234981
|
const currentOrderBook = this.safeValue(this.orderbooks, symbol);
|
|
234870
234982
|
if (fullOrderBook) {
|
|
234871
|
-
const snapshot = this.parseOrderBook(
|
|
234983
|
+
const snapshot = this.parseOrderBook(orderbook, symbol, timestamp);
|
|
234872
234984
|
if (currentOrderBook === undefined) {
|
|
234873
|
-
|
|
234874
|
-
this.orderbooks[symbol] =
|
|
234985
|
+
orderbook = this.orderBook(snapshot);
|
|
234986
|
+
this.orderbooks[symbol] = orderbook;
|
|
234875
234987
|
}
|
|
234876
234988
|
else {
|
|
234877
|
-
|
|
234878
|
-
|
|
234989
|
+
orderbook = this.orderbooks[symbol];
|
|
234990
|
+
orderbook.reset(snapshot);
|
|
234879
234991
|
}
|
|
234880
234992
|
}
|
|
234881
234993
|
else {
|
|
234882
|
-
const asks = this.safeValue(
|
|
234883
|
-
const bids = this.safeValue(
|
|
234994
|
+
const asks = this.safeValue(orderbook, 'asks', []);
|
|
234995
|
+
const bids = this.safeValue(orderbook, 'bids', []);
|
|
234884
234996
|
this.handleDeltas(currentOrderBook['asks'], asks);
|
|
234885
234997
|
this.handleDeltas(currentOrderBook['bids'], bids);
|
|
234886
234998
|
currentOrderBook['nonce'] = timestamp;
|
|
@@ -235201,9 +235313,10 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
235201
235313
|
};
|
|
235202
235314
|
const handler = this.safeValue(handlers, method);
|
|
235203
235315
|
if (handler !== undefined) {
|
|
235204
|
-
|
|
235316
|
+
handler.call(this, client, message);
|
|
235317
|
+
return;
|
|
235205
235318
|
}
|
|
235206
|
-
|
|
235319
|
+
this.handleSubscriptionStatus(client, message);
|
|
235207
235320
|
}
|
|
235208
235321
|
handleAuthenticationMessage(client, message) {
|
|
235209
235322
|
//
|
|
@@ -235227,7 +235340,8 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
235227
235340
|
if (subscription !== undefined) {
|
|
235228
235341
|
const futureIndex = this.safeString(subscription, 'future');
|
|
235229
235342
|
if (futureIndex === 'ohlcv') {
|
|
235230
|
-
|
|
235343
|
+
this.handleOHLCV(client, message);
|
|
235344
|
+
return;
|
|
235231
235345
|
}
|
|
235232
235346
|
const future = this.safeValue(client.futures, futureIndex);
|
|
235233
235347
|
if (future !== undefined) {
|
|
@@ -235236,7 +235350,7 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
235236
235350
|
delete client.subscriptions[id];
|
|
235237
235351
|
}
|
|
235238
235352
|
}
|
|
235239
|
-
authenticate(params = {}) {
|
|
235353
|
+
async authenticate(params = {}) {
|
|
235240
235354
|
let type = undefined;
|
|
235241
235355
|
[type, params] = this.handleMarketTypeAndParams('authenticate', undefined, params);
|
|
235242
235356
|
const url = this.urls['api']['ws'][type];
|
|
@@ -237289,10 +237403,11 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
237289
237403
|
};
|
|
237290
237404
|
const method = this.safeValue(methods, subscriptionDestination);
|
|
237291
237405
|
if (method === undefined) {
|
|
237292
|
-
return
|
|
237406
|
+
return;
|
|
237293
237407
|
}
|
|
237294
237408
|
else {
|
|
237295
|
-
|
|
237409
|
+
method.call(this, client, message, subscription);
|
|
237410
|
+
return;
|
|
237296
237411
|
}
|
|
237297
237412
|
}
|
|
237298
237413
|
}
|
|
@@ -237307,11 +237422,8 @@ class currencycom extends _currencycom_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
237307
237422
|
'ping': this.handlePong,
|
|
237308
237423
|
};
|
|
237309
237424
|
const method = this.safeValue(methods, destination);
|
|
237310
|
-
if (method
|
|
237311
|
-
|
|
237312
|
-
}
|
|
237313
|
-
else {
|
|
237314
|
-
return method.call(this, client, message);
|
|
237425
|
+
if (method !== undefined) {
|
|
237426
|
+
method.call(this, client, message);
|
|
237315
237427
|
}
|
|
237316
237428
|
}
|
|
237317
237429
|
}
|
|
@@ -238088,16 +238200,16 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
238088
238200
|
};
|
|
238089
238201
|
const handler = this.safeValue(handlers, channelId);
|
|
238090
238202
|
if (handler !== undefined) {
|
|
238091
|
-
|
|
238203
|
+
handler.call(this, client, message);
|
|
238204
|
+
return;
|
|
238092
238205
|
}
|
|
238093
238206
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
|
|
238094
238207
|
}
|
|
238095
238208
|
const result = this.safeValue(message, 'result', {});
|
|
238096
238209
|
const accessToken = this.safeString(result, 'access_token');
|
|
238097
238210
|
if (accessToken !== undefined) {
|
|
238098
|
-
|
|
238211
|
+
this.handleAuthenticationMessage(client, message);
|
|
238099
238212
|
}
|
|
238100
|
-
return message;
|
|
238101
238213
|
}
|
|
238102
238214
|
handleAuthenticationMessage(client, message) {
|
|
238103
238215
|
//
|
|
@@ -238121,7 +238233,7 @@ class deribit extends _deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
238121
238233
|
client.resolve(message, messageHash);
|
|
238122
238234
|
return message;
|
|
238123
238235
|
}
|
|
238124
|
-
authenticate(params = {}) {
|
|
238236
|
+
async authenticate(params = {}) {
|
|
238125
238237
|
const url = this.urls['api']['ws'];
|
|
238126
238238
|
const client = this.client(url);
|
|
238127
238239
|
const time = this.milliseconds();
|
|
@@ -238677,25 +238789,25 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238677
238789
|
const orderBook = this.safeValue(message, 'data', {});
|
|
238678
238790
|
const messageHash = 'orderbook:' + symbol;
|
|
238679
238791
|
const timestamp = this.safeInteger(message, 'ts');
|
|
238680
|
-
let
|
|
238681
|
-
if (
|
|
238682
|
-
|
|
238683
|
-
this.orderbooks[symbol] =
|
|
238792
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
238793
|
+
if (orderbook === undefined) {
|
|
238794
|
+
orderbook = this.orderBook({});
|
|
238795
|
+
this.orderbooks[symbol] = orderbook;
|
|
238684
238796
|
}
|
|
238685
238797
|
const event = this.safeString(message, 'event');
|
|
238686
238798
|
if (event === 'snapshot') {
|
|
238687
238799
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bid', 'ask');
|
|
238688
|
-
|
|
238800
|
+
orderbook.reset(snapshot);
|
|
238689
238801
|
}
|
|
238690
238802
|
else {
|
|
238691
238803
|
const asks = this.safeValue(orderBook, 'ask', []);
|
|
238692
238804
|
const bids = this.safeValue(orderBook, 'bid', []);
|
|
238693
|
-
this.handleDeltas(
|
|
238694
|
-
this.handleDeltas(
|
|
238695
|
-
|
|
238696
|
-
|
|
238805
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
238806
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
238807
|
+
orderbook['timestamp'] = timestamp;
|
|
238808
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
238697
238809
|
}
|
|
238698
|
-
client.resolve(
|
|
238810
|
+
client.resolve(orderbook, messageHash);
|
|
238699
238811
|
}
|
|
238700
238812
|
handleDelta(bookside, delta) {
|
|
238701
238813
|
const bidAsk = this.parseBidAsk(delta, 0, 1);
|
|
@@ -238730,7 +238842,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238730
238842
|
};
|
|
238731
238843
|
const eventHandler = this.safeValue(events, event);
|
|
238732
238844
|
if (eventHandler !== undefined) {
|
|
238733
|
-
|
|
238845
|
+
eventHandler.call(this, client, message);
|
|
238846
|
+
return;
|
|
238734
238847
|
}
|
|
238735
238848
|
if ((event === 'update') || (event === 'snapshot')) {
|
|
238736
238849
|
const topic = this.safeString(message, 'topic');
|
|
@@ -238752,7 +238865,8 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238752
238865
|
};
|
|
238753
238866
|
const handler = this.safeValue(handlers, channel);
|
|
238754
238867
|
if (handler !== undefined) {
|
|
238755
|
-
|
|
238868
|
+
handler.call(this, client, message);
|
|
238869
|
+
return;
|
|
238756
238870
|
}
|
|
238757
238871
|
}
|
|
238758
238872
|
}
|
|
@@ -238793,7 +238907,7 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
238793
238907
|
const messageHash = 'authenticated';
|
|
238794
238908
|
client.resolve(message, messageHash);
|
|
238795
238909
|
}
|
|
238796
|
-
authenticate(params = {}) {
|
|
238910
|
+
async authenticate(params = {}) {
|
|
238797
238911
|
const messageHash = 'authenticated';
|
|
238798
238912
|
const [type, query] = this.handleMarketTypeAndParams('authenticate', undefined, params);
|
|
238799
238913
|
const url = this.urls['api']['ws'][type];
|
|
@@ -239039,7 +239153,7 @@ class gate extends _gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
239039
239153
|
// max limit is 100
|
|
239040
239154
|
const subscription = client.subscriptions[messageHash];
|
|
239041
239155
|
const limit = this.safeInteger(subscription, 'limit');
|
|
239042
|
-
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
|
|
239043
239157
|
}
|
|
239044
239158
|
storedOrderBook.cache.push(delta);
|
|
239045
239159
|
return;
|
|
@@ -240767,7 +240881,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240767
240881
|
//
|
|
240768
240882
|
const isArray = Array.isArray(message);
|
|
240769
240883
|
if (isArray) {
|
|
240770
|
-
|
|
240884
|
+
this.handleOrder(client, message);
|
|
240885
|
+
return;
|
|
240771
240886
|
}
|
|
240772
240887
|
const reason = this.safeString(message, 'reason');
|
|
240773
240888
|
if (reason === 'error') {
|
|
@@ -240781,7 +240896,8 @@ class gemini extends _gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240781
240896
|
};
|
|
240782
240897
|
const type = this.safeString(message, 'type', '');
|
|
240783
240898
|
if (type.indexOf('candles') >= 0) {
|
|
240784
|
-
|
|
240899
|
+
this.handleOHLCV(client, message);
|
|
240900
|
+
return;
|
|
240785
240901
|
}
|
|
240786
240902
|
const method = this.safeValue(methods, type);
|
|
240787
240903
|
if (method !== undefined) {
|
|
@@ -240952,7 +241068,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240952
241068
|
}
|
|
240953
241069
|
return future;
|
|
240954
241070
|
}
|
|
240955
|
-
async subscribePublic(name, symbols = undefined, params = {}) {
|
|
241071
|
+
async subscribePublic(name, messageHashPrefix, symbols = undefined, params = {}) {
|
|
240956
241072
|
/**
|
|
240957
241073
|
* @ignore
|
|
240958
241074
|
* @method
|
|
@@ -240962,7 +241078,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
240962
241078
|
*/
|
|
240963
241079
|
await this.loadMarkets();
|
|
240964
241080
|
const url = this.urls['api']['ws']['public'];
|
|
240965
|
-
let messageHash =
|
|
241081
|
+
let messageHash = messageHashPrefix;
|
|
240966
241082
|
if (symbols !== undefined) {
|
|
240967
241083
|
messageHash = messageHash + '::' + symbols.join(',');
|
|
240968
241084
|
}
|
|
@@ -241057,7 +241173,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241057
241173
|
'symbols': [market['id']],
|
|
241058
241174
|
},
|
|
241059
241175
|
};
|
|
241060
|
-
const orderbook = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241176
|
+
const orderbook = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
241061
241177
|
return orderbook.limit();
|
|
241062
241178
|
}
|
|
241063
241179
|
handleOrderBook(client, message) {
|
|
@@ -241150,7 +241266,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241150
241266
|
'symbols': [market['id']],
|
|
241151
241267
|
},
|
|
241152
241268
|
};
|
|
241153
|
-
const result = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241269
|
+
const result = await this.subscribePublic(name, 'ticker', [symbol], this.deepExtend(request, params));
|
|
241154
241270
|
return this.safeValue(result, symbol);
|
|
241155
241271
|
}
|
|
241156
241272
|
async watchTickers(symbols = undefined, params = {}) {
|
|
@@ -241186,7 +241302,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241186
241302
|
'symbols': marketIds,
|
|
241187
241303
|
},
|
|
241188
241304
|
};
|
|
241189
|
-
const tickers = await this.subscribePublic(name, symbols, this.deepExtend(request, params));
|
|
241305
|
+
const tickers = await this.subscribePublic(name, 'tickers', symbols, this.deepExtend(request, params));
|
|
241190
241306
|
if (this.newUpdates) {
|
|
241191
241307
|
return tickers;
|
|
241192
241308
|
}
|
|
@@ -241245,7 +241361,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241245
241361
|
const messageHash = channel + '::' + symbol;
|
|
241246
241362
|
client.resolve(newTickers, messageHash);
|
|
241247
241363
|
}
|
|
241248
|
-
const messageHashes = this.findMessageHashes(client,
|
|
241364
|
+
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
241249
241365
|
for (let i = 0; i < messageHashes.length; i++) {
|
|
241250
241366
|
const messageHash = messageHashes[i];
|
|
241251
241367
|
const parts = messageHash.split('::');
|
|
@@ -241338,7 +241454,8 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241338
241454
|
if (limit !== undefined) {
|
|
241339
241455
|
request['limit'] = limit;
|
|
241340
241456
|
}
|
|
241341
|
-
const
|
|
241457
|
+
const name = 'trades';
|
|
241458
|
+
const trades = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
241342
241459
|
if (this.newUpdates) {
|
|
241343
241460
|
limit = trades.getLimit(symbol, limit);
|
|
241344
241461
|
}
|
|
@@ -241467,7 +241584,7 @@ class hitbtc extends _hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241467
241584
|
if (limit !== undefined) {
|
|
241468
241585
|
request['params']['limit'] = limit;
|
|
241469
241586
|
}
|
|
241470
|
-
const ohlcv = await this.subscribePublic(name, [symbol], this.deepExtend(request, params));
|
|
241587
|
+
const ohlcv = await this.subscribePublic(name, name, [symbol], this.deepExtend(request, params));
|
|
241471
241588
|
if (this.newUpdates) {
|
|
241472
241589
|
limit = ohlcv.getLimit(symbol, limit);
|
|
241473
241590
|
}
|
|
@@ -242364,7 +242481,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
242364
242481
|
// when the user does not have any trades yet
|
|
242365
242482
|
const dataLength = rawTrades.length;
|
|
242366
242483
|
if (dataLength === 0) {
|
|
242367
|
-
return
|
|
242484
|
+
return;
|
|
242368
242485
|
}
|
|
242369
242486
|
if (this.myTrades === undefined) {
|
|
242370
242487
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
@@ -242478,7 +242595,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
242478
242595
|
// usually the first message is an empty array
|
|
242479
242596
|
const dataLength = data.length;
|
|
242480
242597
|
if (dataLength === 0) {
|
|
242481
|
-
return
|
|
242598
|
+
return;
|
|
242482
242599
|
}
|
|
242483
242600
|
if (this.orders === undefined) {
|
|
242484
242601
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
@@ -243221,6 +243338,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
243221
243338
|
delete client.subscriptions[messageHash];
|
|
243222
243339
|
client.reject(e, messageHash);
|
|
243223
243340
|
}
|
|
243341
|
+
return undefined;
|
|
243224
243342
|
}
|
|
243225
243343
|
handleDelta(bookside, delta) {
|
|
243226
243344
|
const price = this.safeFloat(delta, 0);
|
|
@@ -244441,14 +244559,14 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
244441
244559
|
if (subscription !== undefined) {
|
|
244442
244560
|
const method = this.safeValue(subscription, 'method');
|
|
244443
244561
|
if (method !== undefined) {
|
|
244444
|
-
|
|
244562
|
+
method.call(this, client, message, subscription);
|
|
244563
|
+
return;
|
|
244445
244564
|
}
|
|
244446
244565
|
// clean up
|
|
244447
244566
|
if (id in client.subscriptions) {
|
|
244448
244567
|
delete client.subscriptions[id];
|
|
244449
244568
|
}
|
|
244450
244569
|
}
|
|
244451
|
-
return message;
|
|
244452
244570
|
}
|
|
244453
244571
|
handleSystemStatus(client, message) {
|
|
244454
244572
|
//
|
|
@@ -244557,11 +244675,9 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
244557
244675
|
'kline': this.handleOHLCV,
|
|
244558
244676
|
};
|
|
244559
244677
|
const method = this.safeValue(methods, methodName);
|
|
244560
|
-
if (method
|
|
244561
|
-
|
|
244562
|
-
|
|
244563
|
-
else {
|
|
244564
|
-
return method.call(this, client, message);
|
|
244678
|
+
if (method !== undefined) {
|
|
244679
|
+
method.call(this, client, message);
|
|
244680
|
+
return;
|
|
244565
244681
|
}
|
|
244566
244682
|
}
|
|
244567
244683
|
// private spot subjects
|
|
@@ -245531,6 +245647,7 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
245531
245647
|
delete client.subscriptions[messageHash];
|
|
245532
245648
|
client.reject(e, messageHash);
|
|
245533
245649
|
}
|
|
245650
|
+
return undefined;
|
|
245534
245651
|
}
|
|
245535
245652
|
handleDelta(bookside, delta) {
|
|
245536
245653
|
const price = this.safeFloat(delta, 0);
|
|
@@ -245696,11 +245813,8 @@ class huobijp extends _huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
245696
245813
|
// ...
|
|
245697
245814
|
};
|
|
245698
245815
|
const method = this.safeValue(methods, methodName);
|
|
245699
|
-
if (method
|
|
245700
|
-
|
|
245701
|
-
}
|
|
245702
|
-
else {
|
|
245703
|
-
return method.call(this, client, message);
|
|
245816
|
+
if (method !== undefined) {
|
|
245817
|
+
method.call(this, client, message);
|
|
245704
245818
|
}
|
|
245705
245819
|
}
|
|
245706
245820
|
}
|
|
@@ -246109,7 +246223,7 @@ class idex extends _idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
246109
246223
|
const symbol = this.safeSymbol(marketId);
|
|
246110
246224
|
if (!(symbol in this.orderbooks)) {
|
|
246111
246225
|
const orderbook = this.countedOrderBook({});
|
|
246112
|
-
orderbook.cache = [];
|
|
246226
|
+
// orderbook.cache = []; // cache is never used?
|
|
246113
246227
|
this.orderbooks[symbol] = orderbook;
|
|
246114
246228
|
}
|
|
246115
246229
|
this.spawn(this.fetchOrderBookSnapshot, client, symbol);
|
|
@@ -246685,28 +246799,28 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246685
246799
|
const subscription = this.safeValue(client.subscriptions, messageHash, {});
|
|
246686
246800
|
const receivedSnapshot = this.safeBool(subscription, 'receivedSnapshot', false);
|
|
246687
246801
|
const timestamp = this.safeInteger(message, 'Time');
|
|
246688
|
-
let
|
|
246689
|
-
if (
|
|
246690
|
-
|
|
246691
|
-
this.orderbooks[symbol] =
|
|
246802
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
246803
|
+
if (orderbook === undefined) {
|
|
246804
|
+
orderbook = this.orderBook({});
|
|
246805
|
+
this.orderbooks[symbol] = orderbook;
|
|
246692
246806
|
}
|
|
246693
246807
|
if (event === 'OrderBookSnapshot') {
|
|
246694
246808
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'Bids', 'Offers', 'Price', 'Volume');
|
|
246695
|
-
|
|
246809
|
+
orderbook.reset(snapshot);
|
|
246696
246810
|
subscription['receivedSnapshot'] = true;
|
|
246697
246811
|
}
|
|
246698
246812
|
else {
|
|
246699
246813
|
const asks = this.safeValue(orderBook, 'Offers', []);
|
|
246700
246814
|
const bids = this.safeValue(orderBook, 'Bids', []);
|
|
246701
|
-
this.handleDeltas(
|
|
246702
|
-
this.handleDeltas(
|
|
246703
|
-
|
|
246704
|
-
|
|
246815
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
246816
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
246817
|
+
orderbook['timestamp'] = timestamp;
|
|
246818
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
246705
246819
|
}
|
|
246706
246820
|
const checksum = this.safeValue(this.options, 'checksum', true);
|
|
246707
246821
|
if (checksum && receivedSnapshot) {
|
|
246708
|
-
const storedAsks =
|
|
246709
|
-
const storedBids =
|
|
246822
|
+
const storedAsks = orderbook['asks'];
|
|
246823
|
+
const storedBids = orderbook['bids'];
|
|
246710
246824
|
const asksLength = storedAsks.length;
|
|
246711
246825
|
const bidsLength = storedBids.length;
|
|
246712
246826
|
let payload = '';
|
|
@@ -246728,7 +246842,7 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246728
246842
|
}
|
|
246729
246843
|
}
|
|
246730
246844
|
if (receivedSnapshot) {
|
|
246731
|
-
client.resolve(
|
|
246845
|
+
client.resolve(orderbook, messageHash);
|
|
246732
246846
|
}
|
|
246733
246847
|
}
|
|
246734
246848
|
valueToChecksum(value) {
|
|
@@ -246778,7 +246892,8 @@ class independentreserve extends _independentreserve_js__WEBPACK_IMPORTED_MODULE
|
|
|
246778
246892
|
};
|
|
246779
246893
|
const handler = this.safeValue(handlers, event);
|
|
246780
246894
|
if (handler !== undefined) {
|
|
246781
|
-
|
|
246895
|
+
handler.call(this, client, message);
|
|
246896
|
+
return;
|
|
246782
246897
|
}
|
|
246783
246898
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' received an unsupported message: ' + this.json(message));
|
|
246784
246899
|
}
|
|
@@ -247452,7 +247567,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247452
247567
|
const side = sides[key];
|
|
247453
247568
|
const bookside = orderbook[side];
|
|
247454
247569
|
const deltas = this.safeValue(message[1], key, []);
|
|
247455
|
-
timestamp = this.
|
|
247570
|
+
timestamp = this.customHandleDeltas(bookside, deltas, timestamp);
|
|
247456
247571
|
}
|
|
247457
247572
|
orderbook['symbol'] = symbol;
|
|
247458
247573
|
orderbook['timestamp'] = timestamp;
|
|
@@ -247484,11 +247599,11 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247484
247599
|
const storedBids = orderbook['bids'];
|
|
247485
247600
|
let example = undefined;
|
|
247486
247601
|
if (a !== undefined) {
|
|
247487
|
-
timestamp = this.
|
|
247602
|
+
timestamp = this.customHandleDeltas(storedAsks, a, timestamp);
|
|
247488
247603
|
example = this.safeValue(a, 0);
|
|
247489
247604
|
}
|
|
247490
247605
|
if (b !== undefined) {
|
|
247491
|
-
timestamp = this.
|
|
247606
|
+
timestamp = this.customHandleDeltas(storedBids, b, timestamp);
|
|
247492
247607
|
example = this.safeValue(b, 0);
|
|
247493
247608
|
}
|
|
247494
247609
|
// don't remove this line or I will poop on your face
|
|
@@ -247543,7 +247658,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
247543
247658
|
return joined;
|
|
247544
247659
|
}
|
|
247545
247660
|
}
|
|
247546
|
-
|
|
247661
|
+
customHandleDeltas(bookside, deltas, timestamp = undefined) {
|
|
247547
247662
|
for (let j = 0; j < deltas.length; j++) {
|
|
247548
247663
|
const delta = deltas[j];
|
|
247549
247664
|
const price = this.parseNumber(delta[0]);
|
|
@@ -248088,7 +248203,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
248088
248203
|
// "subscription": { name: "ticker" }
|
|
248089
248204
|
// }
|
|
248090
248205
|
//
|
|
248091
|
-
const errorMessage = this.
|
|
248206
|
+
const errorMessage = this.safeString(message, 'errorMessage');
|
|
248092
248207
|
if (errorMessage !== undefined) {
|
|
248093
248208
|
const requestId = this.safeValue(message, 'reqid');
|
|
248094
248209
|
if (requestId !== undefined) {
|
|
@@ -248096,7 +248211,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
248096
248211
|
const broadKey = this.findBroadlyMatchedKey(broad, errorMessage);
|
|
248097
248212
|
let exception = undefined;
|
|
248098
248213
|
if (broadKey === undefined) {
|
|
248099
|
-
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
|
|
248100
248215
|
}
|
|
248101
248216
|
else {
|
|
248102
248217
|
exception = new broad[broadKey](errorMessage);
|
|
@@ -248126,11 +248241,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
248126
248241
|
'ownTrades': this.handleMyTrades,
|
|
248127
248242
|
};
|
|
248128
248243
|
const method = this.safeValue2(methods, name, channelName);
|
|
248129
|
-
if (method
|
|
248130
|
-
|
|
248131
|
-
}
|
|
248132
|
-
else {
|
|
248133
|
-
return method.call(this, client, message, subscription);
|
|
248244
|
+
if (method !== undefined) {
|
|
248245
|
+
method.call(this, client, message, subscription);
|
|
248134
248246
|
}
|
|
248135
248247
|
}
|
|
248136
248248
|
else {
|
|
@@ -248146,11 +248258,8 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
248146
248258
|
'cancelAllStatus': this.handleCancelAllOrders,
|
|
248147
248259
|
};
|
|
248148
248260
|
const method = this.safeValue(methods, event);
|
|
248149
|
-
if (method
|
|
248150
|
-
|
|
248151
|
-
}
|
|
248152
|
-
else {
|
|
248153
|
-
return method.call(this, client, message);
|
|
248261
|
+
if (method !== undefined) {
|
|
248262
|
+
method.call(this, client, message);
|
|
248154
248263
|
}
|
|
248155
248264
|
}
|
|
248156
248265
|
}
|
|
@@ -249235,13 +249344,15 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249235
249344
|
const bid = bids[i];
|
|
249236
249345
|
const price = this.safeNumber(bid, 'price');
|
|
249237
249346
|
const qty = this.safeNumber(bid, 'qty');
|
|
249238
|
-
orderbook['bids']
|
|
249347
|
+
const bidsSide = orderbook['bids'];
|
|
249348
|
+
bidsSide.store(price, qty);
|
|
249239
249349
|
}
|
|
249240
249350
|
for (let i = 0; i < asks.length; i++) {
|
|
249241
249351
|
const ask = asks[i];
|
|
249242
249352
|
const price = this.safeNumber(ask, 'price');
|
|
249243
249353
|
const qty = this.safeNumber(ask, 'qty');
|
|
249244
|
-
orderbook['asks']
|
|
249354
|
+
const asksSide = orderbook['asks'];
|
|
249355
|
+
asksSide.store(price, qty);
|
|
249245
249356
|
}
|
|
249246
249357
|
orderbook['timestamp'] = timestamp;
|
|
249247
249358
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -249270,10 +249381,12 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249270
249381
|
const qty = this.safeNumber(message, 'qty');
|
|
249271
249382
|
const timestamp = this.safeInteger(message, 'timestamp');
|
|
249272
249383
|
if (side === 'sell') {
|
|
249273
|
-
orderbook['asks']
|
|
249384
|
+
const asks = orderbook['asks'];
|
|
249385
|
+
asks.store(price, qty);
|
|
249274
249386
|
}
|
|
249275
249387
|
else {
|
|
249276
|
-
orderbook['bids']
|
|
249388
|
+
const bids = orderbook['bids'];
|
|
249389
|
+
bids.store(price, qty);
|
|
249277
249390
|
}
|
|
249278
249391
|
orderbook['timestamp'] = timestamp;
|
|
249279
249392
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -249609,7 +249722,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249609
249722
|
this.handleAuthenticate(client, message);
|
|
249610
249723
|
}
|
|
249611
249724
|
else if (event === 'alert') {
|
|
249612
|
-
|
|
249725
|
+
this.handleErrorMessage(client, message);
|
|
249613
249726
|
}
|
|
249614
249727
|
else if (event === 'pong') {
|
|
249615
249728
|
client.lastPong = this.milliseconds();
|
|
@@ -249636,7 +249749,7 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
249636
249749
|
};
|
|
249637
249750
|
const method = this.safeValue(methods, feed);
|
|
249638
249751
|
if (method !== undefined) {
|
|
249639
|
-
|
|
249752
|
+
method.call(this, client, message);
|
|
249640
249753
|
}
|
|
249641
249754
|
}
|
|
249642
249755
|
}
|
|
@@ -249732,19 +249845,20 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
249732
249845
|
},
|
|
249733
249846
|
});
|
|
249734
249847
|
}
|
|
249735
|
-
negotiate(privateChannel, params = {}) {
|
|
249848
|
+
async negotiate(privateChannel, params = {}) {
|
|
249736
249849
|
const connectId = privateChannel ? 'private' : 'public';
|
|
249737
249850
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
249738
249851
|
const spawaned = this.safeValue(urls, connectId);
|
|
249739
249852
|
if (spawaned !== undefined) {
|
|
249740
|
-
return spawaned;
|
|
249853
|
+
return await spawaned;
|
|
249741
249854
|
}
|
|
249742
249855
|
// we store an awaitable to the url
|
|
249743
249856
|
// so that multiple calls don't asynchronously
|
|
249744
249857
|
// fetch different urls and overwrite each other
|
|
249745
249858
|
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
|
|
249746
249859
|
this.options['urls'] = urls;
|
|
249747
|
-
|
|
249860
|
+
const future = urls[connectId];
|
|
249861
|
+
return await future;
|
|
249748
249862
|
}
|
|
249749
249863
|
async negotiateHelper(privateChannel, params = {}) {
|
|
249750
249864
|
let response = undefined;
|
|
@@ -250230,7 +250344,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250230
250344
|
const limit = this.safeInteger(subscription, 'limit');
|
|
250231
250345
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
250232
250346
|
if (cacheLength === snapshotDelay) {
|
|
250233
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
250347
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
250234
250348
|
}
|
|
250235
250349
|
storedOrderBook.cache.push(data);
|
|
250236
250350
|
return;
|
|
@@ -250672,7 +250786,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250672
250786
|
//
|
|
250673
250787
|
const topic = this.safeString(message, 'topic');
|
|
250674
250788
|
if (topic === '/market/ticker:all') {
|
|
250675
|
-
|
|
250789
|
+
this.handleTicker(client, message);
|
|
250790
|
+
return;
|
|
250676
250791
|
}
|
|
250677
250792
|
const subject = this.safeString(message, 'subject');
|
|
250678
250793
|
const methods = {
|
|
@@ -250687,11 +250802,8 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250687
250802
|
'stopOrder': this.handleOrder,
|
|
250688
250803
|
};
|
|
250689
250804
|
const method = this.safeValue(methods, subject);
|
|
250690
|
-
if (method
|
|
250691
|
-
|
|
250692
|
-
}
|
|
250693
|
-
else {
|
|
250694
|
-
return method.call(this, client, message);
|
|
250805
|
+
if (method !== undefined) {
|
|
250806
|
+
method.call(this, client, message);
|
|
250695
250807
|
}
|
|
250696
250808
|
}
|
|
250697
250809
|
ping(client) {
|
|
@@ -250739,7 +250851,7 @@ class kucoin extends _kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
250739
250851
|
};
|
|
250740
250852
|
const method = this.safeValue(methods, type);
|
|
250741
250853
|
if (method !== undefined) {
|
|
250742
|
-
|
|
250854
|
+
method.call(this, client, message);
|
|
250743
250855
|
}
|
|
250744
250856
|
}
|
|
250745
250857
|
}
|
|
@@ -250812,19 +250924,20 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
250812
250924
|
},
|
|
250813
250925
|
});
|
|
250814
250926
|
}
|
|
250815
|
-
negotiate(privateChannel, params = {}) {
|
|
250927
|
+
async negotiate(privateChannel, params = {}) {
|
|
250816
250928
|
const connectId = privateChannel ? 'private' : 'public';
|
|
250817
250929
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
250818
250930
|
const spawaned = this.safeValue(urls, connectId);
|
|
250819
250931
|
if (spawaned !== undefined) {
|
|
250820
|
-
return spawaned;
|
|
250932
|
+
return await spawaned;
|
|
250821
250933
|
}
|
|
250822
250934
|
// we store an awaitable to the url
|
|
250823
250935
|
// so that multiple calls don't asynchronously
|
|
250824
250936
|
// fetch different urls and overwrite each other
|
|
250825
|
-
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
|
|
250826
250938
|
this.options['urls'] = urls;
|
|
250827
|
-
|
|
250939
|
+
const future = urls[connectId];
|
|
250940
|
+
return await future;
|
|
250828
250941
|
}
|
|
250829
250942
|
async negotiateHelper(privateChannel, params = {}) {
|
|
250830
250943
|
let response = undefined;
|
|
@@ -251337,6 +251450,9 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251337
251450
|
const messageHash = 'orderbook:' + symbol;
|
|
251338
251451
|
const storedOrderBook = this.safeValue(this.orderbooks, symbol);
|
|
251339
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
|
+
}
|
|
251340
251456
|
const deltaEnd = this.safeInteger(data, 'sequence');
|
|
251341
251457
|
if (nonce === undefined) {
|
|
251342
251458
|
const cacheLength = storedOrderBook.cache.length;
|
|
@@ -251355,7 +251471,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251355
251471
|
const limit = this.safeInteger(subscription, 'limit');
|
|
251356
251472
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
251357
251473
|
if (cacheLength === snapshotDelay) {
|
|
251358
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
251474
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
251359
251475
|
}
|
|
251360
251476
|
storedOrderBook.cache.push(data);
|
|
251361
251477
|
return;
|
|
@@ -251683,11 +251799,8 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251683
251799
|
'position.adjustRiskLimit': this.handlePosition,
|
|
251684
251800
|
};
|
|
251685
251801
|
const method = this.safeValue(methods, subject);
|
|
251686
|
-
if (method
|
|
251687
|
-
|
|
251688
|
-
}
|
|
251689
|
-
else {
|
|
251690
|
-
return method.call(this, client, message);
|
|
251802
|
+
if (method !== undefined) {
|
|
251803
|
+
method.call(this, client, message);
|
|
251691
251804
|
}
|
|
251692
251805
|
}
|
|
251693
251806
|
ping(client) {
|
|
@@ -251736,7 +251849,7 @@ class kucoinfutures extends _kucoinfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
251736
251849
|
};
|
|
251737
251850
|
const method = this.safeValue(methods, type);
|
|
251738
251851
|
if (method !== undefined) {
|
|
251739
|
-
|
|
251852
|
+
method.call(this, client, message);
|
|
251740
251853
|
}
|
|
251741
251854
|
}
|
|
251742
251855
|
}
|
|
@@ -252528,17 +252641,17 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252528
252641
|
const orderBook = this.safeValue(message, 'depth', message);
|
|
252529
252642
|
const datetime = this.safeString(message, 'TS');
|
|
252530
252643
|
const timestamp = this.parse8601(datetime);
|
|
252531
|
-
let
|
|
252532
|
-
if (
|
|
252533
|
-
|
|
252534
|
-
this.orderbooks[symbol] =
|
|
252644
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
252645
|
+
if (orderbook === undefined) {
|
|
252646
|
+
orderbook = this.orderBook({});
|
|
252647
|
+
this.orderbooks[symbol] = orderbook;
|
|
252535
252648
|
}
|
|
252536
252649
|
const snapshot = this.parseOrderBook(orderBook, symbol, timestamp, 'bids', 'asks');
|
|
252537
|
-
|
|
252650
|
+
orderbook.reset(snapshot);
|
|
252538
252651
|
let messageHash = 'orderbook:' + symbol;
|
|
252539
|
-
client.resolve(
|
|
252652
|
+
client.resolve(orderbook, messageHash);
|
|
252540
252653
|
messageHash = 'fetchOrderbook:' + symbol;
|
|
252541
|
-
client.resolve(
|
|
252654
|
+
client.resolve(orderbook, messageHash);
|
|
252542
252655
|
}
|
|
252543
252656
|
handleErrorMessage(client, message) {
|
|
252544
252657
|
//
|
|
@@ -252566,7 +252679,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252566
252679
|
handleMessage(client, message) {
|
|
252567
252680
|
const status = this.safeString(message, 'status');
|
|
252568
252681
|
if (status === 'error') {
|
|
252569
|
-
|
|
252682
|
+
this.handleErrorMessage(client, message);
|
|
252683
|
+
return;
|
|
252570
252684
|
}
|
|
252571
252685
|
const type = this.safeString2(message, 'type', 'action');
|
|
252572
252686
|
if (type === 'ping') {
|
|
@@ -252582,9 +252696,8 @@ class lbank extends _lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252582
252696
|
};
|
|
252583
252697
|
const handler = this.safeValue(handlers, type);
|
|
252584
252698
|
if (handler !== undefined) {
|
|
252585
|
-
|
|
252699
|
+
handler.call(this, client, message);
|
|
252586
252700
|
}
|
|
252587
|
-
return message;
|
|
252588
252701
|
}
|
|
252589
252702
|
async authenticate(params = {}) {
|
|
252590
252703
|
// when we implement more private streams, we need to refactor the authentication
|
|
@@ -252831,24 +252944,24 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252831
252944
|
const symbol = subscription['symbol'];
|
|
252832
252945
|
const messageHash = 'orderbook:' + symbol;
|
|
252833
252946
|
const timestamp = this.safeString(message, 'timestamp');
|
|
252834
|
-
let
|
|
252835
|
-
if (
|
|
252836
|
-
|
|
252837
|
-
this.orderbooks[symbol] =
|
|
252947
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
252948
|
+
if (orderbook === undefined) {
|
|
252949
|
+
orderbook = this.indexedOrderBook({});
|
|
252950
|
+
this.orderbooks[symbol] = orderbook;
|
|
252838
252951
|
}
|
|
252839
252952
|
const asks = this.safeValue(message, 'asks');
|
|
252840
252953
|
if (asks !== undefined) {
|
|
252841
252954
|
const snapshot = this.customParseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'price', 'volume', 'id');
|
|
252842
|
-
|
|
252955
|
+
orderbook.reset(snapshot);
|
|
252843
252956
|
}
|
|
252844
252957
|
else {
|
|
252845
|
-
this.handleDelta(
|
|
252846
|
-
|
|
252847
|
-
|
|
252958
|
+
this.handleDelta(orderbook, message);
|
|
252959
|
+
orderbook['timestamp'] = timestamp;
|
|
252960
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
252848
252961
|
}
|
|
252849
252962
|
const nonce = this.safeInteger(message, 'sequence');
|
|
252850
|
-
|
|
252851
|
-
client.resolve(
|
|
252963
|
+
orderbook['nonce'] = nonce;
|
|
252964
|
+
client.resolve(orderbook, messageHash);
|
|
252852
252965
|
}
|
|
252853
252966
|
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
|
|
252854
252967
|
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
@@ -252940,10 +253053,9 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252940
253053
|
const deleteUpdate = this.safeValue(message, 'delete_update');
|
|
252941
253054
|
if (deleteUpdate !== undefined) {
|
|
252942
253055
|
const orderId = this.safeString(deleteUpdate, 'order_id');
|
|
252943
|
-
asksOrderSide.storeArray(0, 0, orderId);
|
|
252944
|
-
bidsOrderSide.storeArray(0, 0, orderId);
|
|
253056
|
+
asksOrderSide.storeArray([0, 0, orderId]);
|
|
253057
|
+
bidsOrderSide.storeArray([0, 0, orderId]);
|
|
252945
253058
|
}
|
|
252946
|
-
return message;
|
|
252947
253059
|
}
|
|
252948
253060
|
handleMessage(client, message) {
|
|
252949
253061
|
if (message === '') {
|
|
@@ -252955,7 +253067,6 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
252955
253067
|
const handler = handlers[j];
|
|
252956
253068
|
handler.call(this, client, message, subscriptions[0]);
|
|
252957
253069
|
}
|
|
252958
|
-
return message;
|
|
252959
253070
|
}
|
|
252960
253071
|
}
|
|
252961
253072
|
|
|
@@ -254077,7 +254188,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254077
254188
|
//
|
|
254078
254189
|
const msg = this.safeString(message, 'msg');
|
|
254079
254190
|
if (msg === 'PONG') {
|
|
254080
|
-
|
|
254191
|
+
this.handlePong(client, message);
|
|
254081
254192
|
}
|
|
254082
254193
|
else if (msg.indexOf('@') > -1) {
|
|
254083
254194
|
const parts = msg.split('@');
|
|
@@ -254100,7 +254211,8 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254100
254211
|
return;
|
|
254101
254212
|
}
|
|
254102
254213
|
if ('msg' in message) {
|
|
254103
|
-
|
|
254214
|
+
this.handleSubscriptionStatus(client, message);
|
|
254215
|
+
return;
|
|
254104
254216
|
}
|
|
254105
254217
|
const c = this.safeString(message, 'c');
|
|
254106
254218
|
let channel = undefined;
|
|
@@ -254533,13 +254645,13 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254533
254645
|
const firstBidAsk = this.safeValue(payload, 0, []);
|
|
254534
254646
|
const marketId = this.safeString(firstBidAsk, 7);
|
|
254535
254647
|
if (marketId === undefined) {
|
|
254536
|
-
return
|
|
254648
|
+
return;
|
|
254537
254649
|
}
|
|
254538
254650
|
const market = this.safeMarket(marketId);
|
|
254539
254651
|
const symbol = market['symbol'];
|
|
254540
254652
|
const orderbook = this.safeValue(this.orderbooks, symbol);
|
|
254541
254653
|
if (orderbook === undefined) {
|
|
254542
|
-
return
|
|
254654
|
+
return;
|
|
254543
254655
|
}
|
|
254544
254656
|
let timestamp = undefined;
|
|
254545
254657
|
let nonce = undefined;
|
|
@@ -254633,11 +254745,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254633
254745
|
const subscription = this.safeValue(subscriptionsById, id);
|
|
254634
254746
|
if (subscription !== undefined) {
|
|
254635
254747
|
const method = this.safeValue(subscription, 'method');
|
|
254636
|
-
if (method
|
|
254637
|
-
|
|
254638
|
-
}
|
|
254639
|
-
else {
|
|
254640
|
-
return method.call(this, client, message, subscription);
|
|
254748
|
+
if (method !== undefined) {
|
|
254749
|
+
method.call(this, client, message, subscription);
|
|
254641
254750
|
}
|
|
254642
254751
|
}
|
|
254643
254752
|
}
|
|
@@ -254666,7 +254775,7 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254666
254775
|
//
|
|
254667
254776
|
const payload = this.safeString(message, 'o');
|
|
254668
254777
|
if (payload === undefined) {
|
|
254669
|
-
return
|
|
254778
|
+
return;
|
|
254670
254779
|
}
|
|
254671
254780
|
message['o'] = JSON.parse(payload);
|
|
254672
254781
|
const methods = {
|
|
@@ -254681,11 +254790,8 @@ class ndax extends _ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
254681
254790
|
};
|
|
254682
254791
|
const event = this.safeString(message, 'n');
|
|
254683
254792
|
const method = this.safeValue(methods, event);
|
|
254684
|
-
if (method
|
|
254685
|
-
|
|
254686
|
-
}
|
|
254687
|
-
else {
|
|
254688
|
-
return method.call(this, client, message);
|
|
254793
|
+
if (method !== undefined) {
|
|
254794
|
+
method.call(this, client, message);
|
|
254689
254795
|
}
|
|
254690
254796
|
}
|
|
254691
254797
|
}
|
|
@@ -255177,7 +255283,7 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255177
255283
|
};
|
|
255178
255284
|
this.spawn(this.watch, url, messageHash, request, messageHash, future);
|
|
255179
255285
|
}
|
|
255180
|
-
return
|
|
255286
|
+
return future;
|
|
255181
255287
|
}
|
|
255182
255288
|
async watchBalance(params = {}) {
|
|
255183
255289
|
/**
|
|
@@ -255410,7 +255516,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255410
255516
|
// }
|
|
255411
255517
|
//
|
|
255412
255518
|
if (message === 'pong') {
|
|
255413
|
-
|
|
255519
|
+
this.handlePong(client, message);
|
|
255520
|
+
return;
|
|
255414
255521
|
}
|
|
255415
255522
|
const table = this.safeString(message, 'table');
|
|
255416
255523
|
if (table === undefined) {
|
|
@@ -255423,11 +255530,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255423
255530
|
'subscribe': this.handleSubscriptionStatus,
|
|
255424
255531
|
};
|
|
255425
255532
|
const method = this.safeValue(methods, event);
|
|
255426
|
-
if (method
|
|
255427
|
-
|
|
255428
|
-
}
|
|
255429
|
-
else {
|
|
255430
|
-
return method.call(this, client, message);
|
|
255533
|
+
if (method !== undefined) {
|
|
255534
|
+
method.call(this, client, message);
|
|
255431
255535
|
}
|
|
255432
255536
|
}
|
|
255433
255537
|
}
|
|
@@ -255449,11 +255553,8 @@ class okcoin extends _okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
255449
255553
|
if (name.indexOf('candle') >= 0) {
|
|
255450
255554
|
method = this.handleOHLCV;
|
|
255451
255555
|
}
|
|
255452
|
-
if (method
|
|
255453
|
-
|
|
255454
|
-
}
|
|
255455
|
-
else {
|
|
255456
|
-
return method.call(this, client, message);
|
|
255556
|
+
if (method !== undefined) {
|
|
255557
|
+
method.call(this, client, message);
|
|
255457
255558
|
}
|
|
255458
255559
|
}
|
|
255459
255560
|
}
|
|
@@ -256226,7 +256327,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
256226
256327
|
const message = this.extend(request, params);
|
|
256227
256328
|
this.watch(url, messageHash, message, messageHash);
|
|
256228
256329
|
}
|
|
256229
|
-
return future;
|
|
256330
|
+
return await future;
|
|
256230
256331
|
}
|
|
256231
256332
|
async watchBalance(params = {}) {
|
|
256232
256333
|
/**
|
|
@@ -257032,7 +257133,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
257032
257133
|
//
|
|
257033
257134
|
//
|
|
257034
257135
|
if (message === 'pong') {
|
|
257035
|
-
|
|
257136
|
+
this.handlePong(client, message);
|
|
257137
|
+
return;
|
|
257036
257138
|
}
|
|
257037
257139
|
// const table = this.safeString (message, 'table');
|
|
257038
257140
|
// if (table === undefined) {
|
|
@@ -257051,11 +257153,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
257051
257153
|
'mass-cancel': this.handleCancelAllOrders,
|
|
257052
257154
|
};
|
|
257053
257155
|
const method = this.safeValue(methods, event);
|
|
257054
|
-
if (method
|
|
257055
|
-
|
|
257056
|
-
}
|
|
257057
|
-
else {
|
|
257058
|
-
return method.call(this, client, message);
|
|
257156
|
+
if (method !== undefined) {
|
|
257157
|
+
method.call(this, client, message);
|
|
257059
257158
|
}
|
|
257060
257159
|
}
|
|
257061
257160
|
else {
|
|
@@ -257083,12 +257182,9 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
257083
257182
|
if (channel.indexOf('candle') === 0) {
|
|
257084
257183
|
this.handleOHLCV(client, message);
|
|
257085
257184
|
}
|
|
257086
|
-
else {
|
|
257087
|
-
return message;
|
|
257088
|
-
}
|
|
257089
257185
|
}
|
|
257090
257186
|
else {
|
|
257091
|
-
|
|
257187
|
+
method.call(this, client, message);
|
|
257092
257188
|
}
|
|
257093
257189
|
}
|
|
257094
257190
|
}
|
|
@@ -257467,26 +257563,26 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
257467
257563
|
const dateTime = this.safeString(message, 'time');
|
|
257468
257564
|
const timestamp = this.parse8601(dateTime);
|
|
257469
257565
|
const channel = 'book:' + symbol;
|
|
257470
|
-
let
|
|
257471
|
-
if (
|
|
257472
|
-
|
|
257566
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
257567
|
+
if (orderbook === undefined) {
|
|
257568
|
+
orderbook = this.orderBook({});
|
|
257473
257569
|
}
|
|
257474
257570
|
if (type === 'ORDER_BOOK_SNAPSHOT') {
|
|
257475
257571
|
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks');
|
|
257476
|
-
|
|
257572
|
+
orderbook.reset(snapshot);
|
|
257477
257573
|
}
|
|
257478
257574
|
else if (type === 'ORDER_BOOK_UPDATE') {
|
|
257479
257575
|
const changes = this.safeValue(message, 'changes', []);
|
|
257480
|
-
this.handleDeltas(
|
|
257576
|
+
this.handleDeltas(orderbook, changes);
|
|
257481
257577
|
}
|
|
257482
257578
|
else {
|
|
257483
257579
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBook() did not recognize message type ' + type);
|
|
257484
257580
|
}
|
|
257485
|
-
|
|
257486
|
-
|
|
257487
|
-
|
|
257488
|
-
this.orderbooks[symbol] =
|
|
257489
|
-
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);
|
|
257490
257586
|
}
|
|
257491
257587
|
handleDelta(orderbook, delta) {
|
|
257492
257588
|
//
|
|
@@ -258072,13 +258168,14 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
258072
258168
|
if (updateType === 'ORDER_CLOSED' && filled === 0) {
|
|
258073
258169
|
status = 'canceled';
|
|
258074
258170
|
}
|
|
258075
|
-
|
|
258171
|
+
const orderObject = {
|
|
258076
258172
|
'id': orderId,
|
|
258077
258173
|
'symbol': symbol,
|
|
258078
258174
|
'status': status,
|
|
258079
258175
|
'timestamp': this.parse8601(datetime),
|
|
258080
258176
|
'datetime': datetime,
|
|
258081
|
-
}
|
|
258177
|
+
};
|
|
258178
|
+
orders.append(orderObject);
|
|
258082
258179
|
}
|
|
258083
258180
|
else {
|
|
258084
258181
|
const parsed = this.parseOrder(update);
|
|
@@ -258315,7 +258412,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
258315
258412
|
handleMessage(client, message) {
|
|
258316
258413
|
const error = this.safeValue(message, 'error');
|
|
258317
258414
|
if (error !== undefined) {
|
|
258318
|
-
|
|
258415
|
+
this.handleErrorMessage(client, message);
|
|
258416
|
+
return;
|
|
258319
258417
|
}
|
|
258320
258418
|
const type = this.safeValue(message, 'type');
|
|
258321
258419
|
const handlers = {
|
|
@@ -258346,9 +258444,8 @@ class onetrading extends _onetrading_js__WEBPACK_IMPORTED_MODULE_0__/* ["default
|
|
|
258346
258444
|
};
|
|
258347
258445
|
const handler = this.safeValue(handlers, type);
|
|
258348
258446
|
if (handler !== undefined) {
|
|
258349
|
-
|
|
258447
|
+
handler.call(this, client, message);
|
|
258350
258448
|
}
|
|
258351
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' no handler found for this message ' + this.json(message));
|
|
258352
258449
|
}
|
|
258353
258450
|
handlePricePointUpdates(client, message) {
|
|
258354
258451
|
//
|
|
@@ -258813,7 +258910,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258813
258910
|
const bid = this.safeValue(bids, i);
|
|
258814
258911
|
const price = this.safeNumber(bid, 0);
|
|
258815
258912
|
const amount = this.safeNumber(bid, 1);
|
|
258816
|
-
orderbook['bids']
|
|
258913
|
+
const bookSide = orderbook['bids'];
|
|
258914
|
+
bookSide.store(price, amount);
|
|
258817
258915
|
}
|
|
258818
258916
|
}
|
|
258819
258917
|
if (asks !== undefined) {
|
|
@@ -258821,7 +258919,8 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258821
258919
|
const ask = this.safeValue(asks, i);
|
|
258822
258920
|
const price = this.safeNumber(ask, 0);
|
|
258823
258921
|
const amount = this.safeNumber(ask, 1);
|
|
258824
|
-
orderbook['asks']
|
|
258922
|
+
const bookside = orderbook['asks'];
|
|
258923
|
+
bookside.store(price, amount);
|
|
258825
258924
|
}
|
|
258826
258925
|
}
|
|
258827
258926
|
orderbook['symbol'] = symbol;
|
|
@@ -258846,7 +258945,7 @@ class p2b extends _p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258846
258945
|
};
|
|
258847
258946
|
const endpoint = this.safeValue(methods, method);
|
|
258848
258947
|
if (endpoint !== undefined) {
|
|
258849
|
-
|
|
258948
|
+
endpoint.call(this, client, message);
|
|
258850
258949
|
}
|
|
258851
258950
|
}
|
|
258852
258951
|
handleErrorMessage(client, message) {
|
|
@@ -259523,13 +259622,13 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259523
259622
|
}
|
|
259524
259623
|
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
259525
259624
|
}
|
|
259526
|
-
|
|
259625
|
+
customHandleDelta(bookside, delta, market = undefined) {
|
|
259527
259626
|
const bidAsk = this.customParseBidAsk(delta, 0, 1, market);
|
|
259528
259627
|
bookside.storeArray(bidAsk);
|
|
259529
259628
|
}
|
|
259530
|
-
|
|
259629
|
+
customHandleDeltas(bookside, deltas, market = undefined) {
|
|
259531
259630
|
for (let i = 0; i < deltas.length; i++) {
|
|
259532
|
-
this.
|
|
259631
|
+
this.customHandleDelta(bookside, deltas[i], market);
|
|
259533
259632
|
}
|
|
259534
259633
|
}
|
|
259535
259634
|
handleOrderBook(client, message) {
|
|
@@ -259599,8 +259698,8 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
259599
259698
|
const changes = this.safeValue2(message, 'book', 'orderbook_p', {});
|
|
259600
259699
|
const asks = this.safeValue(changes, 'asks', []);
|
|
259601
259700
|
const bids = this.safeValue(changes, 'bids', []);
|
|
259602
|
-
this.
|
|
259603
|
-
this.
|
|
259701
|
+
this.customHandleDeltas(orderbook['asks'], asks, market);
|
|
259702
|
+
this.customHandleDeltas(orderbook['bids'], bids, market);
|
|
259604
259703
|
orderbook['nonce'] = nonce;
|
|
259605
259704
|
orderbook['timestamp'] = timestamp;
|
|
259606
259705
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
@@ -260296,21 +260395,26 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
260296
260395
|
const method = client.subscriptions[id];
|
|
260297
260396
|
delete client.subscriptions[id];
|
|
260298
260397
|
if (method !== true) {
|
|
260299
|
-
|
|
260398
|
+
method.call(this, client, message);
|
|
260399
|
+
return;
|
|
260300
260400
|
}
|
|
260301
260401
|
}
|
|
260302
260402
|
const methodName = this.safeString(message, 'method', '');
|
|
260303
260403
|
if (('market24h' in message) || ('spot_market24h' in message) || (methodName.indexOf('perp_market24h_pack_p') >= 0)) {
|
|
260304
|
-
|
|
260404
|
+
this.handleTicker(client, message);
|
|
260405
|
+
return;
|
|
260305
260406
|
}
|
|
260306
260407
|
else if (('trades' in message) || ('trades_p' in message)) {
|
|
260307
|
-
|
|
260408
|
+
this.handleTrades(client, message);
|
|
260409
|
+
return;
|
|
260308
260410
|
}
|
|
260309
260411
|
else if (('kline' in message) || ('kline_p' in message)) {
|
|
260310
|
-
|
|
260412
|
+
this.handleOHLCV(client, message);
|
|
260413
|
+
return;
|
|
260311
260414
|
}
|
|
260312
260415
|
else if (('book' in message) || ('orderbook_p' in message)) {
|
|
260313
|
-
|
|
260416
|
+
this.handleOrderBook(client, message);
|
|
260417
|
+
return;
|
|
260314
260418
|
}
|
|
260315
260419
|
if (('orders' in message) || ('orders_p' in message)) {
|
|
260316
260420
|
const orders = this.safeValue2(message, 'orders', 'orders_p', {});
|
|
@@ -260397,7 +260501,7 @@ class phemex extends _phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
260397
260501
|
future = this.watch(url, messageHash, message);
|
|
260398
260502
|
client.subscriptions[messageHash] = future;
|
|
260399
260503
|
}
|
|
260400
|
-
return
|
|
260504
|
+
return future;
|
|
260401
260505
|
}
|
|
260402
260506
|
}
|
|
260403
260507
|
|
|
@@ -261453,7 +261557,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261453
261557
|
const bid = this.safeValue(bids, j);
|
|
261454
261558
|
const price = this.safeNumber(bid, 0);
|
|
261455
261559
|
const amount = this.safeNumber(bid, 1);
|
|
261456
|
-
orderbook['bids']
|
|
261560
|
+
const bidsSide = orderbook['bids'];
|
|
261561
|
+
bidsSide.store(price, amount);
|
|
261457
261562
|
}
|
|
261458
261563
|
}
|
|
261459
261564
|
if (asks !== undefined) {
|
|
@@ -261461,7 +261566,8 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261461
261566
|
const ask = this.safeValue(asks, j);
|
|
261462
261567
|
const price = this.safeNumber(ask, 0);
|
|
261463
261568
|
const amount = this.safeNumber(ask, 1);
|
|
261464
|
-
orderbook['asks']
|
|
261569
|
+
const asksSide = orderbook['asks'];
|
|
261570
|
+
asksSide.store(price, amount);
|
|
261465
261571
|
}
|
|
261466
261572
|
}
|
|
261467
261573
|
orderbook['symbol'] = symbol;
|
|
@@ -261595,14 +261701,14 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261595
261701
|
this.handleErrorMessage(client, item);
|
|
261596
261702
|
}
|
|
261597
261703
|
else {
|
|
261598
|
-
|
|
261704
|
+
this.handleOrderRequest(client, message);
|
|
261599
261705
|
}
|
|
261600
261706
|
}
|
|
261601
261707
|
else {
|
|
261602
261708
|
const data = this.safeValue(message, 'data', []);
|
|
261603
261709
|
const dataLength = data.length;
|
|
261604
261710
|
if (dataLength > 0) {
|
|
261605
|
-
|
|
261711
|
+
method.call(this, client, message);
|
|
261606
261712
|
}
|
|
261607
261713
|
}
|
|
261608
261714
|
}
|
|
@@ -261676,7 +261782,6 @@ class poloniex extends _poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
261676
261782
|
/* harmony import */ var _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6877);
|
|
261677
261783
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
261678
261784
|
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
|
|
261679
|
-
|
|
261680
261785
|
// ---------------------------------------------------------------------------
|
|
261681
261786
|
|
|
261682
261787
|
|
|
@@ -261736,18 +261841,21 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
261736
261841
|
},
|
|
261737
261842
|
});
|
|
261738
261843
|
}
|
|
261739
|
-
negotiate(privateChannel, params = {}) {
|
|
261844
|
+
async negotiate(privateChannel, params = {}) {
|
|
261740
261845
|
const connectId = privateChannel ? 'private' : 'public';
|
|
261741
261846
|
const urls = this.safeValue(this.options, 'urls', {});
|
|
261742
261847
|
if (connectId in urls) {
|
|
261743
|
-
return urls[connectId];
|
|
261848
|
+
// return urls[connectId];
|
|
261849
|
+
const storedFuture = urls[connectId];
|
|
261850
|
+
return await storedFuture;
|
|
261744
261851
|
}
|
|
261745
261852
|
// we store an awaitable to the url
|
|
261746
261853
|
// so that multiple calls don't asynchronously
|
|
261747
261854
|
// fetch different urls and overwrite each other
|
|
261748
261855
|
urls[connectId] = this.spawn(this.negotiateHelper, privateChannel, params);
|
|
261749
261856
|
this.options['urls'] = urls;
|
|
261750
|
-
|
|
261857
|
+
const future = urls[connectId];
|
|
261858
|
+
return await future;
|
|
261751
261859
|
}
|
|
261752
261860
|
async negotiateHelper(privateChannel, params = {}) {
|
|
261753
261861
|
let response = undefined;
|
|
@@ -262385,7 +262493,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262385
262493
|
const messageHash = this.safeString(message, 'topic');
|
|
262386
262494
|
const subject = this.safeString(message, 'subject');
|
|
262387
262495
|
if (subject === 'received') {
|
|
262388
|
-
return
|
|
262496
|
+
return;
|
|
262389
262497
|
}
|
|
262390
262498
|
// At the time of writting this, there is no implementation to easily convert each order into the orderbook so raw messages are returned
|
|
262391
262499
|
client.resolve(message, messageHash);
|
|
@@ -262404,9 +262512,10 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262404
262512
|
const topic = this.safeString(message, 'topic');
|
|
262405
262513
|
const isSnapshot = topic.indexOf('Depth') >= 0;
|
|
262406
262514
|
if (isSnapshot) {
|
|
262407
|
-
|
|
262515
|
+
this.handeL2Snapshot(client, message);
|
|
262516
|
+
return;
|
|
262408
262517
|
}
|
|
262409
|
-
|
|
262518
|
+
this.handleL2OrderBook(client, message);
|
|
262410
262519
|
}
|
|
262411
262520
|
handleL2OrderBook(client, message) {
|
|
262412
262521
|
//
|
|
@@ -262443,7 +262552,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262443
262552
|
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
262444
262553
|
if (cacheLength === snapshotDelay) {
|
|
262445
262554
|
const limit = 0;
|
|
262446
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit);
|
|
262555
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
262447
262556
|
}
|
|
262448
262557
|
orderBook.cache.push(data);
|
|
262449
262558
|
return;
|
|
@@ -262631,7 +262740,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262631
262740
|
};
|
|
262632
262741
|
const method = this.safeValue(methods, subject);
|
|
262633
262742
|
if (method !== undefined) {
|
|
262634
|
-
|
|
262743
|
+
method.call(this, client, message);
|
|
262635
262744
|
}
|
|
262636
262745
|
}
|
|
262637
262746
|
ping(client) {
|
|
@@ -262667,7 +262776,7 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262667
262776
|
};
|
|
262668
262777
|
const method = this.safeValue(methods, type);
|
|
262669
262778
|
if (method !== undefined) {
|
|
262670
|
-
|
|
262779
|
+
method.call(this, client, message);
|
|
262671
262780
|
}
|
|
262672
262781
|
}
|
|
262673
262782
|
handleAuthenticate(client, message) {
|
|
@@ -262708,7 +262817,6 @@ class poloniexfutures extends _poloniexfutures_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
262708
262817
|
/* harmony import */ var _probit_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3657);
|
|
262709
262818
|
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6689);
|
|
262710
262819
|
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3020);
|
|
262711
|
-
|
|
262712
262820
|
// ---------------------------------------------------------------------------
|
|
262713
262821
|
|
|
262714
262822
|
|
|
@@ -263158,20 +263266,20 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263158
263266
|
const symbol = this.safeSymbol(marketId);
|
|
263159
263267
|
const dataBySide = this.groupBy(orderBook, 'side');
|
|
263160
263268
|
const messageHash = 'orderbook:' + symbol;
|
|
263161
|
-
let
|
|
263162
|
-
if (
|
|
263163
|
-
|
|
263164
|
-
this.orderbooks[symbol] =
|
|
263269
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
263270
|
+
if (orderbook === undefined) {
|
|
263271
|
+
orderbook = this.orderBook({});
|
|
263272
|
+
this.orderbooks[symbol] = orderbook;
|
|
263165
263273
|
}
|
|
263166
263274
|
const reset = this.safeBool(message, 'reset', false);
|
|
263167
263275
|
if (reset) {
|
|
263168
263276
|
const snapshot = this.parseOrderBook(dataBySide, symbol, undefined, 'buy', 'sell', 'price', 'quantity');
|
|
263169
|
-
|
|
263277
|
+
orderbook.reset(snapshot);
|
|
263170
263278
|
}
|
|
263171
263279
|
else {
|
|
263172
|
-
this.handleDelta(
|
|
263280
|
+
this.handleDelta(orderbook, dataBySide);
|
|
263173
263281
|
}
|
|
263174
|
-
client.resolve(
|
|
263282
|
+
client.resolve(orderbook, messageHash);
|
|
263175
263283
|
}
|
|
263176
263284
|
handleBidAsks(bookSide, bidAsks) {
|
|
263177
263285
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
@@ -263244,11 +263352,13 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263244
263352
|
//
|
|
263245
263353
|
const errorCode = this.safeString(message, 'errorCode');
|
|
263246
263354
|
if (errorCode !== undefined) {
|
|
263247
|
-
|
|
263355
|
+
this.handleErrorMessage(client, message);
|
|
263356
|
+
return;
|
|
263248
263357
|
}
|
|
263249
263358
|
const type = this.safeString(message, 'type');
|
|
263250
263359
|
if (type === 'authorization') {
|
|
263251
|
-
|
|
263360
|
+
this.handleAuthenticate(client, message);
|
|
263361
|
+
return;
|
|
263252
263362
|
}
|
|
263253
263363
|
const handlers = {
|
|
263254
263364
|
'marketdata': this.handleMarketData,
|
|
@@ -263260,7 +263370,8 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263260
263370
|
const channel = this.safeString(message, 'channel');
|
|
263261
263371
|
const handler = this.safeValue(handlers, channel);
|
|
263262
263372
|
if (handler !== undefined) {
|
|
263263
|
-
|
|
263373
|
+
handler.call(this, client, message);
|
|
263374
|
+
return;
|
|
263264
263375
|
}
|
|
263265
263376
|
const error = new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' handleMessage: unknown message: ' + this.json(message));
|
|
263266
263377
|
client.reject(error);
|
|
@@ -263288,7 +263399,7 @@ class probit extends _probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
263288
263399
|
future = this.watch(url, messageHash, this.extend(request, params));
|
|
263289
263400
|
client.subscriptions[messageHash] = future;
|
|
263290
263401
|
}
|
|
263291
|
-
return
|
|
263402
|
+
return future;
|
|
263292
263403
|
}
|
|
263293
263404
|
}
|
|
263294
263405
|
|
|
@@ -263465,15 +263576,15 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
263465
263576
|
if (type === 'SNAPSHOT') {
|
|
263466
263577
|
this.orderbooks[symbol] = this.orderBook({}, limit);
|
|
263467
263578
|
}
|
|
263468
|
-
const
|
|
263579
|
+
const orderbook = this.orderbooks[symbol];
|
|
263469
263580
|
// upbit always returns a snapshot of 15 topmost entries
|
|
263470
263581
|
// the "REALTIME" deltas are not incremental
|
|
263471
263582
|
// therefore we reset the orderbook on each update
|
|
263472
263583
|
// and reinitialize it again with new bidasks
|
|
263473
|
-
|
|
263474
|
-
|
|
263475
|
-
const bids =
|
|
263476
|
-
const asks =
|
|
263584
|
+
orderbook.reset({});
|
|
263585
|
+
orderbook['symbol'] = symbol;
|
|
263586
|
+
const bids = orderbook['bids'];
|
|
263587
|
+
const asks = orderbook['asks'];
|
|
263477
263588
|
const data = this.safeValue(message, 'orderbook_units', []);
|
|
263478
263589
|
for (let i = 0; i < data.length; i++) {
|
|
263479
263590
|
const entry = data[i];
|
|
@@ -263486,10 +263597,10 @@ class upbit extends _upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
263486
263597
|
}
|
|
263487
263598
|
const timestamp = this.safeInteger(message, 'timestamp');
|
|
263488
263599
|
const datetime = this.iso8601(timestamp);
|
|
263489
|
-
|
|
263490
|
-
|
|
263600
|
+
orderbook['timestamp'] = timestamp;
|
|
263601
|
+
orderbook['datetime'] = datetime;
|
|
263491
263602
|
const messageHash = 'orderbook:' + marketId;
|
|
263492
|
-
client.resolve(
|
|
263603
|
+
client.resolve(orderbook, messageHash);
|
|
263493
263604
|
}
|
|
263494
263605
|
handleTrades(client, message) {
|
|
263495
263606
|
// { type: "trade",
|
|
@@ -264264,7 +264375,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
264264
264375
|
handleMessage(client, message) {
|
|
264265
264376
|
const status = this.safeString(message, 'status');
|
|
264266
264377
|
if (status === 'error') {
|
|
264267
|
-
|
|
264378
|
+
this.handleError(client, message);
|
|
264379
|
+
return;
|
|
264268
264380
|
}
|
|
264269
264381
|
const event = this.safeString(message, 'event');
|
|
264270
264382
|
const eventHandlers = {
|
|
@@ -264274,7 +264386,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
264274
264386
|
};
|
|
264275
264387
|
const eventHandler = this.safeValue(eventHandlers, event);
|
|
264276
264388
|
if (eventHandler !== undefined) {
|
|
264277
|
-
|
|
264389
|
+
eventHandler.call(this, client, message);
|
|
264390
|
+
return;
|
|
264278
264391
|
}
|
|
264279
264392
|
const stream = this.safeString(message, 'stream', '');
|
|
264280
264393
|
const streamHandlers = {
|
|
@@ -264290,7 +264403,8 @@ class wazirx extends _wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
264290
264403
|
for (let i = 0; i < streams.length; i++) {
|
|
264291
264404
|
if (this.inArray(streams[i], stream)) {
|
|
264292
264405
|
const handler = streamHandlers[streams[i]];
|
|
264293
|
-
|
|
264406
|
+
handler.call(this, client, message);
|
|
264407
|
+
return;
|
|
264294
264408
|
}
|
|
264295
264409
|
}
|
|
264296
264410
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' this message type is not supported yet. Message: ' + this.json(message));
|
|
@@ -265676,7 +265790,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
265676
265790
|
}
|
|
265677
265791
|
return true;
|
|
265678
265792
|
}
|
|
265679
|
-
authenticate(params = {}) {
|
|
265793
|
+
async authenticate(params = {}) {
|
|
265680
265794
|
this.checkRequiredCredentials();
|
|
265681
265795
|
const url = this.urls['api']['ws']['private'] + '/' + this.uid;
|
|
265682
265796
|
const client = this.client(url);
|
|
@@ -266082,13 +266196,15 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
266082
266196
|
const event = this.safeString(message, 'event');
|
|
266083
266197
|
let method = this.safeValue(methods, event);
|
|
266084
266198
|
if (method !== undefined) {
|
|
266085
|
-
|
|
266199
|
+
method.call(this, client, message);
|
|
266200
|
+
return;
|
|
266086
266201
|
}
|
|
266087
266202
|
const topic = this.safeString(message, 'topic');
|
|
266088
266203
|
if (topic !== undefined) {
|
|
266089
266204
|
method = this.safeValue(methods, topic);
|
|
266090
266205
|
if (method !== undefined) {
|
|
266091
|
-
|
|
266206
|
+
method.call(this, client, message);
|
|
266207
|
+
return;
|
|
266092
266208
|
}
|
|
266093
266209
|
const splitTopic = topic.split('@');
|
|
266094
266210
|
const splitLength = splitTopic.length;
|
|
@@ -266096,19 +266212,19 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
266096
266212
|
const name = this.safeString(splitTopic, 1);
|
|
266097
266213
|
method = this.safeValue(methods, name);
|
|
266098
266214
|
if (method !== undefined) {
|
|
266099
|
-
|
|
266215
|
+
method.call(this, client, message);
|
|
266216
|
+
return;
|
|
266100
266217
|
}
|
|
266101
266218
|
const splitName = name.split('_');
|
|
266102
266219
|
const splitNameLength = splitTopic.length;
|
|
266103
266220
|
if (splitNameLength === 2) {
|
|
266104
266221
|
method = this.safeValue(methods, this.safeString(splitName, 0));
|
|
266105
266222
|
if (method !== undefined) {
|
|
266106
|
-
|
|
266223
|
+
method.call(this, client, message);
|
|
266107
266224
|
}
|
|
266108
266225
|
}
|
|
266109
266226
|
}
|
|
266110
266227
|
}
|
|
266111
|
-
return message;
|
|
266112
266228
|
}
|
|
266113
266229
|
ping(client) {
|
|
266114
266230
|
return { 'event': 'ping' };
|
|
@@ -266592,8 +266708,8 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
266592
266708
|
const networkList = {};
|
|
266593
266709
|
for (let j = 0; j < platformsByPriority.length; j++) {
|
|
266594
266710
|
const network = platformsByPriority[j];
|
|
266595
|
-
const
|
|
266596
|
-
const networkCode = this.networkIdToCode(
|
|
266711
|
+
const idInner = this.safeString(network, 'id');
|
|
266712
|
+
const networkCode = this.networkIdToCode(idInner);
|
|
266597
266713
|
const currentDepositSuspended = this.safeValue(network, 'deposit_suspended');
|
|
266598
266714
|
const currentWithdrawalSuspended = this.safeValue(network, 'withdrawal_suspended');
|
|
266599
266715
|
const currentDeposit = !currentDepositSuspended;
|
|
@@ -266614,7 +266730,7 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
266614
266730
|
}
|
|
266615
266731
|
}
|
|
266616
266732
|
networkList[networkCode] = {
|
|
266617
|
-
'id':
|
|
266733
|
+
'id': idInner,
|
|
266618
266734
|
'network': networkCode,
|
|
266619
266735
|
'active': currentActive,
|
|
266620
266736
|
'deposit': currentDeposit,
|
|
@@ -279911,9 +280027,9 @@ class tokocrypto extends _abstract_tokocrypto_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
279911
280027
|
// "timestamp":1659666786943
|
|
279912
280028
|
// }
|
|
279913
280029
|
//
|
|
279914
|
-
return this.
|
|
280030
|
+
return this.parseBalanceCustom(response, type, marginMode);
|
|
279915
280031
|
}
|
|
279916
|
-
|
|
280032
|
+
parseBalanceCustom(response, type = undefined, marginMode = undefined) {
|
|
279917
280033
|
const timestamp = this.safeInteger(response, 'updateTime');
|
|
279918
280034
|
const result = {
|
|
279919
280035
|
'info': response,
|
|
@@ -284220,7 +284336,8 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
|
|
|
284220
284336
|
// precise.decimals should be integer
|
|
284221
284337
|
precise.decimals = this.parseToInt(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringSub(this.numberToString(precise.decimals), this.numberToString(scale)));
|
|
284222
284338
|
precise.reduce();
|
|
284223
|
-
|
|
284339
|
+
const stringValue = precise.toString();
|
|
284340
|
+
return stringValue;
|
|
284224
284341
|
}
|
|
284225
284342
|
currencyFromPrecision(currency, amount) {
|
|
284226
284343
|
const scale = this.currencies[currency]['precision'];
|
|
@@ -289723,7 +289840,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
289723
289840
|
const stopLoss = this.safeValue(params, 'stopLoss');
|
|
289724
289841
|
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
289725
289842
|
const algoType = this.safeString(params, 'algoType');
|
|
289726
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', price);
|
|
289843
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
|
|
289727
289844
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
|
|
289728
289845
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
289729
289846
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
@@ -292823,11 +292940,29 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
292823
292940
|
const address = this.safeString(response['return'], 'address');
|
|
292824
292941
|
this.checkAddress(address);
|
|
292825
292942
|
return {
|
|
292943
|
+
'id': undefined,
|
|
292826
292944
|
'currency': code,
|
|
292827
292945
|
'address': address,
|
|
292828
292946
|
'tag': undefined,
|
|
292829
292947
|
'network': undefined,
|
|
292830
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
|
+
},
|
|
292831
292966
|
};
|
|
292832
292967
|
}
|
|
292833
292968
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
@@ -292860,6 +292995,27 @@ class yobit extends _abstract_yobit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
292860
292995
|
return {
|
|
292861
292996
|
'info': response,
|
|
292862
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
|
+
},
|
|
292863
293019
|
};
|
|
292864
293020
|
}
|
|
292865
293021
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
@@ -301161,7 +301317,7 @@ SOFTWARE.
|
|
|
301161
301317
|
|
|
301162
301318
|
//-----------------------------------------------------------------------------
|
|
301163
301319
|
// this is updated by vss.js when building
|
|
301164
|
-
const version = '4.2.
|
|
301320
|
+
const version = '4.2.34';
|
|
301165
301321
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
301166
301322
|
//-----------------------------------------------------------------------------
|
|
301167
301323
|
|