ccxt 4.1.7 → 4.1.9
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/CHANGELOG.md +194 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +1298 -202
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/base/Exchange.js +58 -2
- package/dist/cjs/src/bingx.js +100 -39
- package/dist/cjs/src/bitbns.js +3 -3
- package/dist/cjs/src/bitget.js +26 -2
- package/dist/cjs/src/bitmart.js +2 -0
- package/dist/cjs/src/coinfalcon.js +3 -3
- package/dist/cjs/src/gate.js +9 -1
- package/dist/cjs/src/kucoin.js +2 -2
- package/dist/cjs/src/kucoinfutures.js +3 -3
- package/dist/cjs/src/mexc.js +46 -3
- package/dist/cjs/src/pro/bingx.js +891 -0
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +3 -1
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/abstract/mexc.d.ts +2 -0
- package/js/src/abstract/mexc3.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +58 -2
- package/js/src/base/types.d.ts +7 -0
- package/js/src/binance.d.ts +17 -17
- package/js/src/bingx.d.ts +4 -3
- package/js/src/bingx.js +100 -39
- package/js/src/bitbns.js +3 -3
- package/js/src/bitfinex2.d.ts +13 -13
- package/js/src/bitget.d.ts +15 -15
- package/js/src/bitget.js +26 -2
- package/js/src/bitmart.js +2 -0
- package/js/src/bitmex.d.ts +15 -15
- package/js/src/bybit.d.ts +23 -23
- package/js/src/coinbase.d.ts +16 -16
- package/js/src/coinbasepro.d.ts +12 -12
- package/js/src/coinex.d.ts +2 -2
- package/js/src/coinfalcon.js +3 -3
- package/js/src/cryptocom.d.ts +12 -12
- package/js/src/deribit.d.ts +2 -2
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/gate.d.ts +10 -10
- package/js/src/gate.js +9 -1
- package/js/src/huobi.d.ts +16 -16
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +6 -6
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +2 -2
- package/js/src/kucoinfutures.d.ts +10 -10
- package/js/src/kucoinfutures.js +3 -3
- package/js/src/mexc.d.ts +3 -3
- package/js/src/mexc.js +46 -3
- package/js/src/okx.d.ts +13 -13
- package/js/src/phemex.d.ts +2 -2
- package/js/src/poloniex.d.ts +5 -5
- package/js/src/pro/bingx.d.ts +24 -0
- package/js/src/pro/bingx.js +892 -0
- package/js/src/pro/exmo.js +1 -1
- package/js/src/woo.d.ts +2 -2
- package/package.json +1 -1
- package/skip-tests.json +3 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -9817,6 +9817,9 @@ class Exchange {
|
|
|
9817
9817
|
async fetchOpenInterest(symbol, params = {}) {
|
|
9818
9818
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
|
|
9819
9819
|
}
|
|
9820
|
+
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
9821
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
|
|
9822
|
+
}
|
|
9820
9823
|
parseLastPrice(price, market = undefined) {
|
|
9821
9824
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' parseLastPrice() is not supported yet');
|
|
9822
9825
|
}
|
|
@@ -10707,7 +10710,9 @@ class Exchange {
|
|
|
10707
10710
|
}
|
|
10708
10711
|
}
|
|
10709
10712
|
}
|
|
10710
|
-
|
|
10713
|
+
const uniqueResults = this.removeRepeatedElementsFromArray(result);
|
|
10714
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
10715
|
+
return this.filterBySinceLimit(uniqueResults, since, limit, key);
|
|
10711
10716
|
}
|
|
10712
10717
|
async safeDeterministicCall(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}) {
|
|
10713
10718
|
let maxRetries = undefined;
|
|
@@ -10762,7 +10767,9 @@ class Exchange {
|
|
|
10762
10767
|
for (let i = 0; i < results.length; i++) {
|
|
10763
10768
|
result = this.arrayConcat(result, results[i]);
|
|
10764
10769
|
}
|
|
10765
|
-
|
|
10770
|
+
const uniqueResults = this.removeRepeatedElementsFromArray(result);
|
|
10771
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
10772
|
+
return this.filterBySinceLimit(uniqueResults, since, limit, key);
|
|
10766
10773
|
}
|
|
10767
10774
|
async fetchPaginatedCallCursor(method, symbol = undefined, since = undefined, limit = undefined, params = {}, cursorReceived = undefined, cursorSent = undefined, cursorIncrement = undefined, maxEntriesPerRequest = undefined) {
|
|
10768
10775
|
let maxCalls = undefined;
|
|
@@ -10806,6 +10813,55 @@ class Exchange {
|
|
|
10806
10813
|
}
|
|
10807
10814
|
i += 1;
|
|
10808
10815
|
}
|
|
10816
|
+
const sorted = this.sortCursorPaginatedResult(result);
|
|
10817
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
10818
|
+
return this.filterBySinceLimit(sorted, since, limit, key);
|
|
10819
|
+
}
|
|
10820
|
+
async fetchPaginatedCallIncremental(method, symbol = undefined, since = undefined, limit = undefined, params = {}, pageKey = undefined, maxEntriesPerRequest = undefined) {
|
|
10821
|
+
let maxCalls = undefined;
|
|
10822
|
+
[maxCalls, params] = this.handleOptionAndParams(params, method, 'paginationCalls', 10);
|
|
10823
|
+
let maxRetries = undefined;
|
|
10824
|
+
[maxRetries, params] = this.handleOptionAndParams(params, method, 'maxRetries', 3);
|
|
10825
|
+
[maxEntriesPerRequest, params] = this.handleMaxEntriesPerRequestAndParams(method, maxEntriesPerRequest, params);
|
|
10826
|
+
let i = 0;
|
|
10827
|
+
let errors = 0;
|
|
10828
|
+
let result = [];
|
|
10829
|
+
while (i < maxCalls) {
|
|
10830
|
+
try {
|
|
10831
|
+
params[pageKey] = i + 1;
|
|
10832
|
+
const response = await this[method](symbol, since, maxEntriesPerRequest, params);
|
|
10833
|
+
errors = 0;
|
|
10834
|
+
const responseLength = response.length;
|
|
10835
|
+
if (this.verbose) {
|
|
10836
|
+
this.log('Incremental pagination call', i + 1, 'method', method, 'response length', responseLength);
|
|
10837
|
+
}
|
|
10838
|
+
if (responseLength === 0) {
|
|
10839
|
+
break;
|
|
10840
|
+
}
|
|
10841
|
+
result = this.arrayConcat(result, response);
|
|
10842
|
+
}
|
|
10843
|
+
catch (e) {
|
|
10844
|
+
errors += 1;
|
|
10845
|
+
if (errors > maxRetries) {
|
|
10846
|
+
throw e;
|
|
10847
|
+
}
|
|
10848
|
+
}
|
|
10849
|
+
i += 1;
|
|
10850
|
+
}
|
|
10851
|
+
const sorted = this.sortCursorPaginatedResult(result);
|
|
10852
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
10853
|
+
return this.filterBySinceLimit(sorted, since, limit, key);
|
|
10854
|
+
}
|
|
10855
|
+
sortCursorPaginatedResult(result) {
|
|
10856
|
+
const first = this.safeValue(result, 0);
|
|
10857
|
+
if (first !== undefined) {
|
|
10858
|
+
if ('timestamp' in first) {
|
|
10859
|
+
return this.sortBy(result, 'timestamp');
|
|
10860
|
+
}
|
|
10861
|
+
if ('id' in first) {
|
|
10862
|
+
return this.sortBy(result, 'id');
|
|
10863
|
+
}
|
|
10864
|
+
}
|
|
10809
10865
|
return result;
|
|
10810
10866
|
}
|
|
10811
10867
|
removeRepeatedElementsFromArray(input) {
|
|
@@ -25320,6 +25376,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
25320
25376
|
'swap': 'https://open-api.{hostname}/openApi',
|
|
25321
25377
|
'contract': 'https://open-api.{hostname}/openApi',
|
|
25322
25378
|
'wallets': 'https://open-api.{hostname}/openApi',
|
|
25379
|
+
'user': 'https://open-api.{hostname}/openApi',
|
|
25323
25380
|
'subAccount': 'https://open-api.{hostname}/openApi',
|
|
25324
25381
|
'account': 'https://open-api.{hostname}/openApi',
|
|
25325
25382
|
},
|
|
@@ -25488,6 +25545,15 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
25488
25545
|
},
|
|
25489
25546
|
},
|
|
25490
25547
|
},
|
|
25548
|
+
'user': {
|
|
25549
|
+
'auth': {
|
|
25550
|
+
'private': {
|
|
25551
|
+
'post': {
|
|
25552
|
+
'userDataStream': 1,
|
|
25553
|
+
},
|
|
25554
|
+
},
|
|
25555
|
+
},
|
|
25556
|
+
},
|
|
25491
25557
|
'copyTrading': {
|
|
25492
25558
|
'v1': {
|
|
25493
25559
|
'private': {
|
|
@@ -25565,6 +25631,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
25565
25631
|
},
|
|
25566
25632
|
'commonCurrencies': {},
|
|
25567
25633
|
'options': {
|
|
25634
|
+
'defaultType': 'spot',
|
|
25568
25635
|
'accountsByType': {
|
|
25569
25636
|
'spot': 'FUND',
|
|
25570
25637
|
'swap': 'PFUTURES',
|
|
@@ -26084,37 +26151,63 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26084
26151
|
// filledTime: '2023-07-04T20:56:01.000+0800'
|
|
26085
26152
|
// }
|
|
26086
26153
|
//
|
|
26087
|
-
|
|
26154
|
+
//
|
|
26155
|
+
// ws
|
|
26156
|
+
//
|
|
26157
|
+
// spot
|
|
26158
|
+
//
|
|
26159
|
+
// {
|
|
26160
|
+
// E: 1690214529432,
|
|
26161
|
+
// T: 1690214529386,
|
|
26162
|
+
// e: 'trade',
|
|
26163
|
+
// m: true,
|
|
26164
|
+
// p: '29110.19',
|
|
26165
|
+
// q: '0.1868',
|
|
26166
|
+
// s: 'BTC-USDT',
|
|
26167
|
+
// t: '57903921'
|
|
26168
|
+
// }
|
|
26169
|
+
//
|
|
26170
|
+
// swap
|
|
26171
|
+
//
|
|
26172
|
+
// {
|
|
26173
|
+
// q: '0.0421',
|
|
26174
|
+
// p: '29023.5',
|
|
26175
|
+
// T: 1690221401344,
|
|
26176
|
+
// m: false,
|
|
26177
|
+
// s: 'BTC-USDT'
|
|
26178
|
+
// }
|
|
26179
|
+
//
|
|
26180
|
+
let time = this.safeIntegerN(trade, ['time', 'filledTm', 'T']);
|
|
26088
26181
|
const datetimeId = this.safeString(trade, 'filledTm');
|
|
26089
26182
|
if (datetimeId !== undefined) {
|
|
26090
26183
|
time = this.parse8601(datetimeId);
|
|
26091
26184
|
}
|
|
26092
|
-
|
|
26093
|
-
|
|
26094
|
-
let side = undefined;
|
|
26095
|
-
if (isBuyerMaker !== undefined) {
|
|
26096
|
-
side = isBuyerMaker ? 'sell' : 'buy';
|
|
26097
|
-
takeOrMaker = 'taker';
|
|
26185
|
+
if (time === 0) {
|
|
26186
|
+
time = undefined;
|
|
26098
26187
|
}
|
|
26188
|
+
const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
|
|
26189
|
+
const side = this.safeStringLower2(trade, 'side', 'S');
|
|
26099
26190
|
const cost = this.safeString(trade, 'quoteQty');
|
|
26100
26191
|
const type = (cost === undefined) ? 'spot' : 'swap';
|
|
26101
|
-
const currencyId = this.
|
|
26192
|
+
const currencyId = this.safeString2(trade, 'currency', 'N');
|
|
26102
26193
|
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
26194
|
+
const m = this.safeValue(trade, 'm', false);
|
|
26195
|
+
const marketId = this.safeString(trade, 's');
|
|
26103
26196
|
return this.safeTrade({
|
|
26104
|
-
'id': this.
|
|
26197
|
+
'id': this.safeStringN(trade, ['id', 't']),
|
|
26105
26198
|
'info': trade,
|
|
26106
26199
|
'timestamp': time,
|
|
26107
26200
|
'datetime': this.iso8601(time),
|
|
26108
|
-
'symbol': this.safeSymbol(
|
|
26109
|
-
'order':
|
|
26110
|
-
'type':
|
|
26111
|
-
'side': side,
|
|
26112
|
-
'takerOrMaker':
|
|
26113
|
-
'price': this.
|
|
26114
|
-
'amount': this.
|
|
26201
|
+
'symbol': this.safeSymbol(marketId, market, '-', type),
|
|
26202
|
+
'order': this.safeString2(trade, 'orderId', 'i'),
|
|
26203
|
+
'type': this.safeStringLower(trade, 'o'),
|
|
26204
|
+
'side': this.parseOrderSide(side),
|
|
26205
|
+
'takerOrMaker': (isBuyerMaker || m) ? 'maker' : 'taker',
|
|
26206
|
+
'price': this.safeString2(trade, 'price', 'p'),
|
|
26207
|
+
'amount': this.safeStringN(trade, ['qty', 'amount', 'q']),
|
|
26115
26208
|
'cost': cost,
|
|
26116
26209
|
'fee': {
|
|
26117
|
-
'cost': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAbs */ .O.stringAbs(this.
|
|
26210
|
+
'cost': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringAbs */ .O.stringAbs(this.safeString2(trade, 'commission', 'n'))),
|
|
26118
26211
|
'currency': currencyCode,
|
|
26119
26212
|
'rate': undefined,
|
|
26120
26213
|
},
|
|
@@ -26834,15 +26927,20 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26834
26927
|
request['timeInForce'] = 'POC';
|
|
26835
26928
|
}
|
|
26836
26929
|
const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
|
|
26837
|
-
if (
|
|
26838
|
-
if (
|
|
26839
|
-
|
|
26930
|
+
if (isMarketOrder && (side === 'buy')) {
|
|
26931
|
+
if (createMarketBuyOrderRequiresPrice) {
|
|
26932
|
+
if (price === undefined) {
|
|
26933
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
|
|
26934
|
+
}
|
|
26935
|
+
else {
|
|
26936
|
+
const amountString = this.numberToString(amount);
|
|
26937
|
+
const priceString = this.numberToString(price);
|
|
26938
|
+
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
|
|
26939
|
+
request['quoteOrderQty'] = this.priceToPrecision(symbol, cost);
|
|
26940
|
+
}
|
|
26840
26941
|
}
|
|
26841
26942
|
else {
|
|
26842
|
-
|
|
26843
|
-
const priceString = this.numberToString(price);
|
|
26844
|
-
const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
|
|
26845
|
-
request['quoteOrderQty'] = this.priceToPrecision(symbol, cost);
|
|
26943
|
+
request['quoteOrderQty'] = this.priceToPrecision(symbol, amount);
|
|
26846
26944
|
}
|
|
26847
26945
|
}
|
|
26848
26946
|
else {
|
|
@@ -26958,6 +27056,15 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
26958
27056
|
const order = this.safeValue(data, 'order', data);
|
|
26959
27057
|
return this.parseOrder(order, market);
|
|
26960
27058
|
}
|
|
27059
|
+
parseOrderSide(side) {
|
|
27060
|
+
const sides = {
|
|
27061
|
+
'BUY': 'buy',
|
|
27062
|
+
'SELL': 'sell',
|
|
27063
|
+
'SHORT': 'sell',
|
|
27064
|
+
'LONG': 'buy',
|
|
27065
|
+
};
|
|
27066
|
+
return this.safeString(sides, side, side);
|
|
27067
|
+
}
|
|
26961
27068
|
parseOrder(order, market = undefined) {
|
|
26962
27069
|
//
|
|
26963
27070
|
// spot
|
|
@@ -27055,39 +27162,49 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27055
27162
|
// "workingType": "MARK_PRICE"
|
|
27056
27163
|
// }
|
|
27057
27164
|
//
|
|
27058
|
-
const positionSide = this.
|
|
27165
|
+
const positionSide = this.safeString2(order, 'positionSide', 'ps');
|
|
27059
27166
|
const marketType = (positionSide === undefined) ? 'spot' : 'swap';
|
|
27060
|
-
const marketId = this.
|
|
27167
|
+
const marketId = this.safeString2(order, 'symbol', 's');
|
|
27061
27168
|
const symbol = this.safeSymbol(marketId, market, '-', marketType);
|
|
27062
|
-
const
|
|
27169
|
+
const orderId = this.safeString2(order, 'orderId', 'i');
|
|
27170
|
+
const side = this.safeStringLower2(order, 'side', 'S');
|
|
27171
|
+
const type = this.safeStringLower2(order, 'type', 'o');
|
|
27172
|
+
const timestamp = this.safeIntegerN(order, ['time', 'transactTime', 'E']);
|
|
27173
|
+
const lastTradeTimestamp = this.safeInteger2(order, 'updateTime', 'T');
|
|
27174
|
+
const price = this.safeString2(order, 'price', 'p');
|
|
27175
|
+
const average = this.safeString2(order, 'avgPrice', 'ap');
|
|
27176
|
+
const amount = this.safeString2(order, 'origQty', 'q');
|
|
27177
|
+
const filled = this.safeString2(order, 'executedQty', 'z');
|
|
27178
|
+
const statusId = this.safeString2(order, 'status', 'X');
|
|
27063
27179
|
const fee = {
|
|
27064
|
-
'currency': this.
|
|
27065
|
-
'rate': this.
|
|
27180
|
+
'currency': this.safeString2(order, 'feeAsset', 'N'),
|
|
27181
|
+
'rate': this.safeStringN(order, ['fee', 'commission', 'n']),
|
|
27066
27182
|
};
|
|
27183
|
+
const clientOrderId = this.safeString2(order, 'clientOrderId', 'c');
|
|
27067
27184
|
return this.safeOrder({
|
|
27068
27185
|
'info': order,
|
|
27069
|
-
'id':
|
|
27070
|
-
'clientOrderId':
|
|
27186
|
+
'id': orderId,
|
|
27187
|
+
'clientOrderId': clientOrderId,
|
|
27071
27188
|
'timestamp': timestamp,
|
|
27072
27189
|
'datetime': this.iso8601(timestamp),
|
|
27073
|
-
'lastTradeTimestamp':
|
|
27190
|
+
'lastTradeTimestamp': lastTradeTimestamp,
|
|
27074
27191
|
'lastUpdateTimestamp': this.safeInteger(order, 'updateTime'),
|
|
27075
27192
|
'symbol': symbol,
|
|
27076
|
-
'type':
|
|
27193
|
+
'type': type,
|
|
27077
27194
|
'timeInForce': undefined,
|
|
27078
27195
|
'postOnly': undefined,
|
|
27079
|
-
'side': this.
|
|
27080
|
-
'price':
|
|
27196
|
+
'side': this.parseOrderSide(side),
|
|
27197
|
+
'price': price,
|
|
27081
27198
|
'stopPrice': this.safeNumber(order, 'stopPrice'),
|
|
27082
27199
|
'triggerPrice': this.safeNumber(order, 'stopPrice'),
|
|
27083
27200
|
'stopLossPrice': this.safeNumber(order, 'stopLoss'),
|
|
27084
27201
|
'takeProfitPrice': this.safeNumber(order, 'takeProfit'),
|
|
27085
|
-
'average':
|
|
27202
|
+
'average': average,
|
|
27086
27203
|
'cost': undefined,
|
|
27087
|
-
'amount':
|
|
27088
|
-
'filled':
|
|
27204
|
+
'amount': amount,
|
|
27205
|
+
'filled': filled,
|
|
27089
27206
|
'remaining': undefined,
|
|
27090
|
-
'status': this.parseOrderStatus(
|
|
27207
|
+
'status': this.parseOrderStatus(statusId),
|
|
27091
27208
|
'fee': fee,
|
|
27092
27209
|
'trades': undefined,
|
|
27093
27210
|
}, market);
|
|
@@ -30722,13 +30839,13 @@ class bitbns extends _abstract_bitbns_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
30722
30839
|
if (numParts > 1) {
|
|
30723
30840
|
let currencyId = this.safeString(parts, 1);
|
|
30724
30841
|
// note that "Money" stands for INR - the only fiat in bitbns
|
|
30842
|
+
const account = this.account();
|
|
30843
|
+
account['free'] = this.safeString(data, key);
|
|
30844
|
+
account['used'] = this.safeString(data, 'inorder' + currencyId);
|
|
30725
30845
|
if (currencyId === 'Money') {
|
|
30726
30846
|
currencyId = 'INR';
|
|
30727
30847
|
}
|
|
30728
30848
|
const code = this.safeCurrencyCode(currencyId);
|
|
30729
|
-
const account = this.account();
|
|
30730
|
-
account['free'] = this.safeString(data, key);
|
|
30731
|
-
account['used'] = this.safeString(data, 'inorder' + currencyId);
|
|
30732
30849
|
result[code] = account;
|
|
30733
30850
|
}
|
|
30734
30851
|
}
|
|
@@ -39721,8 +39838,26 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39721
39838
|
// "data": "888291686266343424"
|
|
39722
39839
|
// }
|
|
39723
39840
|
//
|
|
39841
|
+
// {
|
|
39842
|
+
// "code":"00000",
|
|
39843
|
+
// "msg":"success",
|
|
39844
|
+
// "requestTime":1696784219602,
|
|
39845
|
+
// "data":{
|
|
39846
|
+
// "orderId":"1094957867615789056",
|
|
39847
|
+
// "clientOrderId":"64f1e4ce842041d296b4517df1b5c2d7"
|
|
39848
|
+
// }
|
|
39849
|
+
// }
|
|
39850
|
+
//
|
|
39851
|
+
const data = this.safeValue(response, 'data');
|
|
39852
|
+
let id = undefined;
|
|
39853
|
+
if (typeof data === 'string') {
|
|
39854
|
+
id = data;
|
|
39855
|
+
}
|
|
39856
|
+
else if (data !== undefined) {
|
|
39857
|
+
id = this.safeString(data, 'orderId');
|
|
39858
|
+
}
|
|
39724
39859
|
const result = {
|
|
39725
|
-
'id':
|
|
39860
|
+
'id': id,
|
|
39726
39861
|
'info': response,
|
|
39727
39862
|
'txid': undefined,
|
|
39728
39863
|
'timestamp': undefined,
|
|
@@ -42505,15 +42640,20 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42505
42640
|
* @name bitget#fetchFundingRateHistory
|
|
42506
42641
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
|
|
42507
42642
|
* @description fetches historical funding rate prices
|
|
42508
|
-
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
|
|
42509
42643
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
42510
42644
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
42511
42645
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
42512
42646
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
42647
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
42513
42648
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
42514
42649
|
*/
|
|
42515
42650
|
this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
|
|
42516
42651
|
await this.loadMarkets();
|
|
42652
|
+
let paginate = false;
|
|
42653
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
42654
|
+
if (paginate) {
|
|
42655
|
+
return await this.fetchPaginatedCallIncremental('fetchFundingRateHistory', symbol, since, limit, params, 'pageNo', 50);
|
|
42656
|
+
}
|
|
42517
42657
|
const market = this.market(symbol);
|
|
42518
42658
|
const request = {
|
|
42519
42659
|
'symbol': market['id'],
|
|
@@ -42524,6 +42664,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42524
42664
|
if (limit !== undefined) {
|
|
42525
42665
|
request['pageSize'] = limit;
|
|
42526
42666
|
}
|
|
42667
|
+
request['nextPage'] = true;
|
|
42527
42668
|
const response = await this.publicMixGetMarketHistoryFundRate(this.extend(request, params));
|
|
42528
42669
|
//
|
|
42529
42670
|
// {
|
|
@@ -44633,6 +44774,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
44633
44774
|
'spot/v1/margin/isolated/account': 6,
|
|
44634
44775
|
'spot/v1/trade_fee': 6,
|
|
44635
44776
|
'spot/v1/user_fee': 6,
|
|
44777
|
+
// broker
|
|
44778
|
+
'spot/v1/broker/rebate': 1,
|
|
44636
44779
|
// contract
|
|
44637
44780
|
'contract/private/assets-detail': 5,
|
|
44638
44781
|
'contract/private/order': 1.2,
|
|
@@ -92212,9 +92355,9 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
92212
92355
|
const amountString = this.safeString(transaction, 'amount');
|
|
92213
92356
|
const amount = this.parseNumber(amountString);
|
|
92214
92357
|
const feeCostString = this.safeString(transaction, 'fee');
|
|
92215
|
-
let feeCost = 0;
|
|
92358
|
+
let feeCost = '0';
|
|
92216
92359
|
if (feeCostString !== undefined) {
|
|
92217
|
-
feeCost =
|
|
92360
|
+
feeCost = feeCostString;
|
|
92218
92361
|
}
|
|
92219
92362
|
return {
|
|
92220
92363
|
'info': transaction,
|
|
@@ -92236,7 +92379,7 @@ class coinfalcon extends _abstract_coinfalcon_js__WEBPACK_IMPORTED_MODULE_0__/*
|
|
|
92236
92379
|
'updated': undefined,
|
|
92237
92380
|
'fee': {
|
|
92238
92381
|
'currency': code,
|
|
92239
|
-
'cost': feeCost,
|
|
92382
|
+
'cost': this.parseNumber(feeCost),
|
|
92240
92383
|
},
|
|
92241
92384
|
};
|
|
92242
92385
|
}
|
|
@@ -117936,6 +118079,13 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
117936
118079
|
// "memo": null
|
|
117937
118080
|
// }
|
|
117938
118081
|
//
|
|
118082
|
+
// {
|
|
118083
|
+
// "currency":"usdt",
|
|
118084
|
+
// "address":"0x01b0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806",
|
|
118085
|
+
// "amount":"1880",
|
|
118086
|
+
// "chain":"eth"
|
|
118087
|
+
// }
|
|
118088
|
+
//
|
|
117939
118089
|
const id = this.safeString(transaction, 'id');
|
|
117940
118090
|
let type = undefined;
|
|
117941
118091
|
let amountString = this.safeString(transaction, 'amount');
|
|
@@ -117953,6 +118103,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
117953
118103
|
if (type === 'withdrawal') {
|
|
117954
118104
|
amountString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringSub */ .O.stringSub(amountString, feeCostString);
|
|
117955
118105
|
}
|
|
118106
|
+
const networkId = this.safeStringUpper(transaction, 'chain');
|
|
117956
118107
|
const currencyId = this.safeString(transaction, 'currency');
|
|
117957
118108
|
const code = this.safeCurrencyCode(currencyId);
|
|
117958
118109
|
const txid = this.safeString(transaction, 'txid');
|
|
@@ -117967,7 +118118,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
117967
118118
|
'txid': txid,
|
|
117968
118119
|
'currency': code,
|
|
117969
118120
|
'amount': this.parseNumber(amountString),
|
|
117970
|
-
'network':
|
|
118121
|
+
'network': this.networkIdToCode(networkId),
|
|
117971
118122
|
'address': address,
|
|
117972
118123
|
'addressTo': undefined,
|
|
117973
118124
|
'addressFrom': undefined,
|
|
@@ -148436,7 +148587,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
148436
148587
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
148437
148588
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
148438
148589
|
*/
|
|
148439
|
-
await this.loadMarkets;
|
|
148590
|
+
await this.loadMarkets();
|
|
148440
148591
|
let paginate = false;
|
|
148441
148592
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
|
|
148442
148593
|
if (paginate) {
|
|
@@ -148469,7 +148620,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
148469
148620
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
148470
148621
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
148471
148622
|
*/
|
|
148472
|
-
await this.loadMarkets;
|
|
148623
|
+
await this.loadMarkets();
|
|
148473
148624
|
let paginate = false;
|
|
148474
148625
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
148475
148626
|
if (paginate) {
|
|
@@ -151995,7 +152146,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
151995
152146
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
151996
152147
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
151997
152148
|
*/
|
|
151998
|
-
await this.loadMarkets;
|
|
152149
|
+
await this.loadMarkets();
|
|
151999
152150
|
let paginate = false;
|
|
152000
152151
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
|
|
152001
152152
|
if (paginate) {
|
|
@@ -152786,12 +152937,12 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
152786
152937
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
152787
152938
|
/**
|
|
152788
152939
|
* @method
|
|
152789
|
-
* @name
|
|
152940
|
+
* @name kucoinfutures#fetchFundingRateHistory
|
|
152790
152941
|
* @description fetches historical funding rate prices
|
|
152791
152942
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
152792
152943
|
* @param {int} [since] not used by kucuoinfutures
|
|
152793
152944
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
152794
|
-
* @param {object} [params] extra parameters specific to the
|
|
152945
|
+
* @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
|
|
152795
152946
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
152796
152947
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
152797
152948
|
*/
|
|
@@ -162722,6 +162873,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
162722
162873
|
'rebate/detail/kickback': 1,
|
|
162723
162874
|
'rebate/referCode': 1,
|
|
162724
162875
|
'rebate/affiliate/commission': 1,
|
|
162876
|
+
'rebate/affiliate/withdraw': 1,
|
|
162877
|
+
'rebate/affiliate/commission/detail': 1,
|
|
162725
162878
|
'mxDeduct/enable': 1,
|
|
162726
162879
|
'userDataStream': 1,
|
|
162727
162880
|
},
|
|
@@ -163886,11 +164039,15 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
163886
164039
|
/**
|
|
163887
164040
|
* @method
|
|
163888
164041
|
* @name mexc3#fetchTrades
|
|
164042
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
|
|
164043
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
|
|
164044
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
|
|
163889
164045
|
* @description get the list of most recent trades for a particular symbol
|
|
163890
164046
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
163891
164047
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
163892
164048
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
163893
164049
|
* @param {object} [params] extra parameters specific to the mexc3 api endpoint
|
|
164050
|
+
* @param {int} [params.until] *spot only* *since must be defined* the latest time in ms to fetch entries for
|
|
163894
164051
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
|
|
163895
164052
|
*/
|
|
163896
164053
|
await this.loadMarkets();
|
|
@@ -163901,11 +164058,21 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
163901
164058
|
if (limit !== undefined) {
|
|
163902
164059
|
request['limit'] = limit;
|
|
163903
164060
|
}
|
|
163904
|
-
// if (since !== undefined) {
|
|
163905
|
-
// request['startTime'] = since; bug in api, waiting for fix
|
|
163906
|
-
// }
|
|
163907
164061
|
let trades = undefined;
|
|
163908
164062
|
if (market['spot']) {
|
|
164063
|
+
const until = this.safeIntegerN(params, ['endTime', 'until', 'till']);
|
|
164064
|
+
if (since !== undefined) {
|
|
164065
|
+
request['startTime'] = since;
|
|
164066
|
+
if (until === undefined) {
|
|
164067
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchTrades() requires an until parameter when since is provided');
|
|
164068
|
+
}
|
|
164069
|
+
}
|
|
164070
|
+
if (until !== undefined) {
|
|
164071
|
+
if (since === undefined) {
|
|
164072
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchTrades() requires a since parameter when until is provided');
|
|
164073
|
+
}
|
|
164074
|
+
request['endTime'] = until;
|
|
164075
|
+
}
|
|
163909
164076
|
let method = this.safeString(this.options, 'fetchTradesMethod', 'spotPublicGetAggTrades');
|
|
163910
164077
|
method = this.safeString(params, 'method', method); // AggTrades, HistoricalTrades, Trades
|
|
163911
164078
|
trades = await this[method](this.extend(request, params));
|
|
@@ -164136,31 +164303,53 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
164136
164303
|
/**
|
|
164137
164304
|
* @method
|
|
164138
164305
|
* @name mexc3#fetchOHLCV
|
|
164306
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
|
164307
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
|
|
164139
164308
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
164140
164309
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
164141
164310
|
* @param {string} timeframe the length of time each candle represents
|
|
164142
164311
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
164143
164312
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
164144
164313
|
* @param {object} [params] extra parameters specific to the mexc3 api endpoint
|
|
164314
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
164315
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
164145
164316
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
164146
164317
|
*/
|
|
164147
164318
|
await this.loadMarkets();
|
|
164148
164319
|
const market = this.market(symbol);
|
|
164320
|
+
const maxLimit = (market['spot']) ? 1000 : 2000;
|
|
164321
|
+
let paginate = false;
|
|
164322
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
164323
|
+
if (paginate) {
|
|
164324
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimit);
|
|
164325
|
+
}
|
|
164149
164326
|
const options = this.safeValue(this.options, 'timeframes', {});
|
|
164150
164327
|
const timeframes = this.safeValue(options, market['type'], {});
|
|
164151
164328
|
const timeframeValue = this.safeString(timeframes, timeframe);
|
|
164329
|
+
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
164152
164330
|
const request = {
|
|
164153
164331
|
'symbol': market['id'],
|
|
164154
164332
|
'interval': timeframeValue,
|
|
164155
164333
|
};
|
|
164156
164334
|
let candles = undefined;
|
|
164157
164335
|
if (market['spot']) {
|
|
164336
|
+
const until = this.safeIntegerN(params, ['until', 'endTime', 'till']);
|
|
164158
164337
|
if (since !== undefined) {
|
|
164159
164338
|
request['startTime'] = since;
|
|
164339
|
+
if (until === undefined) {
|
|
164340
|
+
// we have to calculate it assuming we can get at most 2000 entries per request
|
|
164341
|
+
const end = this.sum(since, maxLimit * duration);
|
|
164342
|
+
const now = this.milliseconds();
|
|
164343
|
+
request['endTime'] = Math.min(end, now);
|
|
164344
|
+
}
|
|
164160
164345
|
}
|
|
164161
164346
|
if (limit !== undefined) {
|
|
164162
164347
|
request['limit'] = limit;
|
|
164163
164348
|
}
|
|
164349
|
+
if (until !== undefined) {
|
|
164350
|
+
params = this.omit(params, ['until', 'till']);
|
|
164351
|
+
request['endTime'] = until;
|
|
164352
|
+
}
|
|
164164
164353
|
const response = await this.spotPublicGetKlines(this.extend(request, params));
|
|
164165
164354
|
//
|
|
164166
164355
|
// [
|
|
@@ -164179,9 +164368,14 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
164179
164368
|
candles = response;
|
|
164180
164369
|
}
|
|
164181
164370
|
else if (market['swap']) {
|
|
164371
|
+
const until = this.safeIntegerProductN(params, ['until', 'endTime', 'till'], 0.001);
|
|
164182
164372
|
if (since !== undefined) {
|
|
164183
164373
|
request['start'] = this.parseToInt(since / 1000);
|
|
164184
164374
|
}
|
|
164375
|
+
if (until !== undefined) {
|
|
164376
|
+
params = this.omit(params, ['until', 'till']);
|
|
164377
|
+
request['end'] = until;
|
|
164378
|
+
}
|
|
164185
164379
|
const priceType = this.safeString(params, 'price', 'default');
|
|
164186
164380
|
params = this.omit(params, 'price');
|
|
164187
164381
|
const method = this.getSupportedMapping(priceType, {
|
|
@@ -197282,6 +197476,905 @@ class binanceusdm extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
197282
197476
|
}
|
|
197283
197477
|
|
|
197284
197478
|
|
|
197479
|
+
/***/ }),
|
|
197480
|
+
|
|
197481
|
+
/***/ 6955:
|
|
197482
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
197483
|
+
|
|
197484
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
197485
|
+
/* harmony export */ "Z": () => (/* binding */ bingx)
|
|
197486
|
+
/* harmony export */ });
|
|
197487
|
+
/* harmony import */ var _bingx_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7960);
|
|
197488
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
197489
|
+
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
|
|
197490
|
+
// ---------------------------------------------------------------------------
|
|
197491
|
+
|
|
197492
|
+
|
|
197493
|
+
|
|
197494
|
+
// ---------------------------------------------------------------------------
|
|
197495
|
+
class bingx extends _bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
197496
|
+
describe() {
|
|
197497
|
+
return this.deepExtend(super.describe(), {
|
|
197498
|
+
'has': {
|
|
197499
|
+
'ws': true,
|
|
197500
|
+
'watchTrades': true,
|
|
197501
|
+
'watchOrderBook': true,
|
|
197502
|
+
'watchOHLCV': true,
|
|
197503
|
+
'watchOrders': true,
|
|
197504
|
+
'watchMyTrades': true,
|
|
197505
|
+
'watchTicker': false,
|
|
197506
|
+
'watchTickers': false,
|
|
197507
|
+
'watchBalance': true,
|
|
197508
|
+
},
|
|
197509
|
+
'urls': {
|
|
197510
|
+
'api': {
|
|
197511
|
+
'ws': {
|
|
197512
|
+
'spot': 'wss://open-api-ws.bingx.com/market',
|
|
197513
|
+
'swap': 'wss://open-api-swap.bingx.com/swap-market',
|
|
197514
|
+
},
|
|
197515
|
+
},
|
|
197516
|
+
},
|
|
197517
|
+
'options': {
|
|
197518
|
+
'ws': {
|
|
197519
|
+
'gunzip': true,
|
|
197520
|
+
},
|
|
197521
|
+
'swap': {
|
|
197522
|
+
'timeframes': {
|
|
197523
|
+
'1m': '1m',
|
|
197524
|
+
'3m': '3m',
|
|
197525
|
+
'5m': '5m',
|
|
197526
|
+
'15m': '15m',
|
|
197527
|
+
'30m': '30m',
|
|
197528
|
+
'1h': '1h',
|
|
197529
|
+
'2h': '2h',
|
|
197530
|
+
'4h': '4h',
|
|
197531
|
+
'6h': '6h',
|
|
197532
|
+
'12h': '12h',
|
|
197533
|
+
'1d': '1d',
|
|
197534
|
+
'3d': '3d',
|
|
197535
|
+
'1w': '1w',
|
|
197536
|
+
'1M': '1M',
|
|
197537
|
+
},
|
|
197538
|
+
},
|
|
197539
|
+
'spot': {
|
|
197540
|
+
'timeframes': {
|
|
197541
|
+
'1m': '1min',
|
|
197542
|
+
'5m': '5min',
|
|
197543
|
+
'15m': '15min',
|
|
197544
|
+
'30m': '30min',
|
|
197545
|
+
'1h': '60min',
|
|
197546
|
+
'1d': '1day',
|
|
197547
|
+
},
|
|
197548
|
+
},
|
|
197549
|
+
},
|
|
197550
|
+
'streaming': {
|
|
197551
|
+
'keepAlive': 1800000, // 30 minutes
|
|
197552
|
+
},
|
|
197553
|
+
});
|
|
197554
|
+
}
|
|
197555
|
+
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
197556
|
+
/**
|
|
197557
|
+
* @method
|
|
197558
|
+
* @name bingx#watchTrades
|
|
197559
|
+
* @description watches information on multiple trades made in a market
|
|
197560
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#Subscribe%20to%20tick-by-tick
|
|
197561
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
|
|
197562
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
197563
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
197564
|
+
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
197565
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
197566
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
197567
|
+
*/
|
|
197568
|
+
await this.loadMarkets();
|
|
197569
|
+
const market = this.market(symbol);
|
|
197570
|
+
const [marketType, query] = this.handleMarketTypeAndParams('watchTrades', market, params);
|
|
197571
|
+
const url = this.safeValue(this.urls['api']['ws'], marketType);
|
|
197572
|
+
if (url === undefined) {
|
|
197573
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchTrades is not supported for ' + marketType + ' markets.');
|
|
197574
|
+
}
|
|
197575
|
+
const messageHash = market['id'] + '@trade';
|
|
197576
|
+
const uuid = this.uuid();
|
|
197577
|
+
const request = {
|
|
197578
|
+
'id': uuid,
|
|
197579
|
+
'dataType': messageHash,
|
|
197580
|
+
};
|
|
197581
|
+
if (marketType === 'swap') {
|
|
197582
|
+
request['reqType'] = 'sub';
|
|
197583
|
+
}
|
|
197584
|
+
const trades = await this.watch(url, messageHash, this.extend(request, query), messageHash);
|
|
197585
|
+
if (this.newUpdates) {
|
|
197586
|
+
limit = trades.getLimit(symbol, limit);
|
|
197587
|
+
}
|
|
197588
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
197589
|
+
}
|
|
197590
|
+
handleTrades(client, message) {
|
|
197591
|
+
//
|
|
197592
|
+
// spot
|
|
197593
|
+
// first snapshot
|
|
197594
|
+
//
|
|
197595
|
+
// {
|
|
197596
|
+
// id: 'd83b78ce-98be-4dc2-b847-12fe471b5bc5',
|
|
197597
|
+
// code: 0,
|
|
197598
|
+
// msg: 'SUCCESS',
|
|
197599
|
+
// timestamp: 1690214699854
|
|
197600
|
+
// }
|
|
197601
|
+
//
|
|
197602
|
+
// subsequent updates
|
|
197603
|
+
//
|
|
197604
|
+
// {
|
|
197605
|
+
// code: 0,
|
|
197606
|
+
// data: {
|
|
197607
|
+
// E: 1690214529432,
|
|
197608
|
+
// T: 1690214529386,
|
|
197609
|
+
// e: 'trade',
|
|
197610
|
+
// m: true,
|
|
197611
|
+
// p: '29110.19',
|
|
197612
|
+
// q: '0.1868',
|
|
197613
|
+
// s: 'BTC-USDT',
|
|
197614
|
+
// t: '57903921'
|
|
197615
|
+
// },
|
|
197616
|
+
// dataType: 'BTC-USDT@trade',
|
|
197617
|
+
// success: true
|
|
197618
|
+
// }
|
|
197619
|
+
//
|
|
197620
|
+
//
|
|
197621
|
+
// swap
|
|
197622
|
+
// first snapshot
|
|
197623
|
+
//
|
|
197624
|
+
// {
|
|
197625
|
+
// id: '2aed93b1-6e1e-4038-aeba-f5eeaec2ca48',
|
|
197626
|
+
// code: 0,
|
|
197627
|
+
// msg: '',
|
|
197628
|
+
// dataType: '',
|
|
197629
|
+
// data: null
|
|
197630
|
+
// }
|
|
197631
|
+
//
|
|
197632
|
+
// subsequent updates
|
|
197633
|
+
//
|
|
197634
|
+
//
|
|
197635
|
+
// {
|
|
197636
|
+
// code: 0,
|
|
197637
|
+
// dataType: 'BTC-USDT@trade',
|
|
197638
|
+
// data: [
|
|
197639
|
+
// {
|
|
197640
|
+
// q: '0.0421',
|
|
197641
|
+
// p: '29023.5',
|
|
197642
|
+
// T: 1690221401344,
|
|
197643
|
+
// m: false,
|
|
197644
|
+
// s: 'BTC-USDT'
|
|
197645
|
+
// },
|
|
197646
|
+
// ...
|
|
197647
|
+
// ]
|
|
197648
|
+
// }
|
|
197649
|
+
//
|
|
197650
|
+
const data = this.safeValue(message, 'data', []);
|
|
197651
|
+
const messageHash = this.safeString(message, 'dataType');
|
|
197652
|
+
const marketId = messageHash.split('@')[0];
|
|
197653
|
+
const marketType = client.url.indexOf('swap') >= 0 ? 'swap' : 'spot';
|
|
197654
|
+
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
197655
|
+
const symbol = market['symbol'];
|
|
197656
|
+
let trades = undefined;
|
|
197657
|
+
if (Array.isArray(data)) {
|
|
197658
|
+
trades = this.parseTrades(data, market);
|
|
197659
|
+
}
|
|
197660
|
+
else {
|
|
197661
|
+
trades = [this.parseTrade(data, market)];
|
|
197662
|
+
}
|
|
197663
|
+
let stored = this.safeValue(this.trades, symbol);
|
|
197664
|
+
if (stored === undefined) {
|
|
197665
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
197666
|
+
stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCache */ .ZL(limit);
|
|
197667
|
+
this.trades[symbol] = stored;
|
|
197668
|
+
}
|
|
197669
|
+
for (let j = 0; j < trades.length; j++) {
|
|
197670
|
+
stored.append(trades[j]);
|
|
197671
|
+
}
|
|
197672
|
+
client.resolve(stored, messageHash);
|
|
197673
|
+
}
|
|
197674
|
+
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
197675
|
+
/**
|
|
197676
|
+
* @method
|
|
197677
|
+
* @name bingx#watchOrderBook
|
|
197678
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
197679
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
197680
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
197681
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
197682
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
197683
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
197684
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
197685
|
+
*/
|
|
197686
|
+
await this.loadMarkets();
|
|
197687
|
+
const market = this.market(symbol);
|
|
197688
|
+
const [marketType, query] = this.handleMarketTypeAndParams('watchOrderBook', market, params);
|
|
197689
|
+
if (limit === undefined) {
|
|
197690
|
+
limit = 100;
|
|
197691
|
+
}
|
|
197692
|
+
else {
|
|
197693
|
+
if (marketType === 'swap') {
|
|
197694
|
+
if ((limit !== 5) && (limit !== 10) && (limit !== 20) && (limit !== 50) && (limit !== 100)) {
|
|
197695
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchOrderBook() (swap) only supports limit 5, 10, 20, 50, and 100');
|
|
197696
|
+
}
|
|
197697
|
+
}
|
|
197698
|
+
else if (marketType === 'spot') {
|
|
197699
|
+
if ((limit !== 20) && (limit !== 100)) {
|
|
197700
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchOrderBook() (spot) only supports limit 20, and 100');
|
|
197701
|
+
}
|
|
197702
|
+
}
|
|
197703
|
+
}
|
|
197704
|
+
const url = this.safeValue(this.urls['api']['ws'], marketType);
|
|
197705
|
+
if (url === undefined) {
|
|
197706
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchOrderBook is not supported for ' + marketType + ' markets.');
|
|
197707
|
+
}
|
|
197708
|
+
const messageHash = market['id'] + '@depth' + limit.toString();
|
|
197709
|
+
const uuid = this.uuid();
|
|
197710
|
+
const request = {
|
|
197711
|
+
'id': uuid,
|
|
197712
|
+
'dataType': messageHash,
|
|
197713
|
+
};
|
|
197714
|
+
if (marketType === 'swap') {
|
|
197715
|
+
request['reqType'] = 'sub';
|
|
197716
|
+
}
|
|
197717
|
+
const orderbook = await this.watch(url, messageHash, this.deepExtend(request, query), messageHash);
|
|
197718
|
+
return orderbook.limit();
|
|
197719
|
+
}
|
|
197720
|
+
handleDelta(bookside, delta) {
|
|
197721
|
+
const price = this.safeFloat(delta, 0);
|
|
197722
|
+
const amount = this.safeFloat(delta, 1);
|
|
197723
|
+
bookside.store(price, amount);
|
|
197724
|
+
}
|
|
197725
|
+
handleOrderBook(client, message) {
|
|
197726
|
+
//
|
|
197727
|
+
// spot
|
|
197728
|
+
//
|
|
197729
|
+
//
|
|
197730
|
+
// {
|
|
197731
|
+
// code: 0,
|
|
197732
|
+
// dataType: 'BTC-USDT@depth20',
|
|
197733
|
+
// data: {
|
|
197734
|
+
// bids: [
|
|
197735
|
+
// [ '28852.9', '34.2621' ],
|
|
197736
|
+
// ...
|
|
197737
|
+
// ],
|
|
197738
|
+
// asks: [
|
|
197739
|
+
// [ '28864.9', '23.4079' ],
|
|
197740
|
+
// ...
|
|
197741
|
+
// ]
|
|
197742
|
+
// },
|
|
197743
|
+
// dataType: 'BTC-USDT@depth20',
|
|
197744
|
+
// success: true
|
|
197745
|
+
// }
|
|
197746
|
+
//
|
|
197747
|
+
// swap
|
|
197748
|
+
//
|
|
197749
|
+
//
|
|
197750
|
+
// {
|
|
197751
|
+
// code: 0,
|
|
197752
|
+
// dataType: 'BTC-USDT@depth20',
|
|
197753
|
+
// data: {
|
|
197754
|
+
// bids: [
|
|
197755
|
+
// [ '28852.9', '34.2621' ],
|
|
197756
|
+
// ...
|
|
197757
|
+
// ],
|
|
197758
|
+
// asks: [
|
|
197759
|
+
// [ '28864.9', '23.4079' ],
|
|
197760
|
+
// ...
|
|
197761
|
+
// ]
|
|
197762
|
+
// }
|
|
197763
|
+
// }
|
|
197764
|
+
//
|
|
197765
|
+
const data = this.safeValue(message, 'data', []);
|
|
197766
|
+
const messageHash = this.safeString(message, 'dataType');
|
|
197767
|
+
const marketId = messageHash.split('@')[0];
|
|
197768
|
+
const marketType = client.url.indexOf('swap') >= 0 ? 'swap' : 'spot';
|
|
197769
|
+
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
197770
|
+
const symbol = market['symbol'];
|
|
197771
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
197772
|
+
if (orderbook === undefined) {
|
|
197773
|
+
orderbook = this.orderBook();
|
|
197774
|
+
}
|
|
197775
|
+
const snapshot = this.parseOrderBook(data, symbol, undefined, 'bids', 'asks', 0, 1);
|
|
197776
|
+
orderbook.reset(snapshot);
|
|
197777
|
+
this.orderbooks[symbol] = orderbook;
|
|
197778
|
+
client.resolve(orderbook, messageHash);
|
|
197779
|
+
}
|
|
197780
|
+
parseWsOHLCV(ohlcv, market = undefined) {
|
|
197781
|
+
//
|
|
197782
|
+
// {
|
|
197783
|
+
// c: '28909.0',
|
|
197784
|
+
// o: '28915.4',
|
|
197785
|
+
// h: '28915.4',
|
|
197786
|
+
// l: '28896.1',
|
|
197787
|
+
// v: '27.6919',
|
|
197788
|
+
// T: 1690907580000
|
|
197789
|
+
// }
|
|
197790
|
+
//
|
|
197791
|
+
return [
|
|
197792
|
+
this.safeInteger(ohlcv, 'T'),
|
|
197793
|
+
this.safeNumber(ohlcv, 'o'),
|
|
197794
|
+
this.safeNumber(ohlcv, 'h'),
|
|
197795
|
+
this.safeNumber(ohlcv, 'l'),
|
|
197796
|
+
this.safeNumber(ohlcv, 'c'),
|
|
197797
|
+
this.safeNumber(ohlcv, 'v'),
|
|
197798
|
+
];
|
|
197799
|
+
}
|
|
197800
|
+
handleOHLCV(client, message) {
|
|
197801
|
+
//
|
|
197802
|
+
// spot
|
|
197803
|
+
//
|
|
197804
|
+
// {
|
|
197805
|
+
// code: 0,
|
|
197806
|
+
// data: {
|
|
197807
|
+
// E: 1696687498608,
|
|
197808
|
+
// K: {
|
|
197809
|
+
// T: 1696687499999,
|
|
197810
|
+
// c: '27917.829',
|
|
197811
|
+
// h: '27918.427',
|
|
197812
|
+
// i: '1min',
|
|
197813
|
+
// l: '27917.7',
|
|
197814
|
+
// n: 262,
|
|
197815
|
+
// o: '27917.91',
|
|
197816
|
+
// q: '25715.359197',
|
|
197817
|
+
// s: 'BTC-USDT',
|
|
197818
|
+
// t: 1696687440000,
|
|
197819
|
+
// v: '0.921100'
|
|
197820
|
+
// },
|
|
197821
|
+
// e: 'kline',
|
|
197822
|
+
// s: 'BTC-USDT'
|
|
197823
|
+
// },
|
|
197824
|
+
// dataType: 'BTC-USDT@kline_1min',
|
|
197825
|
+
// success: true
|
|
197826
|
+
// }
|
|
197827
|
+
//
|
|
197828
|
+
// swap
|
|
197829
|
+
// {
|
|
197830
|
+
// code: 0,
|
|
197831
|
+
// dataType: 'BTC-USDT@kline_1m',
|
|
197832
|
+
// s: 'BTC-USDT',
|
|
197833
|
+
// data: [
|
|
197834
|
+
// {
|
|
197835
|
+
// c: '28909.0',
|
|
197836
|
+
// o: '28915.4',
|
|
197837
|
+
// h: '28915.4',
|
|
197838
|
+
// l: '28896.1',
|
|
197839
|
+
// v: '27.6919',
|
|
197840
|
+
// T: 1690907580000
|
|
197841
|
+
// }
|
|
197842
|
+
// ]
|
|
197843
|
+
// }
|
|
197844
|
+
//
|
|
197845
|
+
const data = this.safeValue(message, 'data', []);
|
|
197846
|
+
let candles = undefined;
|
|
197847
|
+
if (Array.isArray(data)) {
|
|
197848
|
+
candles = data;
|
|
197849
|
+
}
|
|
197850
|
+
else {
|
|
197851
|
+
candles = [this.safeValue(data, 'K', [])];
|
|
197852
|
+
}
|
|
197853
|
+
const messageHash = this.safeString(message, 'dataType');
|
|
197854
|
+
const timeframeId = messageHash.split('_')[1];
|
|
197855
|
+
const marketId = messageHash.split('@')[0];
|
|
197856
|
+
const marketType = client.url.indexOf('swap') >= 0 ? 'swap' : 'spot';
|
|
197857
|
+
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
197858
|
+
const symbol = market['symbol'];
|
|
197859
|
+
this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
|
|
197860
|
+
let stored = this.safeValue(this.ohlcvs[symbol], timeframeId);
|
|
197861
|
+
if (stored === undefined) {
|
|
197862
|
+
const limit = this.safeInteger(this.options, 'OHLCVLimit', 1000);
|
|
197863
|
+
stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheByTimestamp */ .Py(limit);
|
|
197864
|
+
this.ohlcvs[symbol][timeframeId] = stored;
|
|
197865
|
+
}
|
|
197866
|
+
for (let i = 0; i < candles.length; i++) {
|
|
197867
|
+
const candle = candles[i];
|
|
197868
|
+
const parsed = this.parseWsOHLCV(candle, market);
|
|
197869
|
+
stored.append(parsed);
|
|
197870
|
+
}
|
|
197871
|
+
client.resolve(stored, messageHash);
|
|
197872
|
+
}
|
|
197873
|
+
async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
197874
|
+
/**
|
|
197875
|
+
* @method
|
|
197876
|
+
* @name bingx#watchOHLCV
|
|
197877
|
+
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
197878
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#K%E7%BA%BF%20Streams
|
|
197879
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20K-Line%20Data
|
|
197880
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
197881
|
+
* @param {string} timeframe the length of time each candle represents
|
|
197882
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
197883
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
197884
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
197885
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
197886
|
+
*/
|
|
197887
|
+
const market = this.market(symbol);
|
|
197888
|
+
const [marketType, query] = this.handleMarketTypeAndParams('watchOHLCV', market, params);
|
|
197889
|
+
const url = this.safeValue(this.urls['api']['ws'], marketType);
|
|
197890
|
+
if (url === undefined) {
|
|
197891
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchOHLCV is not supported for ' + marketType + ' markets.');
|
|
197892
|
+
}
|
|
197893
|
+
const options = this.safeValue(this.options, marketType, {});
|
|
197894
|
+
const timeframes = this.safeValue(options, 'timeframes', {});
|
|
197895
|
+
const interval = this.safeString(timeframes, timeframe, timeframe);
|
|
197896
|
+
const messageHash = market['id'] + '@kline_' + interval;
|
|
197897
|
+
const uuid = this.uuid();
|
|
197898
|
+
const request = {
|
|
197899
|
+
'id': uuid,
|
|
197900
|
+
'dataType': messageHash,
|
|
197901
|
+
};
|
|
197902
|
+
if (marketType === 'swap') {
|
|
197903
|
+
request['reqType'] = 'sub';
|
|
197904
|
+
}
|
|
197905
|
+
const ohlcv = await this.watch(url, messageHash, this.extend(request, query), messageHash);
|
|
197906
|
+
if (this.newUpdates) {
|
|
197907
|
+
limit = ohlcv.getLimit(symbol, limit);
|
|
197908
|
+
}
|
|
197909
|
+
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
197910
|
+
}
|
|
197911
|
+
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
197912
|
+
/**
|
|
197913
|
+
* @method
|
|
197914
|
+
* @name bingx#watchOrders
|
|
197915
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
|
197916
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
197917
|
+
* @description watches information on multiple orders made by the user
|
|
197918
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
197919
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
197920
|
+
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
197921
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
197922
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
197923
|
+
*/
|
|
197924
|
+
await this.loadMarkets();
|
|
197925
|
+
await this.authenticate();
|
|
197926
|
+
let type = undefined;
|
|
197927
|
+
let market = undefined;
|
|
197928
|
+
if (symbol !== undefined) {
|
|
197929
|
+
market = this.market(symbol);
|
|
197930
|
+
symbol = market['symbol'];
|
|
197931
|
+
}
|
|
197932
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
197933
|
+
const isSpot = (type === 'spot');
|
|
197934
|
+
const spotHash = 'spot:private';
|
|
197935
|
+
const swapHash = 'swap:private';
|
|
197936
|
+
const subscriptionHash = isSpot ? spotHash : swapHash;
|
|
197937
|
+
const spotMessageHash = 'spot:order';
|
|
197938
|
+
const swapMessageHash = 'swap:order';
|
|
197939
|
+
let messageHash = isSpot ? spotMessageHash : swapMessageHash;
|
|
197940
|
+
if (market !== undefined) {
|
|
197941
|
+
messageHash += ':' + symbol;
|
|
197942
|
+
}
|
|
197943
|
+
const url = this.urls['api']['ws'][type] + '?listenKey=' + this.options['listenKey'];
|
|
197944
|
+
let request = undefined;
|
|
197945
|
+
const uuid = this.uuid();
|
|
197946
|
+
if (isSpot) {
|
|
197947
|
+
request = {
|
|
197948
|
+
'id': uuid,
|
|
197949
|
+
'dataType': 'spot.executionReport',
|
|
197950
|
+
};
|
|
197951
|
+
}
|
|
197952
|
+
const orders = await this.watch(url, messageHash, request, subscriptionHash);
|
|
197953
|
+
if (this.newUpdates) {
|
|
197954
|
+
limit = orders.getLimit(symbol, limit);
|
|
197955
|
+
}
|
|
197956
|
+
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
197957
|
+
}
|
|
197958
|
+
async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
197959
|
+
/**
|
|
197960
|
+
* @method
|
|
197961
|
+
* @name bingx#watchMyTrades
|
|
197962
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
|
197963
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
197964
|
+
* @description watches information on multiple trades made by the user
|
|
197965
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
197966
|
+
* @param {int} [since] the earliest time in ms to trades orders for
|
|
197967
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
197968
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
197969
|
+
* @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure
|
|
197970
|
+
*/
|
|
197971
|
+
await this.loadMarkets();
|
|
197972
|
+
await this.authenticate();
|
|
197973
|
+
let type = undefined;
|
|
197974
|
+
let market = undefined;
|
|
197975
|
+
if (symbol !== undefined) {
|
|
197976
|
+
market = this.market(symbol);
|
|
197977
|
+
symbol = market['symbol'];
|
|
197978
|
+
}
|
|
197979
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
197980
|
+
const isSpot = (type === 'spot');
|
|
197981
|
+
const spotSubHash = 'spot:private';
|
|
197982
|
+
const swapSubHash = 'swap:private';
|
|
197983
|
+
const subscriptionHash = isSpot ? spotSubHash : swapSubHash;
|
|
197984
|
+
const spotMessageHash = 'spot:mytrades';
|
|
197985
|
+
const swapMessageHash = 'swap:mytrades';
|
|
197986
|
+
let messageHash = isSpot ? spotMessageHash : swapMessageHash;
|
|
197987
|
+
if (market !== undefined) {
|
|
197988
|
+
messageHash += ':' + symbol;
|
|
197989
|
+
}
|
|
197990
|
+
const url = this.urls['api']['ws'][type] + '?listenKey=' + this.options['listenKey'];
|
|
197991
|
+
let request = undefined;
|
|
197992
|
+
const uuid = this.uuid();
|
|
197993
|
+
if (isSpot) {
|
|
197994
|
+
request = {
|
|
197995
|
+
'id': uuid,
|
|
197996
|
+
'dataType': 'spot.executionReport',
|
|
197997
|
+
};
|
|
197998
|
+
}
|
|
197999
|
+
const trades = await this.watch(url, messageHash, request, subscriptionHash);
|
|
198000
|
+
if (this.newUpdates) {
|
|
198001
|
+
limit = trades.getLimit(symbol, limit);
|
|
198002
|
+
}
|
|
198003
|
+
return this.filterBySymbolSinceLimit(trades, symbol, since, limit, true);
|
|
198004
|
+
}
|
|
198005
|
+
async watchBalance(params = {}) {
|
|
198006
|
+
/**
|
|
198007
|
+
* @method
|
|
198008
|
+
* @name bingx#watchBalance
|
|
198009
|
+
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
|
198010
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
198011
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
198012
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
198013
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/en/latest/manual.html?#balance-structure}
|
|
198014
|
+
*/
|
|
198015
|
+
await this.loadMarkets();
|
|
198016
|
+
await this.authenticate();
|
|
198017
|
+
let type = undefined;
|
|
198018
|
+
[type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params);
|
|
198019
|
+
const isSpot = (type === 'spot');
|
|
198020
|
+
const spotSubHash = 'spot:balance';
|
|
198021
|
+
const swapSubHash = 'swap:private';
|
|
198022
|
+
const spotMessageHash = 'spot:balance';
|
|
198023
|
+
const swapMessageHash = 'swap:balance';
|
|
198024
|
+
const messageHash = isSpot ? spotMessageHash : swapMessageHash;
|
|
198025
|
+
const subscriptionHash = isSpot ? spotSubHash : swapSubHash;
|
|
198026
|
+
const url = this.urls['api']['ws'][type] + '?listenKey=' + this.options['listenKey'];
|
|
198027
|
+
let request = undefined;
|
|
198028
|
+
const uuid = this.uuid();
|
|
198029
|
+
if (type === 'spot') {
|
|
198030
|
+
request = {
|
|
198031
|
+
'id': uuid,
|
|
198032
|
+
'dataType': 'ACCOUNT_UPDATE',
|
|
198033
|
+
};
|
|
198034
|
+
}
|
|
198035
|
+
return await this.watch(url, messageHash, request, subscriptionHash);
|
|
198036
|
+
}
|
|
198037
|
+
handleErrorMessage(client, message) {
|
|
198038
|
+
//
|
|
198039
|
+
// { code: 100400, msg: '', timestamp: 1696245808833 }
|
|
198040
|
+
//
|
|
198041
|
+
// {
|
|
198042
|
+
// code: 100500,
|
|
198043
|
+
// id: '9cd37d32-da98-440b-bd04-37e7dbcf51ad',
|
|
198044
|
+
// msg: '',
|
|
198045
|
+
// timestamp: 1696245842307
|
|
198046
|
+
// }
|
|
198047
|
+
const code = this.safeString(message, 'code');
|
|
198048
|
+
try {
|
|
198049
|
+
if (code !== undefined) {
|
|
198050
|
+
const feedback = this.id + ' ' + this.json(message);
|
|
198051
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
|
|
198052
|
+
}
|
|
198053
|
+
}
|
|
198054
|
+
catch (e) {
|
|
198055
|
+
client.reject(e);
|
|
198056
|
+
}
|
|
198057
|
+
return true;
|
|
198058
|
+
}
|
|
198059
|
+
async authenticate(params = {}) {
|
|
198060
|
+
const time = this.milliseconds();
|
|
198061
|
+
const listenKey = this.safeString(this.options, 'listenKey');
|
|
198062
|
+
if (listenKey === undefined) {
|
|
198063
|
+
const response = await this.userAuthPrivatePostUserDataStream();
|
|
198064
|
+
this.options['listenKey'] = this.safeString(response, 'listenKey');
|
|
198065
|
+
this.options['lastAuthenticatedTime'] = time;
|
|
198066
|
+
return;
|
|
198067
|
+
}
|
|
198068
|
+
const lastAuthenticatedTime = this.safeInteger(this.options, 'lastAuthenticatedTime', 0);
|
|
198069
|
+
const listenKeyRefreshRate = this.safeInteger(this.options, 'listenKeyRefreshRate', 3600000); // 1 hour
|
|
198070
|
+
if (time - lastAuthenticatedTime > listenKeyRefreshRate) {
|
|
198071
|
+
const response = await this.userAuthPrivatePostUserDataStream({ 'listenKey': listenKey }); // extend the expiry
|
|
198072
|
+
this.options['listenKey'] = this.safeString(response, 'listenKey');
|
|
198073
|
+
this.options['lastAuthenticatedTime'] = time;
|
|
198074
|
+
}
|
|
198075
|
+
}
|
|
198076
|
+
async pong(client, message) {
|
|
198077
|
+
//
|
|
198078
|
+
// spot
|
|
198079
|
+
// {
|
|
198080
|
+
// ping: '5963ba3db76049b2870f9a686b2ebaac',
|
|
198081
|
+
// time: '2023-10-02T18:51:55.089+0800'
|
|
198082
|
+
// }
|
|
198083
|
+
// swap
|
|
198084
|
+
// Ping
|
|
198085
|
+
//
|
|
198086
|
+
if (message === 'Ping') {
|
|
198087
|
+
await client.send('Pong');
|
|
198088
|
+
}
|
|
198089
|
+
else {
|
|
198090
|
+
const ping = this.safeString(message, 'ping');
|
|
198091
|
+
const time = this.safeString(message, 'time');
|
|
198092
|
+
await client.send({
|
|
198093
|
+
'pong': ping,
|
|
198094
|
+
'time': time,
|
|
198095
|
+
});
|
|
198096
|
+
}
|
|
198097
|
+
}
|
|
198098
|
+
handleOrder(client, message) {
|
|
198099
|
+
//
|
|
198100
|
+
// {
|
|
198101
|
+
// "code": 0,
|
|
198102
|
+
// "dataType": "spot.executionReport",
|
|
198103
|
+
// "data": {
|
|
198104
|
+
// "e": "executionReport",
|
|
198105
|
+
// "E": 1694680212947,
|
|
198106
|
+
// "s": "LTC-USDT",
|
|
198107
|
+
// "S": "BUY",
|
|
198108
|
+
// "o": "LIMIT",
|
|
198109
|
+
// "q": 0.1,
|
|
198110
|
+
// "p": 50,
|
|
198111
|
+
// "x": "NEW",
|
|
198112
|
+
// "X": "PENDING",
|
|
198113
|
+
// "i": 1702238305204043800,
|
|
198114
|
+
// "l": 0,
|
|
198115
|
+
// "z": 0,
|
|
198116
|
+
// "L": 0,
|
|
198117
|
+
// "n": 0,
|
|
198118
|
+
// "N": "",
|
|
198119
|
+
// "T": 0,
|
|
198120
|
+
// "t": 0,
|
|
198121
|
+
// "O": 1694680212676,
|
|
198122
|
+
// "Z": 0,
|
|
198123
|
+
// "Y": 0,
|
|
198124
|
+
// "Q": 0,
|
|
198125
|
+
// "m": false
|
|
198126
|
+
// }
|
|
198127
|
+
// }
|
|
198128
|
+
//
|
|
198129
|
+
// {
|
|
198130
|
+
// code: 0,
|
|
198131
|
+
// dataType: 'spot.executionReport',
|
|
198132
|
+
// data: {
|
|
198133
|
+
// e: 'executionReport',
|
|
198134
|
+
// E: 1694681809302,
|
|
198135
|
+
// s: 'LTC-USDT',
|
|
198136
|
+
// S: 'BUY',
|
|
198137
|
+
// o: 'MARKET',
|
|
198138
|
+
// q: 0,
|
|
198139
|
+
// p: 62.29,
|
|
198140
|
+
// x: 'TRADE',
|
|
198141
|
+
// X: 'FILLED',
|
|
198142
|
+
// i: '1702245001712369664',
|
|
198143
|
+
// l: 0.0802,
|
|
198144
|
+
// z: 0.0802,
|
|
198145
|
+
// L: 62.308,
|
|
198146
|
+
// n: -0.0000802,
|
|
198147
|
+
// N: 'LTC',
|
|
198148
|
+
// T: 1694681809256,
|
|
198149
|
+
// t: 38259147,
|
|
198150
|
+
// O: 1694681809248,
|
|
198151
|
+
// Z: 4.9971016,
|
|
198152
|
+
// Y: 4.9971016,
|
|
198153
|
+
// Q: 5,
|
|
198154
|
+
// m: false
|
|
198155
|
+
// }
|
|
198156
|
+
// }
|
|
198157
|
+
// swap
|
|
198158
|
+
// {
|
|
198159
|
+
// "e": "ORDER_TRADE_UPDATE",
|
|
198160
|
+
// "E": 1696843635475,
|
|
198161
|
+
// "o": {
|
|
198162
|
+
// "s": "LTC-USDT",
|
|
198163
|
+
// "c": "",
|
|
198164
|
+
// "i": "1711312357852147712",
|
|
198165
|
+
// "S": "BUY",
|
|
198166
|
+
// "o": "MARKET",
|
|
198167
|
+
// "q": "0.10000000",
|
|
198168
|
+
// "p": "64.35010000",
|
|
198169
|
+
// "ap": "64.36000000",
|
|
198170
|
+
// "x": "TRADE",
|
|
198171
|
+
// "X": "FILLED",
|
|
198172
|
+
// "N": "USDT",
|
|
198173
|
+
// "n": "-0.00321800",
|
|
198174
|
+
// "T": 0,
|
|
198175
|
+
// "wt": "MARK_PRICE",
|
|
198176
|
+
// "ps": "LONG",
|
|
198177
|
+
// "rp": "0.00000000",
|
|
198178
|
+
// "z": "0.10000000"
|
|
198179
|
+
// }
|
|
198180
|
+
// }
|
|
198181
|
+
//
|
|
198182
|
+
const isSpot = ('dataType' in message);
|
|
198183
|
+
const data = this.safeValue2(message, 'data', 'o', {});
|
|
198184
|
+
if (this.orders === undefined) {
|
|
198185
|
+
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
|
198186
|
+
this.orders = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
198187
|
+
}
|
|
198188
|
+
const stored = this.orders;
|
|
198189
|
+
const parsedOrder = this.parseOrder(data);
|
|
198190
|
+
stored.append(parsedOrder);
|
|
198191
|
+
const symbol = parsedOrder['symbol'];
|
|
198192
|
+
const spotHash = 'spot:order';
|
|
198193
|
+
const swapHash = 'swap:order';
|
|
198194
|
+
const messageHash = (isSpot) ? spotHash : swapHash;
|
|
198195
|
+
client.resolve(stored, messageHash);
|
|
198196
|
+
client.resolve(stored, messageHash + ':' + symbol);
|
|
198197
|
+
}
|
|
198198
|
+
handleMyTrades(client, message) {
|
|
198199
|
+
//
|
|
198200
|
+
//
|
|
198201
|
+
// {
|
|
198202
|
+
// code: 0,
|
|
198203
|
+
// dataType: 'spot.executionReport',
|
|
198204
|
+
// data: {
|
|
198205
|
+
// e: 'executionReport',
|
|
198206
|
+
// E: 1694681809302,
|
|
198207
|
+
// s: 'LTC-USDT',
|
|
198208
|
+
// S: 'BUY',
|
|
198209
|
+
// o: 'MARKET',
|
|
198210
|
+
// q: 0,
|
|
198211
|
+
// p: 62.29,
|
|
198212
|
+
// x: 'TRADE',
|
|
198213
|
+
// X: 'FILLED',
|
|
198214
|
+
// i: '1702245001712369664',
|
|
198215
|
+
// l: 0.0802,
|
|
198216
|
+
// z: 0.0802,
|
|
198217
|
+
// L: 62.308,
|
|
198218
|
+
// n: -0.0000802,
|
|
198219
|
+
// N: 'LTC',
|
|
198220
|
+
// T: 1694681809256,
|
|
198221
|
+
// t: 38259147,
|
|
198222
|
+
// O: 1694681809248,
|
|
198223
|
+
// Z: 4.9971016,
|
|
198224
|
+
// Y: 4.9971016,
|
|
198225
|
+
// Q: 5,
|
|
198226
|
+
// m: false
|
|
198227
|
+
// }
|
|
198228
|
+
// }
|
|
198229
|
+
//
|
|
198230
|
+
// swap
|
|
198231
|
+
// {
|
|
198232
|
+
// "e": "ORDER_TRADE_UPDATE",
|
|
198233
|
+
// "E": 1696843635475,
|
|
198234
|
+
// "o": {
|
|
198235
|
+
// "s": "LTC-USDT",
|
|
198236
|
+
// "c": "",
|
|
198237
|
+
// "i": "1711312357852147712",
|
|
198238
|
+
// "S": "BUY",
|
|
198239
|
+
// "o": "MARKET",
|
|
198240
|
+
// "q": "0.10000000",
|
|
198241
|
+
// "p": "64.35010000",
|
|
198242
|
+
// "ap": "64.36000000",
|
|
198243
|
+
// "x": "TRADE",
|
|
198244
|
+
// "X": "FILLED",
|
|
198245
|
+
// "N": "USDT",
|
|
198246
|
+
// "n": "-0.00321800",
|
|
198247
|
+
// "T": 0,
|
|
198248
|
+
// "wt": "MARK_PRICE",
|
|
198249
|
+
// "ps": "LONG",
|
|
198250
|
+
// "rp": "0.00000000",
|
|
198251
|
+
// "z": "0.10000000"
|
|
198252
|
+
// }
|
|
198253
|
+
// }
|
|
198254
|
+
//
|
|
198255
|
+
const isSpot = ('dataType' in message);
|
|
198256
|
+
const result = this.safeValue2(message, 'data', 'o', {});
|
|
198257
|
+
let cachedTrades = this.myTrades;
|
|
198258
|
+
if (cachedTrades === undefined) {
|
|
198259
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
198260
|
+
cachedTrades = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolById */ .hl(limit);
|
|
198261
|
+
this.myTrades = cachedTrades;
|
|
198262
|
+
}
|
|
198263
|
+
const parsed = this.parseTrade(result);
|
|
198264
|
+
const symbol = parsed['symbol'];
|
|
198265
|
+
const spotHash = 'spot:mytrades';
|
|
198266
|
+
const swapHash = 'swap:mytrades';
|
|
198267
|
+
const messageHash = isSpot ? spotHash : swapHash;
|
|
198268
|
+
cachedTrades.append(parsed);
|
|
198269
|
+
client.resolve(cachedTrades, messageHash);
|
|
198270
|
+
client.resolve(cachedTrades, messageHash + ':' + symbol);
|
|
198271
|
+
}
|
|
198272
|
+
handleBalance(client, message) {
|
|
198273
|
+
// spot
|
|
198274
|
+
// {
|
|
198275
|
+
// "e":"ACCOUNT_UPDATE",
|
|
198276
|
+
// "E":1696242817000,
|
|
198277
|
+
// "T":1696242817142,
|
|
198278
|
+
// "a":{
|
|
198279
|
+
// "B":[
|
|
198280
|
+
// {
|
|
198281
|
+
// "a":"USDT",
|
|
198282
|
+
// "bc":"-1.00000000000000000000",
|
|
198283
|
+
// "cw":"86.59497382000000050000",
|
|
198284
|
+
// "wb":"86.59497382000000050000"
|
|
198285
|
+
// }
|
|
198286
|
+
// ],
|
|
198287
|
+
// "m":"ASSET_TRANSFER"
|
|
198288
|
+
// }
|
|
198289
|
+
// }
|
|
198290
|
+
// swap
|
|
198291
|
+
// {
|
|
198292
|
+
// "e":"ACCOUNT_UPDATE",
|
|
198293
|
+
// "E":1696244249320,
|
|
198294
|
+
// "a":{
|
|
198295
|
+
// "m":"WITHDRAW",
|
|
198296
|
+
// "B":[
|
|
198297
|
+
// {
|
|
198298
|
+
// "a":"USDT",
|
|
198299
|
+
// "wb":"49.81083984",
|
|
198300
|
+
// "cw":"49.81083984",
|
|
198301
|
+
// "bc":"-1.00000000"
|
|
198302
|
+
// }
|
|
198303
|
+
// ],
|
|
198304
|
+
// "P":[
|
|
198305
|
+
// ]
|
|
198306
|
+
// }
|
|
198307
|
+
// }
|
|
198308
|
+
//
|
|
198309
|
+
const a = this.safeValue(message, 'a', {});
|
|
198310
|
+
const data = this.safeValue(a, 'B', []);
|
|
198311
|
+
const timestamp = this.safeInteger2(message, 'T', 'E');
|
|
198312
|
+
const type = ('P' in a) ? 'swap' : 'spot';
|
|
198313
|
+
if (!(type in this.balance)) {
|
|
198314
|
+
this.balance[type] = {};
|
|
198315
|
+
}
|
|
198316
|
+
this.balance[type]['info'] = data;
|
|
198317
|
+
this.balance[type]['timestamp'] = timestamp;
|
|
198318
|
+
this.balance[type]['datetime'] = this.iso8601(timestamp);
|
|
198319
|
+
for (let i = 0; i < data.length; i++) {
|
|
198320
|
+
const balance = data[i];
|
|
198321
|
+
const currencyId = this.safeString(balance, 'a');
|
|
198322
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
198323
|
+
const account = (code in this.balance) ? this.balance[code] : this.account();
|
|
198324
|
+
account['total'] = this.safeString(balance, 'wb');
|
|
198325
|
+
this.balance[type][code] = account;
|
|
198326
|
+
}
|
|
198327
|
+
this.balance[type] = this.safeBalance(this.balance[type]);
|
|
198328
|
+
client.resolve(this.balance[type], type + ':balance');
|
|
198329
|
+
}
|
|
198330
|
+
handleMessage(client, message) {
|
|
198331
|
+
if (!this.handleErrorMessage(client, message)) {
|
|
198332
|
+
return;
|
|
198333
|
+
}
|
|
198334
|
+
// public subscriptions
|
|
198335
|
+
if ((message === 'Ping') || ('ping' in message)) {
|
|
198336
|
+
this.spawn(this.pong, client, message);
|
|
198337
|
+
return;
|
|
198338
|
+
}
|
|
198339
|
+
const dataType = this.safeString(message, 'dataType', '');
|
|
198340
|
+
if (dataType.indexOf('@depth') >= 0) {
|
|
198341
|
+
this.handleOrderBook(client, message);
|
|
198342
|
+
return;
|
|
198343
|
+
}
|
|
198344
|
+
if (dataType.indexOf('@trade') >= 0) {
|
|
198345
|
+
this.handleTrades(client, message);
|
|
198346
|
+
return;
|
|
198347
|
+
}
|
|
198348
|
+
if (dataType.indexOf('@kline') >= 0) {
|
|
198349
|
+
this.handleOHLCV(client, message);
|
|
198350
|
+
return;
|
|
198351
|
+
}
|
|
198352
|
+
if (dataType.indexOf('executionReport') >= 0) {
|
|
198353
|
+
const data = this.safeValue(message, 'data', {});
|
|
198354
|
+
const type = this.safeString(data, 'x');
|
|
198355
|
+
if (type === 'TRADE') {
|
|
198356
|
+
this.handleMyTrades(client, message);
|
|
198357
|
+
}
|
|
198358
|
+
this.handleOrder(client, message);
|
|
198359
|
+
return;
|
|
198360
|
+
}
|
|
198361
|
+
const e = this.safeString(message, 'e');
|
|
198362
|
+
if (e === 'ACCOUNT_UPDATE') {
|
|
198363
|
+
this.handleBalance(client, message);
|
|
198364
|
+
}
|
|
198365
|
+
if (e === 'ORDER_TRADE_UPDATE') {
|
|
198366
|
+
this.handleOrder(client, message);
|
|
198367
|
+
const data = this.safeValue(message, 'o', {});
|
|
198368
|
+
const type = this.safeString(data, 'x');
|
|
198369
|
+
const status = this.safeString(data, 'X');
|
|
198370
|
+
if ((type === 'TRADE') && (status === 'FILLED')) {
|
|
198371
|
+
this.handleMyTrades(client, message);
|
|
198372
|
+
}
|
|
198373
|
+
}
|
|
198374
|
+
}
|
|
198375
|
+
}
|
|
198376
|
+
|
|
198377
|
+
|
|
197285
198378
|
/***/ }),
|
|
197286
198379
|
|
|
197287
198380
|
/***/ 453:
|
|
@@ -216257,7 +217350,7 @@ class exmo extends _exmo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
216257
217350
|
const symbol = this.safeSymbol(marketId);
|
|
216258
217351
|
const orderBook = this.safeValue(message, 'data', {});
|
|
216259
217352
|
const messageHash = 'orderbook:' + symbol;
|
|
216260
|
-
const timestamp = this.
|
|
217353
|
+
const timestamp = this.safeInteger(message, 'ts');
|
|
216261
217354
|
let storedOrderBook = this.safeValue(this.orderbooks, symbol);
|
|
216262
217355
|
if (storedOrderBook === undefined) {
|
|
216263
217356
|
storedOrderBook = this.orderBook({});
|
|
@@ -274872,39 +275965,39 @@ var __webpack_exports__ = {};
|
|
|
274872
275965
|
(() => {
|
|
274873
275966
|
__webpack_require__.r(__webpack_exports__);
|
|
274874
275967
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
274875
|
-
/* harmony export */ "AccountNotEnabled": () => (/* reexport safe */
|
|
274876
|
-
/* harmony export */ "AccountSuspended": () => (/* reexport safe */
|
|
274877
|
-
/* harmony export */ "AddressPending": () => (/* reexport safe */
|
|
274878
|
-
/* harmony export */ "ArgumentsRequired": () => (/* reexport safe */
|
|
274879
|
-
/* harmony export */ "AuthenticationError": () => (/* reexport safe */
|
|
274880
|
-
/* harmony export */ "BadRequest": () => (/* reexport safe */
|
|
274881
|
-
/* harmony export */ "BadResponse": () => (/* reexport safe */
|
|
274882
|
-
/* harmony export */ "BadSymbol": () => (/* reexport safe */
|
|
274883
|
-
/* harmony export */ "BaseError": () => (/* reexport safe */
|
|
274884
|
-
/* harmony export */ "CancelPending": () => (/* reexport safe */
|
|
274885
|
-
/* harmony export */ "DDoSProtection": () => (/* reexport safe */
|
|
274886
|
-
/* harmony export */ "DuplicateOrderId": () => (/* reexport safe */
|
|
275968
|
+
/* harmony export */ "AccountNotEnabled": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AccountNotEnabled),
|
|
275969
|
+
/* harmony export */ "AccountSuspended": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AccountSuspended),
|
|
275970
|
+
/* harmony export */ "AddressPending": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AddressPending),
|
|
275971
|
+
/* harmony export */ "ArgumentsRequired": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ArgumentsRequired),
|
|
275972
|
+
/* harmony export */ "AuthenticationError": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.AuthenticationError),
|
|
275973
|
+
/* harmony export */ "BadRequest": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadRequest),
|
|
275974
|
+
/* harmony export */ "BadResponse": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadResponse),
|
|
275975
|
+
/* harmony export */ "BadSymbol": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BadSymbol),
|
|
275976
|
+
/* harmony export */ "BaseError": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.BaseError),
|
|
275977
|
+
/* harmony export */ "CancelPending": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.CancelPending),
|
|
275978
|
+
/* harmony export */ "DDoSProtection": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.DDoSProtection),
|
|
275979
|
+
/* harmony export */ "DuplicateOrderId": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.DuplicateOrderId),
|
|
274887
275980
|
/* harmony export */ "Exchange": () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
274888
|
-
/* harmony export */ "ExchangeError": () => (/* reexport safe */
|
|
274889
|
-
/* harmony export */ "ExchangeNotAvailable": () => (/* reexport safe */
|
|
274890
|
-
/* harmony export */ "InsufficientFunds": () => (/* reexport safe */
|
|
274891
|
-
/* harmony export */ "InvalidAddress": () => (/* reexport safe */
|
|
274892
|
-
/* harmony export */ "InvalidNonce": () => (/* reexport safe */
|
|
274893
|
-
/* harmony export */ "InvalidOrder": () => (/* reexport safe */
|
|
274894
|
-
/* harmony export */ "MarginModeAlreadySet": () => (/* reexport safe */
|
|
274895
|
-
/* harmony export */ "NetworkError": () => (/* reexport safe */
|
|
274896
|
-
/* harmony export */ "NoChange": () => (/* reexport safe */
|
|
274897
|
-
/* harmony export */ "NotSupported": () => (/* reexport safe */
|
|
274898
|
-
/* harmony export */ "NullResponse": () => (/* reexport safe */
|
|
274899
|
-
/* harmony export */ "OnMaintenance": () => (/* reexport safe */
|
|
274900
|
-
/* harmony export */ "OrderImmediatelyFillable": () => (/* reexport safe */
|
|
274901
|
-
/* harmony export */ "OrderNotCached": () => (/* reexport safe */
|
|
274902
|
-
/* harmony export */ "OrderNotFillable": () => (/* reexport safe */
|
|
274903
|
-
/* harmony export */ "OrderNotFound": () => (/* reexport safe */
|
|
274904
|
-
/* harmony export */ "PermissionDenied": () => (/* reexport safe */
|
|
274905
|
-
/* harmony export */ "Precise": () => (/* reexport safe */
|
|
274906
|
-
/* harmony export */ "RateLimitExceeded": () => (/* reexport safe */
|
|
274907
|
-
/* harmony export */ "RequestTimeout": () => (/* reexport safe */
|
|
275981
|
+
/* harmony export */ "ExchangeError": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ExchangeError),
|
|
275982
|
+
/* harmony export */ "ExchangeNotAvailable": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.ExchangeNotAvailable),
|
|
275983
|
+
/* harmony export */ "InsufficientFunds": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InsufficientFunds),
|
|
275984
|
+
/* harmony export */ "InvalidAddress": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidAddress),
|
|
275985
|
+
/* harmony export */ "InvalidNonce": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidNonce),
|
|
275986
|
+
/* harmony export */ "InvalidOrder": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.InvalidOrder),
|
|
275987
|
+
/* harmony export */ "MarginModeAlreadySet": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.MarginModeAlreadySet),
|
|
275988
|
+
/* harmony export */ "NetworkError": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NetworkError),
|
|
275989
|
+
/* harmony export */ "NoChange": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NoChange),
|
|
275990
|
+
/* harmony export */ "NotSupported": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NotSupported),
|
|
275991
|
+
/* harmony export */ "NullResponse": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.NullResponse),
|
|
275992
|
+
/* harmony export */ "OnMaintenance": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OnMaintenance),
|
|
275993
|
+
/* harmony export */ "OrderImmediatelyFillable": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderImmediatelyFillable),
|
|
275994
|
+
/* harmony export */ "OrderNotCached": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotCached),
|
|
275995
|
+
/* harmony export */ "OrderNotFillable": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotFillable),
|
|
275996
|
+
/* harmony export */ "OrderNotFound": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.OrderNotFound),
|
|
275997
|
+
/* harmony export */ "PermissionDenied": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.PermissionDenied),
|
|
275998
|
+
/* harmony export */ "Precise": () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__.O),
|
|
275999
|
+
/* harmony export */ "RateLimitExceeded": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.RateLimitExceeded),
|
|
276000
|
+
/* harmony export */ "RequestTimeout": () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__.RequestTimeout),
|
|
274908
276001
|
/* harmony export */ "ace": () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
274909
276002
|
/* harmony export */ "alpaca": () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
274910
276003
|
/* harmony export */ "ascendex": () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -274961,11 +276054,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
274961
276054
|
/* harmony export */ "delta": () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
274962
276055
|
/* harmony export */ "deribit": () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
274963
276056
|
/* harmony export */ "digifinex": () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
274964
|
-
/* harmony export */ "errors": () => (/* reexport module object */
|
|
276057
|
+
/* harmony export */ "errors": () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__),
|
|
274965
276058
|
/* harmony export */ "exchanges": () => (/* binding */ exchanges),
|
|
274966
276059
|
/* harmony export */ "exmo": () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
274967
276060
|
/* harmony export */ "fmfwio": () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
274968
|
-
/* harmony export */ "functions": () => (/* reexport module object */
|
|
276061
|
+
/* harmony export */ "functions": () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__),
|
|
274969
276062
|
/* harmony export */ "gate": () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_58__.Z),
|
|
274970
276063
|
/* harmony export */ "gateio": () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_59__.Z),
|
|
274971
276064
|
/* harmony export */ "gemini": () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_60__.Z),
|
|
@@ -275018,9 +276111,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
275018
276111
|
/* harmony export */ "zonda": () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_105__.Z)
|
|
275019
276112
|
/* harmony export */ });
|
|
275020
276113
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
275021
|
-
/* harmony import */ var
|
|
275022
|
-
/* harmony import */ var
|
|
275023
|
-
/* harmony import */ var
|
|
276114
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(2194);
|
|
276115
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(7100);
|
|
276116
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(6689);
|
|
275024
276117
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
275025
276118
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
275026
276119
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -275133,58 +276226,59 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
275133
276226
|
/* harmony import */ var _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(5078);
|
|
275134
276227
|
/* harmony import */ var _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(1326);
|
|
275135
276228
|
/* harmony import */ var _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(1230);
|
|
275136
|
-
/* harmony import */ var
|
|
275137
|
-
/* harmony import */ var
|
|
275138
|
-
/* harmony import */ var
|
|
275139
|
-
/* harmony import */ var
|
|
275140
|
-
/* harmony import */ var
|
|
275141
|
-
/* harmony import */ var
|
|
275142
|
-
/* harmony import */ var
|
|
275143
|
-
/* harmony import */ var
|
|
275144
|
-
/* harmony import */ var
|
|
275145
|
-
/* harmony import */ var
|
|
275146
|
-
/* harmony import */ var
|
|
275147
|
-
/* harmony import */ var
|
|
275148
|
-
/* harmony import */ var
|
|
275149
|
-
/* harmony import */ var
|
|
275150
|
-
/* harmony import */ var
|
|
275151
|
-
/* harmony import */ var
|
|
275152
|
-
/* harmony import */ var
|
|
275153
|
-
/* harmony import */ var
|
|
275154
|
-
/* harmony import */ var
|
|
275155
|
-
/* harmony import */ var
|
|
275156
|
-
/* harmony import */ var
|
|
275157
|
-
/* harmony import */ var
|
|
275158
|
-
/* harmony import */ var
|
|
275159
|
-
/* harmony import */ var
|
|
275160
|
-
/* harmony import */ var
|
|
275161
|
-
/* harmony import */ var
|
|
275162
|
-
/* harmony import */ var
|
|
275163
|
-
/* harmony import */ var
|
|
275164
|
-
/* harmony import */ var
|
|
275165
|
-
/* harmony import */ var
|
|
275166
|
-
/* harmony import */ var
|
|
275167
|
-
/* harmony import */ var
|
|
275168
|
-
/* harmony import */ var
|
|
275169
|
-
/* harmony import */ var
|
|
275170
|
-
/* harmony import */ var
|
|
275171
|
-
/* harmony import */ var
|
|
275172
|
-
/* harmony import */ var
|
|
275173
|
-
/* harmony import */ var
|
|
275174
|
-
/* harmony import */ var
|
|
275175
|
-
/* harmony import */ var
|
|
275176
|
-
/* harmony import */ var
|
|
275177
|
-
/* harmony import */ var
|
|
275178
|
-
/* harmony import */ var
|
|
275179
|
-
/* harmony import */ var
|
|
275180
|
-
/* harmony import */ var
|
|
275181
|
-
/* harmony import */ var
|
|
275182
|
-
/* harmony import */ var
|
|
275183
|
-
/* harmony import */ var
|
|
275184
|
-
/* harmony import */ var
|
|
275185
|
-
/* harmony import */ var
|
|
275186
|
-
/* harmony import */ var
|
|
275187
|
-
/* harmony import */ var
|
|
276229
|
+
/* harmony import */ var _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(6955);
|
|
276230
|
+
/* harmony import */ var _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(453);
|
|
276231
|
+
/* harmony import */ var _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(9772);
|
|
276232
|
+
/* harmony import */ var _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(588);
|
|
276233
|
+
/* harmony import */ var _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(1885);
|
|
276234
|
+
/* harmony import */ var _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(7504);
|
|
276235
|
+
/* harmony import */ var _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(2302);
|
|
276236
|
+
/* harmony import */ var _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(2191);
|
|
276237
|
+
/* harmony import */ var _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(1297);
|
|
276238
|
+
/* harmony import */ var _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(3005);
|
|
276239
|
+
/* harmony import */ var _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(3623);
|
|
276240
|
+
/* harmony import */ var _src_pro_bittrex_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(2883);
|
|
276241
|
+
/* harmony import */ var _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(6977);
|
|
276242
|
+
/* harmony import */ var _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(2519);
|
|
276243
|
+
/* harmony import */ var _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(5030);
|
|
276244
|
+
/* harmony import */ var _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(5272);
|
|
276245
|
+
/* harmony import */ var _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(3414);
|
|
276246
|
+
/* harmony import */ var _src_pro_coinbaseprime_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(3848);
|
|
276247
|
+
/* harmony import */ var _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(8368);
|
|
276248
|
+
/* harmony import */ var _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(204);
|
|
276249
|
+
/* harmony import */ var _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(6820);
|
|
276250
|
+
/* harmony import */ var _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(2952);
|
|
276251
|
+
/* harmony import */ var _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(1788);
|
|
276252
|
+
/* harmony import */ var _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(9004);
|
|
276253
|
+
/* harmony import */ var _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(8335);
|
|
276254
|
+
/* harmony import */ var _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(1465);
|
|
276255
|
+
/* harmony import */ var _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(9488);
|
|
276256
|
+
/* harmony import */ var _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(5189);
|
|
276257
|
+
/* harmony import */ var _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(8559);
|
|
276258
|
+
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(8384);
|
|
276259
|
+
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(9021);
|
|
276260
|
+
/* harmony import */ var _src_pro_huobipro_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(4625);
|
|
276261
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(3484);
|
|
276262
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(1311);
|
|
276263
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(736);
|
|
276264
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(449);
|
|
276265
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(2387);
|
|
276266
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(7181);
|
|
276267
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(627);
|
|
276268
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(6484);
|
|
276269
|
+
/* harmony import */ var _src_pro_mexc3_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(5351);
|
|
276270
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(8080);
|
|
276271
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(7105);
|
|
276272
|
+
/* harmony import */ var _src_pro_okex_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(1530);
|
|
276273
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(2214);
|
|
276274
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(4360);
|
|
276275
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(7924);
|
|
276276
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(3541);
|
|
276277
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(9782);
|
|
276278
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(7614);
|
|
276279
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(4828);
|
|
276280
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(5630);
|
|
276281
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(3910);
|
|
275188
276282
|
/*
|
|
275189
276283
|
|
|
275190
276284
|
MIT License
|
|
@@ -275219,7 +276313,7 @@ SOFTWARE.
|
|
|
275219
276313
|
|
|
275220
276314
|
//-----------------------------------------------------------------------------
|
|
275221
276315
|
// this is updated by vss.js when building
|
|
275222
|
-
const version = '4.1.
|
|
276316
|
+
const version = '4.1.9';
|
|
275223
276317
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
275224
276318
|
//-----------------------------------------------------------------------------
|
|
275225
276319
|
|
|
@@ -275385,6 +276479,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e
|
|
|
275385
276479
|
|
|
275386
276480
|
|
|
275387
276481
|
|
|
276482
|
+
|
|
275388
276483
|
|
|
275389
276484
|
|
|
275390
276485
|
const exchanges = {
|
|
@@ -275502,58 +276597,59 @@ const pro = {
|
|
|
275502
276597
|
'binancecoinm': _src_pro_binancecoinm_js__WEBPACK_IMPORTED_MODULE_110__/* ["default"] */ .Z,
|
|
275503
276598
|
'binanceus': _src_pro_binanceus_js__WEBPACK_IMPORTED_MODULE_111__/* ["default"] */ .Z,
|
|
275504
276599
|
'binanceusdm': _src_pro_binanceusdm_js__WEBPACK_IMPORTED_MODULE_112__/* ["default"] */ .Z,
|
|
275505
|
-
'
|
|
275506
|
-
'
|
|
275507
|
-
'
|
|
275508
|
-
'
|
|
275509
|
-
'
|
|
275510
|
-
'
|
|
275511
|
-
'
|
|
275512
|
-
'
|
|
275513
|
-
'
|
|
275514
|
-
'
|
|
275515
|
-
'
|
|
275516
|
-
'
|
|
275517
|
-
'
|
|
275518
|
-
'
|
|
275519
|
-
'
|
|
275520
|
-
'
|
|
275521
|
-
'
|
|
275522
|
-
'
|
|
275523
|
-
'
|
|
275524
|
-
'
|
|
275525
|
-
'
|
|
275526
|
-
'
|
|
275527
|
-
'
|
|
275528
|
-
'
|
|
275529
|
-
'
|
|
275530
|
-
'
|
|
275531
|
-
'
|
|
275532
|
-
'
|
|
275533
|
-
'
|
|
275534
|
-
'
|
|
275535
|
-
'
|
|
275536
|
-
'
|
|
275537
|
-
'
|
|
275538
|
-
'
|
|
275539
|
-
'
|
|
275540
|
-
'
|
|
275541
|
-
'
|
|
275542
|
-
'
|
|
275543
|
-
'
|
|
275544
|
-
'
|
|
275545
|
-
'
|
|
275546
|
-
'
|
|
275547
|
-
'
|
|
275548
|
-
'
|
|
275549
|
-
'
|
|
275550
|
-
'
|
|
275551
|
-
'
|
|
275552
|
-
'
|
|
275553
|
-
'
|
|
275554
|
-
'
|
|
275555
|
-
'
|
|
275556
|
-
'
|
|
276600
|
+
'bingx': _src_pro_bingx_js__WEBPACK_IMPORTED_MODULE_113__/* ["default"] */ .Z,
|
|
276601
|
+
'bitcoincom': _src_pro_bitcoincom_js__WEBPACK_IMPORTED_MODULE_114__/* ["default"] */ .Z,
|
|
276602
|
+
'bitfinex': _src_pro_bitfinex_js__WEBPACK_IMPORTED_MODULE_115__/* ["default"] */ .Z,
|
|
276603
|
+
'bitfinex2': _src_pro_bitfinex2_js__WEBPACK_IMPORTED_MODULE_116__/* ["default"] */ .Z,
|
|
276604
|
+
'bitget': _src_pro_bitget_js__WEBPACK_IMPORTED_MODULE_117__/* ["default"] */ .Z,
|
|
276605
|
+
'bitmart': _src_pro_bitmart_js__WEBPACK_IMPORTED_MODULE_118__/* ["default"] */ .Z,
|
|
276606
|
+
'bitmex': _src_pro_bitmex_js__WEBPACK_IMPORTED_MODULE_119__/* ["default"] */ .Z,
|
|
276607
|
+
'bitopro': _src_pro_bitopro_js__WEBPACK_IMPORTED_MODULE_120__/* ["default"] */ .Z,
|
|
276608
|
+
'bitpanda': _src_pro_bitpanda_js__WEBPACK_IMPORTED_MODULE_121__/* ["default"] */ .Z,
|
|
276609
|
+
'bitrue': _src_pro_bitrue_js__WEBPACK_IMPORTED_MODULE_122__/* ["default"] */ .Z,
|
|
276610
|
+
'bitstamp': _src_pro_bitstamp_js__WEBPACK_IMPORTED_MODULE_123__/* ["default"] */ .Z,
|
|
276611
|
+
'bittrex': _src_pro_bittrex_js__WEBPACK_IMPORTED_MODULE_124__/* ["default"] */ .Z,
|
|
276612
|
+
'bitvavo': _src_pro_bitvavo_js__WEBPACK_IMPORTED_MODULE_125__/* ["default"] */ .Z,
|
|
276613
|
+
'blockchaincom': _src_pro_blockchaincom_js__WEBPACK_IMPORTED_MODULE_126__/* ["default"] */ .Z,
|
|
276614
|
+
'bybit': _src_pro_bybit_js__WEBPACK_IMPORTED_MODULE_127__/* ["default"] */ .Z,
|
|
276615
|
+
'cex': _src_pro_cex_js__WEBPACK_IMPORTED_MODULE_128__/* ["default"] */ .Z,
|
|
276616
|
+
'coinbase': _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_129__/* ["default"] */ .Z,
|
|
276617
|
+
'coinbaseprime': _src_pro_coinbaseprime_js__WEBPACK_IMPORTED_MODULE_130__/* ["default"] */ .Z,
|
|
276618
|
+
'coinbasepro': _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_131__/* ["default"] */ .Z,
|
|
276619
|
+
'coinex': _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_132__/* ["default"] */ .Z,
|
|
276620
|
+
'cryptocom': _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_133__/* ["default"] */ .Z,
|
|
276621
|
+
'currencycom': _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_134__/* ["default"] */ .Z,
|
|
276622
|
+
'deribit': _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_135__/* ["default"] */ .Z,
|
|
276623
|
+
'exmo': _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_136__/* ["default"] */ .Z,
|
|
276624
|
+
'gate': _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_137__/* ["default"] */ .Z,
|
|
276625
|
+
'gateio': _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
276626
|
+
'gemini': _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
276627
|
+
'hitbtc': _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
276628
|
+
'hollaex': _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
276629
|
+
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
276630
|
+
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
276631
|
+
'huobipro': _src_pro_huobipro_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
276632
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
276633
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
276634
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
276635
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
276636
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
276637
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
276638
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
276639
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
276640
|
+
'mexc3': _src_pro_mexc3_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
276641
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
276642
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
276643
|
+
'okex': _src_pro_okex_js__WEBPACK_IMPORTED_MODULE_156__/* ["default"] */ .Z,
|
|
276644
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_157__/* ["default"] */ .Z,
|
|
276645
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_158__/* ["default"] */ .Z,
|
|
276646
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_159__/* ["default"] */ .Z,
|
|
276647
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_160__/* ["default"] */ .Z,
|
|
276648
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_161__/* ["default"] */ .Z,
|
|
276649
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_162__/* ["default"] */ .Z,
|
|
276650
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_163__/* ["default"] */ .Z,
|
|
276651
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_164__/* ["default"] */ .Z,
|
|
276652
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_165__/* ["default"] */ .Z,
|
|
275557
276653
|
};
|
|
275558
276654
|
for (const exchange in pro) {
|
|
275559
276655
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -275566,7 +276662,7 @@ for (const exchange in pro) {
|
|
|
275566
276662
|
pro.exchanges = Object.keys(pro);
|
|
275567
276663
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
275568
276664
|
//-----------------------------------------------------------------------------
|
|
275569
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
276665
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_166__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_167__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_168__);
|
|
275570
276666
|
|
|
275571
276667
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
275572
276668
|
//-----------------------------------------------------------------------------
|