ccxt 4.2.14 → 4.2.16
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/README.md +3 -3
- package/dist/ccxt.browser.js +805 -184
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/js/ccxt.js +3 -1
- package/dist/cjs/js/src/ascendex.js +11 -6
- package/dist/cjs/js/src/base/Exchange.js +12 -12
- package/dist/cjs/js/src/binance.js +2 -2
- package/dist/cjs/js/src/bingx.js +41 -6
- package/dist/cjs/js/src/bitget.js +3 -3
- package/dist/cjs/js/src/bitmex.js +3 -6
- package/dist/cjs/js/src/bybit.js +3 -3
- package/dist/cjs/js/src/coinex.js +3 -3
- package/dist/cjs/js/src/coinone.js +1 -1
- package/dist/cjs/js/src/gate.js +3 -3
- package/dist/cjs/js/src/htx.js +2 -2
- package/dist/cjs/js/src/kraken.js +24 -2
- package/dist/cjs/js/src/kucoin.js +1 -1
- package/dist/cjs/js/src/kucoinfutures.js +2 -2
- package/dist/cjs/js/src/okx.js +1 -1
- package/dist/cjs/js/src/phemex.js +28 -25
- package/dist/cjs/js/src/pro/coinone.js +411 -0
- package/dist/cjs/js/src/pro/htx.js +6 -1
- package/dist/cjs/js/src/pro/krakenfutures.js +7 -1
- package/dist/cjs/js/src/pro/woo.js +126 -0
- package/dist/cjs/js/src/woo.js +3 -3
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/ascendex.js +11 -6
- package/js/src/base/Exchange.js +12 -12
- package/js/src/binance.js +2 -2
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +42 -7
- package/js/src/bitget.js +3 -3
- package/js/src/bitmex.js +3 -6
- package/js/src/bybit.js +3 -3
- package/js/src/coinex.js +3 -3
- package/js/src/coinone.js +1 -1
- package/js/src/gate.js +3 -3
- package/js/src/htx.js +2 -2
- package/js/src/kraken.d.ts +1 -0
- package/js/src/kraken.js +24 -2
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/okx.js +1 -1
- package/js/src/phemex.js +28 -25
- package/js/src/pro/coinone.d.ts +21 -0
- package/js/src/pro/coinone.js +412 -0
- package/js/src/pro/htx.js +6 -1
- package/js/src/pro/krakenfutures.js +7 -1
- package/js/src/pro/woo.d.ts +5 -1
- package/js/src/pro/woo.js +127 -1
- package/js/src/woo.js +3 -3
- package/package.json +1 -1
- package/skip-tests.json +1 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -4429,12 +4429,14 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4429
4429
|
*/
|
|
4430
4430
|
await this.loadMarkets();
|
|
4431
4431
|
await this.loadAccounts();
|
|
4432
|
-
let query = undefined;
|
|
4433
4432
|
let marketType = undefined;
|
|
4434
|
-
|
|
4433
|
+
let marginMode = undefined;
|
|
4434
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
4435
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
4435
4436
|
const isMargin = this.safeValue(params, 'margin', false);
|
|
4436
|
-
|
|
4437
|
-
|
|
4437
|
+
const isCross = marginMode === 'cross';
|
|
4438
|
+
marketType = (isMargin || isCross) ? 'margin' : marketType;
|
|
4439
|
+
params = this.omit(params, 'margin');
|
|
4438
4440
|
const accountsByType = this.safeValue(this.options, 'accountsByType', {});
|
|
4439
4441
|
const accountCategory = this.safeString(accountsByType, marketType, 'cash');
|
|
4440
4442
|
const account = this.safeValue(this.accounts, 0, {});
|
|
@@ -4442,15 +4444,18 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4442
4444
|
const request = {
|
|
4443
4445
|
'account-group': accountGroup,
|
|
4444
4446
|
};
|
|
4447
|
+
if ((marginMode === 'isolated') && (marketType !== 'swap')) {
|
|
4448
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' does not supported isolated margin trading');
|
|
4449
|
+
}
|
|
4445
4450
|
if ((accountCategory === 'cash') || (accountCategory === 'margin')) {
|
|
4446
4451
|
request['account-category'] = accountCategory;
|
|
4447
4452
|
}
|
|
4448
4453
|
let response = undefined;
|
|
4449
4454
|
if ((marketType === 'spot') || (marketType === 'margin')) {
|
|
4450
|
-
response = await this.v1PrivateAccountCategoryGetBalance(this.extend(request,
|
|
4455
|
+
response = await this.v1PrivateAccountCategoryGetBalance(this.extend(request, params));
|
|
4451
4456
|
}
|
|
4452
4457
|
else if (marketType === 'swap') {
|
|
4453
|
-
response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request,
|
|
4458
|
+
response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request, params));
|
|
4454
4459
|
}
|
|
4455
4460
|
else {
|
|
4456
4461
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchBalance() is not currently supported for ' + marketType + ' markets');
|
|
@@ -8441,11 +8446,11 @@ class Exchange {
|
|
|
8441
8446
|
let httpsProxy = undefined;
|
|
8442
8447
|
let socksProxy = undefined;
|
|
8443
8448
|
// httpProxy
|
|
8444
|
-
if (this.httpProxy
|
|
8449
|
+
if (this.valueIsDefined(this.httpProxy)) {
|
|
8445
8450
|
usedProxies.push('httpProxy');
|
|
8446
8451
|
httpProxy = this.httpProxy;
|
|
8447
8452
|
}
|
|
8448
|
-
if (this.http_proxy
|
|
8453
|
+
if (this.valueIsDefined(this.http_proxy)) {
|
|
8449
8454
|
usedProxies.push('http_proxy');
|
|
8450
8455
|
httpProxy = this.http_proxy;
|
|
8451
8456
|
}
|
|
@@ -8458,11 +8463,11 @@ class Exchange {
|
|
|
8458
8463
|
httpProxy = this.http_proxy_callback(url, method, headers, body);
|
|
8459
8464
|
}
|
|
8460
8465
|
// httpsProxy
|
|
8461
|
-
if (this.httpsProxy
|
|
8466
|
+
if (this.valueIsDefined(this.httpsProxy)) {
|
|
8462
8467
|
usedProxies.push('httpsProxy');
|
|
8463
8468
|
httpsProxy = this.httpsProxy;
|
|
8464
8469
|
}
|
|
8465
|
-
if (this.https_proxy
|
|
8470
|
+
if (this.valueIsDefined(this.https_proxy)) {
|
|
8466
8471
|
usedProxies.push('https_proxy');
|
|
8467
8472
|
httpsProxy = this.https_proxy;
|
|
8468
8473
|
}
|
|
@@ -8475,11 +8480,11 @@ class Exchange {
|
|
|
8475
8480
|
httpsProxy = this.https_proxy_callback(url, method, headers, body);
|
|
8476
8481
|
}
|
|
8477
8482
|
// socksProxy
|
|
8478
|
-
if (this.socksProxy
|
|
8483
|
+
if (this.valueIsDefined(this.socksProxy)) {
|
|
8479
8484
|
usedProxies.push('socksProxy');
|
|
8480
8485
|
socksProxy = this.socksProxy;
|
|
8481
8486
|
}
|
|
8482
|
-
if (this.socks_proxy
|
|
8487
|
+
if (this.valueIsDefined(this.socks_proxy)) {
|
|
8483
8488
|
usedProxies.push('socks_proxy');
|
|
8484
8489
|
socksProxy = this.socks_proxy;
|
|
8485
8490
|
}
|
|
@@ -8505,29 +8510,29 @@ class Exchange {
|
|
|
8505
8510
|
let wssProxy = undefined;
|
|
8506
8511
|
let wsSocksProxy = undefined;
|
|
8507
8512
|
// ws proxy
|
|
8508
|
-
if (this.wsProxy
|
|
8513
|
+
if (this.valueIsDefined(this.wsProxy)) {
|
|
8509
8514
|
usedProxies.push('wsProxy');
|
|
8510
8515
|
wsProxy = this.wsProxy;
|
|
8511
8516
|
}
|
|
8512
|
-
if (this.ws_proxy
|
|
8517
|
+
if (this.valueIsDefined(this.ws_proxy)) {
|
|
8513
8518
|
usedProxies.push('ws_proxy');
|
|
8514
8519
|
wsProxy = this.ws_proxy;
|
|
8515
8520
|
}
|
|
8516
8521
|
// wss proxy
|
|
8517
|
-
if (this.wssProxy
|
|
8522
|
+
if (this.valueIsDefined(this.wssProxy)) {
|
|
8518
8523
|
usedProxies.push('wssProxy');
|
|
8519
8524
|
wssProxy = this.wssProxy;
|
|
8520
8525
|
}
|
|
8521
|
-
if (this.wss_proxy
|
|
8526
|
+
if (this.valueIsDefined(this.wss_proxy)) {
|
|
8522
8527
|
usedProxies.push('wss_proxy');
|
|
8523
8528
|
wssProxy = this.wss_proxy;
|
|
8524
8529
|
}
|
|
8525
8530
|
// ws socks proxy
|
|
8526
|
-
if (this.wsSocksProxy
|
|
8531
|
+
if (this.valueIsDefined(this.wsSocksProxy)) {
|
|
8527
8532
|
usedProxies.push('wsSocksProxy');
|
|
8528
8533
|
wsSocksProxy = this.wsSocksProxy;
|
|
8529
8534
|
}
|
|
8530
|
-
if (this.ws_socks_proxy
|
|
8535
|
+
if (this.valueIsDefined(this.ws_socks_proxy)) {
|
|
8531
8536
|
usedProxies.push('ws_socks_proxy');
|
|
8532
8537
|
wsSocksProxy = this.ws_socks_proxy;
|
|
8533
8538
|
}
|
|
@@ -17751,12 +17756,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
17751
17756
|
'createPostOnlyOrder': true,
|
|
17752
17757
|
'createReduceOnlyOrder': true,
|
|
17753
17758
|
'createStopLimitOrder': true,
|
|
17759
|
+
'createStopLossOrder': true,
|
|
17754
17760
|
'createStopMarketOrder': false,
|
|
17755
17761
|
'createStopOrder': true,
|
|
17762
|
+
'createTakeProfitOrder': true,
|
|
17756
17763
|
'createTrailingPercentOrder': true,
|
|
17757
17764
|
'createTriggerOrder': true,
|
|
17758
|
-
'createTakeProfitOrder': true,
|
|
17759
|
-
'createStopLossOrder': true,
|
|
17760
17765
|
'editOrder': true,
|
|
17761
17766
|
'fetchAccounts': undefined,
|
|
17762
17767
|
'fetchBalance': true,
|
|
@@ -27792,7 +27797,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27792
27797
|
'has': {
|
|
27793
27798
|
'CORS': undefined,
|
|
27794
27799
|
'spot': true,
|
|
27795
|
-
'margin':
|
|
27800
|
+
'margin': false,
|
|
27796
27801
|
'swap': true,
|
|
27797
27802
|
'future': false,
|
|
27798
27803
|
'option': false,
|
|
@@ -27806,12 +27811,12 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27806
27811
|
'createMarketSellOrderWithCost': true,
|
|
27807
27812
|
'createOrder': true,
|
|
27808
27813
|
'createOrders': true,
|
|
27814
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
27815
|
+
'createStopLossOrder': true,
|
|
27816
|
+
'createTakeProfitOrder': true,
|
|
27809
27817
|
'createTrailingAmountOrder': true,
|
|
27810
27818
|
'createTrailingPercentOrder': true,
|
|
27811
27819
|
'createTriggerOrder': true,
|
|
27812
|
-
'createTakeProfitOrder': true,
|
|
27813
|
-
'createStopLossOrder': true,
|
|
27814
|
-
'createOrderWithTakeProfitAndStopLoss': true,
|
|
27815
27820
|
'fetchBalance': true,
|
|
27816
27821
|
'fetchClosedOrders': true,
|
|
27817
27822
|
'fetchCurrencies': true,
|
|
@@ -27855,6 +27860,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27855
27860
|
'account': 'https://open-api.{hostname}/openApi',
|
|
27856
27861
|
'copyTrading': 'https://open-api.{hostname}/openApi',
|
|
27857
27862
|
},
|
|
27863
|
+
'test': {
|
|
27864
|
+
'swap': 'https://open-api-vst.{hostname}/openApi', // only swap is really "test" but since the API keys are the same, we want to keep all the functionalities when the user enables the sandboxmode
|
|
27865
|
+
},
|
|
27858
27866
|
'www': 'https://bingx.com/',
|
|
27859
27867
|
'doc': 'https://bingx-api.github.io/docs/',
|
|
27860
27868
|
'referral': 'https://bingx.com/invite/OHETOM',
|
|
@@ -28131,6 +28139,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28131
28139
|
'80016': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
28132
28140
|
'80017': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
28133
28141
|
'100414': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
|
|
28142
|
+
'100419': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
28134
28143
|
'100437': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest, // {"code":100437,"msg":"The withdrawal amount is lower than the minimum limit, please re-enter.","timestamp":1689258588845}
|
|
28135
28144
|
},
|
|
28136
28145
|
'broad': {},
|
|
@@ -28187,6 +28196,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28187
28196
|
if (!this.checkRequiredCredentials(false)) {
|
|
28188
28197
|
return undefined;
|
|
28189
28198
|
}
|
|
28199
|
+
const isSandbox = this.safeValue(this.options, 'sandboxMode', false);
|
|
28200
|
+
if (isSandbox) {
|
|
28201
|
+
return undefined;
|
|
28202
|
+
}
|
|
28190
28203
|
const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
|
|
28191
28204
|
//
|
|
28192
28205
|
// {
|
|
@@ -28426,7 +28439,11 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28426
28439
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
28427
28440
|
* @returns {object[]} an array of objects representing market data
|
|
28428
28441
|
*/
|
|
28429
|
-
const requests = [this.
|
|
28442
|
+
const requests = [this.fetchSwapMarkets(params)];
|
|
28443
|
+
const isSandbox = this.safeValue(this.options, 'sandboxMode', false);
|
|
28444
|
+
if (!isSandbox) {
|
|
28445
|
+
requests.push(this.fetchSpotMarkets(params)); // sandbox is swap only
|
|
28446
|
+
}
|
|
28430
28447
|
const promises = await Promise.all(requests);
|
|
28431
28448
|
const spotMarkets = this.safeValue(promises, 0, []);
|
|
28432
28449
|
const swapMarkets = this.safeValue(promises, 1, []);
|
|
@@ -30857,6 +30874,21 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30857
30874
|
// "txId": "0xb5ef8c13b968a406cc62a93a8bd80f9e9a906ef1b3fcf20a2e48573c17659268"
|
|
30858
30875
|
// }
|
|
30859
30876
|
//
|
|
30877
|
+
// withdraw
|
|
30878
|
+
//
|
|
30879
|
+
// {
|
|
30880
|
+
// "code":0,
|
|
30881
|
+
// "timestamp":1705274263621,
|
|
30882
|
+
// "data":{
|
|
30883
|
+
// "id":"1264246141278773252"
|
|
30884
|
+
// }
|
|
30885
|
+
// }
|
|
30886
|
+
//
|
|
30887
|
+
// parse withdraw-type output first...
|
|
30888
|
+
//
|
|
30889
|
+
const data = this.safeValue(transaction, 'data');
|
|
30890
|
+
const dataId = (data === undefined) ? undefined : this.safeString(data, 'id');
|
|
30891
|
+
const id = this.safeString(transaction, 'id', dataId);
|
|
30860
30892
|
const address = this.safeString(transaction, 'address');
|
|
30861
30893
|
const tag = this.safeString(transaction, 'addressTag');
|
|
30862
30894
|
let timestamp = this.safeInteger(transaction, 'insertTime');
|
|
@@ -30877,7 +30909,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30877
30909
|
const type = (rawType === '0') ? 'deposit' : 'withdrawal';
|
|
30878
30910
|
return {
|
|
30879
30911
|
'info': transaction,
|
|
30880
|
-
'id':
|
|
30912
|
+
'id': id,
|
|
30881
30913
|
'txid': this.safeString(transaction, 'txId'),
|
|
30882
30914
|
'type': type,
|
|
30883
30915
|
'currency': code,
|
|
@@ -31511,6 +31543,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
31511
31543
|
const type = section[0];
|
|
31512
31544
|
const version = section[1];
|
|
31513
31545
|
const access = section[2];
|
|
31546
|
+
const isSandbox = this.safeValue(this.options, 'sandboxMode', false);
|
|
31547
|
+
if (isSandbox && (type !== 'swap')) {
|
|
31548
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' does not have a testnet/sandbox URL for ' + type + ' endpoints');
|
|
31549
|
+
}
|
|
31514
31550
|
let url = this.implodeHostname(this.urls['api'][type]);
|
|
31515
31551
|
if (type === 'spot' && version === 'v3') {
|
|
31516
31552
|
url += '/api';
|
|
@@ -31553,6 +31589,10 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
31553
31589
|
nonce() {
|
|
31554
31590
|
return this.milliseconds();
|
|
31555
31591
|
}
|
|
31592
|
+
setSandboxMode(enable) {
|
|
31593
|
+
super.setSandboxMode(enable);
|
|
31594
|
+
this.options['sandboxMode'] = enable;
|
|
31595
|
+
}
|
|
31556
31596
|
handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
31557
31597
|
if (response === undefined) {
|
|
31558
31598
|
return undefined; // fallback to default error handler
|
|
@@ -41440,12 +41480,12 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41440
41480
|
'createMarketSellOrderWithCost': false,
|
|
41441
41481
|
'createOrder': true,
|
|
41442
41482
|
'createOrders': true,
|
|
41483
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
41443
41484
|
'createReduceOnlyOrder': false,
|
|
41485
|
+
'createStopLossOrder': true,
|
|
41486
|
+
'createTakeProfitOrder': true,
|
|
41444
41487
|
'createTrailingPercentOrder': true,
|
|
41445
41488
|
'createTriggerOrder': true,
|
|
41446
|
-
'createTakeProfitOrder': true,
|
|
41447
|
-
'createStopLossOrder': true,
|
|
41448
|
-
'createOrderWithTakeProfitAndStopLoss': true,
|
|
41449
41489
|
'editOrder': true,
|
|
41450
41490
|
'fetchAccounts': false,
|
|
41451
41491
|
'fetchBalance': true,
|
|
@@ -56767,8 +56807,8 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
56767
56807
|
if (fetchOHLCVOpenTimestamp) {
|
|
56768
56808
|
timestamp = this.sum(timestamp, duration);
|
|
56769
56809
|
}
|
|
56770
|
-
const
|
|
56771
|
-
request['startTime'] =
|
|
56810
|
+
const startTime = this.iso8601(timestamp);
|
|
56811
|
+
request['startTime'] = startTime; // starting date filter for results
|
|
56772
56812
|
}
|
|
56773
56813
|
else {
|
|
56774
56814
|
request['reverse'] = true;
|
|
@@ -57878,12 +57918,9 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
57878
57918
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchDepositAddress requires params["network"]');
|
|
57879
57919
|
}
|
|
57880
57920
|
const currency = this.currency(code);
|
|
57881
|
-
let currencyId = currency['id'];
|
|
57882
|
-
const idLength = currencyId.length;
|
|
57883
|
-
currencyId = currencyId.slice(0, idLength - 1) + currencyId.slice(idLength - 1, idLength).toLowerCase(); // make the last letter lowercase
|
|
57884
57921
|
params = this.omit(params, 'network');
|
|
57885
57922
|
const request = {
|
|
57886
|
-
'currency':
|
|
57923
|
+
'currency': currency['id'],
|
|
57887
57924
|
'network': this.networkCodeToId(networkCode, currency['code']),
|
|
57888
57925
|
};
|
|
57889
57926
|
const response = await this.privateGetUserDepositAddress(this.extend(request, params));
|
|
@@ -78793,16 +78830,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
78793
78830
|
'createMarketSellOrderWithCost': false,
|
|
78794
78831
|
'createOrder': true,
|
|
78795
78832
|
'createOrders': true,
|
|
78833
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
78796
78834
|
'createPostOnlyOrder': true,
|
|
78797
78835
|
'createReduceOnlyOrder': true,
|
|
78798
78836
|
'createStopLimitOrder': true,
|
|
78837
|
+
'createStopLossOrder': true,
|
|
78799
78838
|
'createStopMarketOrder': true,
|
|
78800
78839
|
'createStopOrder': true,
|
|
78840
|
+
'createTakeProfitOrder': true,
|
|
78801
78841
|
'createTrailingAmountOrder': true,
|
|
78802
78842
|
'createTriggerOrder': true,
|
|
78803
|
-
'createTakeProfitOrder': true,
|
|
78804
|
-
'createStopLossOrder': true,
|
|
78805
|
-
'createOrderWithTakeProfitAndStopLoss': true,
|
|
78806
78843
|
'editOrder': true,
|
|
78807
78844
|
'fetchBalance': true,
|
|
78808
78845
|
'fetchBorrowInterest': false,
|
|
@@ -94330,12 +94367,12 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
94330
94367
|
'createMarketBuyOrderWithCost': true,
|
|
94331
94368
|
'createMarketOrderWithCost': false,
|
|
94332
94369
|
'createMarketSellOrderWithCost': false,
|
|
94333
|
-
'createTriggerOrder': true,
|
|
94334
|
-
'createTakeProfitOrder': true,
|
|
94335
|
-
'createStopLossOrder': true,
|
|
94336
94370
|
'createOrder': true,
|
|
94337
94371
|
'createOrders': true,
|
|
94338
94372
|
'createReduceOnlyOrder': true,
|
|
94373
|
+
'createStopLossOrder': true,
|
|
94374
|
+
'createTakeProfitOrder': true,
|
|
94375
|
+
'createTriggerOrder': true,
|
|
94339
94376
|
'editOrder': true,
|
|
94340
94377
|
'fetchBalance': true,
|
|
94341
94378
|
'fetchBorrowInterest': true,
|
|
@@ -103123,7 +103160,7 @@ class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
103123
103160
|
'setLeverage': false,
|
|
103124
103161
|
'setMarginMode': false,
|
|
103125
103162
|
'setPositionMode': false,
|
|
103126
|
-
'ws':
|
|
103163
|
+
'ws': true,
|
|
103127
103164
|
},
|
|
103128
103165
|
'urls': {
|
|
103129
103166
|
'logo': 'https://user-images.githubusercontent.com/1294454/38003300-adc12fba-323f-11e8-8525-725f53c4a659.jpg',
|
|
@@ -125502,11 +125539,11 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
125502
125539
|
'createPostOnlyOrder': true,
|
|
125503
125540
|
'createReduceOnlyOrder': true,
|
|
125504
125541
|
'createStopLimitOrder': true,
|
|
125505
|
-
'createStopMarketOrder': false,
|
|
125506
|
-
'createTriggerOrder': true,
|
|
125507
|
-
'createTakeProfitOrder': true,
|
|
125508
125542
|
'createStopLossOrder': true,
|
|
125543
|
+
'createStopMarketOrder': false,
|
|
125509
125544
|
'createStopOrder': true,
|
|
125545
|
+
'createTakeProfitOrder': true,
|
|
125546
|
+
'createTriggerOrder': true,
|
|
125510
125547
|
'editOrder': true,
|
|
125511
125548
|
'fetchBalance': true,
|
|
125512
125549
|
'fetchBorrowRateHistories': false,
|
|
@@ -139965,12 +140002,12 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
139965
140002
|
'createOrders': true,
|
|
139966
140003
|
'createReduceOnlyOrder': false,
|
|
139967
140004
|
'createStopLimitOrder': true,
|
|
140005
|
+
'createStopLossOrder': true,
|
|
139968
140006
|
'createStopMarketOrder': true,
|
|
139969
140007
|
'createStopOrder': true,
|
|
140008
|
+
'createTakeProfitOrder': true,
|
|
139970
140009
|
'createTrailingPercentOrder': true,
|
|
139971
140010
|
'createTriggerOrder': true,
|
|
139972
|
-
'createTakeProfitOrder': true,
|
|
139973
|
-
'createStopLossOrder': true,
|
|
139974
140011
|
'fetchAccounts': true,
|
|
139975
140012
|
'fetchBalance': true,
|
|
139976
140013
|
'fetchBidsAsks': undefined,
|
|
@@ -156124,6 +156161,16 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
156124
156161
|
};
|
|
156125
156162
|
return this.safeString(statuses, status, status);
|
|
156126
156163
|
}
|
|
156164
|
+
parseOrderType(status) {
|
|
156165
|
+
const statuses = {
|
|
156166
|
+
'take-profit': 'market',
|
|
156167
|
+
'stop-loss-limit': 'limit',
|
|
156168
|
+
'stop-loss': 'market',
|
|
156169
|
+
'take-profit-limit': 'limit',
|
|
156170
|
+
'trailing-stop-limit': 'limit',
|
|
156171
|
+
};
|
|
156172
|
+
return this.safeString(statuses, status, status);
|
|
156173
|
+
}
|
|
156127
156174
|
parseOrder(order, market = undefined) {
|
|
156128
156175
|
//
|
|
156129
156176
|
// createOrder for regular orders
|
|
@@ -156266,7 +156313,17 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
156266
156313
|
trades.push(rawTrade);
|
|
156267
156314
|
}
|
|
156268
156315
|
}
|
|
156269
|
-
stopPrice = this.
|
|
156316
|
+
stopPrice = this.omitZero(this.safeString(order, 'stopprice', stopPrice));
|
|
156317
|
+
let stopLossPrice = undefined;
|
|
156318
|
+
let takeProfitPrice = undefined;
|
|
156319
|
+
if (type.startsWith('take-profit')) {
|
|
156320
|
+
takeProfitPrice = this.safeString(description, 'price');
|
|
156321
|
+
price = this.omitZero(this.safeString(description, 'price2'));
|
|
156322
|
+
}
|
|
156323
|
+
else if (type.startsWith('stop-loss')) {
|
|
156324
|
+
stopLossPrice = this.safeString(description, 'price');
|
|
156325
|
+
price = this.omitZero(this.safeString(description, 'price2'));
|
|
156326
|
+
}
|
|
156270
156327
|
return this.safeOrder({
|
|
156271
156328
|
'id': id,
|
|
156272
156329
|
'clientOrderId': clientOrderId,
|
|
@@ -156276,13 +156333,15 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
156276
156333
|
'lastTradeTimestamp': undefined,
|
|
156277
156334
|
'status': status,
|
|
156278
156335
|
'symbol': symbol,
|
|
156279
|
-
'type': type,
|
|
156336
|
+
'type': this.parseOrderType(type),
|
|
156280
156337
|
'timeInForce': undefined,
|
|
156281
156338
|
'postOnly': isPostOnly,
|
|
156282
156339
|
'side': side,
|
|
156283
156340
|
'price': price,
|
|
156284
156341
|
'stopPrice': stopPrice,
|
|
156285
156342
|
'triggerPrice': stopPrice,
|
|
156343
|
+
'takeProfitPrice': takeProfitPrice,
|
|
156344
|
+
'stopLossPrice': stopLossPrice,
|
|
156286
156345
|
'cost': undefined,
|
|
156287
156346
|
'amount': amount,
|
|
156288
156347
|
'filled': filled,
|
|
@@ -160029,8 +160088,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
160029
160088
|
'createPostOnlyOrder': true,
|
|
160030
160089
|
'createStopLimitOrder': true,
|
|
160031
160090
|
'createStopMarketOrder': true,
|
|
160032
|
-
'createTriggerOrder': true,
|
|
160033
160091
|
'createStopOrder': true,
|
|
160092
|
+
'createTriggerOrder': true,
|
|
160034
160093
|
'editOrder': true,
|
|
160035
160094
|
'fetchAccounts': true,
|
|
160036
160095
|
'fetchBalance': true,
|
|
@@ -164522,11 +164581,11 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
164522
164581
|
'createOrders': true,
|
|
164523
164582
|
'createReduceOnlyOrder': true,
|
|
164524
164583
|
'createStopLimitOrder': true,
|
|
164584
|
+
'createStopLossOrder': true,
|
|
164525
164585
|
'createStopMarketOrder': true,
|
|
164526
164586
|
'createStopOrder': true,
|
|
164527
|
-
'createTriggerOrder': true,
|
|
164528
164587
|
'createTakeProfitOrder': true,
|
|
164529
|
-
'
|
|
164588
|
+
'createTriggerOrder': true,
|
|
164530
164589
|
'fetchAccounts': true,
|
|
164531
164590
|
'fetchBalance': true,
|
|
164532
164591
|
'fetchBorrowRateHistories': false,
|
|
@@ -190445,8 +190504,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
190445
190504
|
'createOrderWithTakeProfitAndStopLoss': true,
|
|
190446
190505
|
'createPostOnlyOrder': true,
|
|
190447
190506
|
'createReduceOnlyOrder': true,
|
|
190448
|
-
'createStopLossOrder': true,
|
|
190449
190507
|
'createStopLimitOrder': true,
|
|
190508
|
+
'createStopLossOrder': true,
|
|
190450
190509
|
'createStopMarketOrder': true,
|
|
190451
190510
|
'createStopOrder': true,
|
|
190452
190511
|
'createTakeProfitOrder': true,
|
|
@@ -202578,12 +202637,14 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202578
202637
|
* @description fetch all unfilled currently open orders
|
|
202579
202638
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryopenorder
|
|
202580
202639
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md
|
|
202640
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#spotListAllOpenOrder
|
|
202581
202641
|
* @param {string} symbol unified market symbol
|
|
202582
202642
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
202583
202643
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
202584
202644
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
202585
202645
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
202586
202646
|
*/
|
|
202647
|
+
await this.loadMarkets();
|
|
202587
202648
|
if (symbol === undefined) {
|
|
202588
202649
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
202589
202650
|
}
|
|
@@ -202625,20 +202686,25 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202625
202686
|
* @name phemex#fetchClosedOrders
|
|
202626
202687
|
* @description fetches information on multiple closed orders made by the user
|
|
202627
202688
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
|
|
202689
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#queryorder
|
|
202690
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedgedd-Perpetual-API.md#query-closed-orders-by-symbol
|
|
202691
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#spotDataOrdersByIds
|
|
202628
202692
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
202629
202693
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
202630
202694
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
202631
202695
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
202696
|
+
* @param {string} [params.settle] the settlement currency to fetch orders for
|
|
202632
202697
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
202633
202698
|
*/
|
|
202634
|
-
if (symbol === undefined) {
|
|
202635
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
202636
|
-
}
|
|
202637
202699
|
await this.loadMarkets();
|
|
202638
|
-
|
|
202639
|
-
|
|
202640
|
-
|
|
202641
|
-
}
|
|
202700
|
+
let market = undefined;
|
|
202701
|
+
if (symbol !== undefined) {
|
|
202702
|
+
market = this.market(symbol);
|
|
202703
|
+
}
|
|
202704
|
+
const request = {};
|
|
202705
|
+
if (market !== undefined) {
|
|
202706
|
+
request['symbol'] = market['id'];
|
|
202707
|
+
}
|
|
202642
202708
|
if (since !== undefined) {
|
|
202643
202709
|
request['start'] = since;
|
|
202644
202710
|
}
|
|
@@ -202646,8 +202712,8 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202646
202712
|
request['limit'] = limit;
|
|
202647
202713
|
}
|
|
202648
202714
|
let response = undefined;
|
|
202649
|
-
if (market
|
|
202650
|
-
request['currency'] =
|
|
202715
|
+
if ((symbol === undefined) || (this.safeString(market, 'settle') === 'USDT')) {
|
|
202716
|
+
request['currency'] = this.safeString(params, 'settle', 'USDT');
|
|
202651
202717
|
response = await this.privateGetExchangeOrderV2OrderList(this.extend(request, params));
|
|
202652
202718
|
}
|
|
202653
202719
|
else if (market['swap']) {
|
|
@@ -202708,23 +202774,25 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202708
202774
|
* @description fetch all trades made by the user
|
|
202709
202775
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#query-user-trade
|
|
202710
202776
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-trade
|
|
202777
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#spotDataTradesHist
|
|
202711
202778
|
* @param {string} symbol unified market symbol
|
|
202712
202779
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
202713
202780
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
202714
202781
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
202715
202782
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
202716
202783
|
*/
|
|
202717
|
-
if (symbol === undefined) {
|
|
202718
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
202719
|
-
}
|
|
202720
202784
|
await this.loadMarkets();
|
|
202721
|
-
|
|
202785
|
+
let market = undefined;
|
|
202786
|
+
if (symbol !== undefined) {
|
|
202787
|
+
market = this.market(symbol);
|
|
202788
|
+
}
|
|
202722
202789
|
const request = {};
|
|
202723
202790
|
if (limit !== undefined) {
|
|
202724
202791
|
limit = Math.min(200, limit);
|
|
202725
202792
|
request['limit'] = limit;
|
|
202726
202793
|
}
|
|
202727
|
-
|
|
202794
|
+
const isUSDTSettled = (symbol === undefined) || (this.safeString(market, 'settle') === 'USDT');
|
|
202795
|
+
if (isUSDTSettled) {
|
|
202728
202796
|
request['currency'] = 'USDT';
|
|
202729
202797
|
request['offset'] = 0;
|
|
202730
202798
|
if (limit === undefined) {
|
|
@@ -202737,18 +202805,12 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202737
202805
|
if (since !== undefined) {
|
|
202738
202806
|
request['start'] = since;
|
|
202739
202807
|
}
|
|
202740
|
-
if (market['swap'] && (limit !== undefined)) {
|
|
202741
|
-
request['limit'] = limit;
|
|
202742
|
-
}
|
|
202743
|
-
const isUSDTSettled = market['settle'] === 'USDT';
|
|
202744
202808
|
let response = undefined;
|
|
202745
|
-
if (
|
|
202746
|
-
|
|
202747
|
-
|
|
202748
|
-
|
|
202749
|
-
|
|
202750
|
-
response = await this.privateGetExchangeOrderTrade(this.extend(request, params));
|
|
202751
|
-
}
|
|
202809
|
+
if (isUSDTSettled) {
|
|
202810
|
+
response = await this.privateGetExchangeOrderV2TradingList(this.extend(request, params));
|
|
202811
|
+
}
|
|
202812
|
+
else if (market['swap']) {
|
|
202813
|
+
response = await this.privateGetExchangeOrderTrade(this.extend(request, params));
|
|
202752
202814
|
}
|
|
202753
202815
|
else {
|
|
202754
202816
|
response = await this.privateGetExchangeSpotOrderTrades(this.extend(request, params));
|
|
@@ -231065,6 +231127,425 @@ class coinex extends _coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
231065
231127
|
}
|
|
231066
231128
|
|
|
231067
231129
|
|
|
231130
|
+
/***/ }),
|
|
231131
|
+
|
|
231132
|
+
/***/ 5208:
|
|
231133
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
231134
|
+
|
|
231135
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
231136
|
+
/* harmony export */ Z: () => (/* binding */ coinone)
|
|
231137
|
+
/* harmony export */ });
|
|
231138
|
+
/* harmony import */ var _coinone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7811);
|
|
231139
|
+
/* harmony import */ var _base_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
|
231140
|
+
/* harmony import */ var _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3020);
|
|
231141
|
+
// ---------------------------------------------------------------------------
|
|
231142
|
+
|
|
231143
|
+
|
|
231144
|
+
|
|
231145
|
+
// ---------------------------------------------------------------------------
|
|
231146
|
+
class coinone extends _coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
231147
|
+
describe() {
|
|
231148
|
+
return this.deepExtend(super.describe(), {
|
|
231149
|
+
'has': {
|
|
231150
|
+
'ws': true,
|
|
231151
|
+
'watchOrderBook': true,
|
|
231152
|
+
'watchOrders': false,
|
|
231153
|
+
'watchTrades': true,
|
|
231154
|
+
'watchOHLCV': false,
|
|
231155
|
+
'watchTicker': true,
|
|
231156
|
+
'watchTickers': false,
|
|
231157
|
+
},
|
|
231158
|
+
'urls': {
|
|
231159
|
+
'api': {
|
|
231160
|
+
'ws': 'wss://stream.coinone.co.kr',
|
|
231161
|
+
},
|
|
231162
|
+
},
|
|
231163
|
+
'options': {
|
|
231164
|
+
'expiresIn': '',
|
|
231165
|
+
'userId': '',
|
|
231166
|
+
'wsSessionToken': '',
|
|
231167
|
+
'watchOrderBook': {
|
|
231168
|
+
'snapshotDelay': 6,
|
|
231169
|
+
'snapshotMaxRetries': 3,
|
|
231170
|
+
},
|
|
231171
|
+
'tradesLimit': 1000,
|
|
231172
|
+
'OHLCVLimit': 1000,
|
|
231173
|
+
},
|
|
231174
|
+
'exceptions': {
|
|
231175
|
+
'exact': {
|
|
231176
|
+
'4009': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
231177
|
+
},
|
|
231178
|
+
},
|
|
231179
|
+
'streaming': {
|
|
231180
|
+
'ping': this.ping,
|
|
231181
|
+
'keepAlive': 20000,
|
|
231182
|
+
},
|
|
231183
|
+
});
|
|
231184
|
+
}
|
|
231185
|
+
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
231186
|
+
/**
|
|
231187
|
+
* @method
|
|
231188
|
+
* @name coinone#watchOrderBook
|
|
231189
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
231190
|
+
* @see https://docs.coinone.co.kr/reference/public-websocket-orderbook
|
|
231191
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
231192
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
231193
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
231194
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
231195
|
+
*/
|
|
231196
|
+
await this.loadMarkets();
|
|
231197
|
+
const market = this.market(symbol);
|
|
231198
|
+
const messageHash = 'orderbook:' + market['symbol'];
|
|
231199
|
+
const url = this.urls['api']['ws'];
|
|
231200
|
+
const request = {
|
|
231201
|
+
'request_type': 'SUBSCRIBE',
|
|
231202
|
+
'channel': 'ORDERBOOK',
|
|
231203
|
+
'topic': {
|
|
231204
|
+
'quote_currency': market['quote'],
|
|
231205
|
+
'target_currency': market['base'],
|
|
231206
|
+
},
|
|
231207
|
+
};
|
|
231208
|
+
const message = this.extend(request, params);
|
|
231209
|
+
const orderbook = await this.watch(url, messageHash, message, messageHash);
|
|
231210
|
+
return orderbook.limit();
|
|
231211
|
+
}
|
|
231212
|
+
handleOrderBook(client, message) {
|
|
231213
|
+
//
|
|
231214
|
+
// {
|
|
231215
|
+
// "response_type": "DATA",
|
|
231216
|
+
// "channel": "ORDERBOOK",
|
|
231217
|
+
// "data": {
|
|
231218
|
+
// "quote_currency": "KRW",
|
|
231219
|
+
// "target_currency": "BTC",
|
|
231220
|
+
// "timestamp": 1705288918649,
|
|
231221
|
+
// "id": "1705288918649001",
|
|
231222
|
+
// "asks": [
|
|
231223
|
+
// {
|
|
231224
|
+
// "price": "58412000",
|
|
231225
|
+
// "qty": "0.59919807"
|
|
231226
|
+
// }
|
|
231227
|
+
// ],
|
|
231228
|
+
// "bids": [
|
|
231229
|
+
// {
|
|
231230
|
+
// "price": "58292000",
|
|
231231
|
+
// "qty": "0.1045"
|
|
231232
|
+
// }
|
|
231233
|
+
// ]
|
|
231234
|
+
// }
|
|
231235
|
+
// }
|
|
231236
|
+
//
|
|
231237
|
+
const data = this.safeValue(message, 'data', {});
|
|
231238
|
+
const baseId = this.safeStringUpper(data, 'target_currency');
|
|
231239
|
+
const quoteId = this.safeStringUpper(data, 'quote_currency');
|
|
231240
|
+
const base = this.safeCurrencyCode(baseId);
|
|
231241
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
231242
|
+
const symbol = this.symbol(base + '/' + quote);
|
|
231243
|
+
const timestamp = this.safeInteger(data, 'timestamp');
|
|
231244
|
+
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
231245
|
+
if (orderbook === undefined) {
|
|
231246
|
+
orderbook = this.orderBook();
|
|
231247
|
+
}
|
|
231248
|
+
else {
|
|
231249
|
+
orderbook.reset();
|
|
231250
|
+
}
|
|
231251
|
+
orderbook['symbol'] = symbol;
|
|
231252
|
+
const asks = this.safeValue(data, 'asks', []);
|
|
231253
|
+
const bids = this.safeValue(data, 'bids', []);
|
|
231254
|
+
this.handleDeltas(orderbook['asks'], asks);
|
|
231255
|
+
this.handleDeltas(orderbook['bids'], bids);
|
|
231256
|
+
orderbook['timestamp'] = timestamp;
|
|
231257
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
231258
|
+
const messageHash = 'orderbook:' + symbol;
|
|
231259
|
+
this.orderbooks[symbol] = orderbook;
|
|
231260
|
+
client.resolve(orderbook, messageHash);
|
|
231261
|
+
}
|
|
231262
|
+
handleDelta(bookside, delta) {
|
|
231263
|
+
const bidAsk = this.parseBidAsk(delta, 'price', 'qty');
|
|
231264
|
+
bookside.storeArray(bidAsk);
|
|
231265
|
+
}
|
|
231266
|
+
async watchTicker(symbol, params = {}) {
|
|
231267
|
+
/**
|
|
231268
|
+
* @method
|
|
231269
|
+
* @name coinone#watchTicker
|
|
231270
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
231271
|
+
* @see https://docs.coinone.co.kr/reference/public-websocket-ticker
|
|
231272
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
231273
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
231274
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
231275
|
+
*/
|
|
231276
|
+
await this.loadMarkets();
|
|
231277
|
+
const market = this.market(symbol);
|
|
231278
|
+
const messageHash = 'ticker:' + market['symbol'];
|
|
231279
|
+
const url = this.urls['api']['ws'];
|
|
231280
|
+
const request = {
|
|
231281
|
+
'request_type': 'SUBSCRIBE',
|
|
231282
|
+
'channel': 'TICKER',
|
|
231283
|
+
'topic': {
|
|
231284
|
+
'quote_currency': market['quote'],
|
|
231285
|
+
'target_currency': market['base'],
|
|
231286
|
+
},
|
|
231287
|
+
};
|
|
231288
|
+
const message = this.extend(request, params);
|
|
231289
|
+
return await this.watch(url, messageHash, message, messageHash);
|
|
231290
|
+
}
|
|
231291
|
+
handleTicker(client, message) {
|
|
231292
|
+
//
|
|
231293
|
+
// {
|
|
231294
|
+
// "response_type": "DATA",
|
|
231295
|
+
// "channel": "TICKER",
|
|
231296
|
+
// "data": {
|
|
231297
|
+
// "quote_currency": "KRW",
|
|
231298
|
+
// "target_currency": "BTC",
|
|
231299
|
+
// "timestamp": 1705301117198,
|
|
231300
|
+
// "quote_volume": "19521465345.504",
|
|
231301
|
+
// "target_volume": "334.81445168",
|
|
231302
|
+
// "high": "58710000",
|
|
231303
|
+
// "low": "57276000",
|
|
231304
|
+
// "first": "57293000",
|
|
231305
|
+
// "last": "58532000",
|
|
231306
|
+
// "volume_power": "100",
|
|
231307
|
+
// "ask_best_price": "58537000",
|
|
231308
|
+
// "ask_best_qty": "0.1961",
|
|
231309
|
+
// "bid_best_price": "58532000",
|
|
231310
|
+
// "bid_best_qty": "0.00009258",
|
|
231311
|
+
// "id": "1705301117198001",
|
|
231312
|
+
// "yesterday_high": "59140000",
|
|
231313
|
+
// "yesterday_low": "57273000",
|
|
231314
|
+
// "yesterday_first": "58897000",
|
|
231315
|
+
// "yesterday_last": "57301000",
|
|
231316
|
+
// "yesterday_quote_volume": "12967227517.4262",
|
|
231317
|
+
// "yesterday_target_volume": "220.09232233"
|
|
231318
|
+
// }
|
|
231319
|
+
// }
|
|
231320
|
+
//
|
|
231321
|
+
const data = this.safeValue(message, 'data', {});
|
|
231322
|
+
const ticker = this.parseWsTicker(data);
|
|
231323
|
+
const symbol = ticker['symbol'];
|
|
231324
|
+
this.tickers[symbol] = ticker;
|
|
231325
|
+
const messageHash = 'ticker:' + symbol;
|
|
231326
|
+
client.resolve(this.tickers[symbol], messageHash);
|
|
231327
|
+
}
|
|
231328
|
+
parseWsTicker(ticker, market = undefined) {
|
|
231329
|
+
//
|
|
231330
|
+
// {
|
|
231331
|
+
// "quote_currency": "KRW",
|
|
231332
|
+
// "target_currency": "BTC",
|
|
231333
|
+
// "timestamp": 1705301117198,
|
|
231334
|
+
// "quote_volume": "19521465345.504",
|
|
231335
|
+
// "target_volume": "334.81445168",
|
|
231336
|
+
// "high": "58710000",
|
|
231337
|
+
// "low": "57276000",
|
|
231338
|
+
// "first": "57293000",
|
|
231339
|
+
// "last": "58532000",
|
|
231340
|
+
// "volume_power": "100",
|
|
231341
|
+
// "ask_best_price": "58537000",
|
|
231342
|
+
// "ask_best_qty": "0.1961",
|
|
231343
|
+
// "bid_best_price": "58532000",
|
|
231344
|
+
// "bid_best_qty": "0.00009258",
|
|
231345
|
+
// "id": "1705301117198001",
|
|
231346
|
+
// "yesterday_high": "59140000",
|
|
231347
|
+
// "yesterday_low": "57273000",
|
|
231348
|
+
// "yesterday_first": "58897000",
|
|
231349
|
+
// "yesterday_last": "57301000",
|
|
231350
|
+
// "yesterday_quote_volume": "12967227517.4262",
|
|
231351
|
+
// "yesterday_target_volume": "220.09232233"
|
|
231352
|
+
// }
|
|
231353
|
+
//
|
|
231354
|
+
const timestamp = this.safeInteger(ticker, 'timestamp');
|
|
231355
|
+
const last = this.safeString(ticker, 'last');
|
|
231356
|
+
const baseId = this.safeString(ticker, 'target_currency');
|
|
231357
|
+
const quoteId = this.safeString(ticker, 'quote_currency');
|
|
231358
|
+
const base = this.safeCurrencyCode(baseId);
|
|
231359
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
231360
|
+
const symbol = this.symbol(base + '/' + quote);
|
|
231361
|
+
return this.safeTicker({
|
|
231362
|
+
'symbol': symbol,
|
|
231363
|
+
'timestamp': timestamp,
|
|
231364
|
+
'datetime': this.iso8601(timestamp),
|
|
231365
|
+
'high': this.safeString(ticker, 'high'),
|
|
231366
|
+
'low': this.safeString(ticker, 'low'),
|
|
231367
|
+
'bid': this.safeNumber(ticker, 'bid_best_price'),
|
|
231368
|
+
'bidVolume': this.safeNumber(ticker, 'bid_best_qty'),
|
|
231369
|
+
'ask': this.safeNumber(ticker, 'ask_best_price'),
|
|
231370
|
+
'askVolume': this.safeNumber(ticker, 'ask_best_qty'),
|
|
231371
|
+
'vwap': undefined,
|
|
231372
|
+
'open': this.safeString(ticker, 'first'),
|
|
231373
|
+
'close': last,
|
|
231374
|
+
'last': last,
|
|
231375
|
+
'previousClose': undefined,
|
|
231376
|
+
'change': undefined,
|
|
231377
|
+
'percentage': undefined,
|
|
231378
|
+
'average': undefined,
|
|
231379
|
+
'baseVolume': this.safeString(ticker, 'target_volume'),
|
|
231380
|
+
'quoteVolume': this.safeString(ticker, 'quote_volume'),
|
|
231381
|
+
'info': ticker,
|
|
231382
|
+
}, market);
|
|
231383
|
+
}
|
|
231384
|
+
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
231385
|
+
/**
|
|
231386
|
+
* @method
|
|
231387
|
+
* @name coinone#watchTrades
|
|
231388
|
+
* @description watches information on multiple trades made in a market
|
|
231389
|
+
* @see https://docs.coinone.co.kr/reference/public-websocket-trade
|
|
231390
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
231391
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
231392
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
231393
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
231394
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
231395
|
+
*/
|
|
231396
|
+
await this.loadMarkets();
|
|
231397
|
+
const market = this.market(symbol);
|
|
231398
|
+
const messageHash = 'trade:' + market['symbol'];
|
|
231399
|
+
const url = this.urls['api']['ws'];
|
|
231400
|
+
const request = {
|
|
231401
|
+
'request_type': 'SUBSCRIBE',
|
|
231402
|
+
'channel': 'TRADE',
|
|
231403
|
+
'topic': {
|
|
231404
|
+
'quote_currency': market['quote'],
|
|
231405
|
+
'target_currency': market['base'],
|
|
231406
|
+
},
|
|
231407
|
+
};
|
|
231408
|
+
const message = this.extend(request, params);
|
|
231409
|
+
const trades = await this.watch(url, messageHash, message, messageHash);
|
|
231410
|
+
if (this.newUpdates) {
|
|
231411
|
+
limit = trades.getLimit(market['symbol'], limit);
|
|
231412
|
+
}
|
|
231413
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
231414
|
+
}
|
|
231415
|
+
handleTrades(client, message) {
|
|
231416
|
+
//
|
|
231417
|
+
// {
|
|
231418
|
+
// "response_type": "DATA",
|
|
231419
|
+
// "channel": "TRADE",
|
|
231420
|
+
// "data": {
|
|
231421
|
+
// "quote_currency": "KRW",
|
|
231422
|
+
// "target_currency": "BTC",
|
|
231423
|
+
// "id": "1705303667916001",
|
|
231424
|
+
// "timestamp": 1705303667916,
|
|
231425
|
+
// "price": "58490000",
|
|
231426
|
+
// "qty": "0.0008",
|
|
231427
|
+
// "is_seller_maker": false
|
|
231428
|
+
// }
|
|
231429
|
+
// }
|
|
231430
|
+
//
|
|
231431
|
+
const data = this.safeValue(message, 'data', {});
|
|
231432
|
+
const trade = this.parseWsTrade(data);
|
|
231433
|
+
const symbol = trade['symbol'];
|
|
231434
|
+
let stored = this.safeValue(this.trades, symbol);
|
|
231435
|
+
if (stored === undefined) {
|
|
231436
|
+
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
231437
|
+
stored = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCache */ .ZL(limit);
|
|
231438
|
+
this.trades[symbol] = stored;
|
|
231439
|
+
}
|
|
231440
|
+
stored.append(trade);
|
|
231441
|
+
const messageHash = 'trade:' + symbol;
|
|
231442
|
+
client.resolve(stored, messageHash);
|
|
231443
|
+
}
|
|
231444
|
+
parseWsTrade(trade, market = undefined) {
|
|
231445
|
+
//
|
|
231446
|
+
// {
|
|
231447
|
+
// "quote_currency": "KRW",
|
|
231448
|
+
// "target_currency": "BTC",
|
|
231449
|
+
// "id": "1705303667916001",
|
|
231450
|
+
// "timestamp": 1705303667916,
|
|
231451
|
+
// "price": "58490000",
|
|
231452
|
+
// "qty": "0.0008",
|
|
231453
|
+
// "is_seller_maker": false
|
|
231454
|
+
// }
|
|
231455
|
+
//
|
|
231456
|
+
const baseId = this.safeStringUpper(trade, 'target_currency');
|
|
231457
|
+
const quoteId = this.safeStringUpper(trade, 'quote_currency');
|
|
231458
|
+
const base = this.safeCurrencyCode(baseId);
|
|
231459
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
231460
|
+
const symbol = base + '/' + quote;
|
|
231461
|
+
const timestamp = this.safeInteger(trade, 'timestamp');
|
|
231462
|
+
market = this.safeMarket(symbol, market);
|
|
231463
|
+
const isSellerMaker = this.safeValue(trade, 'is_seller_maker');
|
|
231464
|
+
let side = undefined;
|
|
231465
|
+
if (isSellerMaker !== undefined) {
|
|
231466
|
+
side = isSellerMaker ? 'sell' : 'buy';
|
|
231467
|
+
}
|
|
231468
|
+
const priceString = this.safeString(trade, 'price');
|
|
231469
|
+
const amountString = this.safeString(trade, 'qty');
|
|
231470
|
+
return this.safeTrade({
|
|
231471
|
+
'id': this.safeString(trade, 'id'),
|
|
231472
|
+
'info': trade,
|
|
231473
|
+
'timestamp': timestamp,
|
|
231474
|
+
'datetime': this.iso8601(timestamp),
|
|
231475
|
+
'order': undefined,
|
|
231476
|
+
'symbol': market['symbol'],
|
|
231477
|
+
'type': undefined,
|
|
231478
|
+
'side': side,
|
|
231479
|
+
'takerOrMaker': undefined,
|
|
231480
|
+
'price': priceString,
|
|
231481
|
+
'amount': amountString,
|
|
231482
|
+
'cost': undefined,
|
|
231483
|
+
'fee': undefined,
|
|
231484
|
+
}, market);
|
|
231485
|
+
}
|
|
231486
|
+
handleErrorMessage(client, message) {
|
|
231487
|
+
//
|
|
231488
|
+
// {
|
|
231489
|
+
// "response_type": "ERROR",
|
|
231490
|
+
// "error_code": 160012,
|
|
231491
|
+
// "message": "Invalid Topic"
|
|
231492
|
+
// }
|
|
231493
|
+
//
|
|
231494
|
+
const type = this.safeString(message, 'response_type', '');
|
|
231495
|
+
if (type === 'ERROR') {
|
|
231496
|
+
return true;
|
|
231497
|
+
}
|
|
231498
|
+
return false;
|
|
231499
|
+
}
|
|
231500
|
+
handleMessage(client, message) {
|
|
231501
|
+
if (this.handleErrorMessage(client, message)) {
|
|
231502
|
+
return;
|
|
231503
|
+
}
|
|
231504
|
+
const type = this.safeString(message, 'response_type');
|
|
231505
|
+
if (type === 'PONG') {
|
|
231506
|
+
this.handlePong(client, message);
|
|
231507
|
+
return;
|
|
231508
|
+
}
|
|
231509
|
+
if (type === 'DATA') {
|
|
231510
|
+
const topic = this.safeString(message, 'channel', '');
|
|
231511
|
+
const methods = {
|
|
231512
|
+
'ORDERBOOK': this.handleOrderBook,
|
|
231513
|
+
'TICKER': this.handleTicker,
|
|
231514
|
+
'TRADE': this.handleTrades,
|
|
231515
|
+
};
|
|
231516
|
+
const exacMethod = this.safeValue(methods, topic);
|
|
231517
|
+
if (exacMethod !== undefined) {
|
|
231518
|
+
exacMethod.call(this, client, message);
|
|
231519
|
+
return;
|
|
231520
|
+
}
|
|
231521
|
+
const keys = Object.keys(methods);
|
|
231522
|
+
for (let i = 0; i < keys.length; i++) {
|
|
231523
|
+
const key = keys[i];
|
|
231524
|
+
if (topic.indexOf(keys[i]) >= 0) {
|
|
231525
|
+
const method = methods[key];
|
|
231526
|
+
method.call(this, client, message);
|
|
231527
|
+
return;
|
|
231528
|
+
}
|
|
231529
|
+
}
|
|
231530
|
+
}
|
|
231531
|
+
}
|
|
231532
|
+
ping(client) {
|
|
231533
|
+
return {
|
|
231534
|
+
'request_type': 'PING',
|
|
231535
|
+
};
|
|
231536
|
+
}
|
|
231537
|
+
handlePong(client, message) {
|
|
231538
|
+
//
|
|
231539
|
+
// {
|
|
231540
|
+
// "response_type":"PONG"
|
|
231541
|
+
// }
|
|
231542
|
+
//
|
|
231543
|
+
client.lastPong = this.milliseconds();
|
|
231544
|
+
return message;
|
|
231545
|
+
}
|
|
231546
|
+
}
|
|
231547
|
+
|
|
231548
|
+
|
|
231068
231549
|
/***/ }),
|
|
231069
231550
|
|
|
231070
231551
|
/***/ 6820:
|
|
@@ -239023,11 +239504,16 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
239023
239504
|
// inject trade in existing order by faking an order object
|
|
239024
239505
|
const orderId = this.safeString(parsedTrade, 'order');
|
|
239025
239506
|
const trades = [parsedTrade];
|
|
239507
|
+
const status = this.parseOrderStatus(this.safeString2(data, 'orderStatus', 'status', 'closed'));
|
|
239508
|
+
const filled = this.safeString(data, 'execAmt');
|
|
239509
|
+
const remaining = this.safeString(data, 'remainAmt');
|
|
239026
239510
|
const order = {
|
|
239027
239511
|
'id': orderId,
|
|
239028
239512
|
'trades': trades,
|
|
239029
|
-
'status':
|
|
239513
|
+
'status': status,
|
|
239030
239514
|
'symbol': market['symbol'],
|
|
239515
|
+
'filled': this.parseNumber(filled),
|
|
239516
|
+
'remaining': this.parseNumber(remaining),
|
|
239031
239517
|
};
|
|
239032
239518
|
parsedOrder = order;
|
|
239033
239519
|
}
|
|
@@ -243685,7 +244171,13 @@ class krakenfutures extends _krakenfutures_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
243685
244171
|
const name = this.safeString2(params, 'method', 'watchTickerMethod', method);
|
|
243686
244172
|
params = this.omit(params, ['watchTickerMethod', 'method']);
|
|
243687
244173
|
symbols = this.marketSymbols(symbols, undefined, false);
|
|
243688
|
-
|
|
244174
|
+
const ticker = await this.subscribePublic(name, symbols, params);
|
|
244175
|
+
if (this.newUpdates) {
|
|
244176
|
+
const tickers = {};
|
|
244177
|
+
tickers[ticker['symbol']] = ticker;
|
|
244178
|
+
return tickers;
|
|
244179
|
+
}
|
|
244180
|
+
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
243689
244181
|
}
|
|
243690
244182
|
async watchTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
243691
244183
|
/**
|
|
@@ -257898,6 +258390,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
257898
258390
|
'watchTicker': true,
|
|
257899
258391
|
'watchTickers': true,
|
|
257900
258392
|
'watchTrades': true,
|
|
258393
|
+
'watchPositions': true,
|
|
257901
258394
|
},
|
|
257902
258395
|
'urls': {
|
|
257903
258396
|
'api': {
|
|
@@ -257922,6 +258415,10 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
257922
258415
|
'tradesLimit': 1000,
|
|
257923
258416
|
'ordersLimit': 1000,
|
|
257924
258417
|
'requestId': {},
|
|
258418
|
+
'watchPositions': {
|
|
258419
|
+
'fetchPositionsSnapshot': true,
|
|
258420
|
+
'awaitPositionsSnapshot': true, // whether to wait for the positions snapshot before providing updates
|
|
258421
|
+
},
|
|
257925
258422
|
},
|
|
257926
258423
|
'streaming': {
|
|
257927
258424
|
'ping': this.ping,
|
|
@@ -258480,6 +258977,126 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258480
258977
|
client.resolve(this.orders, messageHashSymbol);
|
|
258481
258978
|
}
|
|
258482
258979
|
}
|
|
258980
|
+
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
258981
|
+
/**
|
|
258982
|
+
* @method
|
|
258983
|
+
* @name woo#watchPositions
|
|
258984
|
+
* @see https://docs.woo.org/#position-push
|
|
258985
|
+
* @description watch all open positions
|
|
258986
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
258987
|
+
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
258988
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
258989
|
+
*/
|
|
258990
|
+
await this.loadMarkets();
|
|
258991
|
+
let messageHash = '';
|
|
258992
|
+
symbols = this.marketSymbols(symbols);
|
|
258993
|
+
if (!this.isEmpty(symbols)) {
|
|
258994
|
+
messageHash = '::' + symbols.join(',');
|
|
258995
|
+
}
|
|
258996
|
+
messageHash = 'positions' + messageHash;
|
|
258997
|
+
const url = this.urls['api']['ws']['private'] + '/' + this.uid;
|
|
258998
|
+
const client = this.client(url);
|
|
258999
|
+
this.setPositionsCache(client, symbols);
|
|
259000
|
+
const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
|
|
259001
|
+
const awaitPositionsSnapshot = this.safeValue('watchPositions', 'awaitPositionsSnapshot', true);
|
|
259002
|
+
if (fetchPositionsSnapshot && awaitPositionsSnapshot && this.positions === undefined) {
|
|
259003
|
+
const snapshot = await client.future('fetchPositionsSnapshot');
|
|
259004
|
+
return this.filterBySymbolsSinceLimit(snapshot, symbols, since, limit, true);
|
|
259005
|
+
}
|
|
259006
|
+
const request = {
|
|
259007
|
+
'event': 'subscribe',
|
|
259008
|
+
'topic': 'position',
|
|
259009
|
+
};
|
|
259010
|
+
const newPositions = await this.watchPrivate(messageHash, request, params);
|
|
259011
|
+
if (this.newUpdates) {
|
|
259012
|
+
return newPositions;
|
|
259013
|
+
}
|
|
259014
|
+
return this.filterBySymbolsSinceLimit(this.positions, symbols, since, limit, true);
|
|
259015
|
+
}
|
|
259016
|
+
setPositionsCache(client, type, symbols = undefined) {
|
|
259017
|
+
const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', false);
|
|
259018
|
+
if (fetchPositionsSnapshot) {
|
|
259019
|
+
const messageHash = 'fetchPositionsSnapshot';
|
|
259020
|
+
if (!(messageHash in client.futures)) {
|
|
259021
|
+
client.future(messageHash);
|
|
259022
|
+
this.spawn(this.loadPositionsSnapshot, client, messageHash);
|
|
259023
|
+
}
|
|
259024
|
+
}
|
|
259025
|
+
else {
|
|
259026
|
+
this.positions = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolBySide */ .tU();
|
|
259027
|
+
}
|
|
259028
|
+
}
|
|
259029
|
+
async loadPositionsSnapshot(client, messageHash) {
|
|
259030
|
+
const positions = await this.fetchPositions();
|
|
259031
|
+
this.positions = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolBySide */ .tU();
|
|
259032
|
+
const cache = this.positions;
|
|
259033
|
+
for (let i = 0; i < positions.length; i++) {
|
|
259034
|
+
const position = positions[i];
|
|
259035
|
+
const contracts = this.safeNumber(position, 'contracts', 0);
|
|
259036
|
+
if (contracts > 0) {
|
|
259037
|
+
cache.append(position);
|
|
259038
|
+
}
|
|
259039
|
+
}
|
|
259040
|
+
// don't remove the future from the .futures cache
|
|
259041
|
+
const future = client.futures[messageHash];
|
|
259042
|
+
future.resolve(cache);
|
|
259043
|
+
client.resolve(cache, 'positions');
|
|
259044
|
+
}
|
|
259045
|
+
handlePositions(client, message) {
|
|
259046
|
+
//
|
|
259047
|
+
// {
|
|
259048
|
+
// "topic":"position",
|
|
259049
|
+
// "ts":1705292345255,
|
|
259050
|
+
// "data":{
|
|
259051
|
+
// "positions":{
|
|
259052
|
+
// "PERP_LTC_USDT":{
|
|
259053
|
+
// "holding":1,
|
|
259054
|
+
// "pendingLongQty":0,
|
|
259055
|
+
// "pendingShortQty":0,
|
|
259056
|
+
// "averageOpenPrice":71.53,
|
|
259057
|
+
// "pnl24H":0,
|
|
259058
|
+
// "fee24H":0.07153,
|
|
259059
|
+
// "settlePrice":71.53,
|
|
259060
|
+
// "markPrice":71.32098452065145,
|
|
259061
|
+
// "version":7886,
|
|
259062
|
+
// "openingTime":1705292304267,
|
|
259063
|
+
// "pnl24HPercentage":0,
|
|
259064
|
+
// "adlQuantile":1,
|
|
259065
|
+
// "positionSide":"BOTH"
|
|
259066
|
+
// }
|
|
259067
|
+
// }
|
|
259068
|
+
// }
|
|
259069
|
+
// }
|
|
259070
|
+
//
|
|
259071
|
+
const data = this.safeValue(message, 'data', {});
|
|
259072
|
+
const rawPositions = this.safeValue(data, 'positions', {});
|
|
259073
|
+
const postitionsIds = Object.keys(rawPositions);
|
|
259074
|
+
if (this.positions === undefined) {
|
|
259075
|
+
this.positions = new _base_ws_Cache_js__WEBPACK_IMPORTED_MODULE_2__/* .ArrayCacheBySymbolBySide */ .tU();
|
|
259076
|
+
}
|
|
259077
|
+
const cache = this.positions;
|
|
259078
|
+
const newPositions = [];
|
|
259079
|
+
for (let i = 0; i < postitionsIds.length; i++) {
|
|
259080
|
+
const marketId = postitionsIds[i];
|
|
259081
|
+
const market = this.safeMarket(marketId);
|
|
259082
|
+
const rawPosition = rawPositions[marketId];
|
|
259083
|
+
const position = this.parsePosition(rawPosition, market);
|
|
259084
|
+
newPositions.push(position);
|
|
259085
|
+
cache.append(position);
|
|
259086
|
+
}
|
|
259087
|
+
const messageHashes = this.findMessageHashes(client, 'positions::');
|
|
259088
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
259089
|
+
const messageHash = messageHashes[i];
|
|
259090
|
+
const parts = messageHash.split('::');
|
|
259091
|
+
const symbolsString = parts[1];
|
|
259092
|
+
const symbols = symbolsString.split(',');
|
|
259093
|
+
const positions = this.filterByArray(newPositions, 'symbol', symbols, false);
|
|
259094
|
+
if (!this.isEmpty(positions)) {
|
|
259095
|
+
client.resolve(positions, messageHash);
|
|
259096
|
+
}
|
|
259097
|
+
}
|
|
259098
|
+
client.resolve(newPositions, 'positions');
|
|
259099
|
+
}
|
|
258483
259100
|
async watchBalance(params = {}) {
|
|
258484
259101
|
/**
|
|
258485
259102
|
* @method
|
|
@@ -258563,6 +259180,7 @@ class woo extends _woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
258563
259180
|
'executionreport': this.handleOrderUpdate,
|
|
258564
259181
|
'trade': this.handleTrade,
|
|
258565
259182
|
'balance': this.handleBalance,
|
|
259183
|
+
'position': this.handlePositions,
|
|
258566
259184
|
};
|
|
258567
259185
|
const event = this.safeString(message, 'event');
|
|
258568
259186
|
let method = this.safeValue(methods, event);
|
|
@@ -281383,16 +282001,16 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
281383
282001
|
'createMarketOrderWithCost': false,
|
|
281384
282002
|
'createMarketSellOrderWithCost': false,
|
|
281385
282003
|
'createOrder': true,
|
|
282004
|
+
'createOrderWithTakeProfitAndStopLoss': true,
|
|
281386
282005
|
'createReduceOnlyOrder': true,
|
|
281387
282006
|
'createStopLimitOrder': false,
|
|
282007
|
+
'createStopLossOrder': true,
|
|
281388
282008
|
'createStopMarketOrder': false,
|
|
281389
282009
|
'createStopOrder': false,
|
|
282010
|
+
'createTakeProfitOrder': true,
|
|
281390
282011
|
'createTrailingAmountOrder': true,
|
|
281391
282012
|
'createTrailingPercentOrder': true,
|
|
281392
282013
|
'createTriggerOrder': true,
|
|
281393
|
-
'createTakeProfitOrder': true,
|
|
281394
|
-
'createStopLossOrder': true,
|
|
281395
|
-
'createOrderWithTakeProfitAndStopLoss': true,
|
|
281396
282014
|
'fetchAccounts': true,
|
|
281397
282015
|
'fetchBalance': true,
|
|
281398
282016
|
'fetchCanceledOrders': false,
|
|
@@ -293296,39 +293914,39 @@ var __webpack_exports__ = {};
|
|
|
293296
293914
|
(() => {
|
|
293297
293915
|
__webpack_require__.r(__webpack_exports__);
|
|
293298
293916
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
293299
|
-
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */
|
|
293300
|
-
/* harmony export */ AccountSuspended: () => (/* reexport safe */
|
|
293301
|
-
/* harmony export */ AddressPending: () => (/* reexport safe */
|
|
293302
|
-
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */
|
|
293303
|
-
/* harmony export */ AuthenticationError: () => (/* reexport safe */
|
|
293304
|
-
/* harmony export */ BadRequest: () => (/* reexport safe */
|
|
293305
|
-
/* harmony export */ BadResponse: () => (/* reexport safe */
|
|
293306
|
-
/* harmony export */ BadSymbol: () => (/* reexport safe */
|
|
293307
|
-
/* harmony export */ BaseError: () => (/* reexport safe */
|
|
293308
|
-
/* harmony export */ CancelPending: () => (/* reexport safe */
|
|
293309
|
-
/* harmony export */ DDoSProtection: () => (/* reexport safe */
|
|
293310
|
-
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */
|
|
293917
|
+
/* harmony export */ AccountNotEnabled: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.AccountNotEnabled),
|
|
293918
|
+
/* harmony export */ AccountSuspended: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.AccountSuspended),
|
|
293919
|
+
/* harmony export */ AddressPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.AddressPending),
|
|
293920
|
+
/* harmony export */ ArgumentsRequired: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.ArgumentsRequired),
|
|
293921
|
+
/* harmony export */ AuthenticationError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.AuthenticationError),
|
|
293922
|
+
/* harmony export */ BadRequest: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.BadRequest),
|
|
293923
|
+
/* harmony export */ BadResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.BadResponse),
|
|
293924
|
+
/* harmony export */ BadSymbol: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.BadSymbol),
|
|
293925
|
+
/* harmony export */ BaseError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.BaseError),
|
|
293926
|
+
/* harmony export */ CancelPending: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.CancelPending),
|
|
293927
|
+
/* harmony export */ DDoSProtection: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.DDoSProtection),
|
|
293928
|
+
/* harmony export */ DuplicateOrderId: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.DuplicateOrderId),
|
|
293311
293929
|
/* harmony export */ Exchange: () => (/* reexport safe */ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__.e),
|
|
293312
|
-
/* harmony export */ ExchangeError: () => (/* reexport safe */
|
|
293313
|
-
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */
|
|
293314
|
-
/* harmony export */ InsufficientFunds: () => (/* reexport safe */
|
|
293315
|
-
/* harmony export */ InvalidAddress: () => (/* reexport safe */
|
|
293316
|
-
/* harmony export */ InvalidNonce: () => (/* reexport safe */
|
|
293317
|
-
/* harmony export */ InvalidOrder: () => (/* reexport safe */
|
|
293318
|
-
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */
|
|
293319
|
-
/* harmony export */ NetworkError: () => (/* reexport safe */
|
|
293320
|
-
/* harmony export */ NoChange: () => (/* reexport safe */
|
|
293321
|
-
/* harmony export */ NotSupported: () => (/* reexport safe */
|
|
293322
|
-
/* harmony export */ NullResponse: () => (/* reexport safe */
|
|
293323
|
-
/* harmony export */ OnMaintenance: () => (/* reexport safe */
|
|
293324
|
-
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */
|
|
293325
|
-
/* harmony export */ OrderNotCached: () => (/* reexport safe */
|
|
293326
|
-
/* harmony export */ OrderNotFillable: () => (/* reexport safe */
|
|
293327
|
-
/* harmony export */ OrderNotFound: () => (/* reexport safe */
|
|
293328
|
-
/* harmony export */ PermissionDenied: () => (/* reexport safe */
|
|
293329
|
-
/* harmony export */ Precise: () => (/* reexport safe */
|
|
293330
|
-
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */
|
|
293331
|
-
/* harmony export */ RequestTimeout: () => (/* reexport safe */
|
|
293930
|
+
/* harmony export */ ExchangeError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.ExchangeError),
|
|
293931
|
+
/* harmony export */ ExchangeNotAvailable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.ExchangeNotAvailable),
|
|
293932
|
+
/* harmony export */ InsufficientFunds: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.InsufficientFunds),
|
|
293933
|
+
/* harmony export */ InvalidAddress: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.InvalidAddress),
|
|
293934
|
+
/* harmony export */ InvalidNonce: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.InvalidNonce),
|
|
293935
|
+
/* harmony export */ InvalidOrder: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.InvalidOrder),
|
|
293936
|
+
/* harmony export */ MarginModeAlreadySet: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.MarginModeAlreadySet),
|
|
293937
|
+
/* harmony export */ NetworkError: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.NetworkError),
|
|
293938
|
+
/* harmony export */ NoChange: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.NoChange),
|
|
293939
|
+
/* harmony export */ NotSupported: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.NotSupported),
|
|
293940
|
+
/* harmony export */ NullResponse: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.NullResponse),
|
|
293941
|
+
/* harmony export */ OnMaintenance: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.OnMaintenance),
|
|
293942
|
+
/* harmony export */ OrderImmediatelyFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.OrderImmediatelyFillable),
|
|
293943
|
+
/* harmony export */ OrderNotCached: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.OrderNotCached),
|
|
293944
|
+
/* harmony export */ OrderNotFillable: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.OrderNotFillable),
|
|
293945
|
+
/* harmony export */ OrderNotFound: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.OrderNotFound),
|
|
293946
|
+
/* harmony export */ PermissionDenied: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.PermissionDenied),
|
|
293947
|
+
/* harmony export */ Precise: () => (/* reexport safe */ _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_156__.O),
|
|
293948
|
+
/* harmony export */ RateLimitExceeded: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.RateLimitExceeded),
|
|
293949
|
+
/* harmony export */ RequestTimeout: () => (/* reexport safe */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__.RequestTimeout),
|
|
293332
293950
|
/* harmony export */ ace: () => (/* reexport safe */ _src_ace_js__WEBPACK_IMPORTED_MODULE_1__.Z),
|
|
293333
293951
|
/* harmony export */ alpaca: () => (/* reexport safe */ _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__.Z),
|
|
293334
293952
|
/* harmony export */ ascendex: () => (/* reexport safe */ _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__.Z),
|
|
@@ -293382,11 +294000,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
293382
294000
|
/* harmony export */ delta: () => (/* reexport safe */ _src_delta_js__WEBPACK_IMPORTED_MODULE_50__.Z),
|
|
293383
294001
|
/* harmony export */ deribit: () => (/* reexport safe */ _src_deribit_js__WEBPACK_IMPORTED_MODULE_51__.Z),
|
|
293384
294002
|
/* harmony export */ digifinex: () => (/* reexport safe */ _src_digifinex_js__WEBPACK_IMPORTED_MODULE_52__.Z),
|
|
293385
|
-
/* harmony export */ errors: () => (/* reexport module object */
|
|
294003
|
+
/* harmony export */ errors: () => (/* reexport module object */ _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__),
|
|
293386
294004
|
/* harmony export */ exchanges: () => (/* binding */ exchanges),
|
|
293387
294005
|
/* harmony export */ exmo: () => (/* reexport safe */ _src_exmo_js__WEBPACK_IMPORTED_MODULE_53__.Z),
|
|
293388
294006
|
/* harmony export */ fmfwio: () => (/* reexport safe */ _src_fmfwio_js__WEBPACK_IMPORTED_MODULE_54__.Z),
|
|
293389
|
-
/* harmony export */ functions: () => (/* reexport module object */
|
|
294007
|
+
/* harmony export */ functions: () => (/* reexport module object */ _src_base_functions_js__WEBPACK_IMPORTED_MODULE_157__),
|
|
293390
294008
|
/* harmony export */ gate: () => (/* reexport safe */ _src_gate_js__WEBPACK_IMPORTED_MODULE_55__.Z),
|
|
293391
294009
|
/* harmony export */ gateio: () => (/* reexport safe */ _src_gateio_js__WEBPACK_IMPORTED_MODULE_56__.Z),
|
|
293392
294010
|
/* harmony export */ gemini: () => (/* reexport safe */ _src_gemini_js__WEBPACK_IMPORTED_MODULE_57__.Z),
|
|
@@ -293435,9 +294053,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
293435
294053
|
/* harmony export */ zonda: () => (/* reexport safe */ _src_zonda_js__WEBPACK_IMPORTED_MODULE_98__.Z)
|
|
293436
294054
|
/* harmony export */ });
|
|
293437
294055
|
/* harmony import */ var _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3043);
|
|
293438
|
-
/* harmony import */ var
|
|
293439
|
-
/* harmony import */ var
|
|
293440
|
-
/* harmony import */ var
|
|
294056
|
+
/* harmony import */ var _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(2194);
|
|
294057
|
+
/* harmony import */ var _src_base_functions_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(7100);
|
|
294058
|
+
/* harmony import */ var _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(6689);
|
|
293441
294059
|
/* harmony import */ var _src_ace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9869);
|
|
293442
294060
|
/* harmony import */ var _src_alpaca_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5660);
|
|
293443
294061
|
/* harmony import */ var _src_ascendex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9612);
|
|
@@ -293561,37 +294179,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
293561
294179
|
/* harmony import */ var _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(3414);
|
|
293562
294180
|
/* harmony import */ var _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(8368);
|
|
293563
294181
|
/* harmony import */ var _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(204);
|
|
293564
|
-
/* harmony import */ var
|
|
293565
|
-
/* harmony import */ var
|
|
293566
|
-
/* harmony import */ var
|
|
293567
|
-
/* harmony import */ var
|
|
293568
|
-
/* harmony import */ var
|
|
293569
|
-
/* harmony import */ var
|
|
293570
|
-
/* harmony import */ var
|
|
293571
|
-
/* harmony import */ var
|
|
293572
|
-
/* harmony import */ var
|
|
293573
|
-
/* harmony import */ var
|
|
293574
|
-
/* harmony import */ var
|
|
293575
|
-
/* harmony import */ var
|
|
293576
|
-
/* harmony import */ var
|
|
293577
|
-
/* harmony import */ var
|
|
293578
|
-
/* harmony import */ var
|
|
293579
|
-
/* harmony import */ var
|
|
293580
|
-
/* harmony import */ var
|
|
293581
|
-
/* harmony import */ var
|
|
293582
|
-
/* harmony import */ var
|
|
293583
|
-
/* harmony import */ var
|
|
293584
|
-
/* harmony import */ var
|
|
293585
|
-
/* harmony import */ var
|
|
293586
|
-
/* harmony import */ var
|
|
293587
|
-
/* harmony import */ var
|
|
293588
|
-
/* harmony import */ var
|
|
293589
|
-
/* harmony import */ var
|
|
293590
|
-
/* harmony import */ var
|
|
293591
|
-
/* harmony import */ var
|
|
293592
|
-
/* harmony import */ var
|
|
293593
|
-
/* harmony import */ var
|
|
293594
|
-
/* harmony import */ var
|
|
294182
|
+
/* harmony import */ var _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(5208);
|
|
294183
|
+
/* harmony import */ var _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(6820);
|
|
294184
|
+
/* harmony import */ var _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(2952);
|
|
294185
|
+
/* harmony import */ var _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(1788);
|
|
294186
|
+
/* harmony import */ var _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(9004);
|
|
294187
|
+
/* harmony import */ var _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(8335);
|
|
294188
|
+
/* harmony import */ var _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(1465);
|
|
294189
|
+
/* harmony import */ var _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(9488);
|
|
294190
|
+
/* harmony import */ var _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(5189);
|
|
294191
|
+
/* harmony import */ var _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(8559);
|
|
294192
|
+
/* harmony import */ var _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(7474);
|
|
294193
|
+
/* harmony import */ var _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(8384);
|
|
294194
|
+
/* harmony import */ var _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(9021);
|
|
294195
|
+
/* harmony import */ var _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(3484);
|
|
294196
|
+
/* harmony import */ var _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(1311);
|
|
294197
|
+
/* harmony import */ var _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(736);
|
|
294198
|
+
/* harmony import */ var _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(449);
|
|
294199
|
+
/* harmony import */ var _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(2387);
|
|
294200
|
+
/* harmony import */ var _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(7181);
|
|
294201
|
+
/* harmony import */ var _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(627);
|
|
294202
|
+
/* harmony import */ var _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(6484);
|
|
294203
|
+
/* harmony import */ var _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(8080);
|
|
294204
|
+
/* harmony import */ var _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(7105);
|
|
294205
|
+
/* harmony import */ var _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(2214);
|
|
294206
|
+
/* harmony import */ var _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(4360);
|
|
294207
|
+
/* harmony import */ var _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(7924);
|
|
294208
|
+
/* harmony import */ var _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(3541);
|
|
294209
|
+
/* harmony import */ var _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(9782);
|
|
294210
|
+
/* harmony import */ var _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(7614);
|
|
294211
|
+
/* harmony import */ var _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(4828);
|
|
294212
|
+
/* harmony import */ var _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(5630);
|
|
294213
|
+
/* harmony import */ var _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(3910);
|
|
293595
294214
|
/*
|
|
293596
294215
|
|
|
293597
294216
|
MIT License
|
|
@@ -293626,7 +294245,7 @@ SOFTWARE.
|
|
|
293626
294245
|
|
|
293627
294246
|
//-----------------------------------------------------------------------------
|
|
293628
294247
|
// this is updated by vss.js when building
|
|
293629
|
-
const version = '4.2.
|
|
294248
|
+
const version = '4.2.16';
|
|
293630
294249
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
293631
294250
|
//-----------------------------------------------------------------------------
|
|
293632
294251
|
|
|
@@ -293782,6 +294401,7 @@ _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion
|
|
|
293782
294401
|
|
|
293783
294402
|
|
|
293784
294403
|
|
|
294404
|
+
|
|
293785
294405
|
|
|
293786
294406
|
|
|
293787
294407
|
const exchanges = {
|
|
@@ -293910,37 +294530,38 @@ const pro = {
|
|
|
293910
294530
|
'coinbase': _src_pro_coinbase_js__WEBPACK_IMPORTED_MODULE_121__/* ["default"] */ .Z,
|
|
293911
294531
|
'coinbasepro': _src_pro_coinbasepro_js__WEBPACK_IMPORTED_MODULE_122__/* ["default"] */ .Z,
|
|
293912
294532
|
'coinex': _src_pro_coinex_js__WEBPACK_IMPORTED_MODULE_123__/* ["default"] */ .Z,
|
|
293913
|
-
'
|
|
293914
|
-
'
|
|
293915
|
-
'
|
|
293916
|
-
'
|
|
293917
|
-
'
|
|
293918
|
-
'
|
|
293919
|
-
'
|
|
293920
|
-
'
|
|
293921
|
-
'
|
|
293922
|
-
'
|
|
293923
|
-
'
|
|
293924
|
-
'
|
|
293925
|
-
'
|
|
293926
|
-
'
|
|
293927
|
-
'
|
|
293928
|
-
'
|
|
293929
|
-
'
|
|
293930
|
-
'
|
|
293931
|
-
'
|
|
293932
|
-
'
|
|
293933
|
-
'
|
|
293934
|
-
'
|
|
293935
|
-
'
|
|
293936
|
-
'
|
|
293937
|
-
'
|
|
293938
|
-
'
|
|
293939
|
-
'
|
|
293940
|
-
'
|
|
293941
|
-
'
|
|
293942
|
-
'
|
|
293943
|
-
'
|
|
294533
|
+
'coinone': _src_pro_coinone_js__WEBPACK_IMPORTED_MODULE_124__/* ["default"] */ .Z,
|
|
294534
|
+
'cryptocom': _src_pro_cryptocom_js__WEBPACK_IMPORTED_MODULE_125__/* ["default"] */ .Z,
|
|
294535
|
+
'currencycom': _src_pro_currencycom_js__WEBPACK_IMPORTED_MODULE_126__/* ["default"] */ .Z,
|
|
294536
|
+
'deribit': _src_pro_deribit_js__WEBPACK_IMPORTED_MODULE_127__/* ["default"] */ .Z,
|
|
294537
|
+
'exmo': _src_pro_exmo_js__WEBPACK_IMPORTED_MODULE_128__/* ["default"] */ .Z,
|
|
294538
|
+
'gate': _src_pro_gate_js__WEBPACK_IMPORTED_MODULE_129__/* ["default"] */ .Z,
|
|
294539
|
+
'gateio': _src_pro_gateio_js__WEBPACK_IMPORTED_MODULE_130__/* ["default"] */ .Z,
|
|
294540
|
+
'gemini': _src_pro_gemini_js__WEBPACK_IMPORTED_MODULE_131__/* ["default"] */ .Z,
|
|
294541
|
+
'hitbtc': _src_pro_hitbtc_js__WEBPACK_IMPORTED_MODULE_132__/* ["default"] */ .Z,
|
|
294542
|
+
'hollaex': _src_pro_hollaex_js__WEBPACK_IMPORTED_MODULE_133__/* ["default"] */ .Z,
|
|
294543
|
+
'htx': _src_pro_htx_js__WEBPACK_IMPORTED_MODULE_134__/* ["default"] */ .Z,
|
|
294544
|
+
'huobi': _src_pro_huobi_js__WEBPACK_IMPORTED_MODULE_135__/* ["default"] */ .Z,
|
|
294545
|
+
'huobijp': _src_pro_huobijp_js__WEBPACK_IMPORTED_MODULE_136__/* ["default"] */ .Z,
|
|
294546
|
+
'idex': _src_pro_idex_js__WEBPACK_IMPORTED_MODULE_137__/* ["default"] */ .Z,
|
|
294547
|
+
'independentreserve': _src_pro_independentreserve_js__WEBPACK_IMPORTED_MODULE_138__/* ["default"] */ .Z,
|
|
294548
|
+
'kraken': _src_pro_kraken_js__WEBPACK_IMPORTED_MODULE_139__/* ["default"] */ .Z,
|
|
294549
|
+
'krakenfutures': _src_pro_krakenfutures_js__WEBPACK_IMPORTED_MODULE_140__/* ["default"] */ .Z,
|
|
294550
|
+
'kucoin': _src_pro_kucoin_js__WEBPACK_IMPORTED_MODULE_141__/* ["default"] */ .Z,
|
|
294551
|
+
'kucoinfutures': _src_pro_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_142__/* ["default"] */ .Z,
|
|
294552
|
+
'luno': _src_pro_luno_js__WEBPACK_IMPORTED_MODULE_143__/* ["default"] */ .Z,
|
|
294553
|
+
'mexc': _src_pro_mexc_js__WEBPACK_IMPORTED_MODULE_144__/* ["default"] */ .Z,
|
|
294554
|
+
'ndax': _src_pro_ndax_js__WEBPACK_IMPORTED_MODULE_145__/* ["default"] */ .Z,
|
|
294555
|
+
'okcoin': _src_pro_okcoin_js__WEBPACK_IMPORTED_MODULE_146__/* ["default"] */ .Z,
|
|
294556
|
+
'okx': _src_pro_okx_js__WEBPACK_IMPORTED_MODULE_147__/* ["default"] */ .Z,
|
|
294557
|
+
'phemex': _src_pro_phemex_js__WEBPACK_IMPORTED_MODULE_148__/* ["default"] */ .Z,
|
|
294558
|
+
'poloniex': _src_pro_poloniex_js__WEBPACK_IMPORTED_MODULE_149__/* ["default"] */ .Z,
|
|
294559
|
+
'poloniexfutures': _src_pro_poloniexfutures_js__WEBPACK_IMPORTED_MODULE_150__/* ["default"] */ .Z,
|
|
294560
|
+
'probit': _src_pro_probit_js__WEBPACK_IMPORTED_MODULE_151__/* ["default"] */ .Z,
|
|
294561
|
+
'upbit': _src_pro_upbit_js__WEBPACK_IMPORTED_MODULE_152__/* ["default"] */ .Z,
|
|
294562
|
+
'wazirx': _src_pro_wazirx_js__WEBPACK_IMPORTED_MODULE_153__/* ["default"] */ .Z,
|
|
294563
|
+
'whitebit': _src_pro_whitebit_js__WEBPACK_IMPORTED_MODULE_154__/* ["default"] */ .Z,
|
|
294564
|
+
'woo': _src_pro_woo_js__WEBPACK_IMPORTED_MODULE_155__/* ["default"] */ .Z,
|
|
293944
294565
|
};
|
|
293945
294566
|
for (const exchange in pro) {
|
|
293946
294567
|
// const ccxtExchange = exchanges[exchange]
|
|
@@ -293953,7 +294574,7 @@ for (const exchange in pro) {
|
|
|
293953
294574
|
pro.exchanges = Object.keys(pro);
|
|
293954
294575
|
pro['Exchange'] = _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e; // now the same for rest and ts
|
|
293955
294576
|
//-----------------------------------------------------------------------------
|
|
293956
|
-
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise:
|
|
294577
|
+
const ccxt = Object.assign({ version, Exchange: _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e, Precise: _src_base_Precise_js__WEBPACK_IMPORTED_MODULE_156__/* .Precise */ .O, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, _src_base_functions_js__WEBPACK_IMPORTED_MODULE_157__, _src_base_errors_js__WEBPACK_IMPORTED_MODULE_158__);
|
|
293957
294578
|
|
|
293958
294579
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ccxt);
|
|
293959
294580
|
//-----------------------------------------------------------------------------
|