ccxt 4.4.32 → 4.4.33

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.
@@ -1173,6 +1173,97 @@ class okx extends okx$1 {
1173
1173
  },
1174
1174
  'brokerId': 'e847386590ce4dBC',
1175
1175
  },
1176
+ 'features': {
1177
+ // https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-order
1178
+ 'default': {
1179
+ 'sandbox': true,
1180
+ 'createOrder': {
1181
+ 'triggerPrice': true,
1182
+ 'triggerPriceType': {
1183
+ 'last': true,
1184
+ 'mark': true,
1185
+ 'index': true,
1186
+ },
1187
+ 'triggerDirection': false,
1188
+ 'stopLossPrice': true,
1189
+ 'takeProfitPrice': true,
1190
+ 'marginMode': true,
1191
+ 'attachedStopLossTakeProfit': {
1192
+ 'triggerPriceType': {
1193
+ 'last': true,
1194
+ 'mark': true,
1195
+ 'index': true,
1196
+ },
1197
+ 'limitPrice': true,
1198
+ },
1199
+ 'timeInForce': {
1200
+ 'GTC': true,
1201
+ 'IOC': true,
1202
+ 'FOK': true,
1203
+ 'PO': true,
1204
+ 'GTD': false,
1205
+ },
1206
+ 'hedged': true,
1207
+ // even though the below params not unified yet, it's useful metadata for users to know that exchange supports them
1208
+ 'selfTradePrevention': true,
1209
+ 'trailing': true,
1210
+ 'twap': true,
1211
+ 'iceberg': true,
1212
+ 'oco': true,
1213
+ },
1214
+ 'createOrders': {
1215
+ 'max': 20,
1216
+ },
1217
+ 'fetchMyTrades': {
1218
+ 'daysBack': 90,
1219
+ 'limit': 100,
1220
+ 'untilDays': 10000,
1221
+ },
1222
+ 'fetchOrder': {
1223
+ 'marginMode': false,
1224
+ 'trigger': true,
1225
+ 'trailing': true,
1226
+ },
1227
+ 'fetchOpenOrders': {
1228
+ 'limit': 100,
1229
+ 'marginMode': false,
1230
+ 'trigger': true,
1231
+ 'trailing': true,
1232
+ },
1233
+ 'fetchOrders': undefined,
1234
+ 'fetchClosedOrders': {
1235
+ 'limit': 100,
1236
+ 'daysBackClosed': 90,
1237
+ 'daysBackCanceled': 1 / 12,
1238
+ 'untilDays': undefined,
1239
+ 'marginMode': false,
1240
+ 'trigger': true,
1241
+ 'trailing': true,
1242
+ },
1243
+ 'fetchOHLCV': {
1244
+ 'limit': 300,
1245
+ },
1246
+ },
1247
+ 'spot': {
1248
+ 'extends': 'default',
1249
+ },
1250
+ 'swap': {
1251
+ 'linear': {
1252
+ 'extends': 'default',
1253
+ },
1254
+ 'inverse': {
1255
+ 'extends': 'default',
1256
+ },
1257
+ },
1258
+ 'future': {
1259
+ 'linear': {
1260
+ 'extends': 'default',
1261
+ },
1262
+ 'inverse': {
1263
+ 'extends': 'default',
1264
+ },
1265
+ },
1266
+ },
1176
1267
  'commonCurrencies': {
1177
1268
  // the exchange refers to ERC20 version of Aeternity (AEToken)
1178
1269
  'AE': 'AET',
@@ -3218,7 +3309,7 @@ class okx extends okx$1 {
3218
3309
  request['newPx'] = this.priceToPrecision(symbol, price);
3219
3310
  }
3220
3311
  }
3221
- params = this.omit(params, ['clOrdId', 'clientOrderId', 'takeProfitPrice', 'stopLossPrice', 'stopLoss', 'takeProfit']);
3312
+ params = this.omit(params, ['clOrdId', 'clientOrderId', 'takeProfitPrice', 'stopLossPrice', 'stopLoss', 'takeProfit', 'postOnly']);
3222
3313
  return this.extend(request, params);
3223
3314
  }
3224
3315
  /**
@@ -510,7 +510,7 @@ class phemex extends phemex$1 {
510
510
  parseSwapMarket(market) {
511
511
  //
512
512
  // {
513
- // "symbol":"BTCUSD",
513
+ // "symbol":"BTCUSD", //
514
514
  // "code":"1",
515
515
  // "type":"Perpetual",
516
516
  // "displaySymbol":"BTC / USD",
@@ -518,7 +518,7 @@ class phemex extends phemex$1 {
518
518
  // "markSymbol":".MBTC",
519
519
  // "fundingRateSymbol":".BTCFR",
520
520
  // "fundingRate8hSymbol":".BTCFR8H",
521
- // "contractUnderlyingAssets":"USD",
521
+ // "contractUnderlyingAssets":"USD", // or eg. `1000 SHIB`
522
522
  // "settleCurrency":"BTC",
523
523
  // "quoteCurrency":"USD",
524
524
  // "contractSize":"1 USD",
@@ -561,7 +561,8 @@ class phemex extends phemex$1 {
561
561
  const baseId = this.safeString2(market, 'baseCurrency', 'contractUnderlyingAssets');
562
562
  const quoteId = this.safeString(market, 'quoteCurrency');
563
563
  const settleId = this.safeString(market, 'settleCurrency');
564
- const base = this.safeCurrencyCode(baseId);
564
+ let base = this.safeCurrencyCode(baseId);
565
+ base = base.replace(' ', ''); // replace space for junction codes, eg. `1000 SHIB`
565
566
  const quote = this.safeCurrencyCode(quoteId);
566
567
  const settle = this.safeCurrencyCode(settleId);
567
568
  let inverse = false;
@@ -2641,7 +2642,7 @@ class phemex extends phemex$1 {
2641
2642
  if (stopLossDefined) {
2642
2643
  const stopLossTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice');
2643
2644
  if (stopLossTriggerPrice === undefined) {
2644
- throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["stopLoss"]["triggerPrice"], or params["stopLoss"]["stopPrice"] for a stop loss order');
2645
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["stopLoss"]["triggerPrice"] for a stop loss order');
2645
2646
  }
2646
2647
  if (market['settle'] === 'USDT') {
2647
2648
  request['stopLossRp'] = this.priceToPrecision(symbol, stopLossTriggerPrice);
@@ -2661,7 +2662,7 @@ class phemex extends phemex$1 {
2661
2662
  if (takeProfitDefined) {
2662
2663
  const takeProfitTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice');
2663
2664
  if (takeProfitTriggerPrice === undefined) {
2664
- throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["takeProfit"]["triggerPrice"], or params["takeProfit"]["stopPrice"] for a take profit order');
2665
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["takeProfit"]["triggerPrice"] for a take profit order');
2665
2666
  }
2666
2667
  if (market['settle'] === 'USDT') {
2667
2668
  request['takeProfitRp'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
@@ -2851,7 +2852,7 @@ class phemex extends phemex$1 {
2851
2852
  request['baseQtyEV'] = this.toEv(amount, market);
2852
2853
  }
2853
2854
  }
2854
- const stopPrice = this.safeString2(params, 'stopPx', 'stopPrice');
2855
+ const stopPrice = this.safeStringN(params, ['triggerPrice', 'stopPx', 'stopPrice']);
2855
2856
  if (stopPrice !== undefined) {
2856
2857
  if (isUSDTSettled) {
2857
2858
  request['stopPxRp'] = this.priceToPrecision(symbol, stopPrice);
@@ -2860,7 +2861,7 @@ class phemex extends phemex$1 {
2860
2861
  request['stopPxEp'] = this.toEp(stopPrice, market);
2861
2862
  }
2862
2863
  }
2863
- params = this.omit(params, ['stopPx', 'stopPrice']);
2864
+ params = this.omit(params, ['triggerPrice', 'stopPx', 'stopPrice']);
2864
2865
  let response = undefined;
2865
2866
  if (isUSDTSettled) {
2866
2867
  const posSide = this.safeString(params, 'posSide');
@@ -4204,6 +4205,7 @@ class phemex extends phemex$1 {
4204
4205
  * @method
4205
4206
  * @name phemex#setMarginMode
4206
4207
  * @description set margin mode to 'cross' or 'isolated'
4208
+ * @see https://phemex-docs.github.io/#set-leverage
4207
4209
  * @param {string} marginMode 'cross' or 'isolated'
4208
4210
  * @param {string} symbol unified market symbol
4209
4211
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4494,6 +4496,8 @@ class phemex extends phemex$1 {
4494
4496
  * @method
4495
4497
  * @name phemex#transfer
4496
4498
  * @description transfer currency internally between wallets on the same account
4499
+ * @see https://phemex-docs.github.io/#transfer-between-spot-and-futures
4500
+ * @see https://phemex-docs.github.io/#universal-transfer-main-account-only-transfer-between-sub-to-main-main-to-sub-or-sub-to-sub
4497
4501
  * @param {string} code unified currency code
4498
4502
  * @param {float} amount amount to transfer
4499
4503
  * @param {string} fromAccount account to transfer from
@@ -4581,6 +4585,7 @@ class phemex extends phemex$1 {
4581
4585
  * @method
4582
4586
  * @name phemex#fetchTransfers
4583
4587
  * @description fetch a history of internal transfers made on an account
4588
+ * @see https://phemex-docs.github.io/#query-transfer-history
4584
4589
  * @param {string} code unified currency code of the currency transferred
4585
4590
  * @param {int} [since] the earliest time in ms to fetch transfers for
4586
4591
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -2252,6 +2252,7 @@ class okx extends okx$1 {
2252
2252
  //
2253
2253
  // { event: 'error', msg: "Illegal request: {"op":"subscribe","args":["spot/ticker:BTC-USDT"]}", code: "60012" }
2254
2254
  // { event: 'error", msg: "channel:ticker,instId:BTC-USDT doesn"t exist", code: "60018" }
2255
+ // {"event":"error","msg":"Illegal request: {\\"id\\":\\"17321173472466905\\",\\"op\\":\\"amend-order\\",\\"args\\":[{\\"instId\\":\\"ETH-USDC\\",\\"ordId\\":\\"2000345622407479296\\",\\"newSz\\":\\"0.050857\\",\\"newPx\\":\\"2949.4\\",\\"postOnly\\":true}],\\"postOnly\\":true}","code":"60012","connId":"0808af6c"}
2255
2256
  //
2256
2257
  let errorCode = this.safeString(message, 'code');
2257
2258
  try {
@@ -2284,7 +2285,16 @@ class okx extends okx$1 {
2284
2285
  catch (e) {
2285
2286
  // if the message contains an id, it means it is a response to a request
2286
2287
  // so we only reject that promise, instead of deleting all futures, destroying the authentication future
2287
- const id = this.safeString(message, 'id');
2288
+ let id = this.safeString(message, 'id');
2289
+ if (id === undefined) {
2290
+ // try to parse it from the stringified json inside msg
2291
+ const msg = this.safeString(message, 'msg');
2292
+ if (msg !== undefined && msg.startsWith('Illegal request: {')) {
2293
+ const stringifiedJson = msg.replace('Illegal request: ', '');
2294
+ const parsedJson = this.parseJson(stringifiedJson);
2295
+ id = this.safeString(parsedJson, 'id');
2296
+ }
2297
+ }
2288
2298
  if (id !== undefined) {
2289
2299
  client.reject(e, id);
2290
2300
  return false;
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, LongShortRatio } 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.31";
7
+ declare const version = "4.4.32";
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.32';
41
+ const version = '4.4.33';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -11,6 +11,7 @@ interface Exchange {
11
11
  publicGetProductsIdTrades(params?: {}): Promise<implicitReturnType>;
12
12
  publicGetTime(params?: {}): Promise<implicitReturnType>;
13
13
  publicGetProductsSparkLines(params?: {}): Promise<implicitReturnType>;
14
+ publicGetProductsVolumeSummary(params?: {}): Promise<implicitReturnType>;
14
15
  privateGetAddressBook(params?: {}): Promise<implicitReturnType>;
15
16
  privateGetAccounts(params?: {}): Promise<implicitReturnType>;
16
17
  privateGetAccountsId(params?: {}): Promise<implicitReturnType>;
@@ -15,6 +15,7 @@ interface Exchange {
15
15
  privatePostAddOrder(params?: {}): Promise<implicitReturnType>;
16
16
  privatePostAddOrderBatch(params?: {}): Promise<implicitReturnType>;
17
17
  privatePostAddExport(params?: {}): Promise<implicitReturnType>;
18
+ privatePostAmendOrder(params?: {}): Promise<implicitReturnType>;
18
19
  privatePostBalance(params?: {}): Promise<implicitReturnType>;
19
20
  privatePostCancelAll(params?: {}): Promise<implicitReturnType>;
20
21
  privatePostCancelAllOrdersAfter(params?: {}): Promise<implicitReturnType>;
@@ -127,6 +127,7 @@ export default class Exchange {
127
127
  id: string;
128
128
  markets: Dictionary<any>;
129
129
  has: Dictionary<boolean | 'emulated'>;
130
+ features: Dictionary<Dictionary<any>>;
130
131
  status: {
131
132
  status: Str;
132
133
  updated: Num;
@@ -815,6 +816,8 @@ export default class Exchange {
815
816
  isRoundNumber(value: number): boolean;
816
817
  safeIntegerOmitZero(obj: object, key: IndexType, defaultValue?: Int): Int;
817
818
  afterConstruct(): void;
819
+ featuresGenerator(): void;
820
+ featuresMapper(initialFeatures: any, marketType: Str, subType?: Str): any;
818
821
  orderbookChecksumMessage(symbol: Str): string;
819
822
  createNetworksByIdObject(): void;
820
823
  getDefaultOptions(): {
@@ -91,6 +91,7 @@ export default class Exchange {
91
91
  this.last_request_path = undefined;
92
92
  this.id = 'Exchange';
93
93
  this.markets = undefined;
94
+ this.features = undefined;
94
95
  this.status = undefined;
95
96
  this.rateLimit = undefined; // milliseconds
96
97
  this.tokenBucket = undefined;
@@ -2299,6 +2300,94 @@ export default class Exchange {
2299
2300
  }
2300
2301
  afterConstruct() {
2301
2302
  this.createNetworksByIdObject();
2303
+ this.featuresGenerator();
2304
+ }
2305
+ featuresGenerator() {
2306
+ //
2307
+ // the exchange-specific features can be something like this, where we support 'string' aliases too:
2308
+ //
2309
+ // {
2310
+ // 'myItem' : {
2311
+ // 'createOrder' : {...},
2312
+ // 'fetchOrders' : {...},
2313
+ // },
2314
+ // 'swap': {
2315
+ // 'linear': 'myItem',
2316
+ // 'inverse': 'myItem',
2317
+ // },
2318
+ // 'future': {
2319
+ // 'linear': 'myItem',
2320
+ // 'inverse': 'myItem',
2321
+ // }
2322
+ // }
2323
+ //
2324
+ //
2325
+ //
2326
+ // this method would regenerate the blank features tree, eg:
2327
+ //
2328
+ // {
2329
+ // "spot": {
2330
+ // "createOrder": undefined,
2331
+ // "fetchBalance": undefined,
2332
+ // ...
2333
+ // },
2334
+ // "swap": {
2335
+ // ...
2336
+ // }
2337
+ // }
2338
+ //
2339
+ if (this.features === undefined) {
2340
+ return;
2341
+ }
2342
+ // reconstruct
2343
+ const initialFeatures = this.features;
2344
+ this.features = {};
2345
+ const unifiedMarketTypes = ['spot', 'swap', 'future', 'option'];
2346
+ const subTypes = ['linear', 'inverse'];
2347
+ // atm only support basic methods to avoid to be able to maintain, eg: 'createOrder', 'fetchOrder', 'fetchOrders', 'fetchMyTrades'
2348
+ for (let i = 0; i < unifiedMarketTypes.length; i++) {
2349
+ const marketType = unifiedMarketTypes[i];
2350
+ // if marketType is not filled for this exchange, don't add that in `features`
2351
+ if (!(marketType in initialFeatures)) {
2352
+ this.features[marketType] = undefined;
2353
+ }
2354
+ else {
2355
+ if (marketType === 'spot') {
2356
+ this.features[marketType] = this.featuresMapper(initialFeatures, marketType, undefined);
2357
+ }
2358
+ else {
2359
+ this.features[marketType] = {};
2360
+ for (let j = 0; j < subTypes.length; j++) {
2361
+ const subType = subTypes[j];
2362
+ this.features[marketType][subType] = this.featuresMapper(initialFeatures, marketType, subType);
2363
+ }
2364
+ }
2365
+ }
2366
+ }
2367
+ }
2368
+ featuresMapper(initialFeatures, marketType, subType = undefined) {
2369
+ let featuresObj = (subType !== undefined) ? initialFeatures[marketType][subType] : initialFeatures[marketType];
2370
+ const extendsStr = this.safeString(featuresObj, 'extends');
2371
+ if (extendsStr !== undefined) {
2372
+ featuresObj = this.omit(featuresObj, 'extends');
2373
+ const extendObj = initialFeatures[extendsStr];
2374
+ featuresObj = this.extend(extendObj, featuresObj); // Warning, do not use deepExtend here, because we override only one level
2375
+ }
2376
+ //
2377
+ // corrections
2378
+ //
2379
+ if ('createOrder' in featuresObj) {
2380
+ const value = this.safeDict(featuresObj['createOrder'], 'attachedStopLossTakeProfit');
2381
+ if (value !== undefined) {
2382
+ featuresObj['createOrder']['stopLoss'] = value;
2383
+ featuresObj['createOrder']['takeProfit'] = value;
2384
+ }
2385
+ // omit 'hedged' from spot
2386
+ if (marketType === 'spot') {
2387
+ featuresObj['createOrder']['hedged'] = undefined;
2388
+ }
2389
+ }
2390
+ return featuresObj;
2302
2391
  }
2303
2392
  orderbookChecksumMessage(symbol) {
2304
2393
  return symbol + ' : ' + 'orderbook data checksum validation failed. You can reconnect by calling watchOrderBook again or you can mute the error by setting exchange.options["watchOrderBook"]["checksum"] = false';
package/js/src/binance.js CHANGED
@@ -1558,6 +1558,157 @@ export default class binance extends Exchange {
1558
1558
  'BUSD': 'USD',
1559
1559
  },
1560
1560
  },
1561
+ 'features': {
1562
+ // https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
1563
+ 'spot': {
1564
+ 'sandbox': true,
1565
+ 'createOrder': {
1566
+ 'triggerPrice': true,
1567
+ 'triggerPriceType': undefined,
1568
+ 'triggerDirection': false,
1569
+ 'stopLossPrice': true,
1570
+ 'takeProfitPrice': true,
1571
+ 'attachedStopLossTakeProfit': undefined,
1572
+ 'marginMode': true,
1573
+ 'timeInForce': {
1574
+ 'GTC': true,
1575
+ 'IOC': true,
1576
+ 'FOK': true,
1577
+ 'PO': true,
1578
+ 'GTD': false,
1579
+ },
1580
+ 'hedged': true,
1581
+ // exchange-supported features
1582
+ 'selfTradePrevention': true,
1583
+ 'trailing': true,
1584
+ 'twap': false,
1585
+ 'iceberg': true,
1586
+ 'oco': false,
1587
+ },
1588
+ 'createOrders': undefined,
1589
+ 'fetchMyTrades': {
1590
+ 'limit': 1000,
1591
+ 'daysBack': undefined,
1592
+ 'untilDays': 1, // days between start-end
1593
+ },
1594
+ 'fetchOrder': {
1595
+ 'marginMode': true,
1596
+ 'trigger': false,
1597
+ 'trailing': false,
1598
+ },
1599
+ 'fetchOpenOrders': {
1600
+ 'limit': undefined,
1601
+ 'marginMode': true,
1602
+ 'trigger': false,
1603
+ 'trailing': false,
1604
+ },
1605
+ 'fetchOrders': {
1606
+ 'limit': 1000,
1607
+ 'daysBack': undefined,
1608
+ 'untilDays': 10000,
1609
+ 'marginMode': true,
1610
+ 'trigger': false,
1611
+ 'trailing': false,
1612
+ },
1613
+ 'fetchClosedOrders': {
1614
+ 'limit': 1000,
1615
+ 'daysBackClosed': undefined,
1616
+ 'daysBackCanceled': undefined,
1617
+ 'untilDays': 10000,
1618
+ 'marginMode': true,
1619
+ 'trigger': false,
1620
+ 'trailing': false,
1621
+ },
1622
+ 'fetchOHLCV': {
1623
+ 'limit': 1000,
1624
+ },
1625
+ },
1626
+ 'default': {
1627
+ 'sandbox': true,
1628
+ 'createOrder': {
1629
+ 'triggerPrice': true,
1630
+ 'triggerPriceType': {
1631
+ 'mark': true,
1632
+ 'last': true,
1633
+ 'index': false,
1634
+ },
1635
+ 'stopLossPrice': true,
1636
+ 'takeProfitPrice': true,
1637
+ 'attachedStopLossTakeProfit': undefined,
1638
+ 'marginMode': false,
1639
+ 'timeInForce': {
1640
+ 'GTC': true,
1641
+ 'IOC': true,
1642
+ 'FOK': true,
1643
+ 'PO': true,
1644
+ 'GTD': true,
1645
+ // 'GTX': true,
1646
+ },
1647
+ 'hedged': true,
1648
+ // exchange-supported features
1649
+ 'selfTradePrevention': true,
1650
+ 'trailing': true,
1651
+ 'twap': false,
1652
+ 'iceberg': false,
1653
+ 'oco': false,
1654
+ },
1655
+ 'createOrders': {
1656
+ 'max': 5,
1657
+ },
1658
+ 'fetchMyTrades': {
1659
+ 'daysBack': undefined,
1660
+ 'limit': 1000,
1661
+ 'untilDays': 7,
1662
+ },
1663
+ 'fetchOrder': {
1664
+ 'marginMode': false,
1665
+ 'trigger': false,
1666
+ 'trailing': false,
1667
+ },
1668
+ 'fetchOpenOrders': {
1669
+ 'limit': 500,
1670
+ 'marginMode': true,
1671
+ 'trigger': false,
1672
+ 'trailing': false,
1673
+ },
1674
+ 'fetchOrders': {
1675
+ 'limit': 1000,
1676
+ 'daysBack': 90,
1677
+ 'untilDays': 7,
1678
+ 'marginMode': true,
1679
+ 'trigger': false,
1680
+ 'trailing': false,
1681
+ },
1682
+ 'fetchClosedOrders': {
1683
+ 'limit': 1000,
1684
+ 'daysBackClosed': 90,
1685
+ 'daysBackCanceled': 3,
1686
+ 'untilDays': 7,
1687
+ 'marginMode': true,
1688
+ 'trigger': false,
1689
+ 'trailing': false,
1690
+ },
1691
+ 'fetchOHLCV': {
1692
+ 'limit': 1500,
1693
+ },
1694
+ },
1695
+ 'swap': {
1696
+ 'linear': {
1697
+ 'extends': 'default',
1698
+ },
1699
+ 'inverse': {
1700
+ 'extends': 'default',
1701
+ },
1702
+ },
1703
+ 'future': {
1704
+ 'linear': {
1705
+ 'extends': 'default',
1706
+ },
1707
+ 'inverse': {
1708
+ 'extends': 'default',
1709
+ },
1710
+ },
1711
+ },
1561
1712
  'exceptions': {
1562
1713
  'spot': {
1563
1714
  'exact': {
@@ -1953,6 +2104,8 @@ export default class binance extends Exchange {
1953
2104
  '-4088': PermissionDenied,
1954
2105
  '-4114': BadRequest,
1955
2106
  '-4115': BadRequest,
2107
+ '-4116': InvalidOrder,
2108
+ '-4117': OperationRejected,
1956
2109
  '-4118': OperationRejected,
1957
2110
  '-4131': OperationRejected,
1958
2111
  '-4140': BadRequest,