ccxt 4.2.85 → 4.2.86
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 +5 -5
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +465 -306
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bingx.js +34 -19
- package/dist/cjs/src/bitbank.js +19 -23
- package/dist/cjs/src/coinex.js +397 -251
- package/dist/cjs/src/idex.js +10 -11
- package/dist/cjs/src/okcoin.js +3 -1
- package/dist/cjs/src/pro/bitget.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/coinex.d.ts +232 -123
- package/js/src/base/Exchange.d.ts +9 -9
- package/js/src/bingx.js +34 -19
- package/js/src/bitbank.js +19 -23
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +397 -251
- package/js/src/idex.js +10 -11
- package/js/src/okcoin.js +3 -1
- package/js/src/pro/bitget.js +1 -0
- package/package.json +1 -1
- package/skip-tests.json +4 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -31973,7 +31973,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
31973
31973
|
symbol += ':' + settle;
|
|
31974
31974
|
}
|
|
31975
31975
|
const fees = this.safeDict(this.fees, type, {});
|
|
31976
|
-
const contractSize = this.
|
|
31976
|
+
const contractSize = (swap) ? this.parseNumber('1') : undefined;
|
|
31977
31977
|
const isActive = this.safeString(market, 'status') === '1';
|
|
31978
31978
|
const isInverse = (spot) ? undefined : false;
|
|
31979
31979
|
const isLinear = (spot) ? undefined : swap;
|
|
@@ -32014,7 +32014,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32014
32014
|
'max': this.safeInteger(market, 'maxLongLeverage'),
|
|
32015
32015
|
},
|
|
32016
32016
|
'amount': {
|
|
32017
|
-
'min': this.
|
|
32017
|
+
'min': this.safeNumber2(market, 'minQty', 'tradeMinQuantity'),
|
|
32018
32018
|
'max': this.safeNumber(market, 'maxQty'),
|
|
32019
32019
|
},
|
|
32020
32020
|
'price': {
|
|
@@ -32022,7 +32022,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32022
32022
|
'max': undefined,
|
|
32023
32023
|
},
|
|
32024
32024
|
'cost': {
|
|
32025
|
-
'min': this.
|
|
32025
|
+
'min': this.safeNumber2(market, 'minNotional', 'tradeMinUSDT'),
|
|
32026
32026
|
'max': this.safeNumber(market, 'maxNotional'),
|
|
32027
32027
|
},
|
|
32028
32028
|
},
|
|
@@ -32379,6 +32379,13 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32379
32379
|
if (isMaker !== undefined) {
|
|
32380
32380
|
takeOrMaker = isMaker ? 'maker' : 'taker';
|
|
32381
32381
|
}
|
|
32382
|
+
let amount = this.safeStringN(trade, ['qty', 'amount', 'q']);
|
|
32383
|
+
if ((market !== undefined) && market['swap'] && ('volume' in trade)) {
|
|
32384
|
+
// private trade returns num of contracts instead of base currency (as the order-related methods do)
|
|
32385
|
+
const contractSize = this.safeString(market['info'], 'tradeMinQuantity');
|
|
32386
|
+
const volume = this.safeString(trade, 'volume');
|
|
32387
|
+
amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(volume, contractSize);
|
|
32388
|
+
}
|
|
32382
32389
|
return this.safeTrade({
|
|
32383
32390
|
'id': this.safeStringN(trade, ['id', 't']),
|
|
32384
32391
|
'info': trade,
|
|
@@ -32390,7 +32397,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
32390
32397
|
'side': this.parseOrderSide(side),
|
|
32391
32398
|
'takerOrMaker': takeOrMaker,
|
|
32392
32399
|
'price': this.safeString2(trade, 'price', 'p'),
|
|
32393
|
-
'amount':
|
|
32400
|
+
'amount': amount,
|
|
32394
32401
|
'cost': cost,
|
|
32395
32402
|
'fee': {
|
|
32396
32403
|
'cost': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(this.safeString2(trade, 'commission', 'n'))),
|
|
@@ -33022,19 +33029,27 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33022
33029
|
}
|
|
33023
33030
|
parsePosition(position, market = undefined) {
|
|
33024
33031
|
//
|
|
33025
|
-
//
|
|
33026
|
-
//
|
|
33027
|
-
//
|
|
33028
|
-
//
|
|
33029
|
-
//
|
|
33030
|
-
//
|
|
33031
|
-
//
|
|
33032
|
-
//
|
|
33033
|
-
//
|
|
33034
|
-
//
|
|
33035
|
-
//
|
|
33036
|
-
//
|
|
33037
|
-
//
|
|
33032
|
+
// {
|
|
33033
|
+
// "positionId":"1773122376147623936",
|
|
33034
|
+
// "symbol":"XRP-USDT",
|
|
33035
|
+
// "currency":"USDT",
|
|
33036
|
+
// "positionAmt":"3",
|
|
33037
|
+
// "availableAmt":"3",
|
|
33038
|
+
// "positionSide":"LONG",
|
|
33039
|
+
// "isolated":false,
|
|
33040
|
+
// "avgPrice":"0.6139",
|
|
33041
|
+
// "initialMargin":"0.0897",
|
|
33042
|
+
// "leverage":20,
|
|
33043
|
+
// "unrealizedProfit":"-0.0023",
|
|
33044
|
+
// "realisedProfit":"-0.0009",
|
|
33045
|
+
// "liquidationPrice":0,
|
|
33046
|
+
// "pnlRatio":"-0.0260",
|
|
33047
|
+
// "maxMarginReduction":"",
|
|
33048
|
+
// "riskRate":"",
|
|
33049
|
+
// "markPrice":"",
|
|
33050
|
+
// "positionValue":"",
|
|
33051
|
+
// "onlyOnePosition":false
|
|
33052
|
+
// }
|
|
33038
33053
|
//
|
|
33039
33054
|
// standard position
|
|
33040
33055
|
//
|
|
@@ -33061,7 +33076,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33061
33076
|
'info': position,
|
|
33062
33077
|
'id': this.safeString(position, 'positionId'),
|
|
33063
33078
|
'symbol': this.safeSymbol(marketId, market, '-', 'swap'),
|
|
33064
|
-
'notional': this.safeNumber(position, '
|
|
33079
|
+
'notional': this.safeNumber(position, 'positionValue'),
|
|
33065
33080
|
'marginMode': marginMode,
|
|
33066
33081
|
'liquidationPrice': undefined,
|
|
33067
33082
|
'entryPrice': this.safeNumber2(position, 'avgPrice', 'entryPrice'),
|
|
@@ -33079,7 +33094,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
33079
33094
|
'lastUpdateTimestamp': undefined,
|
|
33080
33095
|
'maintenanceMargin': undefined,
|
|
33081
33096
|
'maintenanceMarginPercentage': undefined,
|
|
33082
|
-
'collateral':
|
|
33097
|
+
'collateral': undefined,
|
|
33083
33098
|
'initialMargin': this.safeNumber(position, 'initialMargin'),
|
|
33084
33099
|
'initialMarginPercentage': undefined,
|
|
33085
33100
|
'leverage': this.safeNumber(position, 'leverage'),
|
|
@@ -36761,21 +36776,23 @@ class bitbank extends _abstract_bitbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
36761
36776
|
},
|
|
36762
36777
|
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
|
|
36763
36778
|
'exceptions': {
|
|
36764
|
-
'
|
|
36765
|
-
|
|
36766
|
-
|
|
36767
|
-
|
|
36768
|
-
|
|
36769
|
-
|
|
36770
|
-
|
|
36771
|
-
|
|
36772
|
-
|
|
36773
|
-
|
|
36774
|
-
|
|
36775
|
-
|
|
36776
|
-
|
|
36777
|
-
|
|
36778
|
-
|
|
36779
|
+
'exact': {
|
|
36780
|
+
'20001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
36781
|
+
'20002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
36782
|
+
'20003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
36783
|
+
'20005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
36784
|
+
'20004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidNonce,
|
|
36785
|
+
'40020': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
36786
|
+
'40021': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
36787
|
+
'40025': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
36788
|
+
'40013': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
36789
|
+
'40014': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
36790
|
+
'50008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
36791
|
+
'50009': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
36792
|
+
'50010': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
36793
|
+
'60001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
36794
|
+
'60005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
36795
|
+
},
|
|
36779
36796
|
},
|
|
36780
36797
|
});
|
|
36781
36798
|
}
|
|
@@ -37606,16 +37623,10 @@ class bitbank extends _abstract_bitbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
37606
37623
|
'70009': 'We are currently temporarily restricting orders to be carried out. Please use the limit order.',
|
|
37607
37624
|
'70010': 'We are temporarily raising the minimum order quantity as the system load is now rising.',
|
|
37608
37625
|
};
|
|
37609
|
-
const errorClasses = this.exceptions;
|
|
37610
37626
|
const code = this.safeString(data, 'code');
|
|
37611
37627
|
const message = this.safeString(errorMessages, code, 'Error');
|
|
37612
|
-
|
|
37613
|
-
|
|
37614
|
-
throw new errorClasses[code](message);
|
|
37615
|
-
}
|
|
37616
|
-
else {
|
|
37617
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + this.json(response));
|
|
37618
|
-
}
|
|
37628
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], code, message);
|
|
37629
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' ' + this.json(response));
|
|
37619
37630
|
}
|
|
37620
37631
|
return undefined;
|
|
37621
37632
|
}
|
|
@@ -102619,6 +102630,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
102619
102630
|
// 60 per 2 seconds => 30 per second => weight = 13.334
|
|
102620
102631
|
// 40 per 2 seconds => 20 per second => weight = 20
|
|
102621
102632
|
// 20 per 2 seconds => 10 per second => weight = 40
|
|
102633
|
+
// v1 is per 2 seconds and v2 is per 1 second
|
|
102622
102634
|
'rateLimit': 2.5,
|
|
102623
102635
|
'pro': true,
|
|
102624
102636
|
'certified': true,
|
|
@@ -102725,156 +102737,279 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
102725
102737
|
'perpetualPrivate': 'https://api.coinex.com/perpetual',
|
|
102726
102738
|
},
|
|
102727
102739
|
'www': 'https://www.coinex.com',
|
|
102728
|
-
'doc': 'https://
|
|
102740
|
+
'doc': 'https://docs.coinex.com/api/v2',
|
|
102729
102741
|
'fees': 'https://www.coinex.com/fees',
|
|
102730
102742
|
'referral': 'https://www.coinex.com/register?refer_code=yw5fz',
|
|
102731
102743
|
},
|
|
102732
102744
|
'api': {
|
|
102733
|
-
'
|
|
102734
|
-
'
|
|
102735
|
-
'
|
|
102736
|
-
|
|
102737
|
-
|
|
102738
|
-
|
|
102739
|
-
|
|
102740
|
-
|
|
102741
|
-
|
|
102742
|
-
|
|
102743
|
-
|
|
102744
|
-
|
|
102745
|
-
|
|
102746
|
-
|
|
102747
|
-
|
|
102748
|
-
|
|
102749
|
-
|
|
102750
|
-
|
|
102751
|
-
'private': {
|
|
102752
|
-
'get': {
|
|
102753
|
-
'account/amm/balance': 40,
|
|
102754
|
-
'account/investment/balance': 40,
|
|
102755
|
-
'account/balance/history': 40,
|
|
102756
|
-
'account/market/fee': 40,
|
|
102757
|
-
'balance/coin/deposit': 40,
|
|
102758
|
-
'balance/coin/withdraw': 40,
|
|
102759
|
-
'balance/info': 40,
|
|
102760
|
-
'balance/deposit/address/{coin_type}': 40,
|
|
102761
|
-
'contract/transfer/history': 40,
|
|
102762
|
-
'credit/info': 40,
|
|
102763
|
-
'credit/balance': 40,
|
|
102764
|
-
'investment/transfer/history': 40,
|
|
102765
|
-
'margin/account': 1,
|
|
102766
|
-
'margin/config': 1,
|
|
102767
|
-
'margin/loan/history': 40,
|
|
102768
|
-
'margin/transfer/history': 40,
|
|
102769
|
-
'order/deals': 40,
|
|
102770
|
-
'order/finished': 40,
|
|
102771
|
-
'order/pending': 8,
|
|
102772
|
-
'order/status': 8,
|
|
102773
|
-
'order/status/batch': 8,
|
|
102774
|
-
'order/user/deals': 40,
|
|
102775
|
-
'order/stop/finished': 40,
|
|
102776
|
-
'order/stop/pending': 8,
|
|
102777
|
-
'order/user/trade/fee': 1,
|
|
102778
|
-
'order/market/trade/info': 1,
|
|
102779
|
-
'sub_account/balance': 1,
|
|
102780
|
-
'sub_account/transfer/history': 40,
|
|
102781
|
-
'sub_account/auth/api': 40,
|
|
102782
|
-
'sub_account/auth/api/{user_auth_id}': 40,
|
|
102783
|
-
},
|
|
102784
|
-
'post': {
|
|
102785
|
-
'balance/coin/withdraw': 40,
|
|
102786
|
-
'contract/balance/transfer': 40,
|
|
102787
|
-
'margin/flat': 40,
|
|
102788
|
-
'margin/loan': 40,
|
|
102789
|
-
'margin/transfer': 40,
|
|
102790
|
-
'order/limit/batch': 40,
|
|
102791
|
-
'order/ioc': 13.334,
|
|
102792
|
-
'order/limit': 13.334,
|
|
102793
|
-
'order/market': 13.334,
|
|
102794
|
-
'order/modify': 13.334,
|
|
102795
|
-
'order/stop/limit': 13.334,
|
|
102796
|
-
'order/stop/market': 13.334,
|
|
102797
|
-
'order/stop/modify': 13.334,
|
|
102798
|
-
'sub_account/transfer': 40,
|
|
102799
|
-
'sub_account/register': 1,
|
|
102800
|
-
'sub_account/unfrozen': 40,
|
|
102801
|
-
'sub_account/frozen': 40,
|
|
102802
|
-
'sub_account/auth/api': 40,
|
|
102745
|
+
'v1': {
|
|
102746
|
+
'public': {
|
|
102747
|
+
'get': {
|
|
102748
|
+
'amm/market': 1,
|
|
102749
|
+
'common/currency/rate': 1,
|
|
102750
|
+
'common/asset/config': 1,
|
|
102751
|
+
'common/maintain/info': 1,
|
|
102752
|
+
'common/temp-maintain/info': 1,
|
|
102753
|
+
'margin/market': 1,
|
|
102754
|
+
'market/info': 1,
|
|
102755
|
+
'market/list': 1,
|
|
102756
|
+
'market/ticker': 1,
|
|
102757
|
+
'market/ticker/all': 1,
|
|
102758
|
+
'market/depth': 1,
|
|
102759
|
+
'market/deals': 1,
|
|
102760
|
+
'market/kline': 1,
|
|
102761
|
+
'market/detail': 1,
|
|
102762
|
+
},
|
|
102803
102763
|
},
|
|
102804
|
-
'
|
|
102805
|
-
'
|
|
102806
|
-
|
|
102807
|
-
|
|
102808
|
-
|
|
102809
|
-
|
|
102764
|
+
'private': {
|
|
102765
|
+
'get': {
|
|
102766
|
+
'account/amm/balance': 40,
|
|
102767
|
+
'account/investment/balance': 40,
|
|
102768
|
+
'account/balance/history': 40,
|
|
102769
|
+
'account/market/fee': 40,
|
|
102770
|
+
'balance/coin/deposit': 40,
|
|
102771
|
+
'balance/coin/withdraw': 40,
|
|
102772
|
+
'balance/info': 40,
|
|
102773
|
+
'balance/deposit/address/{coin_type}': 40,
|
|
102774
|
+
'contract/transfer/history': 40,
|
|
102775
|
+
'credit/info': 40,
|
|
102776
|
+
'credit/balance': 40,
|
|
102777
|
+
'investment/transfer/history': 40,
|
|
102778
|
+
'margin/account': 1,
|
|
102779
|
+
'margin/config': 1,
|
|
102780
|
+
'margin/loan/history': 40,
|
|
102781
|
+
'margin/transfer/history': 40,
|
|
102782
|
+
'order/deals': 40,
|
|
102783
|
+
'order/finished': 40,
|
|
102784
|
+
'order/pending': 8,
|
|
102785
|
+
'order/status': 8,
|
|
102786
|
+
'order/status/batch': 8,
|
|
102787
|
+
'order/user/deals': 40,
|
|
102788
|
+
'order/stop/finished': 40,
|
|
102789
|
+
'order/stop/pending': 8,
|
|
102790
|
+
'order/user/trade/fee': 1,
|
|
102791
|
+
'order/market/trade/info': 1,
|
|
102792
|
+
'sub_account/balance': 1,
|
|
102793
|
+
'sub_account/transfer/history': 40,
|
|
102794
|
+
'sub_account/auth/api': 40,
|
|
102795
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
|
102796
|
+
},
|
|
102797
|
+
'post': {
|
|
102798
|
+
'balance/coin/withdraw': 40,
|
|
102799
|
+
'contract/balance/transfer': 40,
|
|
102800
|
+
'margin/flat': 40,
|
|
102801
|
+
'margin/loan': 40,
|
|
102802
|
+
'margin/transfer': 40,
|
|
102803
|
+
'order/limit/batch': 40,
|
|
102804
|
+
'order/ioc': 13.334,
|
|
102805
|
+
'order/limit': 13.334,
|
|
102806
|
+
'order/market': 13.334,
|
|
102807
|
+
'order/modify': 13.334,
|
|
102808
|
+
'order/stop/limit': 13.334,
|
|
102809
|
+
'order/stop/market': 13.334,
|
|
102810
|
+
'order/stop/modify': 13.334,
|
|
102811
|
+
'sub_account/transfer': 40,
|
|
102812
|
+
'sub_account/register': 1,
|
|
102813
|
+
'sub_account/unfrozen': 40,
|
|
102814
|
+
'sub_account/frozen': 40,
|
|
102815
|
+
'sub_account/auth/api': 40,
|
|
102816
|
+
},
|
|
102817
|
+
'put': {
|
|
102818
|
+
'balance/deposit/address/{coin_type}': 40,
|
|
102819
|
+
'sub_account/unfrozen': 40,
|
|
102820
|
+
'sub_account/frozen': 40,
|
|
102821
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
|
102822
|
+
'v1/account/settings': 40,
|
|
102823
|
+
},
|
|
102824
|
+
'delete': {
|
|
102825
|
+
'balance/coin/withdraw': 40,
|
|
102826
|
+
'order/pending/batch': 40,
|
|
102827
|
+
'order/pending': 13.334,
|
|
102828
|
+
'order/stop/pending': 40,
|
|
102829
|
+
'order/stop/pending/{id}': 13.334,
|
|
102830
|
+
'order/pending/by_client_id': 40,
|
|
102831
|
+
'order/stop/pending/by_client_id': 40,
|
|
102832
|
+
'sub_account/auth/api/{user_auth_id}': 40,
|
|
102833
|
+
'sub_account/authorize/{id}': 40,
|
|
102834
|
+
},
|
|
102810
102835
|
},
|
|
102811
|
-
'
|
|
102812
|
-
'
|
|
102813
|
-
|
|
102814
|
-
|
|
102815
|
-
|
|
102816
|
-
|
|
102817
|
-
|
|
102818
|
-
|
|
102819
|
-
|
|
102820
|
-
|
|
102836
|
+
'perpetualPublic': {
|
|
102837
|
+
'get': {
|
|
102838
|
+
'ping': 1,
|
|
102839
|
+
'time': 1,
|
|
102840
|
+
'market/list': 1,
|
|
102841
|
+
'market/limit_config': 1,
|
|
102842
|
+
'market/ticker': 1,
|
|
102843
|
+
'market/ticker/all': 1,
|
|
102844
|
+
'market/depth': 1,
|
|
102845
|
+
'market/deals': 1,
|
|
102846
|
+
'market/funding_history': 1,
|
|
102847
|
+
'market/kline': 1,
|
|
102848
|
+
},
|
|
102821
102849
|
},
|
|
102822
|
-
|
|
102823
|
-
|
|
102824
|
-
|
|
102825
|
-
|
|
102826
|
-
|
|
102827
|
-
|
|
102828
|
-
|
|
102829
|
-
|
|
102830
|
-
|
|
102831
|
-
|
|
102832
|
-
|
|
102833
|
-
|
|
102834
|
-
|
|
102850
|
+
'perpetualPrivate': {
|
|
102851
|
+
'get': {
|
|
102852
|
+
'market/user_deals': 1,
|
|
102853
|
+
'asset/query': 40,
|
|
102854
|
+
'order/pending': 8,
|
|
102855
|
+
'order/finished': 40,
|
|
102856
|
+
'order/stop_finished': 40,
|
|
102857
|
+
'order/stop_pending': 8,
|
|
102858
|
+
'order/status': 8,
|
|
102859
|
+
'order/stop_status': 8,
|
|
102860
|
+
'position/finished': 40,
|
|
102861
|
+
'position/pending': 40,
|
|
102862
|
+
'position/funding': 40,
|
|
102863
|
+
'position/adl_history': 40,
|
|
102864
|
+
'market/preference': 40,
|
|
102865
|
+
'position/margin_history': 40,
|
|
102866
|
+
'position/settle_history': 40,
|
|
102867
|
+
},
|
|
102868
|
+
'post': {
|
|
102869
|
+
'market/adjust_leverage': 1,
|
|
102870
|
+
'market/position_expect': 1,
|
|
102871
|
+
'order/put_limit': 20,
|
|
102872
|
+
'order/put_market': 20,
|
|
102873
|
+
'order/put_stop_limit': 20,
|
|
102874
|
+
'order/put_stop_market': 20,
|
|
102875
|
+
'order/modify': 20,
|
|
102876
|
+
'order/modify_stop': 20,
|
|
102877
|
+
'order/cancel': 20,
|
|
102878
|
+
'order/cancel_all': 40,
|
|
102879
|
+
'order/cancel_batch': 40,
|
|
102880
|
+
'order/cancel_stop': 20,
|
|
102881
|
+
'order/cancel_stop_all': 40,
|
|
102882
|
+
'order/close_limit': 20,
|
|
102883
|
+
'order/close_market': 20,
|
|
102884
|
+
'position/adjust_margin': 20,
|
|
102885
|
+
'position/stop_loss': 20,
|
|
102886
|
+
'position/take_profit': 20,
|
|
102887
|
+
'position/market_close': 20,
|
|
102888
|
+
'order/cancel/by_client_id': 20,
|
|
102889
|
+
'order/cancel_stop/by_client_id': 20,
|
|
102890
|
+
'market/preference': 20,
|
|
102891
|
+
},
|
|
102835
102892
|
},
|
|
102836
102893
|
},
|
|
102837
|
-
'
|
|
102838
|
-
'
|
|
102839
|
-
'
|
|
102840
|
-
|
|
102841
|
-
|
|
102842
|
-
|
|
102843
|
-
|
|
102844
|
-
|
|
102845
|
-
|
|
102846
|
-
|
|
102847
|
-
|
|
102848
|
-
|
|
102849
|
-
|
|
102850
|
-
|
|
102851
|
-
|
|
102852
|
-
|
|
102853
|
-
|
|
102894
|
+
'v2': {
|
|
102895
|
+
'public': {
|
|
102896
|
+
'get': {
|
|
102897
|
+
'maintain-info': 1,
|
|
102898
|
+
'ping': 1,
|
|
102899
|
+
'time': 1,
|
|
102900
|
+
'spot/market': 1,
|
|
102901
|
+
'spot/ticker': 1,
|
|
102902
|
+
'spot/depth': 1,
|
|
102903
|
+
'spot/deals': 1,
|
|
102904
|
+
'spot/kline': 1,
|
|
102905
|
+
'spot/index': 1,
|
|
102906
|
+
'futures/market': 1,
|
|
102907
|
+
'futures/ticker': 1,
|
|
102908
|
+
'futures/depth': 1,
|
|
102909
|
+
'futures/deals': 1,
|
|
102910
|
+
'futures/kline': 1,
|
|
102911
|
+
'futures/index': 1,
|
|
102912
|
+
'futures/funding-rate': 1,
|
|
102913
|
+
'futures/funding-rate-history': 1,
|
|
102914
|
+
'futures/position-level': 1,
|
|
102915
|
+
'futures/liquidation-history': 1,
|
|
102916
|
+
'futures/basis-history': 1,
|
|
102917
|
+
},
|
|
102854
102918
|
},
|
|
102855
|
-
'
|
|
102856
|
-
'
|
|
102857
|
-
|
|
102858
|
-
|
|
102859
|
-
|
|
102860
|
-
|
|
102861
|
-
|
|
102862
|
-
|
|
102863
|
-
|
|
102864
|
-
|
|
102865
|
-
|
|
102866
|
-
|
|
102867
|
-
|
|
102868
|
-
|
|
102869
|
-
|
|
102870
|
-
|
|
102871
|
-
|
|
102872
|
-
|
|
102873
|
-
|
|
102874
|
-
|
|
102875
|
-
|
|
102876
|
-
|
|
102877
|
-
|
|
102919
|
+
'private': {
|
|
102920
|
+
'get': {
|
|
102921
|
+
'account/subs': 1,
|
|
102922
|
+
'account/subs/api-detail': 40,
|
|
102923
|
+
'account/subs/info': 1,
|
|
102924
|
+
'account/subs/api': 40,
|
|
102925
|
+
'account/subs/transfer-history': 40,
|
|
102926
|
+
'account/subs/spot-balance': 1,
|
|
102927
|
+
'account/trade-fee-rate': 40,
|
|
102928
|
+
'assets/spot/balance': 40,
|
|
102929
|
+
'assets/futures/balance': 40,
|
|
102930
|
+
'assets/margin/balance': 1,
|
|
102931
|
+
'assets/financial/balance': 40,
|
|
102932
|
+
'assets/amm/liquidity': 40,
|
|
102933
|
+
'assets/credit/info': 40,
|
|
102934
|
+
'assets/margin/borrow-history': 40,
|
|
102935
|
+
'assets/margin/interest-limit': 1,
|
|
102936
|
+
'assets/deposit-address': 40,
|
|
102937
|
+
'assets/deposit-history': 40,
|
|
102938
|
+
'assets/withdraw': 40,
|
|
102939
|
+
'assets/deposit-withdraw-config': 1,
|
|
102940
|
+
'assets/transfer-history': 40,
|
|
102941
|
+
'spot/order-status': 8,
|
|
102942
|
+
'spot/batch-order-status': 8,
|
|
102943
|
+
'spot/pending-order': 8,
|
|
102944
|
+
'spot/finished-order': 40,
|
|
102945
|
+
'spot/pending-stop-order': 8,
|
|
102946
|
+
'spot/finished-stop-order': 40,
|
|
102947
|
+
'spot/user-deals': 40,
|
|
102948
|
+
'spot/order-deals': 40,
|
|
102949
|
+
'futures/order-status': 8,
|
|
102950
|
+
'futures/batch-order-status': 1,
|
|
102951
|
+
'futures/pending-order': 8,
|
|
102952
|
+
'futures/finished-order': 40,
|
|
102953
|
+
'futures/pending-stop-order': 8,
|
|
102954
|
+
'futures/finished-stop-order': 40,
|
|
102955
|
+
'futures/user-deals': 1,
|
|
102956
|
+
'futures/order-deals': 1,
|
|
102957
|
+
'futures/pending-position': 40,
|
|
102958
|
+
'futures/finished-position': 1,
|
|
102959
|
+
'futures/position-margin-history': 1,
|
|
102960
|
+
'futures/position-funding-history': 40,
|
|
102961
|
+
'futures/position-adl-history': 1,
|
|
102962
|
+
'futures/position-settle-history': 1,
|
|
102963
|
+
},
|
|
102964
|
+
'post': {
|
|
102965
|
+
'account/subs': 40,
|
|
102966
|
+
'account/subs/frozen': 40,
|
|
102967
|
+
'account/subs/unfrozen': 40,
|
|
102968
|
+
'account/subs/api': 40,
|
|
102969
|
+
'account/subs/edit-api': 40,
|
|
102970
|
+
'account/subs/delete-api': 40,
|
|
102971
|
+
'account/subs/transfer': 40,
|
|
102972
|
+
'account/settings': 40,
|
|
102973
|
+
'assets/margin/borrow': 40,
|
|
102974
|
+
'assets/margin/repay': 40,
|
|
102975
|
+
'assets/renewal-deposit-address': 40,
|
|
102976
|
+
'assets/withdraw': 40,
|
|
102977
|
+
'assets/cancel-withdraw': 40,
|
|
102978
|
+
'assets/transfer': 40,
|
|
102979
|
+
'assets/amm/add-liquidity': 1,
|
|
102980
|
+
'assets/amm/remove-liquidity': 1,
|
|
102981
|
+
'spot/order': 13.334,
|
|
102982
|
+
'spot/stop-order': 13.334,
|
|
102983
|
+
'spot/batch-order': 40,
|
|
102984
|
+
'spot/batch-stop-order': 1,
|
|
102985
|
+
'spot/modify-order': 13.334,
|
|
102986
|
+
'spot/modify-stop-order': 13.334,
|
|
102987
|
+
'spot/cancel-all-order': 1,
|
|
102988
|
+
'spot/cancel-order': 6.667,
|
|
102989
|
+
'spot/cancel-stop-order': 6.667,
|
|
102990
|
+
'spot/cancel-batch-order': 10,
|
|
102991
|
+
'spot/cancel-batch-stop-order': 10,
|
|
102992
|
+
'spot/cancel-order-by-client-id': 1,
|
|
102993
|
+
'spot/cancel-stop-order-by-client-id': 1,
|
|
102994
|
+
'futures/order': 20,
|
|
102995
|
+
'futures/stop-order': 20,
|
|
102996
|
+
'futures/batch-order': 1,
|
|
102997
|
+
'futures/batch-stop-order': 1,
|
|
102998
|
+
'futures/modify-order': 20,
|
|
102999
|
+
'futures/modify-stop-order': 20,
|
|
103000
|
+
'futures/cancel-all-order': 1,
|
|
103001
|
+
'futures/cancel-order': 10,
|
|
103002
|
+
'futures/cancel-stop-order': 10,
|
|
103003
|
+
'futures/cancel-batch-order': 20,
|
|
103004
|
+
'futures/cancel-batch-stop-order': 20,
|
|
103005
|
+
'futures/cancel-order-by-client-id': 1,
|
|
103006
|
+
'futures/cancel-stop-order-by-client-id': 1,
|
|
103007
|
+
'futures/close-position': 20,
|
|
103008
|
+
'futures/adjust-position-margin': 20,
|
|
103009
|
+
'futures/adjust-position-leverage': 20,
|
|
103010
|
+
'futures/set-position-stop-loss': 20,
|
|
103011
|
+
'futures/set-position-take-profit': 20,
|
|
103012
|
+
},
|
|
102878
103013
|
},
|
|
102879
103014
|
},
|
|
102880
103015
|
},
|
|
@@ -102945,7 +103080,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
102945
103080
|
});
|
|
102946
103081
|
}
|
|
102947
103082
|
async fetchCurrencies(params = {}) {
|
|
102948
|
-
const response = await this.
|
|
103083
|
+
const response = await this.v1PublicGetCommonAssetConfig(params);
|
|
102949
103084
|
// {
|
|
102950
103085
|
// "code": 0,
|
|
102951
103086
|
// "data": {
|
|
@@ -103093,7 +103228,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103093
103228
|
return this.arrayConcat(spotMarkets, swapMarkets);
|
|
103094
103229
|
}
|
|
103095
103230
|
async fetchSpotMarkets(params) {
|
|
103096
|
-
const response = await this.
|
|
103231
|
+
const response = await this.v1PublicGetMarketInfo(params);
|
|
103097
103232
|
//
|
|
103098
103233
|
// {
|
|
103099
103234
|
// "code": 0,
|
|
@@ -103182,7 +103317,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103182
103317
|
return result;
|
|
103183
103318
|
}
|
|
103184
103319
|
async fetchContractMarkets(params) {
|
|
103185
|
-
const response = await this.
|
|
103320
|
+
const response = await this.v1PerpetualPublicGetMarketList(params);
|
|
103186
103321
|
//
|
|
103187
103322
|
// {
|
|
103188
103323
|
// "code": 0,
|
|
@@ -103364,10 +103499,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103364
103499
|
};
|
|
103365
103500
|
let response = undefined;
|
|
103366
103501
|
if (market['swap']) {
|
|
103367
|
-
response = await this.
|
|
103502
|
+
response = await this.v1PerpetualPublicGetMarketTicker(this.extend(request, params));
|
|
103368
103503
|
}
|
|
103369
103504
|
else {
|
|
103370
|
-
response = await this.
|
|
103505
|
+
response = await this.v1PublicGetMarketTicker(this.extend(request, params));
|
|
103371
103506
|
}
|
|
103372
103507
|
//
|
|
103373
103508
|
// Spot
|
|
@@ -103446,10 +103581,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103446
103581
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
|
103447
103582
|
let response = undefined;
|
|
103448
103583
|
if (marketType === 'swap') {
|
|
103449
|
-
response = await this.
|
|
103584
|
+
response = await this.v1PerpetualPublicGetMarketTickerAll(query);
|
|
103450
103585
|
}
|
|
103451
103586
|
else {
|
|
103452
|
-
response = await this.
|
|
103587
|
+
response = await this.v1PublicGetMarketTickerAll();
|
|
103453
103588
|
}
|
|
103454
103589
|
//
|
|
103455
103590
|
// Spot
|
|
@@ -103536,7 +103671,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103536
103671
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
103537
103672
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
103538
103673
|
*/
|
|
103539
|
-
const response = await this.
|
|
103674
|
+
const response = await this.v1PerpetualPublicGetTime(params);
|
|
103540
103675
|
//
|
|
103541
103676
|
// {
|
|
103542
103677
|
// "code": "0",
|
|
@@ -103570,10 +103705,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103570
103705
|
};
|
|
103571
103706
|
let response = undefined;
|
|
103572
103707
|
if (market['swap']) {
|
|
103573
|
-
response = await this.
|
|
103708
|
+
response = await this.v1PerpetualPublicGetMarketDepth(this.extend(request, params));
|
|
103574
103709
|
}
|
|
103575
103710
|
else {
|
|
103576
|
-
response = await this.
|
|
103711
|
+
response = await this.v1PublicGetMarketDepth(this.extend(request, params));
|
|
103577
103712
|
}
|
|
103578
103713
|
//
|
|
103579
103714
|
// Spot
|
|
@@ -103774,10 +103909,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103774
103909
|
}
|
|
103775
103910
|
let response = undefined;
|
|
103776
103911
|
if (market['swap']) {
|
|
103777
|
-
response = await this.
|
|
103912
|
+
response = await this.v1PerpetualPublicGetMarketDeals(this.extend(request, params));
|
|
103778
103913
|
}
|
|
103779
103914
|
else {
|
|
103780
|
-
response = await this.
|
|
103915
|
+
response = await this.v1PublicGetMarketDeals(this.extend(request, params));
|
|
103781
103916
|
}
|
|
103782
103917
|
//
|
|
103783
103918
|
// Spot and Swap
|
|
@@ -103814,7 +103949,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103814
103949
|
const request = {
|
|
103815
103950
|
'market': market['id'],
|
|
103816
103951
|
};
|
|
103817
|
-
const response = await this.
|
|
103952
|
+
const response = await this.v1PublicGetMarketDetail(this.extend(request, params));
|
|
103818
103953
|
//
|
|
103819
103954
|
// {
|
|
103820
103955
|
// "code": 0,
|
|
@@ -103844,7 +103979,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103844
103979
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
103845
103980
|
*/
|
|
103846
103981
|
await this.loadMarkets();
|
|
103847
|
-
const response = await this.
|
|
103982
|
+
const response = await this.v1PublicGetMarketInfo(params);
|
|
103848
103983
|
//
|
|
103849
103984
|
// {
|
|
103850
103985
|
// "code": 0,
|
|
@@ -103932,10 +104067,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103932
104067
|
}
|
|
103933
104068
|
let response = undefined;
|
|
103934
104069
|
if (market['swap']) {
|
|
103935
|
-
response = await this.
|
|
104070
|
+
response = await this.v1PerpetualPublicGetMarketKline(this.extend(request, params));
|
|
103936
104071
|
}
|
|
103937
104072
|
else {
|
|
103938
|
-
response = await this.
|
|
104073
|
+
response = await this.v1PublicGetMarketKline(this.extend(request, params));
|
|
103939
104074
|
}
|
|
103940
104075
|
//
|
|
103941
104076
|
// Spot
|
|
@@ -103981,7 +104116,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
103981
104116
|
const request = {
|
|
103982
104117
|
'market': marketId,
|
|
103983
104118
|
};
|
|
103984
|
-
const response = await this.
|
|
104119
|
+
const response = await this.v1PrivateGetMarginAccount(this.extend(request, params));
|
|
103985
104120
|
//
|
|
103986
104121
|
// {
|
|
103987
104122
|
// "code": 0,
|
|
@@ -104048,7 +104183,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
104048
104183
|
}
|
|
104049
104184
|
async fetchSpotBalance(params = {}) {
|
|
104050
104185
|
await this.loadMarkets();
|
|
104051
|
-
const response = await this.
|
|
104186
|
+
const response = await this.v1PrivateGetBalanceInfo(params);
|
|
104052
104187
|
//
|
|
104053
104188
|
// {
|
|
104054
104189
|
// "code": 0,
|
|
@@ -104085,7 +104220,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
104085
104220
|
}
|
|
104086
104221
|
async fetchSwapBalance(params = {}) {
|
|
104087
104222
|
await this.loadMarkets();
|
|
104088
|
-
const response = await this.
|
|
104223
|
+
const response = await this.v1PerpetualPrivateGetAssetQuery(params);
|
|
104089
104224
|
//
|
|
104090
104225
|
// {
|
|
104091
104226
|
// "code": 0,
|
|
@@ -104119,7 +104254,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
104119
104254
|
}
|
|
104120
104255
|
async fetchFinancialBalance(params = {}) {
|
|
104121
104256
|
await this.loadMarkets();
|
|
104122
|
-
const response = await this.
|
|
104257
|
+
const response = await this.v1PrivateGetAccountInvestmentBalance(params);
|
|
104123
104258
|
//
|
|
104124
104259
|
// {
|
|
104125
104260
|
// "code": 0,
|
|
@@ -104759,53 +104894,53 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
104759
104894
|
if (market['spot']) {
|
|
104760
104895
|
if (isTriggerOrder) {
|
|
104761
104896
|
if (type === 'limit') {
|
|
104762
|
-
response = await this.
|
|
104897
|
+
response = await this.v1PrivatePostOrderStopLimit(request);
|
|
104763
104898
|
}
|
|
104764
104899
|
else {
|
|
104765
|
-
response = await this.
|
|
104900
|
+
response = await this.v1PrivatePostOrderStopMarket(request);
|
|
104766
104901
|
}
|
|
104767
104902
|
}
|
|
104768
104903
|
else {
|
|
104769
104904
|
if (type === 'limit') {
|
|
104770
|
-
response = await this.
|
|
104905
|
+
response = await this.v1PrivatePostOrderLimit(request);
|
|
104771
104906
|
}
|
|
104772
104907
|
else {
|
|
104773
|
-
response = await this.
|
|
104908
|
+
response = await this.v1PrivatePostOrderMarket(request);
|
|
104774
104909
|
}
|
|
104775
104910
|
}
|
|
104776
104911
|
}
|
|
104777
104912
|
else {
|
|
104778
104913
|
if (isTriggerOrder) {
|
|
104779
104914
|
if (type === 'limit') {
|
|
104780
|
-
response = await this.
|
|
104915
|
+
response = await this.v1PerpetualPrivatePostOrderPutStopLimit(request);
|
|
104781
104916
|
}
|
|
104782
104917
|
else {
|
|
104783
|
-
response = await this.
|
|
104918
|
+
response = await this.v1PerpetualPrivatePostOrderPutStopMarket(request);
|
|
104784
104919
|
}
|
|
104785
104920
|
}
|
|
104786
104921
|
else if (isStopLossOrTakeProfitTrigger) {
|
|
104787
104922
|
if (isStopLossTriggerOrder) {
|
|
104788
|
-
response = await this.
|
|
104923
|
+
response = await this.v1PerpetualPrivatePostPositionStopLoss(request);
|
|
104789
104924
|
}
|
|
104790
104925
|
else if (isTakeProfitTriggerOrder) {
|
|
104791
|
-
response = await this.
|
|
104926
|
+
response = await this.v1PerpetualPrivatePostPositionTakeProfit(request);
|
|
104792
104927
|
}
|
|
104793
104928
|
}
|
|
104794
104929
|
else {
|
|
104795
104930
|
if (reduceOnly) {
|
|
104796
104931
|
if (type === 'limit') {
|
|
104797
|
-
response = await this.
|
|
104932
|
+
response = await this.v1PerpetualPrivatePostOrderCloseLimit(request);
|
|
104798
104933
|
}
|
|
104799
104934
|
else {
|
|
104800
|
-
response = await this.
|
|
104935
|
+
response = await this.v1PerpetualPrivatePostOrderCloseMarket(request);
|
|
104801
104936
|
}
|
|
104802
104937
|
}
|
|
104803
104938
|
else {
|
|
104804
104939
|
if (type === 'limit') {
|
|
104805
|
-
response = await this.
|
|
104940
|
+
response = await this.v1PerpetualPrivatePostOrderPutLimit(request);
|
|
104806
104941
|
}
|
|
104807
104942
|
else {
|
|
104808
|
-
response = await this.
|
|
104943
|
+
response = await this.v1PerpetualPrivatePostOrderPutMarket(request);
|
|
104809
104944
|
}
|
|
104810
104945
|
}
|
|
104811
104946
|
}
|
|
@@ -104933,7 +105068,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
104933
105068
|
'market': market['id'],
|
|
104934
105069
|
'batch_orders': this.json(ordersRequests),
|
|
104935
105070
|
};
|
|
104936
|
-
const response = await this.
|
|
105071
|
+
const response = await this.v1PrivatePostOrderLimitBatch(request);
|
|
104937
105072
|
//
|
|
104938
105073
|
// {
|
|
104939
105074
|
// "code": 0,
|
|
@@ -105016,11 +105151,11 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105016
105151
|
let response = undefined;
|
|
105017
105152
|
if (market['spot']) {
|
|
105018
105153
|
request['batch_ids'] = idsString;
|
|
105019
|
-
response = await this.
|
|
105154
|
+
response = await this.v1PrivateDeleteOrderPendingBatch(this.extend(request, params));
|
|
105020
105155
|
}
|
|
105021
105156
|
else {
|
|
105022
105157
|
request['order_ids'] = idsString;
|
|
105023
|
-
response = await this.
|
|
105158
|
+
response = await this.v1PerpetualPrivatePostOrderCancelBatch(this.extend(request, params));
|
|
105024
105159
|
}
|
|
105025
105160
|
//
|
|
105026
105161
|
// spot
|
|
@@ -105157,7 +105292,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105157
105292
|
if (price !== undefined) {
|
|
105158
105293
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
105159
105294
|
}
|
|
105160
|
-
const response = await this.
|
|
105295
|
+
const response = await this.v1PrivatePostOrderModify(this.extend(request, params));
|
|
105161
105296
|
//
|
|
105162
105297
|
// {
|
|
105163
105298
|
// "code": 0,
|
|
@@ -105238,18 +105373,18 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105238
105373
|
request['client_id'] = clientOrderId;
|
|
105239
105374
|
if (stop) {
|
|
105240
105375
|
if (swap) {
|
|
105241
|
-
response = await this.
|
|
105376
|
+
response = await this.v1PerpetualPrivatePostOrderCancelStopByClientId(this.extend(request, query));
|
|
105242
105377
|
}
|
|
105243
105378
|
else {
|
|
105244
|
-
response = await this.
|
|
105379
|
+
response = await this.v1PrivateDeleteOrderStopPendingByClientId(this.extend(request, query));
|
|
105245
105380
|
}
|
|
105246
105381
|
}
|
|
105247
105382
|
else {
|
|
105248
105383
|
if (swap) {
|
|
105249
|
-
response = await this.
|
|
105384
|
+
response = await this.v1PerpetualPrivatePostOrderCancelByClientId(this.extend(request, query));
|
|
105250
105385
|
}
|
|
105251
105386
|
else {
|
|
105252
|
-
response = await this.
|
|
105387
|
+
response = await this.v1PrivateDeleteOrderPendingByClientId(this.extend(request, query));
|
|
105253
105388
|
}
|
|
105254
105389
|
}
|
|
105255
105390
|
}
|
|
@@ -105258,18 +105393,18 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105258
105393
|
request[idRequest] = id;
|
|
105259
105394
|
if (stop) {
|
|
105260
105395
|
if (swap) {
|
|
105261
|
-
response = await this.
|
|
105396
|
+
response = await this.v1PerpetualPrivatePostOrderCancelStop(this.extend(request, query));
|
|
105262
105397
|
}
|
|
105263
105398
|
else {
|
|
105264
|
-
response = await this.
|
|
105399
|
+
response = await this.v1PrivateDeleteOrderStopPendingId(this.extend(request, query));
|
|
105265
105400
|
}
|
|
105266
105401
|
}
|
|
105267
105402
|
else {
|
|
105268
105403
|
if (swap) {
|
|
105269
|
-
response = await this.
|
|
105404
|
+
response = await this.v1PerpetualPrivatePostOrderCancel(this.extend(request, query));
|
|
105270
105405
|
}
|
|
105271
105406
|
else {
|
|
105272
|
-
response = await this.
|
|
105407
|
+
response = await this.v1PrivateDeleteOrderPending(this.extend(request, query));
|
|
105273
105408
|
}
|
|
105274
105409
|
}
|
|
105275
105410
|
}
|
|
@@ -105413,19 +105548,19 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105413
105548
|
let response = undefined;
|
|
105414
105549
|
if (swap) {
|
|
105415
105550
|
if (stop) {
|
|
105416
|
-
response = await this.
|
|
105551
|
+
response = await this.v1PerpetualPrivatePostOrderCancelStopAll(this.extend(request, params));
|
|
105417
105552
|
}
|
|
105418
105553
|
else {
|
|
105419
|
-
response = await this.
|
|
105554
|
+
response = await this.v1PerpetualPrivatePostOrderCancelAll(this.extend(request, params));
|
|
105420
105555
|
}
|
|
105421
105556
|
}
|
|
105422
105557
|
else {
|
|
105423
105558
|
request['account_id'] = accountId;
|
|
105424
105559
|
if (stop) {
|
|
105425
|
-
response = await this.
|
|
105560
|
+
response = await this.v1PrivateDeleteOrderStopPending(this.extend(request, params));
|
|
105426
105561
|
}
|
|
105427
105562
|
else {
|
|
105428
|
-
response = await this.
|
|
105563
|
+
response = await this.v1PrivateDeleteOrderPending(this.extend(request, params));
|
|
105429
105564
|
}
|
|
105430
105565
|
}
|
|
105431
105566
|
//
|
|
@@ -105469,14 +105604,14 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105469
105604
|
let response = undefined;
|
|
105470
105605
|
if (swap) {
|
|
105471
105606
|
if (stop) {
|
|
105472
|
-
response = await this.
|
|
105607
|
+
response = await this.v1PerpetualPrivateGetOrderStopStatus(this.extend(request, params));
|
|
105473
105608
|
}
|
|
105474
105609
|
else {
|
|
105475
|
-
response = await this.
|
|
105610
|
+
response = await this.v1PerpetualPrivateGetOrderStatus(this.extend(request, params));
|
|
105476
105611
|
}
|
|
105477
105612
|
}
|
|
105478
105613
|
else {
|
|
105479
|
-
response = await this.
|
|
105614
|
+
response = await this.v1PrivateGetOrderStatus(this.extend(request, params));
|
|
105480
105615
|
}
|
|
105481
105616
|
//
|
|
105482
105617
|
// Spot
|
|
@@ -105620,14 +105755,14 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105620
105755
|
}
|
|
105621
105756
|
request['offset'] = 0;
|
|
105622
105757
|
if (stop) {
|
|
105623
|
-
response = await this.
|
|
105758
|
+
response = await this.v1PerpetualPrivateGetOrderStopPending(this.extend(request, params));
|
|
105624
105759
|
}
|
|
105625
105760
|
else {
|
|
105626
105761
|
if (status === 'finished') {
|
|
105627
|
-
response = await this.
|
|
105762
|
+
response = await this.v1PerpetualPrivateGetOrderFinished(this.extend(request, params));
|
|
105628
105763
|
}
|
|
105629
105764
|
else if (status === 'pending') {
|
|
105630
|
-
response = await this.
|
|
105765
|
+
response = await this.v1PerpetualPrivateGetOrderPending(this.extend(request, params));
|
|
105631
105766
|
}
|
|
105632
105767
|
}
|
|
105633
105768
|
}
|
|
@@ -105635,18 +105770,18 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105635
105770
|
request['page'] = 1;
|
|
105636
105771
|
if (status === 'finished') {
|
|
105637
105772
|
if (stop) {
|
|
105638
|
-
response = await this.
|
|
105773
|
+
response = await this.v1PrivateGetOrderStopFinished(this.extend(request, params));
|
|
105639
105774
|
}
|
|
105640
105775
|
else {
|
|
105641
|
-
response = await this.
|
|
105776
|
+
response = await this.v1PrivateGetOrderFinished(this.extend(request, params));
|
|
105642
105777
|
}
|
|
105643
105778
|
}
|
|
105644
105779
|
else if (status === 'pending') {
|
|
105645
105780
|
if (stop) {
|
|
105646
|
-
response = await this.
|
|
105781
|
+
response = await this.v1PrivateGetOrderStopPending(this.extend(request, params));
|
|
105647
105782
|
}
|
|
105648
105783
|
else {
|
|
105649
|
-
response = await this.
|
|
105784
|
+
response = await this.v1PrivateGetOrderPending(this.extend(request, params));
|
|
105650
105785
|
}
|
|
105651
105786
|
}
|
|
105652
105787
|
}
|
|
@@ -105858,7 +105993,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105858
105993
|
params = this.omit(params, 'network');
|
|
105859
105994
|
request['smart_contract_name'] = network;
|
|
105860
105995
|
}
|
|
105861
|
-
const response = await this.
|
|
105996
|
+
const response = await this.v1PrivatePutBalanceDepositAddressCoinType(this.extend(request, params));
|
|
105862
105997
|
//
|
|
105863
105998
|
// {
|
|
105864
105999
|
// "code": 0,
|
|
@@ -105902,7 +106037,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
105902
106037
|
if (network !== undefined) {
|
|
105903
106038
|
request['smart_contract_name'] = network;
|
|
105904
106039
|
}
|
|
105905
|
-
const response = await this.
|
|
106040
|
+
const response = await this.v1PrivateGetBalanceDepositAddressCoinType(this.extend(request, params));
|
|
105906
106041
|
//
|
|
105907
106042
|
// {
|
|
105908
106043
|
// "code": 0,
|
|
@@ -106018,11 +106153,11 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106018
106153
|
request['start_time'] = since;
|
|
106019
106154
|
}
|
|
106020
106155
|
request['side'] = 0;
|
|
106021
|
-
response = await this.
|
|
106156
|
+
response = await this.v1PerpetualPrivateGetMarketUserDeals(this.extend(request, params));
|
|
106022
106157
|
}
|
|
106023
106158
|
else {
|
|
106024
106159
|
request['page'] = 1;
|
|
106025
|
-
response = await this.
|
|
106160
|
+
response = await this.v1PrivateGetOrderUserDeals(this.extend(request, params));
|
|
106026
106161
|
}
|
|
106027
106162
|
//
|
|
106028
106163
|
// Spot and Margin
|
|
@@ -106116,8 +106251,8 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106116
106251
|
*/
|
|
106117
106252
|
await this.loadMarkets();
|
|
106118
106253
|
let defaultMethod = undefined;
|
|
106119
|
-
[defaultMethod, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', '
|
|
106120
|
-
const isHistory = (defaultMethod === '
|
|
106254
|
+
[defaultMethod, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', 'v1PerpetualPrivateGetPositionPending');
|
|
106255
|
+
const isHistory = (defaultMethod === 'v1PerpetualPrivateGetPositionFinished');
|
|
106121
106256
|
symbols = this.marketSymbols(symbols);
|
|
106122
106257
|
const request = {};
|
|
106123
106258
|
let market = undefined;
|
|
@@ -106146,11 +106281,11 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106146
106281
|
request['side'] = this.safeInteger(params, 'side', 0); // 0: All, 1: Sell, 2: Buy
|
|
106147
106282
|
}
|
|
106148
106283
|
let response = undefined;
|
|
106149
|
-
if (defaultMethod === '
|
|
106150
|
-
response = await this.
|
|
106284
|
+
if (defaultMethod === 'v1PerpetualPrivateGetPositionPending') {
|
|
106285
|
+
response = await this.v1PerpetualPrivateGetPositionPending(this.extend(request, params));
|
|
106151
106286
|
}
|
|
106152
106287
|
else {
|
|
106153
|
-
response = await this.
|
|
106288
|
+
response = await this.v1PerpetualPrivateGetPositionFinished(this.extend(request, params));
|
|
106154
106289
|
}
|
|
106155
106290
|
//
|
|
106156
106291
|
// {
|
|
@@ -106233,7 +106368,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106233
106368
|
const request = {
|
|
106234
106369
|
'market': market['id'],
|
|
106235
106370
|
};
|
|
106236
|
-
const response = await this.
|
|
106371
|
+
const response = await this.v1PerpetualPrivateGetPositionPending(this.extend(request, params));
|
|
106237
106372
|
//
|
|
106238
106373
|
// {
|
|
106239
106374
|
// "code": 0,
|
|
@@ -106447,7 +106582,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106447
106582
|
'leverage': leverage.toString(),
|
|
106448
106583
|
'position_type': positionType, // 1: isolated, 2: cross
|
|
106449
106584
|
};
|
|
106450
|
-
return await this.
|
|
106585
|
+
return await this.v1PerpetualPrivatePostMarketAdjustLeverage(this.extend(request, params));
|
|
106451
106586
|
}
|
|
106452
106587
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
106453
106588
|
/**
|
|
@@ -106488,7 +106623,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106488
106623
|
'leverage': leverage.toString(),
|
|
106489
106624
|
'position_type': positionType, // 1: isolated, 2: cross
|
|
106490
106625
|
};
|
|
106491
|
-
return await this.
|
|
106626
|
+
return await this.v1PerpetualPrivatePostMarketAdjustLeverage(this.extend(request, params));
|
|
106492
106627
|
}
|
|
106493
106628
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
106494
106629
|
/**
|
|
@@ -106501,7 +106636,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106501
106636
|
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
106502
106637
|
*/
|
|
106503
106638
|
await this.loadMarkets();
|
|
106504
|
-
const response = await this.
|
|
106639
|
+
const response = await this.v1PerpetualPublicGetMarketLimitConfig(params);
|
|
106505
106640
|
//
|
|
106506
106641
|
// {
|
|
106507
106642
|
// "code": 0,
|
|
@@ -106579,7 +106714,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106579
106714
|
'amount': this.amountToPrecision(symbol, amount),
|
|
106580
106715
|
'type': addOrReduce,
|
|
106581
106716
|
};
|
|
106582
|
-
const response = await this.
|
|
106717
|
+
const response = await this.v1PerpetualPrivatePostPositionAdjustMargin(this.extend(request, params));
|
|
106583
106718
|
//
|
|
106584
106719
|
// {
|
|
106585
106720
|
// "code": 0,
|
|
@@ -106709,7 +106844,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106709
106844
|
if (since !== undefined) {
|
|
106710
106845
|
request['start_time'] = since;
|
|
106711
106846
|
}
|
|
106712
|
-
const response = await this.
|
|
106847
|
+
const response = await this.v1PerpetualPrivateGetPositionFunding(this.extend(request, params));
|
|
106713
106848
|
//
|
|
106714
106849
|
// {
|
|
106715
106850
|
// "code": 0,
|
|
@@ -106775,7 +106910,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106775
106910
|
const request = {
|
|
106776
106911
|
'market': market['id'],
|
|
106777
106912
|
};
|
|
106778
|
-
const response = await this.
|
|
106913
|
+
const response = await this.v1PerpetualPublicGetMarketTicker(this.extend(request, params));
|
|
106779
106914
|
//
|
|
106780
106915
|
// {
|
|
106781
106916
|
// "code": 0,
|
|
@@ -106886,7 +107021,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106886
107021
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' fetchFundingRates() supports swap contracts only');
|
|
106887
107022
|
}
|
|
106888
107023
|
}
|
|
106889
|
-
const response = await this.
|
|
107024
|
+
const response = await this.v1PerpetualPublicGetMarketTickerAll(params);
|
|
106890
107025
|
//
|
|
106891
107026
|
// {
|
|
106892
107027
|
// "code": 0,
|
|
@@ -106968,7 +107103,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
106968
107103
|
if (networkCode !== undefined) {
|
|
106969
107104
|
request['smart_contract_name'] = this.networkCodeToId(networkCode);
|
|
106970
107105
|
}
|
|
106971
|
-
const response = await this.
|
|
107106
|
+
const response = await this.v1PrivatePostBalanceCoinWithdraw(this.extend(request, params));
|
|
106972
107107
|
//
|
|
106973
107108
|
// {
|
|
106974
107109
|
// "code": 0,
|
|
@@ -107040,7 +107175,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107040
107175
|
request['start_time'] = since;
|
|
107041
107176
|
}
|
|
107042
107177
|
[request, params] = this.handleUntilOption('end_time', request, params);
|
|
107043
|
-
const response = await this.
|
|
107178
|
+
const response = await this.v1PerpetualPublicGetMarketFundingHistory(this.extend(request, params));
|
|
107044
107179
|
//
|
|
107045
107180
|
// {
|
|
107046
107181
|
// "code": 0,
|
|
@@ -107217,11 +107352,11 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107217
107352
|
let response = undefined;
|
|
107218
107353
|
if ((fromAccount === 'spot') && (toAccount === 'swap')) {
|
|
107219
107354
|
request['transfer_side'] = 'in'; // 'in' spot to swap, 'out' swap to spot
|
|
107220
|
-
response = await this.
|
|
107355
|
+
response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
|
|
107221
107356
|
}
|
|
107222
107357
|
else if ((fromAccount === 'swap') && (toAccount === 'spot')) {
|
|
107223
107358
|
request['transfer_side'] = 'out'; // 'in' spot to swap, 'out' swap to spot
|
|
107224
|
-
response = await this.
|
|
107359
|
+
response = await this.v1PrivatePostContractBalanceTransfer(this.extend(request, params));
|
|
107225
107360
|
}
|
|
107226
107361
|
else {
|
|
107227
107362
|
const accountsById = this.safeValue(this.options, 'accountsById', {});
|
|
@@ -107231,7 +107366,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107231
107366
|
// spot is 0, use fetchBalance() to find the margin account id
|
|
107232
107367
|
request['from_account'] = parseInt(fromId);
|
|
107233
107368
|
request['to_account'] = parseInt(toId);
|
|
107234
|
-
response = await this.
|
|
107369
|
+
response = await this.v1PrivatePostMarginTransfer(this.extend(request, params));
|
|
107235
107370
|
}
|
|
107236
107371
|
//
|
|
107237
107372
|
// {"code": 0, "data": null, "message": "Success"}
|
|
@@ -107354,10 +107489,10 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107354
107489
|
[marginMode, params] = this.handleMarginModeAndParams('fetchTransfers', params);
|
|
107355
107490
|
let response = undefined;
|
|
107356
107491
|
if (marginMode !== undefined) {
|
|
107357
|
-
response = await this.
|
|
107492
|
+
response = await this.v1PrivateGetMarginTransferHistory(this.extend(request, params));
|
|
107358
107493
|
}
|
|
107359
107494
|
else {
|
|
107360
|
-
response = await this.
|
|
107495
|
+
response = await this.v1PrivateGetContractTransferHistory(this.extend(request, params));
|
|
107361
107496
|
}
|
|
107362
107497
|
//
|
|
107363
107498
|
// Swap
|
|
@@ -107429,7 +107564,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107429
107564
|
if (limit !== undefined) {
|
|
107430
107565
|
request['Limit'] = limit;
|
|
107431
107566
|
}
|
|
107432
|
-
const response = await this.
|
|
107567
|
+
const response = await this.v1PrivateGetBalanceCoinWithdraw(this.extend(request, params));
|
|
107433
107568
|
//
|
|
107434
107569
|
// {
|
|
107435
107570
|
// "code": 0,
|
|
@@ -107496,7 +107631,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107496
107631
|
if (limit !== undefined) {
|
|
107497
107632
|
request['Limit'] = limit;
|
|
107498
107633
|
}
|
|
107499
|
-
const response = await this.
|
|
107634
|
+
const response = await this.v1PrivateGetBalanceCoinDeposit(this.extend(request, params));
|
|
107500
107635
|
//
|
|
107501
107636
|
// {
|
|
107502
107637
|
// "code": 0,
|
|
@@ -107589,7 +107724,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107589
107724
|
const request = {
|
|
107590
107725
|
'market': market['id'],
|
|
107591
107726
|
};
|
|
107592
|
-
const response = await this.
|
|
107727
|
+
const response = await this.v1PrivateGetMarginConfig(this.extend(request, params));
|
|
107593
107728
|
//
|
|
107594
107729
|
// {
|
|
107595
107730
|
// "code": 0,
|
|
@@ -107623,7 +107758,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107623
107758
|
* @returns {object} a list of [isolated borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
|
|
107624
107759
|
*/
|
|
107625
107760
|
await this.loadMarkets();
|
|
107626
|
-
const response = await this.
|
|
107761
|
+
const response = await this.v1PrivateGetMarginConfig(params);
|
|
107627
107762
|
//
|
|
107628
107763
|
// {
|
|
107629
107764
|
// "code": 0,
|
|
@@ -107664,7 +107799,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107664
107799
|
if (limit !== undefined) {
|
|
107665
107800
|
request['limit'] = limit;
|
|
107666
107801
|
}
|
|
107667
|
-
const response = await this.
|
|
107802
|
+
const response = await this.v1PrivateGetMarginLoanHistory(this.extend(request, params));
|
|
107668
107803
|
//
|
|
107669
107804
|
// {
|
|
107670
107805
|
// "code": 0,
|
|
@@ -107760,7 +107895,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107760
107895
|
'coin_type': currency['id'],
|
|
107761
107896
|
'amount': this.currencyToPrecision(code, amount),
|
|
107762
107897
|
};
|
|
107763
|
-
const response = await this.
|
|
107898
|
+
const response = await this.v1PrivatePostMarginLoan(this.extend(request, params));
|
|
107764
107899
|
//
|
|
107765
107900
|
// {
|
|
107766
107901
|
// "code": 0,
|
|
@@ -107798,7 +107933,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107798
107933
|
'coin_type': currency['id'],
|
|
107799
107934
|
'amount': this.currencyToPrecision(code, amount),
|
|
107800
107935
|
};
|
|
107801
|
-
const response = await this.
|
|
107936
|
+
const response = await this.v1PrivatePostMarginFlat(this.extend(request, params));
|
|
107802
107937
|
//
|
|
107803
107938
|
// {
|
|
107804
107939
|
// "code": 0,
|
|
@@ -107856,7 +107991,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107856
107991
|
request['coin_type'] = this.safeValue(codes, 0);
|
|
107857
107992
|
}
|
|
107858
107993
|
}
|
|
107859
|
-
const response = await this.
|
|
107994
|
+
const response = await this.v1PublicGetCommonAssetConfig(this.extend(request, params));
|
|
107860
107995
|
//
|
|
107861
107996
|
// {
|
|
107862
107997
|
// "code": 0,
|
|
@@ -107956,7 +108091,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
107956
108091
|
if (marketType !== 'spot') {
|
|
107957
108092
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchLeverages() supports spot margin markets only');
|
|
107958
108093
|
}
|
|
107959
|
-
const response = await this.
|
|
108094
|
+
const response = await this.v1PrivateGetMarginConfig(params);
|
|
107960
108095
|
//
|
|
107961
108096
|
// {
|
|
107962
108097
|
// "code": 0,
|
|
@@ -108015,9 +108150,11 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
108015
108150
|
nonce() {
|
|
108016
108151
|
return this.milliseconds();
|
|
108017
108152
|
}
|
|
108018
|
-
sign(path, api =
|
|
108153
|
+
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
108019
108154
|
path = this.implodeParams(path, params);
|
|
108020
|
-
|
|
108155
|
+
const version = api[0];
|
|
108156
|
+
const requestUrl = api[1];
|
|
108157
|
+
let url = this.urls['api'][requestUrl] + '/' + version + '/' + path;
|
|
108021
108158
|
let query = this.omit(params, this.extractParams(path));
|
|
108022
108159
|
const nonce = this.nonce().toString();
|
|
108023
108160
|
if (method === 'POST') {
|
|
@@ -108046,7 +108183,7 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
108046
108183
|
}
|
|
108047
108184
|
}
|
|
108048
108185
|
}
|
|
108049
|
-
if (
|
|
108186
|
+
if (requestUrl === 'perpetualPrivate') {
|
|
108050
108187
|
this.checkRequiredCredentials();
|
|
108051
108188
|
query = this.extend({
|
|
108052
108189
|
'access_id': this.apiKey,
|
|
@@ -108067,29 +108204,49 @@ class coinex extends _abstract_coinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
108067
108204
|
body = urlencoded;
|
|
108068
108205
|
}
|
|
108069
108206
|
}
|
|
108070
|
-
else if (
|
|
108207
|
+
else if (requestUrl === 'public' || requestUrl === 'perpetualPublic') {
|
|
108071
108208
|
if (Object.keys(query).length) {
|
|
108072
108209
|
url += '?' + this.urlencode(query);
|
|
108073
108210
|
}
|
|
108074
108211
|
}
|
|
108075
108212
|
else {
|
|
108076
|
-
|
|
108077
|
-
|
|
108078
|
-
|
|
108079
|
-
|
|
108080
|
-
|
|
108081
|
-
|
|
108082
|
-
|
|
108083
|
-
|
|
108084
|
-
|
|
108085
|
-
|
|
108086
|
-
|
|
108087
|
-
|
|
108088
|
-
|
|
108089
|
-
|
|
108213
|
+
if (version === 'v1') {
|
|
108214
|
+
this.checkRequiredCredentials();
|
|
108215
|
+
query = this.extend({
|
|
108216
|
+
'access_id': this.apiKey,
|
|
108217
|
+
'tonce': nonce,
|
|
108218
|
+
}, query);
|
|
108219
|
+
query = this.keysort(query);
|
|
108220
|
+
const urlencoded = this.rawencode(query);
|
|
108221
|
+
const signature = this.hash(this.encode(urlencoded + '&secret_key=' + this.secret), _static_dependencies_noble_hashes_md5_js__WEBPACK_IMPORTED_MODULE_5__/* .md5 */ .F);
|
|
108222
|
+
headers = {
|
|
108223
|
+
'Authorization': signature.toUpperCase(),
|
|
108224
|
+
'Content-Type': 'application/json',
|
|
108225
|
+
};
|
|
108226
|
+
if ((method === 'GET') || (method === 'DELETE') || (method === 'PUT')) {
|
|
108227
|
+
url += '?' + urlencoded;
|
|
108228
|
+
}
|
|
108229
|
+
else {
|
|
108230
|
+
body = this.json(query);
|
|
108231
|
+
}
|
|
108090
108232
|
}
|
|
108091
|
-
else {
|
|
108092
|
-
|
|
108233
|
+
else if (version === 'v2') {
|
|
108234
|
+
this.checkRequiredCredentials();
|
|
108235
|
+
query = this.keysort(query);
|
|
108236
|
+
const urlencoded = this.rawencode(query);
|
|
108237
|
+
const preparedString = method + '/' + version + '/' + path + '?' + urlencoded + nonce + this.secret;
|
|
108238
|
+
const signature = this.hash(this.encode(preparedString), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
|
|
108239
|
+
headers = {
|
|
108240
|
+
'X-COINEX-KEY': this.apiKey,
|
|
108241
|
+
'X-COINEX-SIGN': signature,
|
|
108242
|
+
'X-COINEX-TIMESTAMP': nonce,
|
|
108243
|
+
};
|
|
108244
|
+
if ((method === 'GET') || (method === 'DELETE') || (method === 'PUT')) {
|
|
108245
|
+
url += '?' + urlencoded;
|
|
108246
|
+
}
|
|
108247
|
+
else {
|
|
108248
|
+
body = this.json(query);
|
|
108249
|
+
}
|
|
108093
108250
|
}
|
|
108094
108251
|
}
|
|
108095
108252
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
@@ -164923,13 +165080,15 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
164923
165080
|
'network': 'MATIC',
|
|
164924
165081
|
},
|
|
164925
165082
|
'exceptions': {
|
|
164926
|
-
'
|
|
164927
|
-
|
|
164928
|
-
|
|
164929
|
-
|
|
164930
|
-
|
|
164931
|
-
|
|
164932
|
-
|
|
165083
|
+
'exact': {
|
|
165084
|
+
'INVALID_ORDER_QUANTITY': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
165085
|
+
'INSUFFICIENT_FUNDS': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InsufficientFunds,
|
|
165086
|
+
'SERVICE_UNAVAILABLE': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeNotAvailable,
|
|
165087
|
+
'EXCEEDED_RATE_LIMIT': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.DDoSProtection,
|
|
165088
|
+
'INVALID_PARAMETER': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
165089
|
+
'WALLET_NOT_ASSOCIATED': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidAddress,
|
|
165090
|
+
'INVALID_WALLET_SIGNATURE': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
165091
|
+
},
|
|
164933
165092
|
},
|
|
164934
165093
|
'requiredCredentials': {
|
|
164935
165094
|
'walletAddress': true,
|
|
@@ -166255,11 +166414,8 @@ class idex extends _abstract_idex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
166255
166414
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
166256
166415
|
const errorCode = this.safeString(response, 'code');
|
|
166257
166416
|
const message = this.safeString(response, 'message');
|
|
166258
|
-
if (errorCode in this.exceptions) {
|
|
166259
|
-
const Exception = this.exceptions[errorCode];
|
|
166260
|
-
throw new Exception(this.id + ' ' + message);
|
|
166261
|
-
}
|
|
166262
166417
|
if (errorCode !== undefined) {
|
|
166418
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, message);
|
|
166263
166419
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError(this.id + ' ' + message);
|
|
166264
166420
|
}
|
|
166265
166421
|
return undefined;
|
|
@@ -203571,8 +203727,10 @@ class okcoin extends _abstract_okcoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
203571
203727
|
const request = {
|
|
203572
203728
|
'instId': market['id'],
|
|
203573
203729
|
'bar': bar,
|
|
203574
|
-
'limit': limit,
|
|
203575
203730
|
};
|
|
203731
|
+
if (limit !== undefined) {
|
|
203732
|
+
request['limit'] = limit; // default 100, max 100
|
|
203733
|
+
}
|
|
203576
203734
|
let method = undefined;
|
|
203577
203735
|
[method, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'method', 'publicGetMarketCandles');
|
|
203578
203736
|
let response = undefined;
|
|
@@ -234101,6 +234259,7 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
234101
234259
|
'30015': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.AuthenticationError,
|
|
234102
234260
|
'30016': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest, // { event: 'error', code: 30016, msg: 'Param error' }
|
|
234103
234261
|
},
|
|
234262
|
+
'broad': {},
|
|
234104
234263
|
},
|
|
234105
234264
|
},
|
|
234106
234265
|
});
|
|
@@ -323808,7 +323967,7 @@ SOFTWARE.
|
|
|
323808
323967
|
|
|
323809
323968
|
//-----------------------------------------------------------------------------
|
|
323810
323969
|
// this is updated by vss.js when building
|
|
323811
|
-
const version = '4.2.
|
|
323970
|
+
const version = '4.2.86';
|
|
323812
323971
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
323813
323972
|
//-----------------------------------------------------------------------------
|
|
323814
323973
|
|