ccxt 4.3.27 → 4.3.29
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 +30 -0
- package/dist/ccxt.browser.min.js.LICENSE.txt +12 -0
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +2 -1
- package/dist/cjs/src/base/ws/OrderBookSide.js +4 -4
- package/dist/cjs/src/bingx.js +140 -90
- package/dist/cjs/src/bitget.js +1 -0
- package/dist/cjs/src/bitmart.js +137 -2
- package/dist/cjs/src/bybit.js +3 -3
- package/dist/cjs/src/coinbase.js +1 -1
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/pro/bitfinex.js +4 -4
- package/dist/cjs/src/pro/bitfinex2.js +2 -2
- package/dist/cjs/src/pro/bitmex.js +3 -3
- package/dist/cjs/src/pro/blockchaincom.js +2 -2
- package/dist/cjs/src/pro/coinbase.js +5 -1
- package/dist/cjs/src/pro/cryptocom.js +4 -4
- package/dist/cjs/src/pro/deribit.js +9 -9
- package/dist/cjs/src/pro/idex.js +1 -1
- package/dist/cjs/src/pro/luno.js +4 -5
- package/dist/cjs/src/pro/mexc.js +2 -2
- package/dist/cjs/src/whitebit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +7 -0
- package/js/src/abstract/bitget.d.ts +1 -0
- package/js/src/abstract/bitmart.d.ts +2 -0
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.js +2 -1
- package/js/src/base/ws/Cache.d.ts +1 -1
- package/js/src/base/ws/OrderBookSide.d.ts +4 -5
- package/js/src/base/ws/OrderBookSide.js +4 -4
- package/js/src/bingx.js +140 -90
- package/js/src/bitget.js +1 -0
- package/js/src/bitmart.d.ts +3 -1
- package/js/src/bitmart.js +137 -2
- package/js/src/bybit.js +3 -3
- package/js/src/coinbase.js +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +1 -0
- package/js/src/pro/bitfinex.js +4 -4
- package/js/src/pro/bitfinex2.js +2 -2
- package/js/src/pro/bitmex.js +3 -3
- package/js/src/pro/blockchaincom.js +2 -2
- package/js/src/pro/coinbase.js +5 -1
- package/js/src/pro/cryptocom.js +4 -4
- package/js/src/pro/deribit.js +9 -9
- package/js/src/pro/idex.js +1 -1
- package/js/src/pro/luno.js +4 -5
- package/js/src/pro/mexc.js +2 -2
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/whitebit.js +1 -1
- package/package.json +2 -2
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -2486,14 +2486,14 @@ class bybit extends bybit$1 {
|
|
|
2486
2486
|
throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2487
2487
|
}
|
|
2488
2488
|
await this.loadMarkets();
|
|
2489
|
-
if (limit === undefined) {
|
|
2490
|
-
limit = 200;
|
|
2491
|
-
}
|
|
2492
2489
|
let paginate = false;
|
|
2493
2490
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
2494
2491
|
if (paginate) {
|
|
2495
2492
|
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 200);
|
|
2496
2493
|
}
|
|
2494
|
+
if (limit === undefined) {
|
|
2495
|
+
limit = 200;
|
|
2496
|
+
}
|
|
2497
2497
|
const request = {
|
|
2498
2498
|
// 'category': '', // Product type. linear,inverse
|
|
2499
2499
|
// 'symbol': '', // Symbol name
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -2978,7 +2978,7 @@ class coinbase extends coinbase$1 {
|
|
|
2978
2978
|
const marketId = this.safeString(order, 'product_id');
|
|
2979
2979
|
const symbol = this.safeSymbol(marketId, market, '-');
|
|
2980
2980
|
if (symbol !== undefined) {
|
|
2981
|
-
market = this.
|
|
2981
|
+
market = this.safeMarket(symbol, market);
|
|
2982
2982
|
}
|
|
2983
2983
|
const orderConfiguration = this.safeDict(order, 'order_configuration', {});
|
|
2984
2984
|
const limitGTC = this.safeDict(orderConfiguration, 'limit_limit_gtc');
|
|
@@ -2237,7 +2237,7 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
2237
2237
|
/**
|
|
2238
2238
|
* @method
|
|
2239
2239
|
* @name krakenfutures#fetchPositions
|
|
2240
|
-
* @see https://docs.futures.kraken.com/#
|
|
2240
|
+
* @see https://docs.futures.kraken.com/#http-api-trading-v3-api-account-information-get-open-positions
|
|
2241
2241
|
* @description Fetches current contract trading positions
|
|
2242
2242
|
* @param {string[]} symbols List of unified symbols
|
|
2243
2243
|
* @param {object} [params] Not used by krakenfutures
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -427,6 +427,7 @@ class kucoin extends kucoin$1 {
|
|
|
427
427
|
'The withdrawal amount is below the minimum requirement.': errors.ExchangeError,
|
|
428
428
|
'Unsuccessful! Exceeded the max. funds out-transfer limit': errors.InsufficientFunds,
|
|
429
429
|
'The amount increment is invalid.': errors.BadRequest,
|
|
430
|
+
'The quantity is below the minimum requirement.': errors.InvalidOrder,
|
|
430
431
|
'400': errors.BadRequest,
|
|
431
432
|
'401': errors.AuthenticationError,
|
|
432
433
|
'403': errors.NotSupported,
|
|
@@ -325,7 +325,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
325
325
|
const size = (delta2Value < 0) ? -delta2Value : delta2Value;
|
|
326
326
|
const side = (delta2Value < 0) ? 'asks' : 'bids';
|
|
327
327
|
const bookside = orderbook[side];
|
|
328
|
-
bookside.
|
|
328
|
+
bookside.storeArray([price, size, id]);
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
else {
|
|
@@ -336,7 +336,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
336
336
|
const size = (delta2 < 0) ? -delta2 : delta2;
|
|
337
337
|
const side = (delta2 < 0) ? 'asks' : 'bids';
|
|
338
338
|
const countedBookSide = orderbook[side];
|
|
339
|
-
countedBookSide.
|
|
339
|
+
countedBookSide.storeArray([delta[0], size, delta[1]]);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
client.resolve(orderbook, messageHash);
|
|
@@ -352,14 +352,14 @@ class bitfinex extends bitfinex$1 {
|
|
|
352
352
|
const bookside = orderbook[side];
|
|
353
353
|
// price = 0 means that you have to remove the order from your book
|
|
354
354
|
const amount = Precise["default"].stringGt(price, '0') ? size : '0';
|
|
355
|
-
bookside.
|
|
355
|
+
bookside.storeArray([this.parseNumber(price), this.parseNumber(amount), id]);
|
|
356
356
|
}
|
|
357
357
|
else {
|
|
358
358
|
const message3Value = message[3];
|
|
359
359
|
const size = (message3Value < 0) ? -message3Value : message3Value;
|
|
360
360
|
const side = (message3Value < 0) ? 'asks' : 'bids';
|
|
361
361
|
const countedBookSide = orderbook[side];
|
|
362
|
-
countedBookSide.
|
|
362
|
+
countedBookSide.storeArray([message[1], size, message[2]]);
|
|
363
363
|
}
|
|
364
364
|
client.resolve(orderbook, messageHash);
|
|
365
365
|
}
|
|
@@ -630,7 +630,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
630
630
|
// price = 0 means that you have to remove the order from your book
|
|
631
631
|
const amount = Precise["default"].stringGt(price, '0') ? size : '0';
|
|
632
632
|
const idString = this.safeString(deltas, 0);
|
|
633
|
-
bookside.
|
|
633
|
+
bookside.storeArray([this.parseNumber(price), this.parseNumber(amount), idString]);
|
|
634
634
|
}
|
|
635
635
|
else {
|
|
636
636
|
const amount = this.safeString(deltas, 2);
|
|
@@ -639,7 +639,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
639
639
|
const size = Precise["default"].stringLt(amount, '0') ? Precise["default"].stringNeg(amount) : amount;
|
|
640
640
|
const side = Precise["default"].stringLt(amount, '0') ? 'asks' : 'bids';
|
|
641
641
|
const bookside = orderbookItem[side];
|
|
642
|
-
bookside.
|
|
642
|
+
bookside.storeArray([this.parseNumber(price), this.parseNumber(size), this.parseNumber(counter)]);
|
|
643
643
|
}
|
|
644
644
|
client.resolve(orderbook, messageHash);
|
|
645
645
|
}
|
|
@@ -1430,7 +1430,7 @@ class bitmex extends bitmex$1 {
|
|
|
1430
1430
|
const data = this.safeValue(message, 'data', []);
|
|
1431
1431
|
// if it's an initial snapshot
|
|
1432
1432
|
if (action === 'partial') {
|
|
1433
|
-
const filter = this.
|
|
1433
|
+
const filter = this.safeDict(message, 'filter', {});
|
|
1434
1434
|
const marketId = this.safeValue(filter, 'symbol');
|
|
1435
1435
|
const market = this.safeMarket(marketId);
|
|
1436
1436
|
const symbol = market['symbol'];
|
|
@@ -1452,7 +1452,7 @@ class bitmex extends bitmex$1 {
|
|
|
1452
1452
|
let side = this.safeString(data[i], 'side');
|
|
1453
1453
|
side = (side === 'Buy') ? 'bids' : 'asks';
|
|
1454
1454
|
const bookside = orderbook[side];
|
|
1455
|
-
bookside.
|
|
1455
|
+
bookside.storeArray([price, size, id]);
|
|
1456
1456
|
const datetime = this.safeString(data[i], 'timestamp');
|
|
1457
1457
|
orderbook['timestamp'] = this.parse8601(datetime);
|
|
1458
1458
|
orderbook['datetime'] = datetime;
|
|
@@ -1477,7 +1477,7 @@ class bitmex extends bitmex$1 {
|
|
|
1477
1477
|
let side = this.safeString(data[i], 'side');
|
|
1478
1478
|
side = (side === 'Buy') ? 'bids' : 'asks';
|
|
1479
1479
|
const bookside = orderbook[side];
|
|
1480
|
-
bookside.
|
|
1480
|
+
bookside.storeArray([price, size, id]);
|
|
1481
1481
|
const datetime = this.safeString(data[i], 'timestamp');
|
|
1482
1482
|
orderbook['timestamp'] = this.parse8601(datetime);
|
|
1483
1483
|
orderbook['datetime'] = datetime;
|
|
@@ -695,8 +695,8 @@ class blockchaincom extends blockchaincom$1 {
|
|
|
695
695
|
orderbook.reset(snapshot);
|
|
696
696
|
}
|
|
697
697
|
else if (event === 'updated') {
|
|
698
|
-
const asks = this.
|
|
699
|
-
const bids = this.
|
|
698
|
+
const asks = this.safeList(message, 'asks', []);
|
|
699
|
+
const bids = this.safeList(message, 'bids', []);
|
|
700
700
|
this.handleDeltas(orderbook['asks'], asks);
|
|
701
701
|
this.handleDeltas(orderbook['bids'], bids);
|
|
702
702
|
orderbook['timestamp'] = timestamp;
|
|
@@ -246,13 +246,17 @@ class coinbase extends coinbase$1 {
|
|
|
246
246
|
//
|
|
247
247
|
const channel = this.safeString(message, 'channel');
|
|
248
248
|
const events = this.safeValue(message, 'events', []);
|
|
249
|
+
const datetime = this.safeString(message, 'timestamp');
|
|
250
|
+
const timestamp = this.parse8601(datetime);
|
|
249
251
|
const newTickers = [];
|
|
250
252
|
for (let i = 0; i < events.length; i++) {
|
|
251
253
|
const tickersObj = events[i];
|
|
252
|
-
const tickers = this.
|
|
254
|
+
const tickers = this.safeList(tickersObj, 'tickers', []);
|
|
253
255
|
for (let j = 0; j < tickers.length; j++) {
|
|
254
256
|
const ticker = tickers[j];
|
|
255
257
|
const result = this.parseWsTicker(ticker);
|
|
258
|
+
result['timestamp'] = timestamp;
|
|
259
|
+
result['datetime'] = datetime;
|
|
256
260
|
const symbol = result['symbol'];
|
|
257
261
|
this.tickers[symbol] = result;
|
|
258
262
|
const wsMarketId = this.safeString(ticker, 'product_id');
|
|
@@ -128,7 +128,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
128
128
|
const price = this.safeFloat(delta, 0);
|
|
129
129
|
const amount = this.safeFloat(delta, 1);
|
|
130
130
|
const count = this.safeInteger(delta, 2);
|
|
131
|
-
bookside.
|
|
131
|
+
bookside.storeArray([price, amount, count]);
|
|
132
132
|
}
|
|
133
133
|
handleDeltas(bookside, deltas) {
|
|
134
134
|
for (let i = 0; i < deltas.length; i++) {
|
|
@@ -197,11 +197,11 @@ class cryptocom extends cryptocom$1 {
|
|
|
197
197
|
let data = this.safeValue(message, 'data');
|
|
198
198
|
data = this.safeValue(data, 0);
|
|
199
199
|
const timestamp = this.safeInteger(data, 't');
|
|
200
|
-
|
|
201
|
-
if (orderbook === undefined) {
|
|
200
|
+
if (!(symbol in this.orderbooks)) {
|
|
202
201
|
const limit = this.safeInteger(message, 'depth');
|
|
203
|
-
|
|
202
|
+
this.orderbooks[symbol] = this.countedOrderBook({}, limit);
|
|
204
203
|
}
|
|
204
|
+
const orderbook = this.orderbooks[symbol];
|
|
205
205
|
const channel = this.safeString(message, 'channel');
|
|
206
206
|
const nonce = this.safeInteger2(data, 'u', 's');
|
|
207
207
|
let books = data;
|
|
@@ -505,12 +505,12 @@ class deribit extends deribit$1 {
|
|
|
505
505
|
const marketId = this.safeString(data, 'instrument_name');
|
|
506
506
|
const symbol = this.safeSymbol(marketId);
|
|
507
507
|
const timestamp = this.safeInteger(data, 'timestamp');
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
storedOrderBook = this.countedOrderBook();
|
|
508
|
+
if (!(symbol in this.orderbooks)) {
|
|
509
|
+
this.orderbooks[symbol] = this.countedOrderBook();
|
|
511
510
|
}
|
|
512
|
-
const
|
|
513
|
-
const
|
|
511
|
+
const storedOrderBook = this.orderbooks[symbol];
|
|
512
|
+
const asks = this.safeList(data, 'asks', []);
|
|
513
|
+
const bids = this.safeList(data, 'bids', []);
|
|
514
514
|
this.handleDeltas(storedOrderBook['asks'], asks);
|
|
515
515
|
this.handleDeltas(storedOrderBook['bids'], bids);
|
|
516
516
|
storedOrderBook['nonce'] = timestamp;
|
|
@@ -522,8 +522,8 @@ class deribit extends deribit$1 {
|
|
|
522
522
|
client.resolve(storedOrderBook, messageHash);
|
|
523
523
|
}
|
|
524
524
|
cleanOrderBook(data) {
|
|
525
|
-
const bids = this.
|
|
526
|
-
const asks = this.
|
|
525
|
+
const bids = this.safeList(data, 'bids', []);
|
|
526
|
+
const asks = this.safeList(data, 'asks', []);
|
|
527
527
|
const cleanedBids = [];
|
|
528
528
|
for (let i = 0; i < bids.length; i++) {
|
|
529
529
|
cleanedBids.push([bids[i][1], bids[i][2]]);
|
|
@@ -540,10 +540,10 @@ class deribit extends deribit$1 {
|
|
|
540
540
|
const price = delta[1];
|
|
541
541
|
const amount = delta[2];
|
|
542
542
|
if (delta[0] === 'new' || delta[0] === 'change') {
|
|
543
|
-
bookside.
|
|
543
|
+
bookside.storeArray([price, amount, 1]);
|
|
544
544
|
}
|
|
545
545
|
else if (delta[0] === 'delete') {
|
|
546
|
-
bookside.
|
|
546
|
+
bookside.storeArray([price, amount, 0]);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
handleDeltas(bookside, deltas) {
|
package/dist/cjs/src/pro/idex.js
CHANGED
|
@@ -481,7 +481,7 @@ class idex extends idex$1 {
|
|
|
481
481
|
const price = this.safeFloat(delta, 0);
|
|
482
482
|
const amount = this.safeFloat(delta, 1);
|
|
483
483
|
const count = this.safeInteger(delta, 2);
|
|
484
|
-
bookside.
|
|
484
|
+
bookside.storeArray([price, amount, count]);
|
|
485
485
|
}
|
|
486
486
|
handleDeltas(bookside, deltas) {
|
|
487
487
|
for (let i = 0; i < deltas.length; i++) {
|
package/dist/cjs/src/pro/luno.js
CHANGED
|
@@ -190,12 +190,11 @@ class luno extends luno$1 {
|
|
|
190
190
|
//
|
|
191
191
|
const symbol = subscription['symbol'];
|
|
192
192
|
const messageHash = 'orderbook:' + symbol;
|
|
193
|
-
const timestamp = this.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
orderbook = this.indexedOrderBook({});
|
|
197
|
-
this.orderbooks[symbol] = orderbook;
|
|
193
|
+
const timestamp = this.safeInteger(message, 'timestamp');
|
|
194
|
+
if (!(symbol in this.orderbooks)) {
|
|
195
|
+
this.orderbooks[symbol] = this.indexedOrderBook({});
|
|
198
196
|
}
|
|
197
|
+
const orderbook = this.orderbooks[symbol];
|
|
199
198
|
const asks = this.safeValue(message, 'asks');
|
|
200
199
|
if (asks !== undefined) {
|
|
201
200
|
const snapshot = this.customParseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'price', 'volume', 'id');
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -508,8 +508,8 @@ class mexc extends mexc$1 {
|
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
510
|
orderbook['nonce'] = deltaNonce;
|
|
511
|
-
const asks = this.
|
|
512
|
-
const bids = this.
|
|
511
|
+
const asks = this.safeList(delta, 'asks', []);
|
|
512
|
+
const bids = this.safeList(delta, 'bids', []);
|
|
513
513
|
const asksOrderSide = orderbook['asks'];
|
|
514
514
|
const bidsOrderSide = orderbook['bids'];
|
|
515
515
|
this.handleBooksideDelta(asksOrderSide, asks);
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -1470,7 +1470,7 @@ class whitebit extends whitebit$1 {
|
|
|
1470
1470
|
const balance = response[id];
|
|
1471
1471
|
if (typeof balance === 'object' && balance !== undefined) {
|
|
1472
1472
|
const account = this.account();
|
|
1473
|
-
account['free'] = this.
|
|
1473
|
+
account['free'] = this.safeString2(balance, 'available', 'main_balance');
|
|
1474
1474
|
account['used'] = this.safeString(balance, 'freeze');
|
|
1475
1475
|
account['total'] = this.safeString(balance, 'main_balance');
|
|
1476
1476
|
result[code] = account;
|
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, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.28";
|
|
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, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.29';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -7,6 +7,8 @@ interface Exchange {
|
|
|
7
7
|
spotV1PublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
|
|
8
8
|
spotV1PublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
spotV1PublicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
spotV1PublicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
spotV1PublicGetTickerBookTicker(params?: {}): Promise<implicitReturnType>;
|
|
10
12
|
spotV1PrivateGetTradeQuery(params?: {}): Promise<implicitReturnType>;
|
|
11
13
|
spotV1PrivateGetTradeOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
12
14
|
spotV1PrivateGetTradeHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
@@ -20,12 +22,15 @@ interface Exchange {
|
|
|
20
22
|
spotV1PrivatePostTradeCancelOrders(params?: {}): Promise<implicitReturnType>;
|
|
21
23
|
spotV1PrivatePostTradeCancelOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
22
24
|
spotV1PrivatePostTradeCancelAllAfter(params?: {}): Promise<implicitReturnType>;
|
|
25
|
+
spotV2PublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
spotV2PublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
|
|
23
27
|
spotV3PrivateGetGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
24
28
|
spotV3PrivateGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
25
29
|
spotV3PrivateGetCapitalDepositHisrec(params?: {}): Promise<implicitReturnType>;
|
|
26
30
|
spotV3PrivateGetCapitalWithdrawHistory(params?: {}): Promise<implicitReturnType>;
|
|
27
31
|
spotV3PrivatePostPostAssetTransfer(params?: {}): Promise<implicitReturnType>;
|
|
28
32
|
swapV1PublicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
swapV1PublicGetMarketHistoricalTrades(params?: {}): Promise<implicitReturnType>;
|
|
29
34
|
swapV1PrivateGetPositionSideDual(params?: {}): Promise<implicitReturnType>;
|
|
30
35
|
swapV1PrivateGetMarketMarkPriceKlines(params?: {}): Promise<implicitReturnType>;
|
|
31
36
|
swapV1PrivateGetTradeBatchCancelReplace(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,6 +84,7 @@ interface Exchange {
|
|
|
79
84
|
walletsV1PrivateGetCapitalSubAccountDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
80
85
|
walletsV1PrivateGetCapitalDepositSubHisrec(params?: {}): Promise<implicitReturnType>;
|
|
81
86
|
walletsV1PrivateGetCapitalSubAccountInnerTransferRecords(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
walletsV1PrivateGetCapitalDepositRiskRecords(params?: {}): Promise<implicitReturnType>;
|
|
82
88
|
walletsV1PrivatePostCapitalWithdrawApply(params?: {}): Promise<implicitReturnType>;
|
|
83
89
|
walletsV1PrivatePostCapitalInnerTransferApply(params?: {}): Promise<implicitReturnType>;
|
|
84
90
|
walletsV1PrivatePostCapitalSubAccountInnerTransferApply(params?: {}): Promise<implicitReturnType>;
|
|
@@ -95,6 +101,7 @@ interface Exchange {
|
|
|
95
101
|
accountV1PrivatePostInnerTransferAuthorizeSubAccount(params?: {}): Promise<implicitReturnType>;
|
|
96
102
|
userAuthPrivatePostUserDataStream(params?: {}): Promise<implicitReturnType>;
|
|
97
103
|
userAuthPrivatePutUserDataStream(params?: {}): Promise<implicitReturnType>;
|
|
104
|
+
userAuthPrivateDeleteUserDataStream(params?: {}): Promise<implicitReturnType>;
|
|
98
105
|
copyTradingV1PrivateGetSwapTraceCurrentTrack(params?: {}): Promise<implicitReturnType>;
|
|
99
106
|
copyTradingV1PrivatePostSwapTraceCloseTrackOrder(params?: {}): Promise<implicitReturnType>;
|
|
100
107
|
copyTradingV1PrivatePostSwapTraceSetTPSL(params?: {}): Promise<implicitReturnType>;
|
|
@@ -497,6 +497,7 @@ interface Exchange {
|
|
|
497
497
|
privateEarnGetV2EarnLoanBorrowHistory(params?: {}): Promise<implicitReturnType>;
|
|
498
498
|
privateEarnGetV2EarnLoanDebts(params?: {}): Promise<implicitReturnType>;
|
|
499
499
|
privateEarnGetV2EarnLoanReduces(params?: {}): Promise<implicitReturnType>;
|
|
500
|
+
privateEarnGetV2EarnAccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
500
501
|
privateEarnPostV2EarnSavingsSubscribe(params?: {}): Promise<implicitReturnType>;
|
|
501
502
|
privateEarnPostV2EarnSavingsRedeem(params?: {}): Promise<implicitReturnType>;
|
|
502
503
|
privateEarnPostV2EarnSharkfinSubscribe(params?: {}): Promise<implicitReturnType>;
|
|
@@ -79,6 +79,8 @@ interface Exchange {
|
|
|
79
79
|
privatePostSpotV4QueryHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
80
80
|
privatePostSpotV4QueryTrades(params?: {}): Promise<implicitReturnType>;
|
|
81
81
|
privatePostSpotV4QueryOrderTrades(params?: {}): Promise<implicitReturnType>;
|
|
82
|
+
privatePostSpotV4CancelOrders(params?: {}): Promise<implicitReturnType>;
|
|
83
|
+
privatePostSpotV4BatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
82
84
|
privatePostSpotV3CancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
83
85
|
privatePostSpotV2BatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
84
86
|
privatePostSpotV2SubmitOrder(params?: {}): Promise<implicitReturnType>;
|
package/js/src/ascendex.js
CHANGED
|
@@ -1406,7 +1406,7 @@ export default class ascendex extends Exchange {
|
|
|
1406
1406
|
'currency': feeCurrencyCode,
|
|
1407
1407
|
};
|
|
1408
1408
|
}
|
|
1409
|
-
const stopPrice = this.
|
|
1409
|
+
const stopPrice = this.omitZero(this.safeString(order, 'stopPrice'));
|
|
1410
1410
|
let reduceOnly = undefined;
|
|
1411
1411
|
const execInst = this.safeString(order, 'execInst');
|
|
1412
1412
|
if (execInst === 'reduceOnly') {
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -2493,6 +2493,7 @@ export default class Exchange {
|
|
|
2493
2493
|
const shouldParseFees = parseFee || parseFees;
|
|
2494
2494
|
const fees = this.safeList(order, 'fees', []);
|
|
2495
2495
|
let trades = [];
|
|
2496
|
+
const isTriggerOrSLTpOrder = ((this.safeString(order, 'triggerPrice') !== undefined || (this.safeString(order, 'stopLossPrice') !== undefined)) || (this.safeString(order, 'takeProfitPrice') !== undefined));
|
|
2496
2497
|
if (parseFilled || parseCost || shouldParseFees) {
|
|
2497
2498
|
const rawTrades = this.safeValue(order, 'trades', trades);
|
|
2498
2499
|
const oldNumber = this.number;
|
|
@@ -2695,7 +2696,7 @@ export default class Exchange {
|
|
|
2695
2696
|
let postOnly = this.safeValue(order, 'postOnly');
|
|
2696
2697
|
// timeInForceHandling
|
|
2697
2698
|
if (timeInForce === undefined) {
|
|
2698
|
-
if (this.safeString(order, 'type') === 'market') {
|
|
2699
|
+
if (!isTriggerOrSLTpOrder && (this.safeString(order, 'type') === 'market')) {
|
|
2699
2700
|
timeInForce = 'IOC';
|
|
2700
2701
|
}
|
|
2701
2702
|
// allow postOnly override
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
interface IOrderBookSide<T> extends Array<T> {
|
|
2
2
|
store(price: any, size: any): any;
|
|
3
|
-
store(price: any, size: any, index: any): any;
|
|
4
3
|
storeArray(array: any[]): any;
|
|
5
4
|
limit(): any;
|
|
6
5
|
}
|
|
7
|
-
declare class OrderBookSide extends Array implements IOrderBookSide {
|
|
6
|
+
declare class OrderBookSide extends Array implements IOrderBookSide<any> {
|
|
8
7
|
constructor(deltas?: any[], depth?: any);
|
|
9
8
|
storeArray(delta: any): void;
|
|
10
9
|
store(price: any, size: any): void;
|
|
11
10
|
limit(): void;
|
|
12
11
|
}
|
|
13
12
|
declare class CountedOrderBookSide extends OrderBookSide {
|
|
14
|
-
store(price: any, size: any
|
|
13
|
+
store(price: any, size: any): void;
|
|
15
14
|
storeArray(delta: any): void;
|
|
16
15
|
}
|
|
17
|
-
declare class IndexedOrderBookSide extends Array implements IOrderBookSide {
|
|
16
|
+
declare class IndexedOrderBookSide extends Array implements IOrderBookSide<any> {
|
|
18
17
|
constructor(deltas?: any[], depth?: number);
|
|
19
|
-
store(price: any, size: any
|
|
18
|
+
store(price: any, size: any): void;
|
|
20
19
|
storeArray(delta: any): void;
|
|
21
20
|
limit(): void;
|
|
22
21
|
}
|
|
@@ -101,8 +101,8 @@ class OrderBookSide extends Array {
|
|
|
101
101
|
// or deletes price levels based on order counts (3rd value in a bidask delta)
|
|
102
102
|
// this class stores vector arrays of values indexed by price
|
|
103
103
|
class CountedOrderBookSide extends OrderBookSide {
|
|
104
|
-
store(price, size
|
|
105
|
-
|
|
104
|
+
store(price, size) {
|
|
105
|
+
throw new Error('CountedOrderBookSide.store() is not supported, use storeArray([price, size, count]) instead');
|
|
106
106
|
}
|
|
107
107
|
storeArray(delta) {
|
|
108
108
|
const price = delta[0];
|
|
@@ -166,8 +166,8 @@ class IndexedOrderBookSide extends Array {
|
|
|
166
166
|
this.storeArray(deltas[i].slice()); // slice is muy importante
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
store(price, size
|
|
170
|
-
|
|
169
|
+
store(price, size) {
|
|
170
|
+
throw new Error('IndexedOrderBook.store() is not supported, use storeArray([price, size, id]) instead');
|
|
171
171
|
}
|
|
172
172
|
storeArray(delta) {
|
|
173
173
|
const price = delta[0];
|