ccxt 4.2.37 → 4.2.39
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 +6 -5
- package/dist/ccxt.browser.js +3015 -509
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/blofin.js +9 -0
- package/dist/cjs/src/base/Exchange.js +14 -2
- package/dist/cjs/src/binance.js +156 -35
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/bitso.js +18 -2
- package/dist/cjs/src/bitstamp.js +24 -2
- package/dist/cjs/src/bl3p.js +6 -0
- package/dist/cjs/src/blockchaincom.js +21 -0
- package/dist/cjs/src/blofin.js +2103 -0
- package/dist/cjs/src/btcalpha.js +9 -0
- package/dist/cjs/src/btcbox.js +9 -0
- package/dist/cjs/src/btcmarkets.js +19 -0
- package/dist/cjs/src/coinbase.js +13 -2
- package/dist/cjs/src/krakenfutures.js +7 -14
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/okx.js +2 -2
- package/dist/cjs/src/poloniexfutures.js +11 -5
- package/dist/cjs/src/pro/bitmart.js +110 -35
- package/dist/cjs/src/pro/kucoin.js +93 -40
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/wavesexchange.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/blofin.d.ts +36 -0
- package/js/src/abstract/blofin.js +11 -0
- package/js/src/abstract/coinbase.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +14 -2
- package/js/src/base/types.d.ts +2 -0
- package/js/src/bigone.d.ts +2 -2
- package/js/src/binance.d.ts +8 -8
- package/js/src/binance.js +156 -35
- package/js/src/bingx.d.ts +5 -5
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex2.d.ts +2 -2
- package/js/src/bitget.d.ts +5 -5
- package/js/src/bitget.js +1 -1
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +18 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +24 -2
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bl3p.js +6 -0
- package/js/src/blockchaincom.js +21 -0
- package/js/src/blofin.d.ts +124 -0
- package/js/src/blofin.js +2104 -0
- package/js/src/btcalpha.js +9 -0
- package/js/src/btcbox.js +9 -0
- package/js/src/btcmarkets.js +19 -0
- package/js/src/bybit.d.ts +7 -7
- package/js/src/cex.d.ts +1 -1
- package/js/src/coinbase.d.ts +2 -2
- package/js/src/coinbase.js +13 -2
- package/js/src/coinex.d.ts +4 -4
- package/js/src/coinlist.d.ts +2 -2
- package/js/src/coinone.d.ts +1 -1
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +3 -3
- package/js/src/digifinex.d.ts +3 -3
- package/js/src/exmo.d.ts +2 -2
- package/js/src/gate.d.ts +6 -6
- package/js/src/hitbtc.d.ts +2 -2
- package/js/src/hollaex.d.ts +1 -1
- package/js/src/htx.d.ts +3 -3
- package/js/src/huobijp.d.ts +1 -1
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/krakenfutures.js +7 -14
- package/js/src/kucoin.d.ts +5 -5
- package/js/src/kucoinfutures.d.ts +2 -2
- package/js/src/latoken.d.ts +1 -1
- package/js/src/lbank.d.ts +2 -2
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +4 -4
- package/js/src/ndax.d.ts +1 -1
- package/js/src/novadax.d.ts +1 -1
- package/js/src/okcoin.d.ts +2 -2
- package/js/src/okx.d.ts +7 -7
- package/js/src/okx.js +2 -2
- package/js/src/paymium.d.ts +2 -2
- package/js/src/phemex.d.ts +4 -4
- package/js/src/poloniex.d.ts +2 -2
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/poloniexfutures.js +11 -5
- package/js/src/pro/bitmart.d.ts +2 -0
- package/js/src/pro/bitmart.js +110 -35
- package/js/src/pro/bitvavo.d.ts +1 -1
- package/js/src/pro/cex.d.ts +2 -2
- package/js/src/pro/coinbase.d.ts +2 -2
- package/js/src/pro/coinex.d.ts +1 -1
- package/js/src/pro/kucoin.js +93 -40
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/probit.d.ts +1 -1
- package/js/src/timex.d.ts +1 -1
- package/js/src/upbit.d.ts +1 -1
- package/js/src/wavesexchange.js +1 -1
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/woo.d.ts +3 -3
- package/js/src/woo.js +1 -1
- package/js/src/zonda.d.ts +3 -3
- package/package.json +2 -2
|
@@ -24,6 +24,7 @@ class bitmart extends bitmart$1 {
|
|
|
24
24
|
'watchTicker': true,
|
|
25
25
|
'watchTickers': true,
|
|
26
26
|
'watchOrderBook': true,
|
|
27
|
+
'watchOrderBookForSymbols': true,
|
|
27
28
|
'watchOrders': true,
|
|
28
29
|
'watchTrades': true,
|
|
29
30
|
'watchOHLCV': true,
|
|
@@ -50,8 +51,15 @@ class bitmart extends bitmart$1 {
|
|
|
50
51
|
'fetchBalanceSnapshot': true,
|
|
51
52
|
'awaitBalanceSnapshot': false, // whether to wait for the balance snapshot before providing updates
|
|
52
53
|
},
|
|
54
|
+
//
|
|
55
|
+
// orderbook channels can have:
|
|
56
|
+
// - 'depth5', 'depth20', 'depth50' // these endpoints emit full Orderbooks once in every 500ms
|
|
57
|
+
// - 'depth/increase100' // this endpoint is preferred, because it emits once in 100ms. however, when this value is chosen, it only affects spot-market, but contracts markets automatically `depth50` will be being used
|
|
53
58
|
'watchOrderBook': {
|
|
54
|
-
'depth': 'depth/increase100',
|
|
59
|
+
'depth': 'depth/increase100',
|
|
60
|
+
},
|
|
61
|
+
'watchOrderBookForSymbols': {
|
|
62
|
+
'depth': 'depth/increase100',
|
|
55
63
|
},
|
|
56
64
|
'ws': {
|
|
57
65
|
'inflate': true,
|
|
@@ -98,6 +106,24 @@ class bitmart extends bitmart$1 {
|
|
|
98
106
|
}
|
|
99
107
|
return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
100
108
|
}
|
|
109
|
+
async subscribeMultiple(channel, type, symbols, params = {}) {
|
|
110
|
+
const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
|
|
111
|
+
const channelType = (type === 'spot') ? 'spot' : 'futures';
|
|
112
|
+
const actionType = (type === 'spot') ? 'op' : 'action';
|
|
113
|
+
const rawSubscriptions = [];
|
|
114
|
+
const messageHashes = [];
|
|
115
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
116
|
+
const market = this.market(symbols[i]);
|
|
117
|
+
const message = channelType + '/' + channel + ':' + market['id'];
|
|
118
|
+
rawSubscriptions.push(message);
|
|
119
|
+
messageHashes.push(channel + ':' + market['symbol']);
|
|
120
|
+
}
|
|
121
|
+
const request = {
|
|
122
|
+
'args': rawSubscriptions,
|
|
123
|
+
};
|
|
124
|
+
request[actionType] = 'subscribe';
|
|
125
|
+
return await this.watchMultiple(url, messageHashes, this.deepExtend(request, params), rawSubscriptions);
|
|
126
|
+
}
|
|
101
127
|
async watchBalance(params = {}) {
|
|
102
128
|
/**
|
|
103
129
|
* @method
|
|
@@ -1156,8 +1182,8 @@ class bitmart extends bitmart$1 {
|
|
|
1156
1182
|
// "symbol": "BTC_USDT"
|
|
1157
1183
|
// }
|
|
1158
1184
|
//
|
|
1159
|
-
const asks = this.
|
|
1160
|
-
const bids = this.
|
|
1185
|
+
const asks = this.safeList(message, 'asks', []);
|
|
1186
|
+
const bids = this.safeList(message, 'bids', []);
|
|
1161
1187
|
this.handleDeltas(orderbook['asks'], asks);
|
|
1162
1188
|
this.handleDeltas(orderbook['bids'], bids);
|
|
1163
1189
|
const timestamp = this.safeInteger(message, 'ms_t');
|
|
@@ -1171,6 +1197,7 @@ class bitmart extends bitmart$1 {
|
|
|
1171
1197
|
handleOrderBook(client, message) {
|
|
1172
1198
|
//
|
|
1173
1199
|
// spot depth-all
|
|
1200
|
+
//
|
|
1174
1201
|
// {
|
|
1175
1202
|
// "data": [
|
|
1176
1203
|
// {
|
|
@@ -1190,33 +1217,31 @@ class bitmart extends bitmart$1 {
|
|
|
1190
1217
|
// ],
|
|
1191
1218
|
// "table": "spot/depth5"
|
|
1192
1219
|
// }
|
|
1220
|
+
//
|
|
1193
1221
|
// spot increse depth snapshot
|
|
1222
|
+
//
|
|
1194
1223
|
// {
|
|
1195
1224
|
// "data":[
|
|
1196
1225
|
// {
|
|
1197
|
-
//
|
|
1198
|
-
//
|
|
1199
|
-
//
|
|
1200
|
-
// "0.02039"
|
|
1201
|
-
// ],
|
|
1202
|
-
// ...
|
|
1203
|
-
// ],
|
|
1204
|
-
// "bids":[
|
|
1205
|
-
// [
|
|
1206
|
-
// "43652.51",
|
|
1207
|
-
// "0.00500"
|
|
1226
|
+
// "asks":[
|
|
1227
|
+
// [ "43652.52", "0.02039" ],
|
|
1228
|
+
// ...
|
|
1208
1229
|
// ],
|
|
1209
|
-
//
|
|
1210
|
-
//
|
|
1211
|
-
//
|
|
1212
|
-
//
|
|
1213
|
-
//
|
|
1214
|
-
//
|
|
1230
|
+
// "bids":[
|
|
1231
|
+
// [ "43652.51", "0.00500" ],
|
|
1232
|
+
// ...
|
|
1233
|
+
// ],
|
|
1234
|
+
// "ms_t":1703376836487,
|
|
1235
|
+
// "symbol":"BTC_USDT",
|
|
1236
|
+
// "type":"snapshot", // or update
|
|
1237
|
+
// "version":2141731
|
|
1215
1238
|
// }
|
|
1216
1239
|
// ],
|
|
1217
1240
|
// "table":"spot/depth/increase100"
|
|
1218
1241
|
// }
|
|
1242
|
+
//
|
|
1219
1243
|
// swap
|
|
1244
|
+
//
|
|
1220
1245
|
// {
|
|
1221
1246
|
// "group":"futures/depth50:BTCUSDT",
|
|
1222
1247
|
// "data":{
|
|
@@ -1237,50 +1262,69 @@ class bitmart extends bitmart$1 {
|
|
|
1237
1262
|
// }
|
|
1238
1263
|
// }
|
|
1239
1264
|
//
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1265
|
+
const isSpot = ('table' in message);
|
|
1266
|
+
let datas = [];
|
|
1267
|
+
if (isSpot) {
|
|
1268
|
+
datas = this.safeList(message, 'data', datas);
|
|
1269
|
+
}
|
|
1270
|
+
else {
|
|
1271
|
+
const orderBookEntry = this.safeDict(message, 'data');
|
|
1272
|
+
if (orderBookEntry !== undefined) {
|
|
1273
|
+
datas.push(orderBookEntry);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
const length = datas.length;
|
|
1277
|
+
if (length <= 0) {
|
|
1242
1278
|
return;
|
|
1243
1279
|
}
|
|
1244
|
-
const
|
|
1245
|
-
const isSpot = (depths === undefined);
|
|
1246
|
-
const table = this.safeString2(message, 'table', 'group');
|
|
1280
|
+
const channelName = this.safeString2(message, 'table', 'group');
|
|
1247
1281
|
// find limit subscribed to
|
|
1248
1282
|
const limitsToCheck = ['100', '50', '20', '10', '5'];
|
|
1249
1283
|
let limit = 0;
|
|
1250
1284
|
for (let i = 0; i < limitsToCheck.length; i++) {
|
|
1251
1285
|
const limitString = limitsToCheck[i];
|
|
1252
|
-
if (
|
|
1286
|
+
if (channelName.indexOf(limitString) >= 0) {
|
|
1253
1287
|
limit = this.parseToInt(limitString);
|
|
1254
1288
|
break;
|
|
1255
1289
|
}
|
|
1256
1290
|
}
|
|
1257
1291
|
if (isSpot) {
|
|
1258
|
-
|
|
1259
|
-
|
|
1292
|
+
const channel = channelName.replace('spot/', '');
|
|
1293
|
+
for (let i = 0; i < datas.length; i++) {
|
|
1294
|
+
const update = datas[i];
|
|
1260
1295
|
const marketId = this.safeString(update, 'symbol');
|
|
1261
1296
|
const symbol = this.safeSymbol(marketId);
|
|
1262
|
-
let orderbook = this.
|
|
1297
|
+
let orderbook = this.safeDict(this.orderbooks, symbol);
|
|
1263
1298
|
if (orderbook === undefined) {
|
|
1264
1299
|
orderbook = this.orderBook({}, limit);
|
|
1265
1300
|
orderbook['symbol'] = symbol;
|
|
1266
1301
|
this.orderbooks[symbol] = orderbook;
|
|
1267
1302
|
}
|
|
1268
1303
|
const type = this.safeValue(update, 'type');
|
|
1269
|
-
if ((type === 'snapshot') || (!(
|
|
1304
|
+
if ((type === 'snapshot') || (!(channelName.indexOf('increase') >= 0))) {
|
|
1270
1305
|
orderbook.reset({});
|
|
1271
1306
|
}
|
|
1272
1307
|
this.handleOrderBookMessage(client, update, orderbook);
|
|
1273
1308
|
const timestamp = this.safeInteger(update, 'ms_t');
|
|
1274
|
-
orderbook['timestamp']
|
|
1275
|
-
|
|
1276
|
-
|
|
1309
|
+
if (orderbook['timestamp'] === undefined) {
|
|
1310
|
+
orderbook['timestamp'] = timestamp;
|
|
1311
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
1312
|
+
}
|
|
1313
|
+
const messageHash = channelName + ':' + marketId;
|
|
1277
1314
|
client.resolve(orderbook, messageHash);
|
|
1315
|
+
// resolve ForSymbols
|
|
1316
|
+
const messageHashForMulti = channel + ':' + symbol;
|
|
1317
|
+
client.resolve(orderbook, messageHashForMulti);
|
|
1278
1318
|
}
|
|
1279
1319
|
}
|
|
1280
1320
|
else {
|
|
1321
|
+
const tableParts = channelName.split(':');
|
|
1322
|
+
const channel = tableParts[0].replace('futures/', '');
|
|
1323
|
+
const data = datas[0]; // contract markets always contain only one member
|
|
1324
|
+
const depths = data['depths'];
|
|
1281
1325
|
const marketId = this.safeString(data, 'symbol');
|
|
1282
1326
|
const symbol = this.safeSymbol(marketId);
|
|
1283
|
-
let orderbook = this.
|
|
1327
|
+
let orderbook = this.safeDict(this.orderbooks, symbol);
|
|
1284
1328
|
if (orderbook === undefined) {
|
|
1285
1329
|
orderbook = this.orderBook({}, limit);
|
|
1286
1330
|
orderbook['symbol'] = symbol;
|
|
@@ -1309,10 +1353,41 @@ class bitmart extends bitmart$1 {
|
|
|
1309
1353
|
const timestamp = this.safeInteger(data, 'ms_t');
|
|
1310
1354
|
orderbook['timestamp'] = timestamp;
|
|
1311
1355
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
1312
|
-
const messageHash =
|
|
1356
|
+
const messageHash = channelName;
|
|
1313
1357
|
client.resolve(orderbook, messageHash);
|
|
1358
|
+
// resolve ForSymbols
|
|
1359
|
+
const messageHashForMulti = channel + ':' + symbol;
|
|
1360
|
+
client.resolve(orderbook, messageHashForMulti);
|
|
1314
1361
|
}
|
|
1315
1362
|
}
|
|
1363
|
+
async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
|
|
1364
|
+
/**
|
|
1365
|
+
* @method
|
|
1366
|
+
* @name bitmart#watchOrderBookForSymbols
|
|
1367
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1368
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
|
|
1369
|
+
* @param {string[]} symbols unified array of symbols
|
|
1370
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1371
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1372
|
+
* @param {string} [params.depth] the type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
|
|
1373
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1374
|
+
*/
|
|
1375
|
+
await this.loadMarkets();
|
|
1376
|
+
symbols = this.marketSymbols(symbols, undefined, false, true);
|
|
1377
|
+
if (symbols.length > 20) {
|
|
1378
|
+
throw new errors.NotSupported(this.id + ' watchOrderBookForSymbols() accepts a maximum of 20 symbols in one request');
|
|
1379
|
+
}
|
|
1380
|
+
const market = this.market(symbols[0]);
|
|
1381
|
+
let channel = undefined;
|
|
1382
|
+
[channel, params] = this.handleOptionAndParams(params, 'watchOrderBookForSymbols', 'depth', 'depth/increase100');
|
|
1383
|
+
let type = 'spot';
|
|
1384
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrderBookForSymbols', market, params);
|
|
1385
|
+
if (type === 'swap' && channel === 'depth/increase100') {
|
|
1386
|
+
channel = 'depth50';
|
|
1387
|
+
}
|
|
1388
|
+
const orderbook = await this.subscribeMultiple(channel, type, symbols, params);
|
|
1389
|
+
return orderbook.limit();
|
|
1390
|
+
}
|
|
1316
1391
|
async authenticate(type, params = {}) {
|
|
1317
1392
|
this.checkRequiredCredentials();
|
|
1318
1393
|
const url = this.implodeHostname(this.urls['api']['ws'][type]['private']);
|
|
@@ -37,6 +37,7 @@ class kucoin extends kucoin$1 {
|
|
|
37
37
|
'watchOrderBook': {
|
|
38
38
|
'snapshotDelay': 5,
|
|
39
39
|
'snapshotMaxRetries': 3,
|
|
40
|
+
'method': '/market/level2', // '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50'
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
'streaming': {
|
|
@@ -438,10 +439,15 @@ class kucoin extends kucoin$1 {
|
|
|
438
439
|
/**
|
|
439
440
|
* @method
|
|
440
441
|
* @name kucoin#watchOrderBook
|
|
442
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level1-bbo-market-data
|
|
443
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-market-data
|
|
444
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-5-best-ask-bid-orders
|
|
445
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-50-best-ask-bid-orders
|
|
441
446
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
442
447
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
443
448
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
444
449
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
450
|
+
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
|
|
445
451
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
446
452
|
*/
|
|
447
453
|
//
|
|
@@ -465,10 +471,15 @@ class kucoin extends kucoin$1 {
|
|
|
465
471
|
/**
|
|
466
472
|
* @method
|
|
467
473
|
* @name kucoin#watchOrderBookForSymbols
|
|
474
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level1-bbo-market-data
|
|
475
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-market-data
|
|
476
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-5-best-ask-bid-orders
|
|
477
|
+
* @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/level2-50-best-ask-bid-orders
|
|
468
478
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
469
479
|
* @param {string[]} symbols unified array of symbols
|
|
470
480
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
471
481
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
482
|
+
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
|
|
472
483
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
473
484
|
*/
|
|
474
485
|
const symbolsLength = symbols.length;
|
|
@@ -476,28 +487,36 @@ class kucoin extends kucoin$1 {
|
|
|
476
487
|
throw new errors.ArgumentsRequired(this.id + ' watchOrderBookForSymbols() requires a non-empty array of symbols');
|
|
477
488
|
}
|
|
478
489
|
if (limit !== undefined) {
|
|
479
|
-
if ((limit !== 20) && (limit !== 100)) {
|
|
480
|
-
throw new errors.ExchangeError(this.id + " watchOrderBook 'limit' argument must be undefined, 20 or 100");
|
|
490
|
+
if ((limit !== 20) && (limit !== 100) && (limit !== 50) && (limit !== 5)) {
|
|
491
|
+
throw new errors.ExchangeError(this.id + " watchOrderBook 'limit' argument must be undefined, 5, 20, 50 or 100");
|
|
481
492
|
}
|
|
482
493
|
}
|
|
483
494
|
await this.loadMarkets();
|
|
484
495
|
symbols = this.marketSymbols(symbols);
|
|
485
496
|
const marketIds = this.marketIds(symbols);
|
|
486
497
|
const url = await this.negotiate(false);
|
|
487
|
-
|
|
498
|
+
let method = undefined;
|
|
499
|
+
[method, params] = this.handleOptionAndParams(params, 'watchOrderBook', 'method', '/market/level2');
|
|
500
|
+
if ((limit === 5) || (limit === 50)) {
|
|
501
|
+
method = '/spotMarket/level2Depth' + limit.toString();
|
|
502
|
+
}
|
|
503
|
+
const topic = method + ':' + marketIds.join(',');
|
|
488
504
|
const messageHashes = [];
|
|
489
505
|
const subscriptionHashes = [];
|
|
490
506
|
for (let i = 0; i < symbols.length; i++) {
|
|
491
507
|
const symbol = symbols[i];
|
|
492
508
|
messageHashes.push('orderbook:' + symbol);
|
|
493
509
|
const marketId = marketIds[i];
|
|
494
|
-
subscriptionHashes.push('
|
|
510
|
+
subscriptionHashes.push(method + ':' + marketId);
|
|
511
|
+
}
|
|
512
|
+
let subscription = {};
|
|
513
|
+
if (method === '/market/level2') { // other streams return the entire orderbook, so we don't need to fetch the snapshot through REST
|
|
514
|
+
subscription = {
|
|
515
|
+
'method': this.handleOrderBookSubscription,
|
|
516
|
+
'symbols': symbols,
|
|
517
|
+
'limit': limit,
|
|
518
|
+
};
|
|
495
519
|
}
|
|
496
|
-
const subscription = {
|
|
497
|
-
'method': this.handleOrderBookSubscription,
|
|
498
|
-
'symbols': symbols,
|
|
499
|
-
'limit': limit,
|
|
500
|
-
};
|
|
501
520
|
const orderbook = await this.subscribeMultiple(url, messageHashes, topic, subscriptionHashes, params, subscription);
|
|
502
521
|
return orderbook.limit();
|
|
503
522
|
}
|
|
@@ -521,41 +540,74 @@ class kucoin extends kucoin$1 {
|
|
|
521
540
|
// }
|
|
522
541
|
// }
|
|
523
542
|
//
|
|
543
|
+
// {
|
|
544
|
+
// "topic": "/spotMarket/level2Depth5:BTC-USDT",
|
|
545
|
+
// "type": "message",
|
|
546
|
+
// "data": {
|
|
547
|
+
// "asks": [
|
|
548
|
+
// [
|
|
549
|
+
// "42815.6",
|
|
550
|
+
// "1.24016245"
|
|
551
|
+
// ]
|
|
552
|
+
// ],
|
|
553
|
+
// "bids": [
|
|
554
|
+
// [
|
|
555
|
+
// "42815.5",
|
|
556
|
+
// "0.08652716"
|
|
557
|
+
// ]
|
|
558
|
+
// ],
|
|
559
|
+
// "timestamp": 1707204474018
|
|
560
|
+
// },
|
|
561
|
+
// "subject": "level2"
|
|
562
|
+
// }
|
|
563
|
+
//
|
|
524
564
|
const data = this.safeValue(message, 'data');
|
|
525
|
-
const
|
|
565
|
+
const subject = this.safeString(message, 'subject');
|
|
566
|
+
const topic = this.safeString(message, 'topic');
|
|
567
|
+
const topicParts = topic.split(':');
|
|
568
|
+
const topicSymbol = this.safeString(topicParts, 1);
|
|
569
|
+
const topicChannel = this.safeString(topicParts, 0);
|
|
570
|
+
const marketId = this.safeString(data, 'symbol', topicSymbol);
|
|
526
571
|
const symbol = this.safeSymbol(marketId, undefined, '-');
|
|
527
572
|
const messageHash = 'orderbook:' + symbol;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const cacheLength = storedOrderBook.cache.length;
|
|
533
|
-
const topic = this.safeString(message, 'topic');
|
|
534
|
-
const topicParts = topic.split(':');
|
|
535
|
-
const topicSymbol = this.safeString(topicParts, 1);
|
|
536
|
-
const topicChannel = this.safeString(topicParts, 0);
|
|
537
|
-
const subscriptions = Object.keys(client.subscriptions);
|
|
538
|
-
let subscription = undefined;
|
|
539
|
-
for (let i = 0; i < subscriptions.length; i++) {
|
|
540
|
-
const key = subscriptions[i];
|
|
541
|
-
if ((key.indexOf(topicSymbol) >= 0) && (key.indexOf(topicChannel) >= 0)) {
|
|
542
|
-
subscription = client.subscriptions[key];
|
|
543
|
-
break;
|
|
544
|
-
}
|
|
573
|
+
let orderbook = this.safeDict(this.orderbooks, symbol);
|
|
574
|
+
if (subject === 'level2') {
|
|
575
|
+
if (orderbook === undefined) {
|
|
576
|
+
orderbook = this.orderBook();
|
|
545
577
|
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
if (cacheLength === snapshotDelay) {
|
|
549
|
-
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
578
|
+
else {
|
|
579
|
+
orderbook.reset();
|
|
550
580
|
}
|
|
551
|
-
|
|
552
|
-
return;
|
|
581
|
+
orderbook['symbol'] = symbol;
|
|
553
582
|
}
|
|
554
|
-
else
|
|
555
|
-
|
|
583
|
+
else {
|
|
584
|
+
const nonce = this.safeInteger(orderbook, 'nonce');
|
|
585
|
+
const deltaEnd = this.safeInteger2(data, 'sequenceEnd', 'timestamp');
|
|
586
|
+
if (nonce === undefined) {
|
|
587
|
+
const cacheLength = orderbook.cache.length;
|
|
588
|
+
const subscriptions = Object.keys(client.subscriptions);
|
|
589
|
+
let subscription = undefined;
|
|
590
|
+
for (let i = 0; i < subscriptions.length; i++) {
|
|
591
|
+
const key = subscriptions[i];
|
|
592
|
+
if ((key.indexOf(topicSymbol) >= 0) && (key.indexOf(topicChannel) >= 0)) {
|
|
593
|
+
subscription = client.subscriptions[key];
|
|
594
|
+
break;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
const limit = this.safeInteger(subscription, 'limit');
|
|
598
|
+
const snapshotDelay = this.handleOption('watchOrderBook', 'snapshotDelay', 5);
|
|
599
|
+
if (cacheLength === snapshotDelay) {
|
|
600
|
+
this.spawn(this.loadOrderBook, client, messageHash, symbol, limit, {});
|
|
601
|
+
}
|
|
602
|
+
orderbook.cache.push(data);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
else if (nonce >= deltaEnd) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
556
608
|
}
|
|
557
|
-
this.handleDelta(
|
|
558
|
-
client.resolve(
|
|
609
|
+
this.handleDelta(orderbook, data);
|
|
610
|
+
client.resolve(orderbook, messageHash);
|
|
559
611
|
}
|
|
560
612
|
getCacheIndex(orderbook, cache) {
|
|
561
613
|
const firstDelta = this.safeValue(cache, 0);
|
|
@@ -575,11 +627,11 @@ class kucoin extends kucoin$1 {
|
|
|
575
627
|
return cache.length;
|
|
576
628
|
}
|
|
577
629
|
handleDelta(orderbook, delta) {
|
|
578
|
-
|
|
579
|
-
|
|
630
|
+
const timestamp = this.safeInteger2(delta, 'time', 'timestamp');
|
|
631
|
+
orderbook['nonce'] = this.safeInteger(delta, 'sequenceEnd', timestamp);
|
|
580
632
|
orderbook['timestamp'] = timestamp;
|
|
581
633
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
582
|
-
const changes = this.safeValue(delta, 'changes');
|
|
634
|
+
const changes = this.safeValue(delta, 'changes', delta);
|
|
583
635
|
const bids = this.safeValue(changes, 'bids', []);
|
|
584
636
|
const asks = this.safeValue(changes, 'asks', []);
|
|
585
637
|
const storedBids = orderbook['bids'];
|
|
@@ -993,6 +1045,7 @@ class kucoin extends kucoin$1 {
|
|
|
993
1045
|
}
|
|
994
1046
|
const subject = this.safeString(message, 'subject');
|
|
995
1047
|
const methods = {
|
|
1048
|
+
'level2': this.handleOrderBook,
|
|
996
1049
|
'trade.l2update': this.handleOrderBook,
|
|
997
1050
|
'trade.ticker': this.handleTicker,
|
|
998
1051
|
'trade.snapshot': this.handleTicker,
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -469,7 +469,7 @@ class mexc extends mexc$1 {
|
|
|
469
469
|
}
|
|
470
470
|
try {
|
|
471
471
|
this.handleDelta(storedOrderBook, data);
|
|
472
|
-
const timestamp = this.
|
|
472
|
+
const timestamp = this.safeInteger2(message, 't', 'ts');
|
|
473
473
|
storedOrderBook['timestamp'] = timestamp;
|
|
474
474
|
storedOrderBook['datetime'] = this.iso8601(timestamp);
|
|
475
475
|
}
|
|
@@ -311,7 +311,7 @@ class wavesexchange extends wavesexchange$1 {
|
|
|
311
311
|
},
|
|
312
312
|
},
|
|
313
313
|
'currencies': {
|
|
314
|
-
'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.
|
|
314
|
+
'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.parseToInt('8') }),
|
|
315
315
|
},
|
|
316
316
|
'precisionMode': number.DECIMAL_PLACES,
|
|
317
317
|
'options': {
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -1065,7 +1065,7 @@ class woo extends woo$1 {
|
|
|
1065
1065
|
if (stopPrice !== undefined) {
|
|
1066
1066
|
request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
|
|
1067
1067
|
}
|
|
1068
|
-
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', price);
|
|
1068
|
+
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
|
|
1069
1069
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
|
|
1070
1070
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
1071
1071
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
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.38";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -37,6 +37,7 @@ import bitteam from './src/bitteam.js';
|
|
|
37
37
|
import bitvavo from './src/bitvavo.js';
|
|
38
38
|
import bl3p from './src/bl3p.js';
|
|
39
39
|
import blockchaincom from './src/blockchaincom.js';
|
|
40
|
+
import blofin from './src/blofin.js';
|
|
40
41
|
import btcalpha from './src/btcalpha.js';
|
|
41
42
|
import btcbox from './src/btcbox.js';
|
|
42
43
|
import btcmarkets from './src/btcmarkets.js';
|
|
@@ -199,6 +200,7 @@ declare const exchanges: {
|
|
|
199
200
|
bitvavo: typeof bitvavo;
|
|
200
201
|
bl3p: typeof bl3p;
|
|
201
202
|
blockchaincom: typeof blockchaincom;
|
|
203
|
+
blofin: typeof blofin;
|
|
202
204
|
btcalpha: typeof btcalpha;
|
|
203
205
|
btcbox: typeof btcbox;
|
|
204
206
|
btcmarkets: typeof btcmarkets;
|
|
@@ -432,6 +434,7 @@ declare const ccxt: {
|
|
|
432
434
|
bitvavo: typeof bitvavo;
|
|
433
435
|
bl3p: typeof bl3p;
|
|
434
436
|
blockchaincom: typeof blockchaincom;
|
|
437
|
+
blofin: typeof blofin;
|
|
435
438
|
btcalpha: typeof btcalpha;
|
|
436
439
|
btcbox: typeof btcbox;
|
|
437
440
|
btcmarkets: typeof btcmarkets;
|
|
@@ -501,5 +504,5 @@ declare const ccxt: {
|
|
|
501
504
|
zaif: typeof zaif;
|
|
502
505
|
zonda: typeof zonda;
|
|
503
506
|
} & typeof functions & typeof errors;
|
|
504
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
507
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
505
508
|
export default ccxt;
|
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.39';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -73,6 +73,7 @@ import bitteam from './src/bitteam.js';
|
|
|
73
73
|
import bitvavo from './src/bitvavo.js';
|
|
74
74
|
import bl3p from './src/bl3p.js';
|
|
75
75
|
import blockchaincom from './src/blockchaincom.js';
|
|
76
|
+
import blofin from './src/blofin.js';
|
|
76
77
|
import btcalpha from './src/btcalpha.js';
|
|
77
78
|
import btcbox from './src/btcbox.js';
|
|
78
79
|
import btcmarkets from './src/btcmarkets.js';
|
|
@@ -236,6 +237,7 @@ const exchanges = {
|
|
|
236
237
|
'bitvavo': bitvavo,
|
|
237
238
|
'bl3p': bl3p,
|
|
238
239
|
'blockchaincom': blockchaincom,
|
|
240
|
+
'blofin': blofin,
|
|
239
241
|
'btcalpha': btcalpha,
|
|
240
242
|
'btcbox': btcbox,
|
|
241
243
|
'btcmarkets': btcmarkets,
|
|
@@ -380,6 +382,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
380
382
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
381
383
|
//-----------------------------------------------------------------------------
|
|
382
384
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
383
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
385
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
384
386
|
export default ccxt;
|
|
385
387
|
//-----------------------------------------------------------------------------
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { implicitReturnType } from '../base/types.js';
|
|
2
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
|
+
interface Exchange {
|
|
4
|
+
publicGetMarketInstruments(params?: {}): Promise<implicitReturnType>;
|
|
5
|
+
publicGetMarketTickers(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetMarketBooks(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetMarketTrades(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetMarketCandles(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetMarketMarkPrice(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetMarketFundingRate(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetMarketFundingRateHistory(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
privateGetAssetBalances(params?: {}): Promise<implicitReturnType>;
|
|
13
|
+
privateGetTradeOrdersPending(params?: {}): Promise<implicitReturnType>;
|
|
14
|
+
privateGetTradeFillsHistory(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
privateGetAssetDepositHistory(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
privateGetAssetWithdrawalHistory(params?: {}): Promise<implicitReturnType>;
|
|
17
|
+
privateGetAssetBills(params?: {}): Promise<implicitReturnType>;
|
|
18
|
+
privateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
19
|
+
privateGetAccountPositions(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
privateGetAccountLeverageInfo(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetTradeOrdersTpslPending(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
privateGetTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
|
|
23
|
+
privateGetTradeOrdersTpslHistory(params?: {}): Promise<implicitReturnType>;
|
|
24
|
+
privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
|
|
25
|
+
privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
privatePostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
privatePostTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privatePostTradeOrderTpsl(params?: {}): Promise<implicitReturnType>;
|
|
29
|
+
privatePostTradeCancelBatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
30
|
+
privatePostTradeCancelTpsl(params?: {}): Promise<implicitReturnType>;
|
|
31
|
+
privatePostTradeClosePosition(params?: {}): Promise<implicitReturnType>;
|
|
32
|
+
privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
}
|
|
34
|
+
declare abstract class Exchange extends _Exchange {
|
|
35
|
+
}
|
|
36
|
+
export default Exchange;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
// -------------------------------------------------------------------------------
|
|
8
|
+
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
9
|
+
class Exchange extends _Exchange {
|
|
10
|
+
}
|
|
11
|
+
export default Exchange;
|
|
@@ -72,6 +72,7 @@ interface Exchange {
|
|
|
72
72
|
v3PrivatePostBrokerageOrdersBatchCancel(params?: {}): Promise<implicitReturnType>;
|
|
73
73
|
v3PrivatePostBrokerageOrdersEdit(params?: {}): Promise<implicitReturnType>;
|
|
74
74
|
v3PrivatePostBrokerageOrdersEditPreview(params?: {}): Promise<implicitReturnType>;
|
|
75
|
+
v3PrivatePostBrokerageOrdersPreview(params?: {}): Promise<implicitReturnType>;
|
|
75
76
|
v3PrivatePostBrokeragePortfolios(params?: {}): Promise<implicitReturnType>;
|
|
76
77
|
v3PrivatePostBrokeragePortfoliosMoveFunds(params?: {}): Promise<implicitReturnType>;
|
|
77
78
|
v3PrivatePostBrokerageConvertQuote(params?: {}): Promise<implicitReturnType>;
|
package/js/src/abstract/okx.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ interface Exchange {
|
|
|
98
98
|
privateGetTradeEasyConvertHistory(params?: {}): Promise<implicitReturnType>;
|
|
99
99
|
privateGetTradeOneClickRepayCurrencyList(params?: {}): Promise<implicitReturnType>;
|
|
100
100
|
privateGetTradeOneClickRepayHistory(params?: {}): Promise<implicitReturnType>;
|
|
101
|
+
privateGetTradeAccountRateLimit(params?: {}): Promise<implicitReturnType>;
|
|
101
102
|
privateGetAssetCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
102
103
|
privateGetAssetBalances(params?: {}): Promise<implicitReturnType>;
|
|
103
104
|
privateGetAssetNonTradableAssets(params?: {}): Promise<implicitReturnType>;
|