ccxt 4.3.59 → 4.3.61
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +90 -1
- package/dist/cjs/src/bingx.js +415 -116
- package/dist/cjs/src/bitfinex.js +38 -4
- package/dist/cjs/src/bitso.js +4 -1
- package/dist/cjs/src/bybit.js +11 -3
- package/dist/cjs/src/cryptocom.js +14 -6
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/hyperliquid.js +11 -3
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/mexc.js +2 -1
- package/dist/cjs/src/okx.js +11 -2
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +34 -3
- package/dist/cjs/src/pro/phemex.js +1 -1
- package/dist/cjs/src/pro/xt.js +5 -1
- package/dist/cjs/src/timex.js +18 -2
- package/dist/cjs/src/vertex.js +10 -1
- package/dist/cjs/src/xt.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +1 -1
- package/js/src/binance.d.ts +1 -1
- package/js/src/binance.js +90 -1
- package/js/src/bingx.js +415 -116
- package/js/src/bitfinex.d.ts +2 -2
- package/js/src/bitfinex.js +38 -4
- package/js/src/bitso.js +4 -1
- package/js/src/bybit.js +11 -3
- package/js/src/cryptocom.js +14 -6
- package/js/src/gate.js +1 -2
- package/js/src/hyperliquid.js +11 -3
- package/js/src/kraken.js +1 -1
- package/js/src/mexc.js +2 -1
- package/js/src/okx.js +11 -2
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/kucoin.js +34 -3
- package/js/src/pro/phemex.js +1 -1
- package/js/src/pro/xt.js +5 -1
- package/js/src/timex.d.ts +2 -2
- package/js/src/timex.js +18 -2
- package/js/src/vertex.js +10 -1
- package/js/src/xt.js +1 -1
- package/package.json +1 -1
package/js/src/bitfinex.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ export default class bitfinex extends Exchange {
|
|
|
38
38
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
39
39
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
40
40
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
41
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<
|
|
42
|
-
cancelAllOrders(symbol?: Str, params?: {}): Promise<
|
|
41
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
42
|
+
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
43
43
|
parseOrder(order: Dict, market?: Market): Order;
|
|
44
44
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
45
45
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/bitfinex.js
CHANGED
|
@@ -1158,7 +1158,33 @@ export default class bitfinex extends Exchange {
|
|
|
1158
1158
|
const request = {
|
|
1159
1159
|
'order_id': parseInt(id),
|
|
1160
1160
|
};
|
|
1161
|
-
|
|
1161
|
+
const response = await this.privatePostOrderCancel(this.extend(request, params));
|
|
1162
|
+
//
|
|
1163
|
+
// {
|
|
1164
|
+
// id: '161236928925',
|
|
1165
|
+
// cid: '1720172026812',
|
|
1166
|
+
// cid_date: '2024-07-05',
|
|
1167
|
+
// gid: null,
|
|
1168
|
+
// symbol: 'adaust',
|
|
1169
|
+
// exchange: 'bitfinex',
|
|
1170
|
+
// price: '0.33',
|
|
1171
|
+
// avg_execution_price: '0.0',
|
|
1172
|
+
// side: 'buy',
|
|
1173
|
+
// type: 'exchange limit',
|
|
1174
|
+
// timestamp: '1720172026.813',
|
|
1175
|
+
// is_live: true,
|
|
1176
|
+
// is_cancelled: false,
|
|
1177
|
+
// is_hidden: false,
|
|
1178
|
+
// oco_order: null,
|
|
1179
|
+
// was_forced: false,
|
|
1180
|
+
// original_amount: '10.0',
|
|
1181
|
+
// remaining_amount: '10.0',
|
|
1182
|
+
// executed_amount: '0.0',
|
|
1183
|
+
// src: 'api',
|
|
1184
|
+
// meta: {}
|
|
1185
|
+
// }
|
|
1186
|
+
//
|
|
1187
|
+
return this.parseOrder(response);
|
|
1162
1188
|
}
|
|
1163
1189
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1164
1190
|
/**
|
|
@@ -1166,11 +1192,19 @@ export default class bitfinex extends Exchange {
|
|
|
1166
1192
|
* @name bitfinex#cancelAllOrders
|
|
1167
1193
|
* @description cancel all open orders
|
|
1168
1194
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
|
|
1169
|
-
* @param {string} symbol
|
|
1195
|
+
* @param {string} symbol not used by bitfinex cancelAllOrders
|
|
1170
1196
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1171
1197
|
* @returns {object} response from exchange
|
|
1172
1198
|
*/
|
|
1173
|
-
|
|
1199
|
+
const response = await this.privatePostOrderCancelAll(params);
|
|
1200
|
+
//
|
|
1201
|
+
// { result: 'Submitting 1 order cancellations.' }
|
|
1202
|
+
//
|
|
1203
|
+
return [
|
|
1204
|
+
this.safeOrder({
|
|
1205
|
+
'info': response,
|
|
1206
|
+
}),
|
|
1207
|
+
];
|
|
1174
1208
|
}
|
|
1175
1209
|
parseOrder(order, market = undefined) {
|
|
1176
1210
|
//
|
|
@@ -1649,7 +1683,7 @@ export default class bitfinex extends Exchange {
|
|
|
1649
1683
|
return response;
|
|
1650
1684
|
}
|
|
1651
1685
|
nonce() {
|
|
1652
|
-
return this.
|
|
1686
|
+
return this.microseconds();
|
|
1653
1687
|
}
|
|
1654
1688
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1655
1689
|
let request = '/' + this.implodeParams(path, params);
|
package/js/src/bitso.js
CHANGED
|
@@ -100,7 +100,10 @@ export default class bitso extends Exchange {
|
|
|
100
100
|
'urls': {
|
|
101
101
|
'logo': 'https://user-images.githubusercontent.com/51840849/87295554-11f98280-c50e-11ea-80d6-15b3bafa8cbf.jpg',
|
|
102
102
|
'api': {
|
|
103
|
-
'rest': 'https://
|
|
103
|
+
'rest': 'https://bitso.com/api',
|
|
104
|
+
},
|
|
105
|
+
'test': {
|
|
106
|
+
'rest': 'https://stage.bitso.com/api',
|
|
104
107
|
},
|
|
105
108
|
'www': 'https://bitso.com',
|
|
106
109
|
'doc': 'https://bitso.com/api_info',
|
package/js/src/bybit.js
CHANGED
|
@@ -4346,6 +4346,11 @@ export default class bybit extends Exchange {
|
|
|
4346
4346
|
}
|
|
4347
4347
|
await this.loadMarkets();
|
|
4348
4348
|
const market = this.market(symbol);
|
|
4349
|
+
const types = await this.isUnifiedEnabled();
|
|
4350
|
+
const enableUnifiedAccount = types[1];
|
|
4351
|
+
if (!enableUnifiedAccount) {
|
|
4352
|
+
throw new NotSupported(this.id + ' cancelOrders() supports UTA accounts only');
|
|
4353
|
+
}
|
|
4349
4354
|
let category = undefined;
|
|
4350
4355
|
[category, params] = this.getBybitType('cancelOrders', market, params);
|
|
4351
4356
|
if (category === 'inverse') {
|
|
@@ -4449,13 +4454,16 @@ export default class bybit extends Exchange {
|
|
|
4449
4454
|
* @name bybit#cancelOrdersForSymbols
|
|
4450
4455
|
* @description cancel multiple orders for multiple symbols
|
|
4451
4456
|
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4452
|
-
* @param {
|
|
4453
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4457
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4454
4458
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4455
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4456
4459
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4457
4460
|
*/
|
|
4458
4461
|
await this.loadMarkets();
|
|
4462
|
+
const types = await this.isUnifiedEnabled();
|
|
4463
|
+
const enableUnifiedAccount = types[1];
|
|
4464
|
+
if (!enableUnifiedAccount) {
|
|
4465
|
+
throw new NotSupported(this.id + ' cancelOrdersForSymbols() supports UTA accounts only');
|
|
4466
|
+
}
|
|
4459
4467
|
const ordersRequests = [];
|
|
4460
4468
|
let category = undefined;
|
|
4461
4469
|
for (let i = 0; i < orders.length; i++) {
|
package/js/src/cryptocom.js
CHANGED
|
@@ -817,15 +817,23 @@ export default class cryptocom extends Exchange {
|
|
|
817
817
|
'instrument_name': market['id'],
|
|
818
818
|
'timeframe': this.safeString(this.timeframes, timeframe, timeframe),
|
|
819
819
|
};
|
|
820
|
-
if (since !== undefined) {
|
|
821
|
-
request['start_ts'] = since;
|
|
822
|
-
}
|
|
823
820
|
if (limit !== undefined) {
|
|
824
821
|
request['count'] = limit;
|
|
825
822
|
}
|
|
826
|
-
const
|
|
823
|
+
const now = this.microseconds();
|
|
824
|
+
const duration = this.parseTimeframe(timeframe);
|
|
825
|
+
const until = this.safeInteger(params, 'until', now);
|
|
827
826
|
params = this.omit(params, ['until']);
|
|
828
|
-
if (
|
|
827
|
+
if (since !== undefined) {
|
|
828
|
+
request['start_ts'] = since;
|
|
829
|
+
if (limit !== undefined) {
|
|
830
|
+
request['end_ts'] = this.sum(since, duration * (limit + 1) * 1000) - 1;
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
request['end_ts'] = until;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
829
837
|
request['end_ts'] = until;
|
|
830
838
|
}
|
|
831
839
|
const response = await this.v1PublicGetPublicGetCandlestick(this.extend(request, params));
|
|
@@ -1478,7 +1486,7 @@ export default class cryptocom extends Exchange {
|
|
|
1478
1486
|
* @name cryptocom#cancelOrdersForSymbols
|
|
1479
1487
|
* @description cancel multiple orders for multiple symbols
|
|
1480
1488
|
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
|
|
1481
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
|
|
1489
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1482
1490
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1483
1491
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1484
1492
|
*/
|
package/js/src/gate.js
CHANGED
|
@@ -5140,8 +5140,7 @@ export default class gate extends Exchange {
|
|
|
5140
5140
|
* @name gate#cancelOrdersForSymbols
|
|
5141
5141
|
* @description cancel multiple orders for multiple symbols
|
|
5142
5142
|
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5143
|
-
* @param {
|
|
5144
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
5143
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
5145
5144
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5146
5145
|
* @param {string[]} [params.clientOrderIds] client order ids
|
|
5147
5146
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -251,8 +251,16 @@ export default class hyperliquid extends Exchange {
|
|
|
251
251
|
'withdraw': undefined,
|
|
252
252
|
'networks': undefined,
|
|
253
253
|
'fee': undefined,
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
'limits': {
|
|
255
|
+
'amount': {
|
|
256
|
+
'min': undefined,
|
|
257
|
+
'max': undefined,
|
|
258
|
+
},
|
|
259
|
+
'withdraw': {
|
|
260
|
+
'min': undefined,
|
|
261
|
+
'max': undefined,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
256
264
|
};
|
|
257
265
|
}
|
|
258
266
|
return result;
|
|
@@ -1318,7 +1326,7 @@ export default class hyperliquid extends Exchange {
|
|
|
1318
1326
|
* @description cancel multiple orders for multiple symbols
|
|
1319
1327
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1320
1328
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1321
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
|
|
1329
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1322
1330
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1323
1331
|
* @param {string} [params.vaultAddress] the vault address
|
|
1324
1332
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/js/src/kraken.js
CHANGED
|
@@ -1052,7 +1052,7 @@ export default class kraken extends Exchange {
|
|
|
1052
1052
|
else {
|
|
1053
1053
|
direction = 'in';
|
|
1054
1054
|
}
|
|
1055
|
-
const timestamp = this.
|
|
1055
|
+
const timestamp = this.safeIntegerProduct(item, 'time', 1000);
|
|
1056
1056
|
return {
|
|
1057
1057
|
'info': item,
|
|
1058
1058
|
'id': id,
|
package/js/src/mexc.js
CHANGED
|
@@ -5236,9 +5236,10 @@ export default class mexc extends Exchange {
|
|
|
5236
5236
|
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5237
5237
|
*/
|
|
5238
5238
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5239
|
-
const networks = this.
|
|
5239
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
5240
5240
|
let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
|
|
5241
5241
|
network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
|
|
5242
|
+
network = this.networkCodeToId(network);
|
|
5242
5243
|
this.checkAddress(address);
|
|
5243
5244
|
await this.loadMarkets();
|
|
5244
5245
|
const currency = this.currency(code);
|
package/js/src/okx.js
CHANGED
|
@@ -927,7 +927,16 @@ export default class okx extends Exchange {
|
|
|
927
927
|
'64003': AccountNotEnabled,
|
|
928
928
|
'70010': BadRequest,
|
|
929
929
|
'70013': BadRequest,
|
|
930
|
-
'70016': BadRequest,
|
|
930
|
+
'70016': BadRequest,
|
|
931
|
+
'1009': BadRequest,
|
|
932
|
+
'4001': AuthenticationError,
|
|
933
|
+
'4002': BadRequest,
|
|
934
|
+
'4003': RateLimitExceeded,
|
|
935
|
+
'4004': NetworkError,
|
|
936
|
+
'4005': ExchangeNotAvailable,
|
|
937
|
+
'4006': BadRequest,
|
|
938
|
+
'4007': AuthenticationError,
|
|
939
|
+
'4008': RateLimitExceeded, // The number of subscribed channels exceeds the maximum limit.
|
|
931
940
|
},
|
|
932
941
|
'broad': {
|
|
933
942
|
'Internal Server Error': ExchangeNotAvailable,
|
|
@@ -3351,7 +3360,7 @@ export default class okx extends Exchange {
|
|
|
3351
3360
|
* @description cancel multiple orders for multiple symbols
|
|
3352
3361
|
* @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
|
3353
3362
|
* @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
|
|
3354
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol
|
|
3363
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
3355
3364
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3356
3365
|
* @param {boolean} [params.trigger] whether the order is a stop/trigger order
|
|
3357
3366
|
* @param {boolean} [params.trailing] set to true if you want to cancel trailing orders
|
package/js/src/pro/cex.js
CHANGED
|
@@ -1015,7 +1015,7 @@ export default class cex extends cexRest {
|
|
|
1015
1015
|
// }
|
|
1016
1016
|
//
|
|
1017
1017
|
const data = this.safeValue(message, 'data', {});
|
|
1018
|
-
const incrementalId = this.
|
|
1018
|
+
const incrementalId = this.safeInteger(data, 'id');
|
|
1019
1019
|
const pair = this.safeString(data, 'pair', '');
|
|
1020
1020
|
const symbol = this.pairToSymbol(pair);
|
|
1021
1021
|
const storedOrderBook = this.safeValue(this.orderbooks, symbol);
|
package/js/src/pro/kucoin.js
CHANGED
|
@@ -43,6 +43,9 @@ export default class kucoin extends kucoinRest {
|
|
|
43
43
|
'snapshotMaxRetries': 3,
|
|
44
44
|
'method': '/market/level2', // '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50'
|
|
45
45
|
},
|
|
46
|
+
'watchMyTrades': {
|
|
47
|
+
'method': '/spotMarket/tradeOrders', // or '/spot/tradeFills'
|
|
48
|
+
},
|
|
46
49
|
},
|
|
47
50
|
'streaming': {
|
|
48
51
|
// kucoin does not support built-in ws protocol-level ping-pong
|
|
@@ -986,11 +989,13 @@ export default class kucoin extends kucoinRest {
|
|
|
986
989
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
987
990
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
988
991
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
992
|
+
* @param {string} [params.method] '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
|
|
989
993
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
990
994
|
*/
|
|
991
995
|
await this.loadMarkets();
|
|
992
996
|
const url = await this.negotiate(true);
|
|
993
|
-
|
|
997
|
+
let topic = undefined;
|
|
998
|
+
[topic, params] = this.handleOptionAndParams(params, 'watchMyTrades', 'method', '/spotMarket/tradeOrders');
|
|
994
999
|
const request = {
|
|
995
1000
|
'privateChannel': true,
|
|
996
1001
|
};
|
|
@@ -1048,6 +1053,8 @@ export default class kucoin extends kucoinRest {
|
|
|
1048
1053
|
client.resolve(this.myTrades, symbolSpecificMessageHash);
|
|
1049
1054
|
}
|
|
1050
1055
|
parseWsTrade(trade, market = undefined) {
|
|
1056
|
+
//
|
|
1057
|
+
// /spotMarket/tradeOrders
|
|
1051
1058
|
//
|
|
1052
1059
|
// {
|
|
1053
1060
|
// "symbol": "KCS-USDT",
|
|
@@ -1070,6 +1077,22 @@ export default class kucoin extends kucoinRest {
|
|
|
1070
1077
|
// "ts": 1670329987311000000
|
|
1071
1078
|
// }
|
|
1072
1079
|
//
|
|
1080
|
+
// /spot/tradeFills
|
|
1081
|
+
//
|
|
1082
|
+
// {
|
|
1083
|
+
// "fee": 0.00262148,
|
|
1084
|
+
// "feeCurrency": "USDT",
|
|
1085
|
+
// "feeRate": 0.001,
|
|
1086
|
+
// "orderId": "62417436b29df8000183df2f",
|
|
1087
|
+
// "orderType": "market",
|
|
1088
|
+
// "price": 131.074,
|
|
1089
|
+
// "side": "sell",
|
|
1090
|
+
// "size": 0.02,
|
|
1091
|
+
// "symbol": "LTC-USDT",
|
|
1092
|
+
// "time": "1648456758734571745",
|
|
1093
|
+
// "tradeId": "624174362e113d2f467b3043"
|
|
1094
|
+
// }
|
|
1095
|
+
//
|
|
1073
1096
|
const marketId = this.safeString(trade, 'symbol');
|
|
1074
1097
|
market = this.safeMarket(marketId, market, '-');
|
|
1075
1098
|
const symbol = market['symbol'];
|
|
@@ -1079,7 +1102,10 @@ export default class kucoin extends kucoinRest {
|
|
|
1079
1102
|
const price = this.safeString(trade, 'matchPrice');
|
|
1080
1103
|
const amount = this.safeString(trade, 'matchSize');
|
|
1081
1104
|
const order = this.safeString(trade, 'orderId');
|
|
1082
|
-
const timestamp = this.
|
|
1105
|
+
const timestamp = this.safeIntegerProduct2(trade, 'ts', 'time', 0.000001);
|
|
1106
|
+
const feeCurrency = market['quote'];
|
|
1107
|
+
const feeRate = this.safeString(trade, 'feeRate');
|
|
1108
|
+
const feeCost = this.safeString(trade, 'fee');
|
|
1083
1109
|
return this.safeTrade({
|
|
1084
1110
|
'info': trade,
|
|
1085
1111
|
'timestamp': timestamp,
|
|
@@ -1093,7 +1119,11 @@ export default class kucoin extends kucoinRest {
|
|
|
1093
1119
|
'price': price,
|
|
1094
1120
|
'amount': amount,
|
|
1095
1121
|
'cost': undefined,
|
|
1096
|
-
'fee':
|
|
1122
|
+
'fee': {
|
|
1123
|
+
'cost': feeCost,
|
|
1124
|
+
'rate': feeRate,
|
|
1125
|
+
'currency': feeCurrency,
|
|
1126
|
+
},
|
|
1097
1127
|
}, market);
|
|
1098
1128
|
}
|
|
1099
1129
|
async watchBalance(params = {}) {
|
|
@@ -1202,6 +1232,7 @@ export default class kucoin extends kucoinRest {
|
|
|
1202
1232
|
'account.balance': this.handleBalance,
|
|
1203
1233
|
'orderChange': this.handleOrder,
|
|
1204
1234
|
'stopOrder': this.handleOrder,
|
|
1235
|
+
'/spot/tradeFills': this.handleMyTrade,
|
|
1205
1236
|
};
|
|
1206
1237
|
const method = this.safeValue(methods, subject);
|
|
1207
1238
|
if (method !== undefined) {
|
package/js/src/pro/phemex.js
CHANGED
package/js/src/pro/xt.js
CHANGED
|
@@ -252,7 +252,11 @@ export default class xt extends xtRest {
|
|
|
252
252
|
await this.loadMarkets();
|
|
253
253
|
const market = this.market(symbol);
|
|
254
254
|
const name = 'kline@' + market['id'] + ',' + timeframe;
|
|
255
|
-
|
|
255
|
+
const ohlcv = await this.subscribe(name, 'public', 'watchOHLCV', market, undefined, params);
|
|
256
|
+
if (this.newUpdates) {
|
|
257
|
+
limit = ohlcv.getLimit(symbol, limit);
|
|
258
|
+
}
|
|
259
|
+
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
256
260
|
}
|
|
257
261
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
258
262
|
/**
|
package/js/src/timex.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export default class timex extends Exchange {
|
|
|
22
22
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
23
23
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
24
24
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
25
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any
|
|
26
|
-
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<any>;
|
|
25
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
26
|
+
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<any[]>;
|
|
27
27
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
28
28
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
29
29
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/timex.js
CHANGED
|
@@ -879,7 +879,8 @@ export default class timex extends Exchange {
|
|
|
879
879
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
880
880
|
*/
|
|
881
881
|
await this.loadMarkets();
|
|
882
|
-
|
|
882
|
+
const orders = await this.cancelOrders([id], symbol, params);
|
|
883
|
+
return this.safeDict(orders, 0);
|
|
883
884
|
}
|
|
884
885
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
885
886
|
/**
|
|
@@ -921,7 +922,22 @@ export default class timex extends Exchange {
|
|
|
921
922
|
// ],
|
|
922
923
|
// "unchangedOrders": [ "string" ],
|
|
923
924
|
// }
|
|
924
|
-
|
|
925
|
+
//
|
|
926
|
+
const changedOrders = this.safeList(response, 'changedOrders', []);
|
|
927
|
+
const unchangedOrders = this.safeList(response, 'unchangedOrders', []);
|
|
928
|
+
const orders = [];
|
|
929
|
+
for (let i = 0; i < changedOrders.length; i++) {
|
|
930
|
+
const newOrder = this.safeDict(changedOrders[i], 'newOrder');
|
|
931
|
+
orders.push(this.parseOrder(newOrder));
|
|
932
|
+
}
|
|
933
|
+
for (let i = 0; i < unchangedOrders.length; i++) {
|
|
934
|
+
orders.push(this.safeOrder({
|
|
935
|
+
'info': unchangedOrders[i],
|
|
936
|
+
'id': unchangedOrders[i],
|
|
937
|
+
'status': 'unchanged',
|
|
938
|
+
}));
|
|
939
|
+
}
|
|
940
|
+
return orders;
|
|
925
941
|
}
|
|
926
942
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
927
943
|
/**
|
package/js/src/vertex.js
CHANGED
|
@@ -399,7 +399,16 @@ export default class vertex extends Exchange {
|
|
|
399
399
|
'withdraw': this.safeBool(data, 'can_withdraw'),
|
|
400
400
|
'networks': undefined,
|
|
401
401
|
'fee': undefined,
|
|
402
|
-
'limits':
|
|
402
|
+
'limits': {
|
|
403
|
+
'amount': {
|
|
404
|
+
'min': undefined,
|
|
405
|
+
'max': undefined,
|
|
406
|
+
},
|
|
407
|
+
'withdraw': {
|
|
408
|
+
'min': undefined,
|
|
409
|
+
'max': undefined,
|
|
410
|
+
},
|
|
411
|
+
},
|
|
403
412
|
};
|
|
404
413
|
}
|
|
405
414
|
return result;
|
package/js/src/xt.js
CHANGED
|
@@ -827,7 +827,7 @@ export default class xt extends Exchange {
|
|
|
827
827
|
'name': this.safeString(entry, 'fullName'),
|
|
828
828
|
'active': active,
|
|
829
829
|
'fee': this.parseNumber(minWithdrawFeeString),
|
|
830
|
-
'precision':
|
|
830
|
+
'precision': minPrecision,
|
|
831
831
|
'deposit': deposit,
|
|
832
832
|
'withdraw': withdraw,
|
|
833
833
|
'networks': networks,
|
package/package.json
CHANGED