ccxt 4.4.2 → 4.4.3
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 +10 -10
- package/dist/cjs/src/bitmart.js +3 -1
- package/dist/cjs/src/bitstamp.js +24 -36
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/cryptocom.js +2 -1
- package/dist/cjs/src/mexc.js +19 -0
- package/dist/cjs/src/pro/cryptocom.js +191 -21
- package/dist/cjs/src/pro/mexc.js +82 -3
- package/dist/cjs/src/pro/okx.js +6 -3
- package/dist/cjs/src/pro/oxfun.js +75 -0
- package/dist/cjs/src/pro/phemex.js +45 -1
- package/dist/cjs/src/pro/woofipro.js +67 -0
- package/dist/cjs/src/xt.js +6 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/binance.js +10 -10
- package/js/src/bitmart.js +3 -1
- package/js/src/bitstamp.js +24 -36
- package/js/src/bybit.js +2 -1
- package/js/src/cryptocom.js +2 -1
- package/js/src/mexc.js +19 -0
- package/js/src/pro/cryptocom.d.ts +7 -1
- package/js/src/pro/cryptocom.js +191 -21
- package/js/src/pro/mexc.d.ts +3 -1
- package/js/src/pro/mexc.js +82 -3
- package/js/src/pro/okx.js +6 -3
- package/js/src/pro/oxfun.d.ts +3 -0
- package/js/src/pro/oxfun.js +75 -0
- package/js/src/pro/phemex.d.ts +2 -1
- package/js/src/pro/phemex.js +45 -1
- package/js/src/pro/woofipro.d.ts +3 -0
- package/js/src/pro/woofipro.js +67 -0
- package/js/src/xt.js +6 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ class oxfun extends oxfun$1 {
|
|
|
22
22
|
'watchMyTrades': false,
|
|
23
23
|
'watchTicker': true,
|
|
24
24
|
'watchTickers': true,
|
|
25
|
+
'watchBidsAsks': true,
|
|
25
26
|
'watchBalance': true,
|
|
26
27
|
'createOrderWs': true,
|
|
27
28
|
'editOrderWs': true,
|
|
@@ -496,6 +497,77 @@ class oxfun extends oxfun$1 {
|
|
|
496
497
|
client.resolve(ticker, messageHash);
|
|
497
498
|
}
|
|
498
499
|
}
|
|
500
|
+
async watchBidsAsks(symbols = undefined, params = {}) {
|
|
501
|
+
/**
|
|
502
|
+
* @method
|
|
503
|
+
* @name oxfun#watchBidsAsks
|
|
504
|
+
* @see https://docs.ox.fun/?json#best-bid-ask
|
|
505
|
+
* @description watches best bid & ask for symbols
|
|
506
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
507
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
508
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
509
|
+
*/
|
|
510
|
+
await this.loadMarkets();
|
|
511
|
+
symbols = this.marketSymbols(symbols, undefined, false);
|
|
512
|
+
const messageHashes = [];
|
|
513
|
+
const args = [];
|
|
514
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
515
|
+
const market = this.market(symbols[i]);
|
|
516
|
+
args.push('bestBidAsk:' + market['id']);
|
|
517
|
+
messageHashes.push('bidask:' + market['symbol']);
|
|
518
|
+
}
|
|
519
|
+
const newTickers = await this.subscribeMultiple(messageHashes, args, params);
|
|
520
|
+
if (this.newUpdates) {
|
|
521
|
+
const tickers = {};
|
|
522
|
+
tickers[newTickers['symbol']] = newTickers;
|
|
523
|
+
return tickers;
|
|
524
|
+
}
|
|
525
|
+
return this.filterByArray(this.bidsasks, 'symbol', symbols);
|
|
526
|
+
}
|
|
527
|
+
handleBidAsk(client, message) {
|
|
528
|
+
//
|
|
529
|
+
// {
|
|
530
|
+
// "table": "bestBidAsk",
|
|
531
|
+
// "data": {
|
|
532
|
+
// "ask": [
|
|
533
|
+
// 19045.0,
|
|
534
|
+
// 1.0
|
|
535
|
+
// ],
|
|
536
|
+
// "checksum": 3790706311,
|
|
537
|
+
// "marketCode": "BTC-USD-SWAP-LIN",
|
|
538
|
+
// "bid": [
|
|
539
|
+
// 19015.0,
|
|
540
|
+
// 1.0
|
|
541
|
+
// ],
|
|
542
|
+
// "timestamp": "1665456882928"
|
|
543
|
+
// }
|
|
544
|
+
// }
|
|
545
|
+
//
|
|
546
|
+
const data = this.safeDict(message, 'data', {});
|
|
547
|
+
const parsedTicker = this.parseWsBidAsk(data);
|
|
548
|
+
const symbol = parsedTicker['symbol'];
|
|
549
|
+
this.bidsasks[symbol] = parsedTicker;
|
|
550
|
+
const messageHash = 'bidask:' + symbol;
|
|
551
|
+
client.resolve(parsedTicker, messageHash);
|
|
552
|
+
}
|
|
553
|
+
parseWsBidAsk(ticker, market = undefined) {
|
|
554
|
+
const marketId = this.safeString(ticker, 'marketCode');
|
|
555
|
+
market = this.safeMarket(marketId, market);
|
|
556
|
+
const symbol = this.safeString(market, 'symbol');
|
|
557
|
+
const timestamp = this.safeInteger(ticker, 'timestamp');
|
|
558
|
+
const ask = this.safeList(ticker, 'ask', []);
|
|
559
|
+
const bid = this.safeList(ticker, 'bid', []);
|
|
560
|
+
return this.safeTicker({
|
|
561
|
+
'symbol': symbol,
|
|
562
|
+
'timestamp': timestamp,
|
|
563
|
+
'datetime': this.iso8601(timestamp),
|
|
564
|
+
'ask': this.safeNumber(ask, 0),
|
|
565
|
+
'askVolume': this.safeNumber(ask, 1),
|
|
566
|
+
'bid': this.safeNumber(bid, 0),
|
|
567
|
+
'bidVolume': this.safeNumber(bid, 1),
|
|
568
|
+
'info': ticker,
|
|
569
|
+
}, market);
|
|
570
|
+
}
|
|
499
571
|
async watchBalance(params = {}) {
|
|
500
572
|
/**
|
|
501
573
|
* @method
|
|
@@ -1019,6 +1091,9 @@ class oxfun extends oxfun$1 {
|
|
|
1019
1091
|
if (table.indexOf('order') > -1) {
|
|
1020
1092
|
this.handleOrders(client, message);
|
|
1021
1093
|
}
|
|
1094
|
+
if (table === 'bestBidAsk') {
|
|
1095
|
+
this.handleBidAsk(client, message);
|
|
1096
|
+
}
|
|
1022
1097
|
}
|
|
1023
1098
|
else {
|
|
1024
1099
|
if (event === 'login') {
|
|
@@ -14,7 +14,7 @@ class phemex extends phemex$1 {
|
|
|
14
14
|
'has': {
|
|
15
15
|
'ws': true,
|
|
16
16
|
'watchTicker': true,
|
|
17
|
-
'watchTickers':
|
|
17
|
+
'watchTickers': true,
|
|
18
18
|
'watchTrades': true,
|
|
19
19
|
'watchMyTrades': true,
|
|
20
20
|
'watchOrders': true,
|
|
@@ -523,6 +523,50 @@ class phemex extends phemex$1 {
|
|
|
523
523
|
const request = this.deepExtend(subscribe, params);
|
|
524
524
|
return await this.watch(url, messageHash, request, subscriptionHash);
|
|
525
525
|
}
|
|
526
|
+
async watchTickers(symbols = undefined, params = {}) {
|
|
527
|
+
/**
|
|
528
|
+
* @method
|
|
529
|
+
* @name phemex#watchTickers
|
|
530
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#subscribe-24-hours-ticker
|
|
531
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#subscribe-24-hours-ticker
|
|
532
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#subscribe-24-hours-ticker
|
|
533
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
534
|
+
* @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
|
|
535
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
536
|
+
* @param {string} [params.channel] the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
|
|
537
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
538
|
+
*/
|
|
539
|
+
await this.loadMarkets();
|
|
540
|
+
symbols = this.marketSymbols(symbols, undefined, false);
|
|
541
|
+
const first = symbols[0];
|
|
542
|
+
const market = this.market(first);
|
|
543
|
+
const isSwap = market['swap'];
|
|
544
|
+
const settleIsUSDT = market['settle'] === 'USDT';
|
|
545
|
+
let name = 'spot_market24h';
|
|
546
|
+
if (isSwap) {
|
|
547
|
+
name = settleIsUSDT ? 'perp_market24h_pack_p' : 'market24h';
|
|
548
|
+
}
|
|
549
|
+
const url = this.urls['api']['ws'];
|
|
550
|
+
const requestId = this.requestId();
|
|
551
|
+
const subscriptionHash = name + '.subscribe';
|
|
552
|
+
const messageHashes = [];
|
|
553
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
554
|
+
messageHashes.push('ticker:' + symbols[i]);
|
|
555
|
+
}
|
|
556
|
+
const subscribe = {
|
|
557
|
+
'method': subscriptionHash,
|
|
558
|
+
'id': requestId,
|
|
559
|
+
'params': [],
|
|
560
|
+
};
|
|
561
|
+
const request = this.deepExtend(subscribe, params);
|
|
562
|
+
const ticker = await this.watchMultiple(url, messageHashes, request, messageHashes);
|
|
563
|
+
if (this.newUpdates) {
|
|
564
|
+
const result = {};
|
|
565
|
+
result[ticker['symbol']] = ticker;
|
|
566
|
+
return result;
|
|
567
|
+
}
|
|
568
|
+
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
569
|
+
}
|
|
526
570
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
527
571
|
/**
|
|
528
572
|
* @method
|
|
@@ -21,6 +21,7 @@ class woofipro extends woofipro$1 {
|
|
|
21
21
|
'watchOrders': true,
|
|
22
22
|
'watchTicker': true,
|
|
23
23
|
'watchTickers': true,
|
|
24
|
+
'watchBidsAsks': true,
|
|
24
25
|
'watchTrades': true,
|
|
25
26
|
'watchTradesForSymbols': false,
|
|
26
27
|
'watchPositions': true,
|
|
@@ -288,6 +289,71 @@ class woofipro extends woofipro$1 {
|
|
|
288
289
|
}
|
|
289
290
|
client.resolve(result, topic);
|
|
290
291
|
}
|
|
292
|
+
async watchBidsAsks(symbols = undefined, params = {}) {
|
|
293
|
+
/**
|
|
294
|
+
* @method
|
|
295
|
+
* @name woofipro#watchBidsAsks
|
|
296
|
+
* @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/public/bbos
|
|
297
|
+
* @description watches best bid & ask for symbols
|
|
298
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
299
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
300
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
301
|
+
*/
|
|
302
|
+
await this.loadMarkets();
|
|
303
|
+
symbols = this.marketSymbols(symbols);
|
|
304
|
+
const name = 'bbos';
|
|
305
|
+
const topic = name;
|
|
306
|
+
const request = {
|
|
307
|
+
'event': 'subscribe',
|
|
308
|
+
'topic': topic,
|
|
309
|
+
};
|
|
310
|
+
const message = this.extend(request, params);
|
|
311
|
+
const tickers = await this.watchPublic(topic, message);
|
|
312
|
+
return this.filterByArray(tickers, 'symbol', symbols);
|
|
313
|
+
}
|
|
314
|
+
handleBidAsk(client, message) {
|
|
315
|
+
//
|
|
316
|
+
// {
|
|
317
|
+
// "topic": "bbos",
|
|
318
|
+
// "ts": 1726212495000,
|
|
319
|
+
// "data": [
|
|
320
|
+
// {
|
|
321
|
+
// "symbol": "PERP_WOO_USDC",
|
|
322
|
+
// "ask": 0.16570,
|
|
323
|
+
// "askSize": 4224,
|
|
324
|
+
// "bid": 0.16553,
|
|
325
|
+
// "bidSize": 6645
|
|
326
|
+
// }
|
|
327
|
+
// ]
|
|
328
|
+
// }
|
|
329
|
+
//
|
|
330
|
+
const topic = this.safeString(message, 'topic');
|
|
331
|
+
const data = this.safeList(message, 'data', []);
|
|
332
|
+
const timestamp = this.safeInteger(message, 'ts');
|
|
333
|
+
const result = [];
|
|
334
|
+
for (let i = 0; i < data.length; i++) {
|
|
335
|
+
const ticker = this.parseWsBidAsk(this.extend(data[i], { 'ts': timestamp }));
|
|
336
|
+
this.tickers[ticker['symbol']] = ticker;
|
|
337
|
+
result.push(ticker);
|
|
338
|
+
}
|
|
339
|
+
client.resolve(result, topic);
|
|
340
|
+
}
|
|
341
|
+
parseWsBidAsk(ticker, market = undefined) {
|
|
342
|
+
const marketId = this.safeString(ticker, 'symbol');
|
|
343
|
+
market = this.safeMarket(marketId, market);
|
|
344
|
+
const symbol = this.safeString(market, 'symbol');
|
|
345
|
+
const timestamp = this.safeInteger(ticker, 'ts');
|
|
346
|
+
return this.safeTicker({
|
|
347
|
+
'symbol': symbol,
|
|
348
|
+
'timestamp': timestamp,
|
|
349
|
+
'datetime': this.iso8601(timestamp),
|
|
350
|
+
'ask': this.safeString(ticker, 'ask'),
|
|
351
|
+
'askVolume': this.safeString(ticker, 'askSize'),
|
|
352
|
+
'bid': this.safeString(ticker, 'bid'),
|
|
353
|
+
'bidVolume': this.safeString(ticker, 'bidSize'),
|
|
354
|
+
'info': ticker,
|
|
355
|
+
}, market);
|
|
356
|
+
}
|
|
291
357
|
async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
292
358
|
/**
|
|
293
359
|
* @method
|
|
@@ -1202,6 +1268,7 @@ class woofipro extends woofipro$1 {
|
|
|
1202
1268
|
'algoexecutionreport': this.handleOrderUpdate,
|
|
1203
1269
|
'position': this.handlePositions,
|
|
1204
1270
|
'balance': this.handleBalance,
|
|
1271
|
+
'bbos': this.handleBidAsk,
|
|
1205
1272
|
};
|
|
1206
1273
|
const event = this.safeString(message, 'event');
|
|
1207
1274
|
let method = this.safeValue(methods, event);
|
package/dist/cjs/src/xt.js
CHANGED
|
@@ -1135,12 +1135,14 @@ class xt extends xt$1 {
|
|
|
1135
1135
|
let maxCost = undefined;
|
|
1136
1136
|
let minPrice = undefined;
|
|
1137
1137
|
let maxPrice = undefined;
|
|
1138
|
+
let amountPrecision = undefined;
|
|
1138
1139
|
for (let i = 0; i < filters.length; i++) {
|
|
1139
1140
|
const entry = filters[i];
|
|
1140
1141
|
const filter = this.safeString(entry, 'filter');
|
|
1141
1142
|
if (filter === 'QUANTITY') {
|
|
1142
1143
|
minAmount = this.safeNumber(entry, 'min');
|
|
1143
1144
|
maxAmount = this.safeNumber(entry, 'max');
|
|
1145
|
+
amountPrecision = this.safeNumber(entry, 'tickSize');
|
|
1144
1146
|
}
|
|
1145
1147
|
if (filter === 'QUOTE_QTY') {
|
|
1146
1148
|
minCost = this.safeNumber(entry, 'min');
|
|
@@ -1150,6 +1152,9 @@ class xt extends xt$1 {
|
|
|
1150
1152
|
maxPrice = this.safeNumber(entry, 'max');
|
|
1151
1153
|
}
|
|
1152
1154
|
}
|
|
1155
|
+
if (amountPrecision === undefined) {
|
|
1156
|
+
amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
|
|
1157
|
+
}
|
|
1153
1158
|
const underlyingType = this.safeString(market, 'underlyingType');
|
|
1154
1159
|
let linear = undefined;
|
|
1155
1160
|
let inverse = undefined;
|
|
@@ -1232,7 +1237,7 @@ class xt extends xt$1 {
|
|
|
1232
1237
|
'optionType': undefined,
|
|
1233
1238
|
'precision': {
|
|
1234
1239
|
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision'))),
|
|
1235
|
-
'amount':
|
|
1240
|
+
'amount': amountPrecision,
|
|
1236
1241
|
'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseCoinPrecision'))),
|
|
1237
1242
|
'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteCoinPrecision'))),
|
|
1238
1243
|
},
|
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 { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.2";
|
|
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, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.3';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -83,6 +83,7 @@ interface Exchange {
|
|
|
83
83
|
privatePostSpotV4QueryTrades(params?: {}): Promise<implicitReturnType>;
|
|
84
84
|
privatePostSpotV4QueryOrderTrades(params?: {}): Promise<implicitReturnType>;
|
|
85
85
|
privatePostSpotV4CancelOrders(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
privatePostSpotV4CancelAll(params?: {}): Promise<implicitReturnType>;
|
|
86
87
|
privatePostSpotV4BatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
87
88
|
privatePostSpotV3CancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
88
89
|
privatePostSpotV2BatchOrders(params?: {}): Promise<implicitReturnType>;
|
package/js/src/binance.js
CHANGED
|
@@ -6403,8 +6403,8 @@ export default class binance extends Exchange {
|
|
|
6403
6403
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOrders', params);
|
|
6404
6404
|
let isPortfolioMargin = undefined;
|
|
6405
6405
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOrders', 'papi', 'portfolioMargin', false);
|
|
6406
|
-
const isConditional = this.
|
|
6407
|
-
params = this.omit(params, ['stop', 'conditional', 'type']);
|
|
6406
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6407
|
+
params = this.omit(params, ['stop', 'trigger', 'conditional', 'type']);
|
|
6408
6408
|
let request = {
|
|
6409
6409
|
'symbol': market['id'],
|
|
6410
6410
|
};
|
|
@@ -6673,7 +6673,7 @@ export default class binance extends Exchange {
|
|
|
6673
6673
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
6674
6674
|
let isPortfolioMargin = undefined;
|
|
6675
6675
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrders', 'papi', 'portfolioMargin', false);
|
|
6676
|
-
const isConditional = this.safeBoolN(params, ['stop', '
|
|
6676
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6677
6677
|
if (symbol !== undefined) {
|
|
6678
6678
|
market = this.market(symbol);
|
|
6679
6679
|
request['symbol'] = market['id'];
|
|
@@ -6690,7 +6690,7 @@ export default class binance extends Exchange {
|
|
|
6690
6690
|
}
|
|
6691
6691
|
let subType = undefined;
|
|
6692
6692
|
[subType, params] = this.handleSubTypeAndParams('fetchOpenOrders', market, params);
|
|
6693
|
-
params = this.omit(params, ['type', 'stop', '
|
|
6693
|
+
params = this.omit(params, ['type', 'stop', 'trigger', 'conditional']);
|
|
6694
6694
|
let response = undefined;
|
|
6695
6695
|
if (type === 'option') {
|
|
6696
6696
|
if (since !== undefined) {
|
|
@@ -6773,8 +6773,8 @@ export default class binance extends Exchange {
|
|
|
6773
6773
|
};
|
|
6774
6774
|
let isPortfolioMargin = undefined;
|
|
6775
6775
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOpenOrder', 'papi', 'portfolioMargin', false);
|
|
6776
|
-
const isConditional = this.safeBoolN(params, ['stop', '
|
|
6777
|
-
params = this.omit(params, ['stop', '
|
|
6776
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
6777
|
+
params = this.omit(params, ['stop', 'trigger', 'conditional']);
|
|
6778
6778
|
const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
|
|
6779
6779
|
const orderIdRequest = isPortfolioMarginConditional ? 'strategyId' : 'orderId';
|
|
6780
6780
|
request[orderIdRequest] = id;
|
|
@@ -7089,7 +7089,7 @@ export default class binance extends Exchange {
|
|
|
7089
7089
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
7090
7090
|
let isPortfolioMargin = undefined;
|
|
7091
7091
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'cancelOrder', 'papi', 'portfolioMargin', false);
|
|
7092
|
-
const isConditional = this.
|
|
7092
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
7093
7093
|
const request = {
|
|
7094
7094
|
'symbol': market['id'],
|
|
7095
7095
|
};
|
|
@@ -7115,7 +7115,7 @@ export default class binance extends Exchange {
|
|
|
7115
7115
|
request['orderId'] = id;
|
|
7116
7116
|
}
|
|
7117
7117
|
}
|
|
7118
|
-
params = this.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'conditional']);
|
|
7118
|
+
params = this.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'trigger', 'conditional']);
|
|
7119
7119
|
let response = undefined;
|
|
7120
7120
|
if (market['option']) {
|
|
7121
7121
|
response = await this.eapiPrivateDeleteOrder(this.extend(request, params));
|
|
@@ -7193,9 +7193,9 @@ export default class binance extends Exchange {
|
|
|
7193
7193
|
};
|
|
7194
7194
|
let isPortfolioMargin = undefined;
|
|
7195
7195
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'cancelAllOrders', 'papi', 'portfolioMargin', false);
|
|
7196
|
-
const isConditional = this.
|
|
7196
|
+
const isConditional = this.safeBoolN(params, ['stop', 'trigger', 'conditional']);
|
|
7197
7197
|
const type = this.safeString(params, 'type', market['type']);
|
|
7198
|
-
params = this.omit(params, ['type', 'stop', 'conditional']);
|
|
7198
|
+
params = this.omit(params, ['type', 'stop', 'trigger', 'conditional']);
|
|
7199
7199
|
let marginMode = undefined;
|
|
7200
7200
|
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
7201
7201
|
let response = undefined;
|
package/js/src/bitmart.js
CHANGED
|
@@ -232,6 +232,7 @@ export default class bitmart extends Exchange {
|
|
|
232
232
|
'spot/v4/query/trades': 5,
|
|
233
233
|
'spot/v4/query/order-trades': 5,
|
|
234
234
|
'spot/v4/cancel_orders': 3,
|
|
235
|
+
'spot/v4/cancel_all': 90,
|
|
235
236
|
'spot/v4/batch_orders': 3,
|
|
236
237
|
// newer endpoint
|
|
237
238
|
'spot/v3/cancel_order': 1,
|
|
@@ -2967,6 +2968,7 @@ export default class bitmart extends Exchange {
|
|
|
2967
2968
|
* @name bitmart#cancelAllOrders
|
|
2968
2969
|
* @description cancel all open orders in a market
|
|
2969
2970
|
* @see https://developer-pro.bitmart.com/en/spot/#cancel-all-orders
|
|
2971
|
+
* @see https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
|
|
2970
2972
|
* @see https://developer-pro.bitmart.com/en/futures/#cancel-all-orders-signed
|
|
2971
2973
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-all-orders-signed
|
|
2972
2974
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
@@ -2985,7 +2987,7 @@ export default class bitmart extends Exchange {
|
|
|
2985
2987
|
let type = undefined;
|
|
2986
2988
|
[type, params] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
|
|
2987
2989
|
if (type === 'spot') {
|
|
2988
|
-
response = await this.
|
|
2990
|
+
response = await this.privatePostSpotV4CancelAll(this.extend(request, params));
|
|
2989
2991
|
}
|
|
2990
2992
|
else if (type === 'swap') {
|
|
2991
2993
|
if (symbol === undefined) {
|
package/js/src/bitstamp.js
CHANGED
|
@@ -392,46 +392,34 @@ export default class bitstamp extends Exchange {
|
|
|
392
392
|
'trading': {
|
|
393
393
|
'tierBased': true,
|
|
394
394
|
'percentage': true,
|
|
395
|
-
'taker': this.parseNumber('0.
|
|
396
|
-
'maker': this.parseNumber('0.
|
|
395
|
+
'taker': this.parseNumber('0.004'),
|
|
396
|
+
'maker': this.parseNumber('0.004'),
|
|
397
397
|
'tiers': {
|
|
398
398
|
'taker': [
|
|
399
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
400
|
-
[this.parseNumber('
|
|
401
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
402
|
-
[this.parseNumber('
|
|
403
|
-
[this.parseNumber('
|
|
404
|
-
[this.parseNumber('
|
|
405
|
-
[this.parseNumber('
|
|
406
|
-
[this.parseNumber('
|
|
407
|
-
[this.parseNumber('
|
|
408
|
-
[this.parseNumber('
|
|
409
|
-
[this.parseNumber('
|
|
410
|
-
[this.parseNumber('100000000'), this.parseNumber('0.0007')],
|
|
411
|
-
[this.parseNumber('500000000'), this.parseNumber('0.0005')],
|
|
412
|
-
[this.parseNumber('2000000000'), this.parseNumber('0.0003')],
|
|
413
|
-
[this.parseNumber('6000000000'), this.parseNumber('0.0001')],
|
|
414
|
-
[this.parseNumber('20000000000'), this.parseNumber('0.00005')],
|
|
415
|
-
[this.parseNumber('20000000001'), this.parseNumber('0')],
|
|
399
|
+
[this.parseNumber('0'), this.parseNumber('0.004')],
|
|
400
|
+
[this.parseNumber('10000'), this.parseNumber('0.003')],
|
|
401
|
+
[this.parseNumber('100000'), this.parseNumber('0.002')],
|
|
402
|
+
[this.parseNumber('500000'), this.parseNumber('0.0018')],
|
|
403
|
+
[this.parseNumber('1500000'), this.parseNumber('0.0016')],
|
|
404
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0012')],
|
|
405
|
+
[this.parseNumber('20000000'), this.parseNumber('0.001')],
|
|
406
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0008')],
|
|
407
|
+
[this.parseNumber('100000000'), this.parseNumber('0.0006')],
|
|
408
|
+
[this.parseNumber('250000000'), this.parseNumber('0.0005')],
|
|
409
|
+
[this.parseNumber('1000000000'), this.parseNumber('0.0003')],
|
|
416
410
|
],
|
|
417
411
|
'maker': [
|
|
418
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
419
|
-
[this.parseNumber('
|
|
420
|
-
[this.parseNumber('100000'), this.parseNumber('0.
|
|
421
|
-
[this.parseNumber('
|
|
422
|
-
[this.parseNumber('
|
|
423
|
-
[this.parseNumber('
|
|
424
|
-
[this.parseNumber('
|
|
425
|
-
[this.parseNumber('
|
|
426
|
-
[this.parseNumber('
|
|
427
|
-
[this.parseNumber('
|
|
428
|
-
[this.parseNumber('
|
|
429
|
-
[this.parseNumber('100000000'), this.parseNumber('0.0007')],
|
|
430
|
-
[this.parseNumber('500000000'), this.parseNumber('0.0005')],
|
|
431
|
-
[this.parseNumber('2000000000'), this.parseNumber('0.0003')],
|
|
432
|
-
[this.parseNumber('6000000000'), this.parseNumber('0.0001')],
|
|
433
|
-
[this.parseNumber('20000000000'), this.parseNumber('0.00005')],
|
|
434
|
-
[this.parseNumber('20000000001'), this.parseNumber('0')],
|
|
412
|
+
[this.parseNumber('0'), this.parseNumber('0.003')],
|
|
413
|
+
[this.parseNumber('10000'), this.parseNumber('0.002')],
|
|
414
|
+
[this.parseNumber('100000'), this.parseNumber('0.001')],
|
|
415
|
+
[this.parseNumber('500000'), this.parseNumber('0.0008')],
|
|
416
|
+
[this.parseNumber('1500000'), this.parseNumber('0.0006')],
|
|
417
|
+
[this.parseNumber('5000000'), this.parseNumber('0.0003')],
|
|
418
|
+
[this.parseNumber('20000000'), this.parseNumber('0.002')],
|
|
419
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0001')],
|
|
420
|
+
[this.parseNumber('100000000'), this.parseNumber('0')],
|
|
421
|
+
[this.parseNumber('250000000'), this.parseNumber('0')],
|
|
422
|
+
[this.parseNumber('1000000000'), this.parseNumber('0')],
|
|
435
423
|
],
|
|
436
424
|
},
|
|
437
425
|
},
|
package/js/src/bybit.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/bybit.js';
|
|
9
9
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
10
|
-
import { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout, MarginModeAlreadySet, NoChange, ManualInteractionNeeded } from './base/errors.js';
|
|
10
|
+
import { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout, MarginModeAlreadySet, NoChange, ManualInteractionNeeded, BadSymbol } from './base/errors.js';
|
|
11
11
|
import { Precise } from './base/Precise.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
13
13
|
import { rsa } from './base/functions/rsa.js';
|
|
@@ -979,6 +979,7 @@ export default class bybit extends Exchange {
|
|
|
979
979
|
'3200300': InsufficientFunds, // {"retCode":3200300,"retMsg":"Insufficient margin balance.","result":null,"retExtMap":{}}
|
|
980
980
|
},
|
|
981
981
|
'broad': {
|
|
982
|
+
'Not supported symbols': BadSymbol,
|
|
982
983
|
'Request timeout': RequestTimeout,
|
|
983
984
|
'unknown orderInfo': OrderNotFound,
|
|
984
985
|
'invalid api_key': AuthenticationError,
|
package/js/src/cryptocom.js
CHANGED
|
@@ -605,7 +605,7 @@ export default class cryptocom extends Exchange {
|
|
|
605
605
|
* @method
|
|
606
606
|
* @name cryptocom#fetchTickers
|
|
607
607
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
608
|
-
* @see https://exchange-docs.crypto.com/
|
|
608
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-tickers
|
|
609
609
|
* @see https://exchange-docs.crypto.com/derivatives/index.html#public-get-tickers
|
|
610
610
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
611
611
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1799,6 +1799,7 @@ export default class cryptocom extends Exchange {
|
|
|
1799
1799
|
* @method
|
|
1800
1800
|
* @name cryptocom#fetchDepositAddress
|
|
1801
1801
|
* @description fetch the deposit address for a currency associated with this account
|
|
1802
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address
|
|
1802
1803
|
* @param {string} code unified currency code
|
|
1803
1804
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1804
1805
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
package/js/src/mexc.js
CHANGED
|
@@ -5196,6 +5196,16 @@ export default class mexc extends Exchange {
|
|
|
5196
5196
|
return this.parseTransaction(response, currency);
|
|
5197
5197
|
}
|
|
5198
5198
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
5199
|
+
/**
|
|
5200
|
+
* @method
|
|
5201
|
+
* @name mexc#setPositionMode
|
|
5202
|
+
* @description set hedged to true or false for a market
|
|
5203
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#change-position-mode
|
|
5204
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
5205
|
+
* @param {string} symbol not used by mexc setPositionMode ()
|
|
5206
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5207
|
+
* @returns {object} response from the exchange
|
|
5208
|
+
*/
|
|
5199
5209
|
const request = {
|
|
5200
5210
|
'positionMode': hedged ? 1 : 2, // 1 Hedge, 2 One-way, before changing position mode make sure that there are no active orders, planned orders, or open positions, the risk limit level will be reset to 1
|
|
5201
5211
|
};
|
|
@@ -5209,6 +5219,15 @@ export default class mexc extends Exchange {
|
|
|
5209
5219
|
return response;
|
|
5210
5220
|
}
|
|
5211
5221
|
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
5222
|
+
/**
|
|
5223
|
+
* @method
|
|
5224
|
+
* @name mexc#fetchPositionMode
|
|
5225
|
+
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5226
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode
|
|
5227
|
+
* @param {string} symbol not used by mexc fetchPositionMode
|
|
5228
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5229
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5230
|
+
*/
|
|
5212
5231
|
const response = await this.contractPrivateGetPositionPositionMode(params);
|
|
5213
5232
|
//
|
|
5214
5233
|
// {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import cryptocomRest from '../cryptocom.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Str, Strings, OrderBook, Order, Trade, Ticker, OHLCV, Position, Balances, Num } from '../base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Str, Strings, OrderBook, Order, Trade, Ticker, OHLCV, Position, Balances, Num, Dict, Tickers, Market } from '../base/types.js';
|
|
3
3
|
import Client from '../base/ws/Client.js';
|
|
4
4
|
export default class cryptocom extends cryptocomRest {
|
|
5
5
|
describe(): any;
|
|
@@ -19,7 +19,13 @@ export default class cryptocom extends cryptocomRest {
|
|
|
19
19
|
watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
20
20
|
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
21
21
|
unWatchTicker(symbol: string, params?: {}): Promise<any>;
|
|
22
|
+
watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
23
|
+
unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
|
|
22
24
|
handleTicker(client: Client, message: any): void;
|
|
25
|
+
parseWsTicker(ticker: Dict, market?: Market): Ticker;
|
|
26
|
+
watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
27
|
+
handleBidAsk(client: Client, message: any): void;
|
|
28
|
+
parseWsBidAsk(ticker: any, market?: any): Ticker;
|
|
23
29
|
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
24
30
|
unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
|
|
25
31
|
handleOHLCV(client: Client, message: any): void;
|