ccxt 4.1.16 → 4.1.18

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.
Files changed (54) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +447 -172
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ascendex.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +81 -0
  7. package/dist/cjs/src/base/functions/type.js +1 -1
  8. package/dist/cjs/src/bingx.js +8 -3
  9. package/dist/cjs/src/bit2c.js +4 -4
  10. package/dist/cjs/src/bitget.js +269 -96
  11. package/dist/cjs/src/bitstamp1.js +12 -12
  12. package/dist/cjs/src/bl3p.js +1 -1
  13. package/dist/cjs/src/btcbox.js +4 -4
  14. package/dist/cjs/src/btctradeua.js +17 -17
  15. package/dist/cjs/src/bybit.js +9 -2
  16. package/dist/cjs/src/coincheck.js +5 -5
  17. package/dist/cjs/src/coinspot.js +14 -14
  18. package/dist/cjs/src/gate.js +2 -2
  19. package/dist/cjs/src/kraken.js +1 -1
  20. package/dist/cjs/src/okx.js +12 -3
  21. package/dist/cjs/src/paymium.js +1 -1
  22. package/dist/cjs/src/pro/hollaex.js +1 -1
  23. package/dist/cjs/src/pro/mexc.js +1 -1
  24. package/dist/cjs/src/whitebit.js +1 -1
  25. package/dist/cjs/src/woo.js +1 -1
  26. package/js/ccxt.d.ts +1 -1
  27. package/js/ccxt.js +1 -1
  28. package/js/src/abstract/okex.d.ts +9 -0
  29. package/js/src/abstract/okex5.d.ts +9 -0
  30. package/js/src/abstract/okx.d.ts +9 -0
  31. package/js/src/ascendex.js +1 -1
  32. package/js/src/base/Exchange.d.ts +1 -0
  33. package/js/src/base/Exchange.js +81 -0
  34. package/js/src/base/functions/type.js +1 -1
  35. package/js/src/bingx.js +8 -3
  36. package/js/src/bit2c.js +4 -4
  37. package/js/src/bitget.js +269 -96
  38. package/js/src/bitstamp1.js +12 -12
  39. package/js/src/bl3p.js +1 -1
  40. package/js/src/btcbox.js +4 -4
  41. package/js/src/btctradeua.js +17 -17
  42. package/js/src/bybit.js +9 -2
  43. package/js/src/coincheck.js +5 -5
  44. package/js/src/coinspot.js +14 -14
  45. package/js/src/gate.js +2 -2
  46. package/js/src/kraken.js +1 -1
  47. package/js/src/okx.js +12 -3
  48. package/js/src/paymium.js +1 -1
  49. package/js/src/pro/hollaex.js +1 -1
  50. package/js/src/pro/mexc.js +1 -1
  51. package/js/src/whitebit.js +1 -1
  52. package/js/src/woo.js +1 -1
  53. package/package.json +1 -1
  54. package/skip-tests.json +10 -2
@@ -6127,7 +6127,7 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
6127
6127
  * @param {object} [params] extra parameters specific to the ascendex api endpoint
6128
6128
  * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
6129
6129
  */
6130
- return await this.modifyMarginHelper(symbol, amount, 'reduce', params);
6130
+ return await this.modifyMarginHelper(symbol, -amount, 'reduce', params);
6131
6131
  }
6132
6132
  async addMargin(symbol, amount, params = {}) {
6133
6133
  /**
@@ -8051,6 +8051,87 @@ class Exchange {
8051
8051
  },
8052
8052
  }, currency);
8053
8053
  }
8054
+ safeMarketStructure(market = undefined) {
8055
+ const cleanStructure = {
8056
+ 'id': undefined,
8057
+ 'lowercaseId': undefined,
8058
+ 'symbol': undefined,
8059
+ 'base': undefined,
8060
+ 'quote': undefined,
8061
+ 'settle': undefined,
8062
+ 'baseId': undefined,
8063
+ 'quoteId': undefined,
8064
+ 'settleId': undefined,
8065
+ 'type': undefined,
8066
+ 'spot': undefined,
8067
+ 'margin': undefined,
8068
+ 'swap': undefined,
8069
+ 'future': undefined,
8070
+ 'option': undefined,
8071
+ 'index': undefined,
8072
+ 'active': undefined,
8073
+ 'contract': undefined,
8074
+ 'linear': undefined,
8075
+ 'inverse': undefined,
8076
+ 'taker': undefined,
8077
+ 'maker': undefined,
8078
+ 'contractSize': undefined,
8079
+ 'expiry': undefined,
8080
+ 'expiryDatetime': undefined,
8081
+ 'strike': undefined,
8082
+ 'optionType': undefined,
8083
+ 'precision': {
8084
+ 'amount': undefined,
8085
+ 'price': undefined,
8086
+ 'cost': undefined,
8087
+ 'base': undefined,
8088
+ 'quote': undefined,
8089
+ },
8090
+ 'limits': {
8091
+ 'leverage': {
8092
+ 'min': undefined,
8093
+ 'max': undefined,
8094
+ },
8095
+ 'amount': {
8096
+ 'min': undefined,
8097
+ 'max': undefined,
8098
+ },
8099
+ 'price': {
8100
+ 'min': undefined,
8101
+ 'max': undefined,
8102
+ },
8103
+ 'cost': {
8104
+ 'min': undefined,
8105
+ 'max': undefined,
8106
+ },
8107
+ },
8108
+ 'created': undefined,
8109
+ 'info': undefined,
8110
+ };
8111
+ if (market !== undefined) {
8112
+ const result = this.extend(cleanStructure, market);
8113
+ // set undefined swap/future/etc
8114
+ if (result['spot']) {
8115
+ if (result['contract'] === undefined) {
8116
+ result['contract'] = false;
8117
+ }
8118
+ if (result['swap'] === undefined) {
8119
+ result['swap'] = false;
8120
+ }
8121
+ if (result['future'] === undefined) {
8122
+ result['future'] = false;
8123
+ }
8124
+ if (result['option'] === undefined) {
8125
+ result['option'] = false;
8126
+ }
8127
+ if (result['index'] === undefined) {
8128
+ result['index'] = false;
8129
+ }
8130
+ }
8131
+ return result;
8132
+ }
8133
+ return cleanStructure;
8134
+ }
8054
8135
  setMarkets(markets, currencies = undefined) {
8055
8136
  const values = [];
8056
8137
  this.markets_by_id = {};
@@ -12910,7 +12991,7 @@ const safeInteger = (o, k, $default) => {
12910
12991
  return isNumber(n) ? n : $default;
12911
12992
  };
12912
12993
  const safeIntegerProduct = (o, k, $factor, $default) => {
12913
- const n = asInteger(prop(o, k));
12994
+ const n = asFloat(prop(o, k));
12914
12995
  return isNumber(n) ? parseInt(n * $factor) : $default;
12915
12996
  };
12916
12997
  const safeTimestamp = (o, k, $default) => {
@@ -26543,14 +26624,19 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
26543
26624
  if (time === 0) {
26544
26625
  time = undefined;
26545
26626
  }
26546
- const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
26547
- const side = this.safeStringLower2(trade, 'side', 'S');
26548
26627
  const cost = this.safeString(trade, 'quoteQty');
26549
26628
  const type = (cost === undefined) ? 'spot' : 'swap';
26550
26629
  const currencyId = this.safeString2(trade, 'currency', 'N');
26551
26630
  const currencyCode = this.safeCurrencyCode(currencyId);
26552
26631
  const m = this.safeValue(trade, 'm', false);
26553
26632
  const marketId = this.safeString(trade, 's');
26633
+ const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
26634
+ let takeOrMaker = (isBuyerMaker || m) ? 'maker' : 'taker';
26635
+ let side = this.safeStringLower2(trade, 'side', 'S');
26636
+ if (side === undefined) {
26637
+ side = (isBuyerMaker || m) ? 'sell' : 'buy';
26638
+ takeOrMaker = 'taker';
26639
+ }
26554
26640
  return this.safeTrade({
26555
26641
  'id': this.safeStringN(trade, ['id', 't']),
26556
26642
  'info': trade,
@@ -26560,7 +26646,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
26560
26646
  'order': this.safeString2(trade, 'orderId', 'i'),
26561
26647
  'type': this.safeStringLower(trade, 'o'),
26562
26648
  'side': this.parseOrderSide(side),
26563
- 'takerOrMaker': (isBuyerMaker || m) ? 'maker' : 'taker',
26649
+ 'takerOrMaker': takeOrMaker,
26564
26650
  'price': this.safeString2(trade, 'price', 'p'),
26565
26651
  'amount': this.safeStringN(trade, ['qty', 'amount', 'q']),
26566
26652
  'cost': cost,
@@ -28936,10 +29022,10 @@ class bit2c extends _abstract_bit2c_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
28936
29022
  },
28937
29023
  },
28938
29024
  'markets': {
28939
- 'BTC/NIS': { 'id': 'BtcNis', 'symbol': 'BTC/NIS', 'base': 'BTC', 'quote': 'NIS', 'baseId': 'Btc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true },
28940
- 'ETH/NIS': { 'id': 'EthNis', 'symbol': 'ETH/NIS', 'base': 'ETH', 'quote': 'NIS', 'baseId': 'Eth', 'quoteId': 'Nis', 'type': 'spot', 'spot': true },
28941
- 'LTC/NIS': { 'id': 'LtcNis', 'symbol': 'LTC/NIS', 'base': 'LTC', 'quote': 'NIS', 'baseId': 'Ltc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true },
28942
- 'USDC/NIS': { 'id': 'UsdcNis', 'symbol': 'USDC/NIS', 'base': 'USDC', 'quote': 'NIS', 'baseId': 'Usdc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true },
29025
+ 'BTC/NIS': this.safeMarketStructure({ 'id': 'BtcNis', 'symbol': 'BTC/NIS', 'base': 'BTC', 'quote': 'NIS', 'baseId': 'Btc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true }),
29026
+ 'ETH/NIS': this.safeMarketStructure({ 'id': 'EthNis', 'symbol': 'ETH/NIS', 'base': 'ETH', 'quote': 'NIS', 'baseId': 'Eth', 'quoteId': 'Nis', 'type': 'spot', 'spot': true }),
29027
+ 'LTC/NIS': this.safeMarketStructure({ 'id': 'LtcNis', 'symbol': 'LTC/NIS', 'base': 'LTC', 'quote': 'NIS', 'baseId': 'Ltc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true }),
29028
+ 'USDC/NIS': this.safeMarketStructure({ 'id': 'UsdcNis', 'symbol': 'USDC/NIS', 'base': 'USDC', 'quote': 'NIS', 'baseId': 'Usdc', 'quoteId': 'Nis', 'type': 'spot', 'spot': true }),
28943
29029
  },
28944
29030
  'fees': {
28945
29031
  'trading': {
@@ -40322,7 +40408,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
40322
40408
  'startTime': since,
40323
40409
  'endTime': this.milliseconds(),
40324
40410
  };
40325
- [request, params] = this.handleUntilOption('endTime', params, request);
40411
+ [request, params] = this.handleUntilOption('endTime', request, params);
40326
40412
  if (limit !== undefined) {
40327
40413
  request['pageSize'] = limit;
40328
40414
  }
@@ -41510,10 +41596,26 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41510
41596
  // "cTime": "1652745674488"
41511
41597
  // }
41512
41598
  //
41599
+ // swap, isolated and cross margin: cancelOrder
41600
+ //
41601
+ // {
41602
+ // "orderId": "1098749943604719616",
41603
+ // "clientOid": "0ec8d262b3d2436aa651095a745b9b8d"
41604
+ // }
41605
+ //
41606
+ // spot: cancelOrder
41607
+ //
41608
+ // {
41609
+ // "code": "00000",
41610
+ // "msg": "success",
41611
+ // "requestTime": 1697689270716,
41612
+ // "data": "1098753830701928448"
41613
+ // }
41614
+ //
41513
41615
  const marketId = this.safeString(order, 'symbol');
41514
41616
  market = this.safeMarket(marketId, market);
41515
41617
  const symbol = market['symbol'];
41516
- const id = this.safeString(order, 'orderId');
41618
+ const id = this.safeString2(order, 'orderId', 'data');
41517
41619
  const price = this.safeString2(order, 'price', 'executePrice');
41518
41620
  const amount = this.safeString2(order, 'quantity', 'size');
41519
41621
  const filled = this.safeString2(order, 'fillQuantity', 'filledQty');
@@ -41589,6 +41691,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41589
41691
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
41590
41692
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
41591
41693
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
41694
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-place-order
41695
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-place-order
41592
41696
  * @param {string} symbol unified symbol of the market to create an order in
41593
41697
  * @param {string} type 'market' or 'limit'
41594
41698
  * @param {string} side 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
@@ -41603,13 +41707,23 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41603
41707
  * @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered (perpetual swap markets only)
41604
41708
  * @param {float} [params.stopLoss.triggerPrice] *swap only* stop loss trigger price
41605
41709
  * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
41710
+ * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
41711
+ * @param {string} [params.loanType] *spot margin only* 'normal', 'autoLoan', 'autoRepay', or 'autoLoanAndRepay' default is 'normal'
41606
41712
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
41607
41713
  */
41608
41714
  await this.loadMarkets();
41609
41715
  const market = this.market(symbol);
41610
- const [marketType, query] = this.handleMarketTypeAndParams('createOrder', market, params);
41716
+ let marketType = undefined;
41717
+ let marginMode = undefined;
41718
+ let response = undefined;
41719
+ [marketType, params] = this.handleMarketTypeAndParams('createOrder', market, params);
41720
+ [marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
41721
+ const marketId = market['id'];
41722
+ const parts = marketId.split('_');
41723
+ const marginMarketId = this.safeStringUpper(parts, 0);
41724
+ const symbolRequest = (marginMode !== undefined) ? marginMarketId : marketId;
41611
41725
  const request = {
41612
- 'symbol': market['id'],
41726
+ 'symbol': symbolRequest,
41613
41727
  'orderType': type,
41614
41728
  };
41615
41729
  const isMarketOrder = type === 'market';
@@ -41631,12 +41745,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41631
41745
  if ((type === 'limit') && (triggerPrice === undefined)) {
41632
41746
  request['price'] = this.priceToPrecision(symbol, price);
41633
41747
  }
41748
+ // default triggerType to market price for unification
41749
+ const triggerType = this.safeString(params, 'triggerType', 'market_price');
41750
+ const reduceOnly = this.safeValue(params, 'reduceOnly', false);
41634
41751
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
41635
- let method = this.getSupportedMapping(marketType, {
41636
- 'spot': 'privateSpotPostTradeOrders',
41637
- 'swap': 'privateMixPostOrderPlaceOrder',
41638
- 'future': 'privateMixPostOrderPlaceOrder',
41639
- });
41640
41752
  const exchangeSpecificTifParam = this.safeStringN(params, ['force', 'timeInForceValue', 'timeInForce']);
41641
41753
  let postOnly = undefined;
41642
41754
  [postOnly, params] = this.handlePostOnly(isMarketOrder, exchangeSpecificTifParam === 'post_only', params);
@@ -41644,55 +41756,33 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41644
41756
  const timeInForce = this.safeStringLower(params, 'timeInForce', defaultTimeInForce);
41645
41757
  let timeInForceKey = 'timeInForceValue';
41646
41758
  if (marketType === 'spot') {
41647
- if (isStopLossOrTakeProfitTrigger || isStopLossOrTakeProfit) {
41648
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() does not support stop loss/take profit orders on spot markets, only swap markets');
41649
- }
41650
- timeInForceKey = 'force';
41651
- let quantityKey = 'quantity';
41652
- let quantity = undefined;
41653
- const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
41654
- if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
41655
- if (price === undefined) {
41656
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
41657
- }
41658
- else {
41659
- const amountString = this.numberToString(amount);
41660
- const priceString = this.numberToString(price);
41661
- const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
41662
- quantity = this.priceToPrecision(symbol, cost);
41663
- }
41664
- }
41665
- else {
41666
- quantity = this.amountToPrecision(symbol, amount);
41667
- }
41668
- if (clientOrderId !== undefined) {
41669
- request['clientOrderId'] = clientOrderId;
41670
- }
41671
- request['side'] = side;
41672
- if (triggerPrice !== undefined) {
41673
- quantityKey = 'size';
41674
- timeInForceKey = 'timeInForceValue';
41675
- // default triggerType to market price for unification
41676
- const triggerType = this.safeString(params, 'triggerType', 'market_price');
41677
- request['triggerType'] = triggerType;
41678
- request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
41679
- if (price !== undefined) {
41680
- request['executePrice'] = this.priceToPrecision(symbol, price);
41681
- }
41682
- method = 'privateSpotPostPlanPlacePlan';
41759
+ if (marginMode !== undefined) {
41760
+ timeInForceKey = 'timeInForce';
41683
41761
  }
41684
- if (quantity !== undefined) {
41685
- request[quantityKey] = quantity;
41762
+ else if (triggerPrice === undefined) {
41763
+ timeInForceKey = 'force';
41686
41764
  }
41687
41765
  }
41688
- else {
41766
+ if (postOnly) {
41767
+ request[timeInForceKey] = 'post_only';
41768
+ }
41769
+ else if (timeInForce === 'gtc') {
41770
+ const gtcRequest = (marginMode !== undefined) ? 'gtc' : 'normal';
41771
+ request[timeInForceKey] = gtcRequest;
41772
+ }
41773
+ else if (timeInForce === 'fok') {
41774
+ request[timeInForceKey] = 'fok';
41775
+ }
41776
+ else if (timeInForce === 'ioc') {
41777
+ request[timeInForceKey] = 'ioc';
41778
+ }
41779
+ params = this.omit(params, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'postOnly', 'reduceOnly']);
41780
+ if ((marketType === 'swap') || (marketType === 'future')) {
41689
41781
  request['marginCoin'] = market['settleId'];
41690
41782
  if (clientOrderId !== undefined) {
41691
41783
  request['clientOid'] = clientOrderId;
41692
41784
  }
41693
41785
  if (isTriggerOrder || isStopLossOrTakeProfitTrigger) {
41694
- // default triggerType to market price for unification
41695
- const triggerType = this.safeString(params, 'triggerType', 'market_price');
41696
41786
  request['triggerType'] = triggerType;
41697
41787
  }
41698
41788
  if (isStopLossOrTakeProfitTrigger) {
@@ -41702,7 +41792,6 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41702
41792
  request['holdSide'] = (side === 'buy') ? 'long' : 'short';
41703
41793
  }
41704
41794
  else {
41705
- const reduceOnly = this.safeValue(params, 'reduceOnly', false);
41706
41795
  request['size'] = this.amountToPrecision(symbol, amount);
41707
41796
  if (reduceOnly) {
41708
41797
  request['side'] = (side === 'buy') ? 'close_short' : 'close_long';
@@ -41724,7 +41813,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41724
41813
  if (price !== undefined) {
41725
41814
  request['executePrice'] = this.priceToPrecision(symbol, price);
41726
41815
  }
41727
- method = 'privateMixPostPlanPlacePlan';
41816
+ response = await this.privateMixPostPlanPlacePlan(this.extend(request, params));
41728
41817
  }
41729
41818
  else if (isStopLossOrTakeProfitTrigger) {
41730
41819
  if (isStopLossTriggerOrder) {
@@ -41735,9 +41824,9 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41735
41824
  request['triggerPrice'] = this.priceToPrecision(symbol, takeProfitTriggerPrice);
41736
41825
  request['planType'] = 'pos_profit';
41737
41826
  }
41738
- method = 'privateMixPostPlanPlacePositionsTPSL';
41827
+ response = await this.privateMixPostPlanPlacePositionsTPSL(this.extend(request, params));
41739
41828
  }
41740
- else if (isStopLossOrTakeProfit) {
41829
+ else {
41741
41830
  if (isStopLoss) {
41742
41831
  const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice');
41743
41832
  request['presetStopLossPrice'] = this.priceToPrecision(symbol, slTriggerPrice);
@@ -41746,22 +41835,75 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41746
41835
  const tpTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice');
41747
41836
  request['presetTakeProfitPrice'] = this.priceToPrecision(symbol, tpTriggerPrice);
41748
41837
  }
41838
+ response = await this.privateMixPostOrderPlaceOrder(this.extend(request, params));
41749
41839
  }
41750
41840
  }
41751
- if (postOnly) {
41752
- request[timeInForceKey] = 'post_only';
41753
- }
41754
- else if (timeInForce === 'gtc') {
41755
- request[timeInForceKey] = 'normal';
41756
- }
41757
- else if (timeInForce === 'fok') {
41758
- request[timeInForceKey] = 'fok';
41841
+ else if (marketType === 'spot') {
41842
+ if (isStopLossOrTakeProfitTrigger || isStopLossOrTakeProfit) {
41843
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() does not support stop loss/take profit orders on spot markets, only swap markets');
41844
+ }
41845
+ let quantity = undefined;
41846
+ const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
41847
+ if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
41848
+ if (price === undefined) {
41849
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
41850
+ }
41851
+ else {
41852
+ const amountString = this.numberToString(amount);
41853
+ const priceString = this.numberToString(price);
41854
+ const cost = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise.stringMul */ .O.stringMul(amountString, priceString));
41855
+ quantity = this.priceToPrecision(symbol, cost);
41856
+ }
41857
+ }
41858
+ else {
41859
+ quantity = this.amountToPrecision(symbol, amount);
41860
+ }
41861
+ request['side'] = side;
41862
+ if (triggerPrice !== undefined) {
41863
+ if (quantity !== undefined) {
41864
+ request['size'] = quantity;
41865
+ }
41866
+ request['triggerType'] = triggerType;
41867
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
41868
+ if (price !== undefined) {
41869
+ request['executePrice'] = this.priceToPrecision(symbol, price);
41870
+ }
41871
+ if (clientOrderId !== undefined) {
41872
+ request['clientOrderId'] = clientOrderId;
41873
+ }
41874
+ response = await this.privateSpotPostPlanPlacePlan(this.extend(request, params));
41875
+ }
41876
+ else if (marginMode !== undefined) {
41877
+ request['loanType'] = 'normal';
41878
+ if (clientOrderId !== undefined) {
41879
+ request['clientOid'] = clientOrderId;
41880
+ }
41881
+ if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
41882
+ request['quoteAmount'] = quantity;
41883
+ }
41884
+ else {
41885
+ request['baseQuantity'] = quantity;
41886
+ }
41887
+ if (marginMode === 'isolated') {
41888
+ response = await this.privateMarginPostIsolatedOrderPlaceOrder(this.extend(request, params));
41889
+ }
41890
+ else if (marginMode === 'cross') {
41891
+ response = await this.privateMarginPostCrossOrderPlaceOrder(this.extend(request, params));
41892
+ }
41893
+ }
41894
+ else {
41895
+ if (clientOrderId !== undefined) {
41896
+ request['clientOrderId'] = clientOrderId;
41897
+ }
41898
+ if (quantity !== undefined) {
41899
+ request['quantity'] = quantity;
41900
+ }
41901
+ response = await this.privateSpotPostTradeOrders(this.extend(request, params));
41902
+ }
41759
41903
  }
41760
- else if (timeInForce === 'ioc') {
41761
- request[timeInForceKey] = 'ioc';
41904
+ else {
41905
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' createOrder() does not support ' + marketType + ' orders');
41762
41906
  }
41763
- const omitted = this.omit(query, ['stopPrice', 'triggerType', 'stopLossPrice', 'takeProfitPrice', 'stopLoss', 'takeProfit', 'postOnly', 'reduceOnly']);
41764
- const response = await this[method](this.extend(request, omitted));
41765
41907
  //
41766
41908
  // {
41767
41909
  // "code": "00000",
@@ -41773,7 +41915,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41773
41915
  // }
41774
41916
  // }
41775
41917
  //
41776
- const data = this.safeValue(response, 'data');
41918
+ const data = this.safeValue(response, 'data', {});
41777
41919
  return this.parseOrder(data, market);
41778
41920
  }
41779
41921
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
@@ -41892,44 +42034,130 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41892
42034
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-plan-order
41893
42035
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-order
41894
42036
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-plan-order-tpsl
42037
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-cancel-order
42038
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-cancel-order
41895
42039
  * @param {string} id order id
41896
42040
  * @param {string} symbol unified symbol of the market the order was made in
41897
42041
  * @param {object} [params] extra parameters specific to the bitget api endpoint
42042
+ * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
41898
42043
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
41899
42044
  */
41900
42045
  this.checkRequiredSymbol('cancelOrder', symbol);
41901
42046
  await this.loadMarkets();
41902
42047
  const market = this.market(symbol);
41903
- const [marketType, query] = this.handleMarketTypeAndParams('cancelOrder', market, params);
41904
- let method = this.getSupportedMapping(marketType, {
41905
- 'spot': 'privateSpotPostTradeCancelOrder',
41906
- 'swap': 'privateMixPostOrderCancelOrder',
41907
- 'future': 'privateMixPostOrderCancelOrder',
41908
- });
42048
+ let marketType = undefined;
42049
+ let marginMode = undefined;
42050
+ let response = undefined;
42051
+ [marketType, params] = this.handleMarketTypeAndParams('cancelOrder', market, params);
42052
+ [marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
42053
+ const symbolRequest = (marginMode !== undefined) ? (market['info']['symbolName']) : (market['id']);
41909
42054
  const request = {
41910
- 'symbol': market['id'],
42055
+ 'symbol': symbolRequest,
41911
42056
  'orderId': id,
41912
42057
  };
41913
- const stop = this.safeValue(query, 'stop');
41914
- if (stop) {
41915
- if (marketType === 'spot') {
41916
- method = 'privateSpotPostPlanCancelPlan';
41917
- }
41918
- else {
41919
- const planType = this.safeString(params, 'planType');
42058
+ const stop = this.safeValue(params, 'stop');
42059
+ const planType = this.safeString(params, 'planType');
42060
+ params = this.omit(params, ['stop', 'planType']);
42061
+ if ((marketType === 'swap') || (marketType === 'future')) {
42062
+ request['marginCoin'] = market['settleId'];
42063
+ if (stop) {
41920
42064
  if (planType === undefined) {
41921
42065
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' cancelOrder() requires a planType parameter for stop orders, either normal_plan, profit_plan or loss_plan');
41922
42066
  }
41923
42067
  request['planType'] = planType;
41924
- method = 'privateMixPostPlanCancelPlan';
42068
+ response = await this.privateMixPostPlanCancelPlan(this.extend(request, params));
42069
+ }
42070
+ else {
42071
+ response = await this.privateMixPostOrderCancelOrder(this.extend(request, params));
41925
42072
  }
41926
42073
  }
41927
- if (marketType === 'swap') {
41928
- request['marginCoin'] = market['settleId'];
42074
+ else if (marketType === 'spot') {
42075
+ if (marginMode !== undefined) {
42076
+ if (marginMode === 'isolated') {
42077
+ response = await this.privateMarginPostIsolatedOrderCancelOrder(this.extend(request, params));
42078
+ }
42079
+ else if (marginMode === 'cross') {
42080
+ response = await this.privateMarginPostCrossOrderCancelOrder(this.extend(request, params));
42081
+ }
42082
+ }
42083
+ else {
42084
+ if (stop) {
42085
+ response = await this.privateSpotPostPlanCancelPlan(this.extend(request, params));
42086
+ }
42087
+ else {
42088
+ response = await this.privateSpotPostTradeCancelOrder(this.extend(request, params));
42089
+ }
42090
+ }
41929
42091
  }
41930
- const ommitted = this.omit(query, ['stop', 'planType']);
41931
- const response = await this[method](this.extend(request, ommitted));
41932
- return this.parseOrder(response, market);
42092
+ else {
42093
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' cancelOrder() does not support ' + marketType + ' orders');
42094
+ }
42095
+ //
42096
+ // spot
42097
+ //
42098
+ // {
42099
+ // "code": "00000",
42100
+ // "msg": "success",
42101
+ // "requestTime": 1697689270716,
42102
+ // "data": "1098753830701928448"
42103
+ // }
42104
+ //
42105
+ // isolated margin
42106
+ //
42107
+ // {
42108
+ // "code": "00000",
42109
+ // "msg": "success",
42110
+ // "requestTime": 1697688367859,
42111
+ // "data": {
42112
+ // "resultList": [
42113
+ // {
42114
+ // "orderId": "1098749943604719616",
42115
+ // "clientOid": "0ec8d262b3d2436aa651095a745b9b8d"
42116
+ // }
42117
+ // ],
42118
+ // "failure": []
42119
+ // }
42120
+ // }
42121
+ //
42122
+ // cross margin
42123
+ //
42124
+ // {
42125
+ // "code": "00000",
42126
+ // "msg": "success",
42127
+ // "requestTime": :1697689028972,
42128
+ // "data": {
42129
+ // "resultList": [
42130
+ // {
42131
+ // "orderId": "1098751730051067906",
42132
+ // "clientOid": "ecb50ca373374c5bb814bc724e36b0eb"
42133
+ // }
42134
+ // ],
42135
+ // "failure": []
42136
+ // }
42137
+ // }
42138
+ //
42139
+ // swap
42140
+ //
42141
+ // {
42142
+ // "code": "00000",
42143
+ // "msg": "success",
42144
+ // "requestTime": 1697690413177,
42145
+ // "data": {
42146
+ // "orderId": "1098758604547850241",
42147
+ // "clientOid": "1098758604585598977"
42148
+ // }
42149
+ // }
42150
+ //
42151
+ let order = response;
42152
+ if ((marketType === 'swap') || (marketType === 'future')) {
42153
+ order = this.safeValue(response, 'data', {});
42154
+ }
42155
+ else if (marginMode !== undefined) {
42156
+ const data = this.safeValue(response, 'data', {});
42157
+ const resultList = this.safeValue(data, 'resultList', []);
42158
+ order = resultList[0];
42159
+ }
42160
+ return this.parseOrder(order, market);
41933
42161
  }
41934
42162
  async cancelOrders(ids, symbol = undefined, params = {}) {
41935
42163
  /**
@@ -41938,30 +42166,44 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
41938
42166
  * @description cancel multiple orders
41939
42167
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order-in-batch-v2-single-instruments
41940
42168
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#batch-cancel-order
42169
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
42170
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
41941
42171
  * @param {string[]} ids order ids
41942
42172
  * @param {string} symbol unified market symbol, default is undefined
41943
42173
  * @param {object} [params] extra parameters specific to the bitget api endpoint
42174
+ * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
41944
42175
  * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
41945
42176
  */
41946
42177
  this.checkRequiredSymbol('cancelOrders', symbol);
41947
42178
  await this.loadMarkets();
41948
42179
  const market = this.market(symbol);
41949
42180
  let type = undefined;
42181
+ let marginMode = undefined;
42182
+ [marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
41950
42183
  [type, params] = this.handleMarketTypeAndParams('cancelOrders', market, params);
41951
42184
  const request = {};
41952
- let method = undefined;
42185
+ let response = undefined;
41953
42186
  if (type === 'spot') {
41954
- method = 'privateSpotPostTradeCancelBatchOrdersV2';
41955
- request['symbol'] = market['id'];
42187
+ request['symbol'] = market['info']['symbolName']; // regular id like LTCUSDT_SPBL does not work here
41956
42188
  request['orderIds'] = ids;
42189
+ if (marginMode !== undefined) {
42190
+ if (marginMode === 'cross') {
42191
+ response = await this.privateMarginPostCrossOrderBatchCancelOrder(this.extend(request, params));
42192
+ }
42193
+ else {
42194
+ response = await this.privateMarginPostIsolatedOrderBatchCancelOrder(this.extend(request, params));
42195
+ }
42196
+ }
42197
+ else {
42198
+ response = await this.privateSpotPostTradeCancelBatchOrdersV2(this.extend(request, params));
42199
+ }
41957
42200
  }
41958
42201
  else {
41959
- method = 'privateMixPostOrderCancelBatchOrders';
41960
42202
  request['symbol'] = market['id'];
41961
42203
  request['marginCoin'] = market['quote'];
41962
42204
  request['orderIds'] = ids;
42205
+ response = await this.privateMixPostOrderCancelBatchOrders(this.extend(request, params));
41963
42206
  }
41964
- const response = await this[method](this.extend(request, params));
41965
42207
  //
41966
42208
  // spot
41967
42209
  //
@@ -42007,8 +42249,11 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
42007
42249
  * @description cancel all open orders
42008
42250
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-order
42009
42251
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-all-trigger-order-tpsl
42252
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-batch-cancel-orders
42253
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-cancel-order
42010
42254
  * @param {string} symbol unified market symbol
42011
42255
  * @param {object} [params] extra parameters specific to the bitget api endpoint
42256
+ * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
42012
42257
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
42013
42258
  */
42014
42259
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
@@ -42025,8 +42270,22 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
42025
42270
  }
42026
42271
  let marketType = undefined;
42027
42272
  [marketType, params] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
42273
+ let marginMode = undefined;
42274
+ [marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
42028
42275
  if (marketType === 'spot') {
42029
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' cancelAllOrders () does not support spot markets');
42276
+ if (marginMode === undefined) {
42277
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' cancelAllOrders () does not support spot markets, only spot-margin');
42278
+ }
42279
+ this.checkRequiredSymbol('cancelAllOrders', symbol);
42280
+ const spotMarginRequest = {
42281
+ 'symbol': market['info']['symbolName'], // regular id like LTCUSDT_SPBL does not work here
42282
+ };
42283
+ if (marginMode === 'cross') {
42284
+ return await this.privateMarginPostCrossOrderBatchCancelOrder(this.extend(spotMarginRequest, params));
42285
+ }
42286
+ else {
42287
+ return await this.privateMarginPostIsolatedOrderBatchCancelOrder(this.extend(spotMarginRequest, params));
42288
+ }
42030
42289
  }
42031
42290
  const request = {
42032
42291
  'productType': productType,
@@ -42628,7 +42887,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
42628
42887
  if (since !== undefined) {
42629
42888
  request['before'] = since;
42630
42889
  }
42631
- [request, params] = this.handleUntilOption('after', params, request);
42890
+ [request, params] = this.handleUntilOption('after', request, params);
42632
42891
  const response = await this.privateSpotPostAccountBills(this.extend(request, params));
42633
42892
  //
42634
42893
  // {
@@ -42745,7 +43004,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
42745
43004
  else if (orderId === undefined) {
42746
43005
  request['startTime'] = 0;
42747
43006
  }
42748
- [request, params] = this.handleUntilOption('endTime', params, request);
43007
+ [request, params] = this.handleUntilOption('endTime', request, params);
42749
43008
  if (!('endTime' in request) && (orderId === undefined)) {
42750
43009
  request['endTime'] = this.milliseconds();
42751
43010
  }
@@ -43659,7 +43918,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
43659
43918
  if (limit !== undefined) {
43660
43919
  request['limit'] = limit;
43661
43920
  }
43662
- [request, params] = this.handleUntilOption('after', params, request);
43921
+ [request, params] = this.handleUntilOption('after', request, params);
43663
43922
  const response = await this.privateSpotGetAccountTransferRecords(this.extend(request, params));
43664
43923
  //
43665
43924
  // {
@@ -62021,18 +62280,18 @@ class bitstamp1 extends _abstract_bitstamp1_js__WEBPACK_IMPORTED_MODULE_0__/* ["
62021
62280
  },
62022
62281
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
62023
62282
  'markets': {
62024
- 'BTC/USD': { 'id': 'btcusd', 'symbol': 'BTC/USD', 'base': 'BTC', 'quote': 'USD', 'baseId': 'btc', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62025
- 'BTC/EUR': { 'id': 'btceur', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'btc', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62026
- 'EUR/USD': { 'id': 'eurusd', 'symbol': 'EUR/USD', 'base': 'EUR', 'quote': 'USD', 'baseId': 'eur', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62027
- 'XRP/USD': { 'id': 'xrpusd', 'symbol': 'XRP/USD', 'base': 'XRP', 'quote': 'USD', 'baseId': 'xrp', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62028
- 'XRP/EUR': { 'id': 'xrpeur', 'symbol': 'XRP/EUR', 'base': 'XRP', 'quote': 'EUR', 'baseId': 'xrp', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62029
- 'XRP/BTC': { 'id': 'xrpbtc', 'symbol': 'XRP/BTC', 'base': 'XRP', 'quote': 'BTC', 'baseId': 'xrp', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62030
- 'LTC/USD': { 'id': 'ltcusd', 'symbol': 'LTC/USD', 'base': 'LTC', 'quote': 'USD', 'baseId': 'ltc', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62031
- 'LTC/EUR': { 'id': 'ltceur', 'symbol': 'LTC/EUR', 'base': 'LTC', 'quote': 'EUR', 'baseId': 'ltc', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62032
- 'LTC/BTC': { 'id': 'ltcbtc', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'baseId': 'ltc', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62033
- 'ETH/USD': { 'id': 'ethusd', 'symbol': 'ETH/USD', 'base': 'ETH', 'quote': 'USD', 'baseId': 'eth', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62034
- 'ETH/EUR': { 'id': 'etheur', 'symbol': 'ETH/EUR', 'base': 'ETH', 'quote': 'EUR', 'baseId': 'eth', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62035
- 'ETH/BTC': { 'id': 'ethbtc', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'baseId': 'eth', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true },
62283
+ 'BTC/USD': this.safeMarketStructure({ 'id': 'btcusd', 'symbol': 'BTC/USD', 'base': 'BTC', 'quote': 'USD', 'baseId': 'btc', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62284
+ 'BTC/EUR': this.safeMarketStructure({ 'id': 'btceur', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'btc', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62285
+ 'EUR/USD': this.safeMarketStructure({ 'id': 'eurusd', 'symbol': 'EUR/USD', 'base': 'EUR', 'quote': 'USD', 'baseId': 'eur', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62286
+ 'XRP/USD': this.safeMarketStructure({ 'id': 'xrpusd', 'symbol': 'XRP/USD', 'base': 'XRP', 'quote': 'USD', 'baseId': 'xrp', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62287
+ 'XRP/EUR': this.safeMarketStructure({ 'id': 'xrpeur', 'symbol': 'XRP/EUR', 'base': 'XRP', 'quote': 'EUR', 'baseId': 'xrp', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62288
+ 'XRP/BTC': this.safeMarketStructure({ 'id': 'xrpbtc', 'symbol': 'XRP/BTC', 'base': 'XRP', 'quote': 'BTC', 'baseId': 'xrp', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62289
+ 'LTC/USD': this.safeMarketStructure({ 'id': 'ltcusd', 'symbol': 'LTC/USD', 'base': 'LTC', 'quote': 'USD', 'baseId': 'ltc', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62290
+ 'LTC/EUR': this.safeMarketStructure({ 'id': 'ltceur', 'symbol': 'LTC/EUR', 'base': 'LTC', 'quote': 'EUR', 'baseId': 'ltc', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62291
+ 'LTC/BTC': this.safeMarketStructure({ 'id': 'ltcbtc', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'baseId': 'ltc', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62292
+ 'ETH/USD': this.safeMarketStructure({ 'id': 'ethusd', 'symbol': 'ETH/USD', 'base': 'ETH', 'quote': 'USD', 'baseId': 'eth', 'quoteId': 'usd', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62293
+ 'ETH/EUR': this.safeMarketStructure({ 'id': 'etheur', 'symbol': 'ETH/EUR', 'base': 'ETH', 'quote': 'EUR', 'baseId': 'eth', 'quoteId': 'eur', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62294
+ 'ETH/BTC': this.safeMarketStructure({ 'id': 'ethbtc', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'baseId': 'eth', 'quoteId': 'btc', 'maker': 0.005, 'taker': 0.005, 'type': 'spot', 'spot': true }),
62036
62295
  },
62037
62296
  });
62038
62297
  }
@@ -66663,7 +66922,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
66663
66922
  },
66664
66923
  },
66665
66924
  'markets': {
66666
- 'BTC/EUR': { 'id': 'BTCEUR', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'BTC', 'quoteId': 'EUR', 'maker': 0.0025, 'taker': 0.0025, 'type': 'spot', 'spot': true },
66925
+ 'BTC/EUR': this.safeMarketStructure({ 'id': 'BTCEUR', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'BTC', 'quoteId': 'EUR', 'maker': 0.0025, 'taker': 0.0025, 'type': 'spot', 'spot': true }),
66667
66926
  },
66668
66927
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
66669
66928
  });
@@ -69258,10 +69517,10 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
69258
69517
  },
69259
69518
  },
69260
69519
  'markets': {
69261
- 'BTC/JPY': { 'id': 'btc', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0005'), 'maker': this.parseNumber('0.0005'), 'type': 'spot', 'spot': true },
69262
- 'ETH/JPY': { 'id': 'eth', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true },
69263
- 'LTC/JPY': { 'id': 'ltc', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true },
69264
- 'BCH/JPY': { 'id': 'bch', 'symbol': 'BCH/JPY', 'base': 'BCH', 'quote': 'JPY', 'baseId': 'bch', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true },
69520
+ 'BTC/JPY': this.safeMarketStructure({ 'id': 'btc', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0005'), 'maker': this.parseNumber('0.0005'), 'type': 'spot', 'spot': true }),
69521
+ 'ETH/JPY': this.safeMarketStructure({ 'id': 'eth', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
69522
+ 'LTC/JPY': this.safeMarketStructure({ 'id': 'ltc', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
69523
+ 'BCH/JPY': this.safeMarketStructure({ 'id': 'bch', 'symbol': 'BCH/JPY', 'base': 'BCH', 'quote': 'JPY', 'baseId': 'bch', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
69265
69524
  },
69266
69525
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
69267
69526
  'exceptions': {
@@ -71075,23 +71334,23 @@ class btctradeua extends _abstract_btctradeua_js__WEBPACK_IMPORTED_MODULE_0__/*
71075
71334
  },
71076
71335
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .TICK_SIZE */ .sh,
71077
71336
  'markets': {
71078
- 'BCH/UAH': { 'id': 'bch_uah', 'symbol': 'BCH/UAH', 'base': 'BCH', 'quote': 'UAH', 'baseId': 'bch', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71079
- 'BTC/UAH': { 'id': 'btc_uah', 'symbol': 'BTC/UAH', 'base': 'BTC', 'quote': 'UAH', 'baseId': 'btc', 'quoteId': 'uah', 'precision': { 'price': this.parseNumber('1e-1') }, 'limits': { 'amount': { 'min': this.parseNumber('1e-10') } }, 'type': 'spot', 'spot': true },
71080
- 'DASH/BTC': { 'id': 'dash_btc', 'symbol': 'DASH/BTC', 'base': 'DASH', 'quote': 'BTC', 'baseId': 'dash', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
71081
- 'DASH/UAH': { 'id': 'dash_uah', 'symbol': 'DASH/UAH', 'base': 'DASH', 'quote': 'UAH', 'baseId': 'dash', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71082
- 'DOGE/BTC': { 'id': 'doge_btc', 'symbol': 'DOGE/BTC', 'base': 'DOGE', 'quote': 'BTC', 'baseId': 'doge', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
71083
- 'DOGE/UAH': { 'id': 'doge_uah', 'symbol': 'DOGE/UAH', 'base': 'DOGE', 'quote': 'UAH', 'baseId': 'doge', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71084
- 'ETH/UAH': { 'id': 'eth_uah', 'symbol': 'ETH/UAH', 'base': 'ETH', 'quote': 'UAH', 'baseId': 'eth', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71085
- 'ITI/UAH': { 'id': 'iti_uah', 'symbol': 'ITI/UAH', 'base': 'ITI', 'quote': 'UAH', 'baseId': 'iti', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71086
- 'KRB/UAH': { 'id': 'krb_uah', 'symbol': 'KRB/UAH', 'base': 'KRB', 'quote': 'UAH', 'baseId': 'krb', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71087
- 'LTC/BTC': { 'id': 'ltc_btc', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'baseId': 'ltc', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
71088
- 'LTC/UAH': { 'id': 'ltc_uah', 'symbol': 'LTC/UAH', 'base': 'LTC', 'quote': 'UAH', 'baseId': 'ltc', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71089
- 'NVC/BTC': { 'id': 'nvc_btc', 'symbol': 'NVC/BTC', 'base': 'NVC', 'quote': 'BTC', 'baseId': 'nvc', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
71090
- 'NVC/UAH': { 'id': 'nvc_uah', 'symbol': 'NVC/UAH', 'base': 'NVC', 'quote': 'UAH', 'baseId': 'nvc', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71091
- 'PPC/BTC': { 'id': 'ppc_btc', 'symbol': 'PPC/BTC', 'base': 'PPC', 'quote': 'BTC', 'baseId': 'ppc', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
71092
- 'SIB/UAH': { 'id': 'sib_uah', 'symbol': 'SIB/UAH', 'base': 'SIB', 'quote': 'UAH', 'baseId': 'sib', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71093
- 'XMR/UAH': { 'id': 'xmr_uah', 'symbol': 'XMR/UAH', 'base': 'XMR', 'quote': 'UAH', 'baseId': 'xmr', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71094
- 'ZEC/UAH': { 'id': 'zec_uah', 'symbol': 'ZEC/UAH', 'base': 'ZEC', 'quote': 'UAH', 'baseId': 'zec', 'quoteId': 'uah', 'type': 'spot', 'spot': true },
71337
+ 'BCH/UAH': this.safeMarketStructure({ 'id': 'bch_uah', 'symbol': 'BCH/UAH', 'base': 'BCH', 'quote': 'UAH', 'baseId': 'bch', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71338
+ 'BTC/UAH': this.safeMarketStructure({ 'id': 'btc_uah', 'symbol': 'BTC/UAH', 'base': 'BTC', 'quote': 'UAH', 'baseId': 'btc', 'quoteId': 'uah', 'precision': { 'price': this.parseNumber('1e-1') }, 'limits': { 'amount': { 'min': this.parseNumber('1e-10') } }, 'type': 'spot', 'spot': true }),
71339
+ 'DASH/BTC': this.safeMarketStructure({ 'id': 'dash_btc', 'symbol': 'DASH/BTC', 'base': 'DASH', 'quote': 'BTC', 'baseId': 'dash', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
71340
+ 'DASH/UAH': this.safeMarketStructure({ 'id': 'dash_uah', 'symbol': 'DASH/UAH', 'base': 'DASH', 'quote': 'UAH', 'baseId': 'dash', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71341
+ 'DOGE/BTC': this.safeMarketStructure({ 'id': 'doge_btc', 'symbol': 'DOGE/BTC', 'base': 'DOGE', 'quote': 'BTC', 'baseId': 'doge', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
71342
+ 'DOGE/UAH': this.safeMarketStructure({ 'id': 'doge_uah', 'symbol': 'DOGE/UAH', 'base': 'DOGE', 'quote': 'UAH', 'baseId': 'doge', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71343
+ 'ETH/UAH': this.safeMarketStructure({ 'id': 'eth_uah', 'symbol': 'ETH/UAH', 'base': 'ETH', 'quote': 'UAH', 'baseId': 'eth', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71344
+ 'ITI/UAH': this.safeMarketStructure({ 'id': 'iti_uah', 'symbol': 'ITI/UAH', 'base': 'ITI', 'quote': 'UAH', 'baseId': 'iti', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71345
+ 'KRB/UAH': this.safeMarketStructure({ 'id': 'krb_uah', 'symbol': 'KRB/UAH', 'base': 'KRB', 'quote': 'UAH', 'baseId': 'krb', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71346
+ 'LTC/BTC': this.safeMarketStructure({ 'id': 'ltc_btc', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'baseId': 'ltc', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
71347
+ 'LTC/UAH': this.safeMarketStructure({ 'id': 'ltc_uah', 'symbol': 'LTC/UAH', 'base': 'LTC', 'quote': 'UAH', 'baseId': 'ltc', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71348
+ 'NVC/BTC': this.safeMarketStructure({ 'id': 'nvc_btc', 'symbol': 'NVC/BTC', 'base': 'NVC', 'quote': 'BTC', 'baseId': 'nvc', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
71349
+ 'NVC/UAH': this.safeMarketStructure({ 'id': 'nvc_uah', 'symbol': 'NVC/UAH', 'base': 'NVC', 'quote': 'UAH', 'baseId': 'nvc', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71350
+ 'PPC/BTC': this.safeMarketStructure({ 'id': 'ppc_btc', 'symbol': 'PPC/BTC', 'base': 'PPC', 'quote': 'BTC', 'baseId': 'ppc', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
71351
+ 'SIB/UAH': this.safeMarketStructure({ 'id': 'sib_uah', 'symbol': 'SIB/UAH', 'base': 'SIB', 'quote': 'UAH', 'baseId': 'sib', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71352
+ 'XMR/UAH': this.safeMarketStructure({ 'id': 'xmr_uah', 'symbol': 'XMR/UAH', 'base': 'XMR', 'quote': 'UAH', 'baseId': 'xmr', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71353
+ 'ZEC/UAH': this.safeMarketStructure({ 'id': 'zec_uah', 'symbol': 'ZEC/UAH', 'base': 'ZEC', 'quote': 'UAH', 'baseId': 'zec', 'quoteId': 'uah', 'type': 'spot', 'spot': true }),
71095
71354
  },
71096
71355
  'fees': {
71097
71356
  'trading': {
@@ -76036,9 +76295,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
76036
76295
  let fee = undefined;
76037
76296
  const feeCostString = this.safeString(order, 'cumExecFee');
76038
76297
  if (feeCostString !== undefined) {
76298
+ let feeCurrency = undefined;
76299
+ if (market['spot']) {
76300
+ feeCurrency = (side === 'buy') ? market['quote'] : market['base'];
76301
+ }
76302
+ else {
76303
+ feeCurrency = market['settle'];
76304
+ }
76039
76305
  fee = {
76040
76306
  'cost': feeCostString,
76041
- 'currency': market['settle'],
76307
+ 'currency': feeCurrency,
76042
76308
  };
76043
76309
  }
76044
76310
  let clientOrderId = this.safeString(order, 'orderLinkId');
@@ -76124,7 +76390,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
76124
76390
  const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
76125
76391
  const length = result.length;
76126
76392
  if (length === 0) {
76127
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id + ' does not exist.');
76393
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound('Order ' + id.toString() + ' does not exist.');
76128
76394
  }
76129
76395
  if (length > 1) {
76130
76396
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder(this.id + ' returned more than one order');
@@ -86749,13 +87015,13 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
86749
87015
  },
86750
87016
  },
86751
87017
  'markets': {
86752
- 'BTC/JPY': { 'id': 'btc_jpy', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'type': 'spot', 'spot': true },
87018
+ 'BTC/JPY': this.safeMarketStructure({ 'id': 'btc_jpy', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'type': 'spot', 'spot': true }),
86753
87019
  // 'ETH/JPY': { 'id': 'eth_jpy', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy' },
86754
- 'ETC/JPY': { 'id': 'etc_jpy', 'symbol': 'ETC/JPY', 'base': 'ETC', 'quote': 'JPY', 'baseId': 'etc', 'quoteId': 'jpy', 'type': 'spot', 'spot': true },
87020
+ 'ETC/JPY': this.safeMarketStructure({ 'id': 'etc_jpy', 'symbol': 'ETC/JPY', 'base': 'ETC', 'quote': 'JPY', 'baseId': 'etc', 'quoteId': 'jpy', 'type': 'spot', 'spot': true }),
86755
87021
  // 'DAO/JPY': { 'id': 'dao_jpy', 'symbol': 'DAO/JPY', 'base': 'DAO', 'quote': 'JPY', 'baseId': 'dao', 'quoteId': 'jpy' },
86756
87022
  // 'LSK/JPY': { 'id': 'lsk_jpy', 'symbol': 'LSK/JPY', 'base': 'LSK', 'quote': 'JPY', 'baseId': 'lsk', 'quoteId': 'jpy' },
86757
- 'FCT/JPY': { 'id': 'fct_jpy', 'symbol': 'FCT/JPY', 'base': 'FCT', 'quote': 'JPY', 'baseId': 'fct', 'quoteId': 'jpy', 'type': 'spot', 'spot': true },
86758
- 'MONA/JPY': { 'id': 'mona_jpy', 'symbol': 'MONA/JPY', 'base': 'MONA', 'quote': 'JPY', 'baseId': 'mona', 'quoteId': 'jpy', 'type': 'spot', 'spot': true },
87023
+ 'FCT/JPY': this.safeMarketStructure({ 'id': 'fct_jpy', 'symbol': 'FCT/JPY', 'base': 'FCT', 'quote': 'JPY', 'baseId': 'fct', 'quoteId': 'jpy', 'type': 'spot', 'spot': true }),
87024
+ 'MONA/JPY': this.safeMarketStructure({ 'id': 'mona_jpy', 'symbol': 'MONA/JPY', 'base': 'MONA', 'quote': 'JPY', 'baseId': 'mona', 'quoteId': 'jpy', 'type': 'spot', 'spot': true }),
86759
87025
  // 'XMR/JPY': { 'id': 'xmr_jpy', 'symbol': 'XMR/JPY', 'base': 'XMR', 'quote': 'JPY', 'baseId': 'xmr', 'quoteId': 'jpy' },
86760
87026
  // 'REP/JPY': { 'id': 'rep_jpy', 'symbol': 'REP/JPY', 'base': 'REP', 'quote': 'JPY', 'baseId': 'rep', 'quoteId': 'jpy' },
86761
87027
  // 'XRP/JPY': { 'id': 'xrp_jpy', 'symbol': 'XRP/JPY', 'base': 'XRP', 'quote': 'JPY', 'baseId': 'xrp', 'quoteId': 'jpy' },
@@ -86764,7 +87030,7 @@ class coincheck extends _abstract_coincheck_js__WEBPACK_IMPORTED_MODULE_0__/* ["
86764
87030
  // 'LTC/JPY': { 'id': 'ltc_jpy', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy' },
86765
87031
  // 'DASH/JPY': { 'id': 'dash_jpy', 'symbol': 'DASH/JPY', 'base': 'DASH', 'quote': 'JPY', 'baseId': 'dash', 'quoteId': 'jpy' },
86766
87032
  // 'ETH/BTC': { 'id': 'eth_btc', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'baseId': 'eth', 'quoteId': 'btc' },
86767
- 'ETC/BTC': { 'id': 'etc_btc', 'symbol': 'ETC/BTC', 'base': 'ETC', 'quote': 'BTC', 'baseId': 'etc', 'quoteId': 'btc', 'type': 'spot', 'spot': true },
87033
+ 'ETC/BTC': this.safeMarketStructure({ 'id': 'etc_btc', 'symbol': 'ETC/BTC', 'base': 'ETC', 'quote': 'BTC', 'baseId': 'etc', 'quoteId': 'btc', 'type': 'spot', 'spot': true }),
86768
87034
  // 'LSK/BTC': { 'id': 'lsk_btc', 'symbol': 'LSK/BTC', 'base': 'LSK', 'quote': 'BTC', 'baseId': 'lsk', 'quoteId': 'btc' },
86769
87035
  // 'FCT/BTC': { 'id': 'fct_btc', 'symbol': 'FCT/BTC', 'base': 'FCT', 'quote': 'BTC', 'baseId': 'fct', 'quoteId': 'btc' },
86770
87036
  // 'XMR/BTC': { 'id': 'xmr_btc', 'symbol': 'XMR/BTC', 'base': 'XMR', 'quote': 'BTC', 'baseId': 'xmr', 'quoteId': 'btc' },
@@ -97366,20 +97632,20 @@ class coinspot extends _abstract_coinspot_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
97366
97632
  },
97367
97633
  },
97368
97634
  'markets': {
97369
- 'ADA/AUD': { 'id': 'ada', 'symbol': 'ADA/AUD', 'base': 'ADA', 'quote': 'AUD', 'baseId': 'ada', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97370
- 'BTC/AUD': { 'id': 'btc', 'symbol': 'BTC/AUD', 'base': 'BTC', 'quote': 'AUD', 'baseId': 'btc', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97371
- 'ETH/AUD': { 'id': 'eth', 'symbol': 'ETH/AUD', 'base': 'ETH', 'quote': 'AUD', 'baseId': 'eth', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97372
- 'XRP/AUD': { 'id': 'xrp', 'symbol': 'XRP/AUD', 'base': 'XRP', 'quote': 'AUD', 'baseId': 'xrp', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97373
- 'LTC/AUD': { 'id': 'ltc', 'symbol': 'LTC/AUD', 'base': 'LTC', 'quote': 'AUD', 'baseId': 'ltc', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97374
- 'DOGE/AUD': { 'id': 'doge', 'symbol': 'DOGE/AUD', 'base': 'DOGE', 'quote': 'AUD', 'baseId': 'doge', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97375
- 'RFOX/AUD': { 'id': 'rfox', 'symbol': 'RFOX/AUD', 'base': 'RFOX', 'quote': 'AUD', 'baseId': 'rfox', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97376
- 'POWR/AUD': { 'id': 'powr', 'symbol': 'POWR/AUD', 'base': 'POWR', 'quote': 'AUD', 'baseId': 'powr', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97377
- 'NEO/AUD': { 'id': 'neo', 'symbol': 'NEO/AUD', 'base': 'NEO', 'quote': 'AUD', 'baseId': 'neo', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97378
- 'TRX/AUD': { 'id': 'trx', 'symbol': 'TRX/AUD', 'base': 'TRX', 'quote': 'AUD', 'baseId': 'trx', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97379
- 'EOS/AUD': { 'id': 'eos', 'symbol': 'EOS/AUD', 'base': 'EOS', 'quote': 'AUD', 'baseId': 'eos', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97380
- 'XLM/AUD': { 'id': 'xlm', 'symbol': 'XLM/AUD', 'base': 'XLM', 'quote': 'AUD', 'baseId': 'xlm', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97381
- 'RHOC/AUD': { 'id': 'rhoc', 'symbol': 'RHOC/AUD', 'base': 'RHOC', 'quote': 'AUD', 'baseId': 'rhoc', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97382
- 'GAS/AUD': { 'id': 'gas', 'symbol': 'GAS/AUD', 'base': 'GAS', 'quote': 'AUD', 'baseId': 'gas', 'quoteId': 'aud', 'type': 'spot', 'spot': true },
97635
+ 'ADA/AUD': this.safeMarketStructure({ 'id': 'ada', 'symbol': 'ADA/AUD', 'base': 'ADA', 'quote': 'AUD', 'baseId': 'ada', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97636
+ 'BTC/AUD': this.safeMarketStructure({ 'id': 'btc', 'symbol': 'BTC/AUD', 'base': 'BTC', 'quote': 'AUD', 'baseId': 'btc', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97637
+ 'ETH/AUD': this.safeMarketStructure({ 'id': 'eth', 'symbol': 'ETH/AUD', 'base': 'ETH', 'quote': 'AUD', 'baseId': 'eth', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97638
+ 'XRP/AUD': this.safeMarketStructure({ 'id': 'xrp', 'symbol': 'XRP/AUD', 'base': 'XRP', 'quote': 'AUD', 'baseId': 'xrp', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97639
+ 'LTC/AUD': this.safeMarketStructure({ 'id': 'ltc', 'symbol': 'LTC/AUD', 'base': 'LTC', 'quote': 'AUD', 'baseId': 'ltc', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97640
+ 'DOGE/AUD': this.safeMarketStructure({ 'id': 'doge', 'symbol': 'DOGE/AUD', 'base': 'DOGE', 'quote': 'AUD', 'baseId': 'doge', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97641
+ 'RFOX/AUD': this.safeMarketStructure({ 'id': 'rfox', 'symbol': 'RFOX/AUD', 'base': 'RFOX', 'quote': 'AUD', 'baseId': 'rfox', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97642
+ 'POWR/AUD': this.safeMarketStructure({ 'id': 'powr', 'symbol': 'POWR/AUD', 'base': 'POWR', 'quote': 'AUD', 'baseId': 'powr', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97643
+ 'NEO/AUD': this.safeMarketStructure({ 'id': 'neo', 'symbol': 'NEO/AUD', 'base': 'NEO', 'quote': 'AUD', 'baseId': 'neo', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97644
+ 'TRX/AUD': this.safeMarketStructure({ 'id': 'trx', 'symbol': 'TRX/AUD', 'base': 'TRX', 'quote': 'AUD', 'baseId': 'trx', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97645
+ 'EOS/AUD': this.safeMarketStructure({ 'id': 'eos', 'symbol': 'EOS/AUD', 'base': 'EOS', 'quote': 'AUD', 'baseId': 'eos', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97646
+ 'XLM/AUD': this.safeMarketStructure({ 'id': 'xlm', 'symbol': 'XLM/AUD', 'base': 'XLM', 'quote': 'AUD', 'baseId': 'xlm', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97647
+ 'RHOC/AUD': this.safeMarketStructure({ 'id': 'rhoc', 'symbol': 'RHOC/AUD', 'base': 'RHOC', 'quote': 'AUD', 'baseId': 'rhoc', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97648
+ 'GAS/AUD': this.safeMarketStructure({ 'id': 'gas', 'symbol': 'GAS/AUD', 'base': 'GAS', 'quote': 'AUD', 'baseId': 'gas', 'quoteId': 'aud', 'type': 'spot', 'spot': true }),
97383
97649
  },
97384
97650
  'commonCurrencies': {
97385
97651
  'DRK': 'DASH',
@@ -117068,7 +117334,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
117068
117334
  'max': undefined,
117069
117335
  },
117070
117336
  },
117071
- 'created': this.safeIntegerProduct(market, 'create_time', 1000),
117337
+ 'created': this.safeTimestamp(market, 'create_time'),
117072
117338
  'info': market,
117073
117339
  });
117074
117340
  }
@@ -121499,7 +121765,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
121499
121765
  // lsr_taker: '9.3765153315902'
121500
121766
  // }
121501
121767
  //
121502
- const timestamp = this.safeIntegerProduct(interest, 'time', 1000);
121768
+ const timestamp = this.safeTimestamp(interest, 'time');
121503
121769
  return {
121504
121770
  'symbol': this.safeString(market, 'symbol'),
121505
121771
  'openInterestAmount': this.safeNumber(interest, 'open_interest'),
@@ -143915,7 +144181,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
143915
144181
  else {
143916
144182
  direction = 'in';
143917
144183
  }
143918
- const timestamp = this.safeIntegerProduct(item, 'time', 1000);
144184
+ const timestamp = this.safeTimestamp(item, 'time');
143919
144185
  return {
143920
144186
  'info': item,
143921
144187
  'id': id,
@@ -178697,6 +178963,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
178697
178963
  'trade/orders-history-archive': 1,
178698
178964
  'trade/fills': 1 / 3,
178699
178965
  'trade/fills-history': 2.2,
178966
+ 'trade/fills-archive': 2,
178700
178967
  'trade/order-algo': 1,
178701
178968
  'trade/orders-algo-pending': 1,
178702
178969
  'trade/orders-algo-history': 1,
@@ -178763,6 +179030,12 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
178763
179030
  'tradingBot/grid/orders-algo-details': 1,
178764
179031
  'tradingBot/grid/sub-orders': 1,
178765
179032
  'tradingBot/grid/positions': 1,
179033
+ 'tradingBot/grid/ai-param': 1,
179034
+ 'tradingBot/public/rsi-back-testing': 1,
179035
+ 'tradingBot/signal/orders-algo-details': 1,
179036
+ 'tradingBot/signal/positions': 1,
179037
+ 'tradingBot/signal/sub-orders': 1,
179038
+ 'tradingBot/signal/event-history': 1,
178766
179039
  'tradingBot/recurring/orders-algo-pending': 1,
178767
179040
  'tradingBot/recurring/orders-algo-history': 1,
178768
179041
  'tradingBot/recurring/orders-algo-details': 1,
@@ -178819,6 +179092,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
178819
179092
  'trade/amend-order': 1 / 3,
178820
179093
  'trade/amend-batch-orders': 1 / 150,
178821
179094
  'trade/close-position': 1,
179095
+ 'trade/fills-archive': 172800,
178822
179096
  'trade/order-algo': 1,
178823
179097
  'trade/cancel-algos': 1,
178824
179098
  'trade/amend-algos': 1,
@@ -178893,6 +179167,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
178893
179167
  'broker/nd/rebate-per-orders': 36000,
178894
179168
  'finance/sfp/dcd/quote': 10,
178895
179169
  'finance/sfp/dcd/order': 10,
179170
+ 'broker/nd/report-subaccount-ip': 0.25,
178896
179171
  'broker/fd/rebate-per-orders': 36000,
178897
179172
  },
178898
179173
  },
@@ -182368,7 +182643,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
182368
182643
  market = this.market(symbol);
182369
182644
  request['instId'] = market['id'];
182370
182645
  }
182371
- [request, params] = this.handleUntilOption('end', params, request);
182646
+ [request, params] = this.handleUntilOption('end', request, params);
182372
182647
  const [type, query] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
182373
182648
  request['instType'] = this.convertToInstrumentType(type);
182374
182649
  if (limit !== undefined) {
@@ -182487,7 +182762,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
182487
182762
  currency = this.currency(code);
182488
182763
  request['ccy'] = currency['id'];
182489
182764
  }
182490
- [request, params] = this.handleUntilOption('end', params, request);
182765
+ [request, params] = this.handleUntilOption('end', request, params);
182491
182766
  const response = await this[method](this.extend(request, query));
182492
182767
  //
182493
182768
  // privateGetAccountBills, privateGetAccountBillsArchive
@@ -182930,7 +183205,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
182930
183205
  if (limit !== undefined) {
182931
183206
  request['limit'] = limit; // default 100, max 100
182932
183207
  }
182933
- [request, params] = this.handleUntilOption('after', params, request);
183208
+ [request, params] = this.handleUntilOption('after', request, params);
182934
183209
  const response = await this.privateGetAssetDepositHistory(this.extend(request, params));
182935
183210
  //
182936
183211
  // {
@@ -185459,7 +185734,7 @@ class paymium extends _abstract_paymium_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
185459
185734
  },
185460
185735
  },
185461
185736
  'markets': {
185462
- 'BTC/EUR': { 'id': 'eur', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'btc', 'quoteId': 'eur', 'type': 'spot', 'spot': true },
185737
+ 'BTC/EUR': this.safeMarketStructure({ 'id': 'eur', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'btc', 'quoteId': 'eur', 'type': 'spot', 'spot': true }),
185463
185738
  },
185464
185739
  'fees': {
185465
185740
  'trading': {
@@ -222327,7 +222602,7 @@ class hollaex extends _hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
222327
222602
  const messageHash = this.safeString(message, 'topic');
222328
222603
  const data = this.safeValue(message, 'data');
222329
222604
  const keys = Object.keys(data);
222330
- const timestamp = this.safeIntegerProduct(message, 'time', 1000);
222605
+ const timestamp = this.safeTimestamp(message, 'time');
222331
222606
  this.balance['info'] = data;
222332
222607
  this.balance['timestamp'] = timestamp;
222333
222608
  this.balance['datetime'] = this.iso8601(timestamp);
@@ -231535,7 +231810,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
231535
231810
  // }
231536
231811
  //
231537
231812
  return [
231538
- this.safeIntegerProduct(ohlcv, 't', 1000),
231813
+ this.safeTimestamp(ohlcv, 't'),
231539
231814
  this.safeNumber(ohlcv, 'o'),
231540
231815
  this.safeNumber(ohlcv, 'h'),
231541
231816
  this.safeNumber(ohlcv, 'l'),
@@ -264319,7 +264594,7 @@ class whitebit extends _abstract_whitebit_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
264319
264594
  // ]
264320
264595
  // }
264321
264596
  //
264322
- const timestamp = this.safeIntegerProduct(response, 'timestamp', 1000);
264597
+ const timestamp = this.safeTimestamp(response, 'timestamp');
264323
264598
  return this.parseOrderBook(response, symbol, timestamp);
264324
264599
  }
264325
264600
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
@@ -266142,7 +266417,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
266142
266417
  'max': undefined,
266143
266418
  },
266144
266419
  },
266145
- 'created': this.safeIntegerProduct(market, 'created_time', 1000),
266420
+ 'created': this.safeTimestamp(market, 'created_time'),
266146
266421
  'info': market,
266147
266422
  });
266148
266423
  }
@@ -277895,7 +278170,7 @@ SOFTWARE.
277895
278170
 
277896
278171
  //-----------------------------------------------------------------------------
277897
278172
  // this is updated by vss.js when building
277898
- const version = '4.1.16';
278173
+ const version = '4.1.18';
277899
278174
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
277900
278175
  //-----------------------------------------------------------------------------
277901
278176