ccxt 4.2.54 → 4.2.55
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 +25 -5
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/gate.js +6 -2
- package/dist/cjs/src/okx.js +17 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/gate.d.ts +13 -9
- package/js/src/abstract/gateio.d.ts +13 -9
- package/js/src/bybit.js +1 -1
- package/js/src/gate.js +6 -2
- package/js/src/okx.js +17 -1
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/package.json +1 -1
- package/skip-tests.json +27 -7
package/dist/cjs/ccxt.js
CHANGED
|
@@ -176,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
176
176
|
|
|
177
177
|
//-----------------------------------------------------------------------------
|
|
178
178
|
// this is updated by vss.js when building
|
|
179
|
-
const version = '4.2.
|
|
179
|
+
const version = '4.2.55';
|
|
180
180
|
Exchange["default"].ccxtVersion = version;
|
|
181
181
|
const exchanges = {
|
|
182
182
|
'ace': ace,
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -78,6 +78,7 @@ class bybit extends bybit$1 {
|
|
|
78
78
|
'fetchIsolatedBorrowRate': false,
|
|
79
79
|
'fetchIsolatedBorrowRates': false,
|
|
80
80
|
'fetchLedger': true,
|
|
81
|
+
'fetchLeverage': true,
|
|
81
82
|
'fetchMarketLeverageTiers': true,
|
|
82
83
|
'fetchMarkets': true,
|
|
83
84
|
'fetchMarkOHLCV': true,
|
|
@@ -108,7 +109,6 @@ class bybit extends bybit$1 {
|
|
|
108
109
|
'fetchUnderlyingAssets': false,
|
|
109
110
|
'fetchVolatilityHistory': true,
|
|
110
111
|
'fetchWithdrawals': true,
|
|
111
|
-
'fetchLeverage': true,
|
|
112
112
|
'repayCrossMargin': true,
|
|
113
113
|
'setLeverage': true,
|
|
114
114
|
'setMarginMode': true,
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -45,7 +45,7 @@ class gate extends gate$1 {
|
|
|
45
45
|
'spot': 'https://api.gateio.ws/api/v4',
|
|
46
46
|
'options': 'https://api.gateio.ws/api/v4',
|
|
47
47
|
'subAccounts': 'https://api.gateio.ws/api/v4',
|
|
48
|
-
'
|
|
48
|
+
'unified': 'https://api.gateio.ws/api/v4',
|
|
49
49
|
'rebate': 'https://api.gateio.ws/api/v4',
|
|
50
50
|
'earn': 'https://api.gateio.ws/api/v4',
|
|
51
51
|
'account': 'https://api.gateio.ws/api/v4',
|
|
@@ -268,11 +268,14 @@ class gate extends gate$1 {
|
|
|
268
268
|
'saved_address': 1,
|
|
269
269
|
'fee': 1,
|
|
270
270
|
'total_balance': 2.5,
|
|
271
|
+
'small_balance': 1,
|
|
272
|
+
'small_balance_history': 1,
|
|
271
273
|
},
|
|
272
274
|
'post': {
|
|
273
275
|
'transfers': 2.5,
|
|
274
276
|
'sub_account_transfers': 2.5,
|
|
275
277
|
'sub_account_to_sub_account': 2.5,
|
|
278
|
+
'small_balance': 1,
|
|
276
279
|
},
|
|
277
280
|
},
|
|
278
281
|
'subAccounts': {
|
|
@@ -295,7 +298,7 @@ class gate extends gate$1 {
|
|
|
295
298
|
'sub_accounts/{user_id}/keys/{key}': 2.5,
|
|
296
299
|
},
|
|
297
300
|
},
|
|
298
|
-
'
|
|
301
|
+
'unified': {
|
|
299
302
|
'get': {
|
|
300
303
|
'accounts': 20 / 15,
|
|
301
304
|
'account_mode': 20 / 15,
|
|
@@ -304,6 +307,7 @@ class gate extends gate$1 {
|
|
|
304
307
|
'loans': 20 / 15,
|
|
305
308
|
'loan_records': 20 / 15,
|
|
306
309
|
'interest_records': 20 / 15,
|
|
310
|
+
'estimate_rate': 20 / 15,
|
|
307
311
|
},
|
|
308
312
|
'post': {
|
|
309
313
|
'account_mode': 20 / 15,
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -573,6 +573,7 @@ class okx extends okx$1 {
|
|
|
573
573
|
'50027': errors.PermissionDenied,
|
|
574
574
|
'50028': errors.ExchangeError,
|
|
575
575
|
'50044': errors.BadRequest,
|
|
576
|
+
'50062': errors.ExchangeError,
|
|
576
577
|
// API Class
|
|
577
578
|
'50100': errors.ExchangeError,
|
|
578
579
|
'50101': errors.AuthenticationError,
|
|
@@ -627,6 +628,15 @@ class okx extends okx$1 {
|
|
|
627
628
|
'51072': errors.InvalidOrder,
|
|
628
629
|
'51073': errors.InvalidOrder,
|
|
629
630
|
'51074': errors.InvalidOrder,
|
|
631
|
+
'51090': errors.InvalidOrder,
|
|
632
|
+
'51091': errors.InvalidOrder,
|
|
633
|
+
'51092': errors.InvalidOrder,
|
|
634
|
+
'51093': errors.InvalidOrder,
|
|
635
|
+
'51094': errors.InvalidOrder,
|
|
636
|
+
'51095': errors.InvalidOrder,
|
|
637
|
+
'51096': errors.InvalidOrder,
|
|
638
|
+
'51098': errors.InvalidOrder,
|
|
639
|
+
'51099': errors.InvalidOrder,
|
|
630
640
|
'51100': errors.InvalidOrder,
|
|
631
641
|
'51101': errors.InvalidOrder,
|
|
632
642
|
'51102': errors.InvalidOrder,
|
|
@@ -2754,7 +2764,7 @@ class okx extends okx$1 {
|
|
|
2754
2764
|
}
|
|
2755
2765
|
request['tpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
2756
2766
|
const takeProfitLimitPrice = this.safeValueN(takeProfit, ['price', 'takeProfitPrice', 'tpOrdPx']);
|
|
2757
|
-
const takeProfitOrderType = this.
|
|
2767
|
+
const takeProfitOrderType = this.safeString2(takeProfit, 'type', 'tpOrdKind');
|
|
2758
2768
|
if (takeProfitOrderType !== undefined) {
|
|
2759
2769
|
const takeProfitLimitOrderType = (takeProfitOrderType === 'limit');
|
|
2760
2770
|
const takeProfitMarketOrderType = (takeProfitOrderType === 'market');
|
|
@@ -2766,6 +2776,7 @@ class okx extends okx$1 {
|
|
|
2766
2776
|
throw new errors.InvalidOrder(this.id + ' createOrder() requires a limit price in params["takeProfit"]["price"] or params["takeProfit"]["tpOrdPx"] for a take profit limit order');
|
|
2767
2777
|
}
|
|
2768
2778
|
else {
|
|
2779
|
+
request['tpOrdKind'] = takeProfitOrderType;
|
|
2769
2780
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice);
|
|
2770
2781
|
}
|
|
2771
2782
|
}
|
|
@@ -2774,6 +2785,7 @@ class okx extends okx$1 {
|
|
|
2774
2785
|
}
|
|
2775
2786
|
}
|
|
2776
2787
|
else if (takeProfitLimitPrice !== undefined) {
|
|
2788
|
+
request['tpOrdKind'] = 'limit';
|
|
2777
2789
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice); // limit tp order
|
|
2778
2790
|
}
|
|
2779
2791
|
else {
|
|
@@ -2798,6 +2810,7 @@ class okx extends okx$1 {
|
|
|
2798
2810
|
const twoWayCondition = ((takeProfitPrice !== undefined) && (stopLossPrice !== undefined));
|
|
2799
2811
|
// if TP and SL are sent together
|
|
2800
2812
|
// as ordType 'conditional' only stop-loss order will be applied
|
|
2813
|
+
// tpOrdKind is 'condition' which is the default
|
|
2801
2814
|
if (twoWayCondition) {
|
|
2802
2815
|
request['ordType'] = 'oco';
|
|
2803
2816
|
}
|
|
@@ -2851,6 +2864,7 @@ class okx extends okx$1 {
|
|
|
2851
2864
|
* @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
|
|
2852
2865
|
* @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
|
|
2853
2866
|
* @param {string} [params.trailingPercent] the percent to trail away from the current market price
|
|
2867
|
+
* @param {string} [params.tpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
2854
2868
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2855
2869
|
*/
|
|
2856
2870
|
await this.loadMarkets();
|
|
@@ -3016,6 +3030,7 @@ class okx extends okx$1 {
|
|
|
3016
3030
|
takeProfitTriggerPrice = this.safeValue(takeProfit, 'triggerPrice');
|
|
3017
3031
|
takeProfitPrice = this.safeValue(takeProfit, 'price');
|
|
3018
3032
|
const takeProfitType = this.safeString(takeProfit, 'type');
|
|
3033
|
+
request['newTpOrdKind'] = (takeProfitType === 'limit') ? takeProfitType : 'condition';
|
|
3019
3034
|
request['newTpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
3020
3035
|
request['newTpOrdPx'] = (takeProfitType === 'market') ? '-1' : this.priceToPrecision(symbol, takeProfitPrice);
|
|
3021
3036
|
request['newTpTriggerPxType'] = takeProfitTriggerPriceType;
|
|
@@ -3061,6 +3076,7 @@ class okx extends okx$1 {
|
|
|
3061
3076
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3062
3077
|
* @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
|
|
3063
3078
|
* @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
|
|
3079
|
+
* @param {string} [params.newTpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
3064
3080
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3065
3081
|
*/
|
|
3066
3082
|
await this.loadMarkets();
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.2.
|
|
7
|
+
declare const version = "4.2.54";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.2.
|
|
41
|
+
const version = '4.2.55';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -66,9 +66,12 @@ interface Exchange {
|
|
|
66
66
|
privateWalletGetSavedAddress(params?: {}): Promise<implicitReturnType>;
|
|
67
67
|
privateWalletGetFee(params?: {}): Promise<implicitReturnType>;
|
|
68
68
|
privateWalletGetTotalBalance(params?: {}): Promise<implicitReturnType>;
|
|
69
|
+
privateWalletGetSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
70
|
+
privateWalletGetSmallBalanceHistory(params?: {}): Promise<implicitReturnType>;
|
|
69
71
|
privateWalletPostTransfers(params?: {}): Promise<implicitReturnType>;
|
|
70
72
|
privateWalletPostSubAccountTransfers(params?: {}): Promise<implicitReturnType>;
|
|
71
73
|
privateWalletPostSubAccountToSubAccount(params?: {}): Promise<implicitReturnType>;
|
|
74
|
+
privateWalletPostSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
72
75
|
privateSubAccountsGetSubAccounts(params?: {}): Promise<implicitReturnType>;
|
|
73
76
|
privateSubAccountsGetSubAccountsUserId(params?: {}): Promise<implicitReturnType>;
|
|
74
77
|
privateSubAccountsGetSubAccountsUserIdKeys(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,15 +82,16 @@ interface Exchange {
|
|
|
79
82
|
privateSubAccountsPostSubAccountsUserIdUnlock(params?: {}): Promise<implicitReturnType>;
|
|
80
83
|
privateSubAccountsPutSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
81
84
|
privateSubAccountsDeleteSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
privateUnifiedGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
privateUnifiedGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
privateUnifiedGetBorrowable(params?: {}): Promise<implicitReturnType>;
|
|
88
|
+
privateUnifiedGetTransferable(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateUnifiedGetLoans(params?: {}): Promise<implicitReturnType>;
|
|
90
|
+
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
|
+
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
|
+
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
|
+
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
91
95
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
92
96
|
privateSpotGetBatchFee(params?: {}): Promise<implicitReturnType>;
|
|
93
97
|
privateSpotGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
@@ -66,9 +66,12 @@ interface gate {
|
|
|
66
66
|
privateWalletGetSavedAddress(params?: {}): Promise<implicitReturnType>;
|
|
67
67
|
privateWalletGetFee(params?: {}): Promise<implicitReturnType>;
|
|
68
68
|
privateWalletGetTotalBalance(params?: {}): Promise<implicitReturnType>;
|
|
69
|
+
privateWalletGetSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
70
|
+
privateWalletGetSmallBalanceHistory(params?: {}): Promise<implicitReturnType>;
|
|
69
71
|
privateWalletPostTransfers(params?: {}): Promise<implicitReturnType>;
|
|
70
72
|
privateWalletPostSubAccountTransfers(params?: {}): Promise<implicitReturnType>;
|
|
71
73
|
privateWalletPostSubAccountToSubAccount(params?: {}): Promise<implicitReturnType>;
|
|
74
|
+
privateWalletPostSmallBalance(params?: {}): Promise<implicitReturnType>;
|
|
72
75
|
privateSubAccountsGetSubAccounts(params?: {}): Promise<implicitReturnType>;
|
|
73
76
|
privateSubAccountsGetSubAccountsUserId(params?: {}): Promise<implicitReturnType>;
|
|
74
77
|
privateSubAccountsGetSubAccountsUserIdKeys(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,15 +82,16 @@ interface gate {
|
|
|
79
82
|
privateSubAccountsPostSubAccountsUserIdUnlock(params?: {}): Promise<implicitReturnType>;
|
|
80
83
|
privateSubAccountsPutSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
81
84
|
privateSubAccountsDeleteSubAccountsUserIdKeysKey(params?: {}): Promise<implicitReturnType>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
privateUnifiedGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
privateUnifiedGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
privateUnifiedGetBorrowable(params?: {}): Promise<implicitReturnType>;
|
|
88
|
+
privateUnifiedGetTransferable(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateUnifiedGetLoans(params?: {}): Promise<implicitReturnType>;
|
|
90
|
+
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
|
+
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
|
+
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
|
+
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
91
95
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
92
96
|
privateSpotGetBatchFee(params?: {}): Promise<implicitReturnType>;
|
|
93
97
|
privateSpotGetAccounts(params?: {}): Promise<implicitReturnType>;
|
package/js/src/bybit.js
CHANGED
|
@@ -81,6 +81,7 @@ export default class bybit extends Exchange {
|
|
|
81
81
|
'fetchIsolatedBorrowRate': false,
|
|
82
82
|
'fetchIsolatedBorrowRates': false,
|
|
83
83
|
'fetchLedger': true,
|
|
84
|
+
'fetchLeverage': true,
|
|
84
85
|
'fetchMarketLeverageTiers': true,
|
|
85
86
|
'fetchMarkets': true,
|
|
86
87
|
'fetchMarkOHLCV': true,
|
|
@@ -111,7 +112,6 @@ export default class bybit extends Exchange {
|
|
|
111
112
|
'fetchUnderlyingAssets': false,
|
|
112
113
|
'fetchVolatilityHistory': true,
|
|
113
114
|
'fetchWithdrawals': true,
|
|
114
|
-
'fetchLeverage': true,
|
|
115
115
|
'repayCrossMargin': true,
|
|
116
116
|
'setLeverage': true,
|
|
117
117
|
'setMarginMode': true,
|
package/js/src/gate.js
CHANGED
|
@@ -48,7 +48,7 @@ export default class gate extends Exchange {
|
|
|
48
48
|
'spot': 'https://api.gateio.ws/api/v4',
|
|
49
49
|
'options': 'https://api.gateio.ws/api/v4',
|
|
50
50
|
'subAccounts': 'https://api.gateio.ws/api/v4',
|
|
51
|
-
'
|
|
51
|
+
'unified': 'https://api.gateio.ws/api/v4',
|
|
52
52
|
'rebate': 'https://api.gateio.ws/api/v4',
|
|
53
53
|
'earn': 'https://api.gateio.ws/api/v4',
|
|
54
54
|
'account': 'https://api.gateio.ws/api/v4',
|
|
@@ -271,11 +271,14 @@ export default class gate extends Exchange {
|
|
|
271
271
|
'saved_address': 1,
|
|
272
272
|
'fee': 1,
|
|
273
273
|
'total_balance': 2.5,
|
|
274
|
+
'small_balance': 1,
|
|
275
|
+
'small_balance_history': 1,
|
|
274
276
|
},
|
|
275
277
|
'post': {
|
|
276
278
|
'transfers': 2.5,
|
|
277
279
|
'sub_account_transfers': 2.5,
|
|
278
280
|
'sub_account_to_sub_account': 2.5,
|
|
281
|
+
'small_balance': 1,
|
|
279
282
|
},
|
|
280
283
|
},
|
|
281
284
|
'subAccounts': {
|
|
@@ -298,7 +301,7 @@ export default class gate extends Exchange {
|
|
|
298
301
|
'sub_accounts/{user_id}/keys/{key}': 2.5,
|
|
299
302
|
},
|
|
300
303
|
},
|
|
301
|
-
'
|
|
304
|
+
'unified': {
|
|
302
305
|
'get': {
|
|
303
306
|
'accounts': 20 / 15,
|
|
304
307
|
'account_mode': 20 / 15,
|
|
@@ -307,6 +310,7 @@ export default class gate extends Exchange {
|
|
|
307
310
|
'loans': 20 / 15,
|
|
308
311
|
'loan_records': 20 / 15,
|
|
309
312
|
'interest_records': 20 / 15,
|
|
313
|
+
'estimate_rate': 20 / 15,
|
|
310
314
|
},
|
|
311
315
|
'post': {
|
|
312
316
|
'account_mode': 20 / 15,
|
package/js/src/okx.js
CHANGED
|
@@ -576,6 +576,7 @@ export default class okx extends Exchange {
|
|
|
576
576
|
'50027': PermissionDenied,
|
|
577
577
|
'50028': ExchangeError,
|
|
578
578
|
'50044': BadRequest,
|
|
579
|
+
'50062': ExchangeError,
|
|
579
580
|
// API Class
|
|
580
581
|
'50100': ExchangeError,
|
|
581
582
|
'50101': AuthenticationError,
|
|
@@ -630,6 +631,15 @@ export default class okx extends Exchange {
|
|
|
630
631
|
'51072': InvalidOrder,
|
|
631
632
|
'51073': InvalidOrder,
|
|
632
633
|
'51074': InvalidOrder,
|
|
634
|
+
'51090': InvalidOrder,
|
|
635
|
+
'51091': InvalidOrder,
|
|
636
|
+
'51092': InvalidOrder,
|
|
637
|
+
'51093': InvalidOrder,
|
|
638
|
+
'51094': InvalidOrder,
|
|
639
|
+
'51095': InvalidOrder,
|
|
640
|
+
'51096': InvalidOrder,
|
|
641
|
+
'51098': InvalidOrder,
|
|
642
|
+
'51099': InvalidOrder,
|
|
633
643
|
'51100': InvalidOrder,
|
|
634
644
|
'51101': InvalidOrder,
|
|
635
645
|
'51102': InvalidOrder,
|
|
@@ -2757,7 +2767,7 @@ export default class okx extends Exchange {
|
|
|
2757
2767
|
}
|
|
2758
2768
|
request['tpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
2759
2769
|
const takeProfitLimitPrice = this.safeValueN(takeProfit, ['price', 'takeProfitPrice', 'tpOrdPx']);
|
|
2760
|
-
const takeProfitOrderType = this.
|
|
2770
|
+
const takeProfitOrderType = this.safeString2(takeProfit, 'type', 'tpOrdKind');
|
|
2761
2771
|
if (takeProfitOrderType !== undefined) {
|
|
2762
2772
|
const takeProfitLimitOrderType = (takeProfitOrderType === 'limit');
|
|
2763
2773
|
const takeProfitMarketOrderType = (takeProfitOrderType === 'market');
|
|
@@ -2769,6 +2779,7 @@ export default class okx extends Exchange {
|
|
|
2769
2779
|
throw new InvalidOrder(this.id + ' createOrder() requires a limit price in params["takeProfit"]["price"] or params["takeProfit"]["tpOrdPx"] for a take profit limit order');
|
|
2770
2780
|
}
|
|
2771
2781
|
else {
|
|
2782
|
+
request['tpOrdKind'] = takeProfitOrderType;
|
|
2772
2783
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice);
|
|
2773
2784
|
}
|
|
2774
2785
|
}
|
|
@@ -2777,6 +2788,7 @@ export default class okx extends Exchange {
|
|
|
2777
2788
|
}
|
|
2778
2789
|
}
|
|
2779
2790
|
else if (takeProfitLimitPrice !== undefined) {
|
|
2791
|
+
request['tpOrdKind'] = 'limit';
|
|
2780
2792
|
request['tpOrdPx'] = this.priceToPrecision(symbol, takeProfitLimitPrice); // limit tp order
|
|
2781
2793
|
}
|
|
2782
2794
|
else {
|
|
@@ -2801,6 +2813,7 @@ export default class okx extends Exchange {
|
|
|
2801
2813
|
const twoWayCondition = ((takeProfitPrice !== undefined) && (stopLossPrice !== undefined));
|
|
2802
2814
|
// if TP and SL are sent together
|
|
2803
2815
|
// as ordType 'conditional' only stop-loss order will be applied
|
|
2816
|
+
// tpOrdKind is 'condition' which is the default
|
|
2804
2817
|
if (twoWayCondition) {
|
|
2805
2818
|
request['ordType'] = 'oco';
|
|
2806
2819
|
}
|
|
@@ -2854,6 +2867,7 @@ export default class okx extends Exchange {
|
|
|
2854
2867
|
* @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
|
|
2855
2868
|
* @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
|
|
2856
2869
|
* @param {string} [params.trailingPercent] the percent to trail away from the current market price
|
|
2870
|
+
* @param {string} [params.tpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
2857
2871
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2858
2872
|
*/
|
|
2859
2873
|
await this.loadMarkets();
|
|
@@ -3019,6 +3033,7 @@ export default class okx extends Exchange {
|
|
|
3019
3033
|
takeProfitTriggerPrice = this.safeValue(takeProfit, 'triggerPrice');
|
|
3020
3034
|
takeProfitPrice = this.safeValue(takeProfit, 'price');
|
|
3021
3035
|
const takeProfitType = this.safeString(takeProfit, 'type');
|
|
3036
|
+
request['newTpOrdKind'] = (takeProfitType === 'limit') ? takeProfitType : 'condition';
|
|
3022
3037
|
request['newTpTriggerPx'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
|
|
3023
3038
|
request['newTpOrdPx'] = (takeProfitType === 'market') ? '-1' : this.priceToPrecision(symbol, takeProfitPrice);
|
|
3024
3039
|
request['newTpTriggerPxType'] = takeProfitTriggerPriceType;
|
|
@@ -3064,6 +3079,7 @@ export default class okx extends Exchange {
|
|
|
3064
3079
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3065
3080
|
* @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
|
|
3066
3081
|
* @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
|
|
3082
|
+
* @param {string} [params.newTpOrdKind] 'condition' or 'limit', the default is 'condition'
|
|
3067
3083
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3068
3084
|
*/
|
|
3069
3085
|
await this.loadMarkets();
|
|
@@ -15,7 +15,7 @@ export declare class BigInteger {
|
|
|
15
15
|
protected intValue(): number;
|
|
16
16
|
protected byteValue(): number;
|
|
17
17
|
protected shortValue(): number;
|
|
18
|
-
protected signum():
|
|
18
|
+
protected signum(): 0 | 1 | -1;
|
|
19
19
|
toByteArray(): number[];
|
|
20
20
|
protected equals(a: BigInteger): boolean;
|
|
21
21
|
protected min(a: BigInteger): BigInteger;
|
package/package.json
CHANGED
package/skip-tests.json
CHANGED
|
@@ -219,6 +219,12 @@
|
|
|
219
219
|
"withdraw": "not provided",
|
|
220
220
|
"deposit": "not provided"
|
|
221
221
|
},
|
|
222
|
+
"fetchTickers": {
|
|
223
|
+
"open": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177570#L3624"
|
|
224
|
+
},
|
|
225
|
+
"watchTickers": {
|
|
226
|
+
"open": "same"
|
|
227
|
+
},
|
|
222
228
|
"fetchOrderBook": {
|
|
223
229
|
"bid": "multiple bids might have same value"
|
|
224
230
|
},
|
|
@@ -297,18 +303,30 @@
|
|
|
297
303
|
"networks": "missing"
|
|
298
304
|
},
|
|
299
305
|
"fetchTickers": {
|
|
300
|
-
"
|
|
301
|
-
"
|
|
306
|
+
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177564#L3615",
|
|
307
|
+
"quoteVolume": "quoteVolume >= baseVolume * low is failing"
|
|
302
308
|
},
|
|
303
309
|
"fetchTicker": {
|
|
304
|
-
"
|
|
305
|
-
"
|
|
310
|
+
"spread": "same",
|
|
311
|
+
"quoteVolume": "same"
|
|
312
|
+
},
|
|
313
|
+
"watchTickers": {
|
|
314
|
+
"spread": "same",
|
|
315
|
+
"quoteVolume": "same"
|
|
316
|
+
},
|
|
317
|
+
"fetchOrderBook": {
|
|
318
|
+
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177564#L3946"
|
|
319
|
+
},
|
|
320
|
+
"fetchL2OrderBook": {
|
|
321
|
+
"spread": "same"
|
|
306
322
|
},
|
|
307
|
-
"fetchL2OrderBook": "bid==ask , https://app.travis-ci.com/github/ccxt/ccxt/builds/263304041#L2170",
|
|
308
|
-
"fetchLOrderBook": "same",
|
|
309
323
|
"watchOrderBook": {
|
|
310
324
|
"nonce":"missing https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L4256",
|
|
311
|
-
"
|
|
325
|
+
"spread": "same"
|
|
326
|
+
},
|
|
327
|
+
"watchOrderBookForSymbols": {
|
|
328
|
+
"nonce":"same",
|
|
329
|
+
"spread": "same"
|
|
312
330
|
},
|
|
313
331
|
"watchTrades":{
|
|
314
332
|
"side": "not set https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L4312"
|
|
@@ -849,6 +867,7 @@
|
|
|
849
867
|
}
|
|
850
868
|
},
|
|
851
869
|
"delta": {
|
|
870
|
+
"httpsProxy": "http://5.75.153.75:8002",
|
|
852
871
|
"skipMethods": {
|
|
853
872
|
"loadMarkets": "expiryDatetime must be equal to expiry in iso8601 format",
|
|
854
873
|
"fetchOrderBook": "ask crossing bids test failing",
|
|
@@ -1223,6 +1242,7 @@
|
|
|
1223
1242
|
"currencyIdAndCode": "messed"
|
|
1224
1243
|
},
|
|
1225
1244
|
"fetchCurrencies": {
|
|
1245
|
+
"currencyIdAndCode": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269188556#L4337",
|
|
1226
1246
|
"withdraw":"not provided",
|
|
1227
1247
|
"deposit":"not provided"
|
|
1228
1248
|
},
|