ccxt 4.2.38 → 4.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +425 -105
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +14 -2
  6. package/dist/cjs/src/binance.js +156 -35
  7. package/dist/cjs/src/bitget.js +1 -1
  8. package/dist/cjs/src/bitso.js +18 -2
  9. package/dist/cjs/src/bitstamp.js +24 -2
  10. package/dist/cjs/src/bl3p.js +6 -0
  11. package/dist/cjs/src/blockchaincom.js +21 -0
  12. package/dist/cjs/src/btcalpha.js +9 -0
  13. package/dist/cjs/src/btcbox.js +9 -0
  14. package/dist/cjs/src/btcmarkets.js +19 -0
  15. package/dist/cjs/src/coinbase.js +13 -2
  16. package/dist/cjs/src/krakenfutures.js +7 -14
  17. package/dist/cjs/src/luno.js +1 -1
  18. package/dist/cjs/src/okx.js +2 -2
  19. package/dist/cjs/src/poloniexfutures.js +11 -5
  20. package/dist/cjs/src/pro/bitmart.js +110 -35
  21. package/dist/cjs/src/pro/mexc.js +1 -1
  22. package/dist/cjs/src/wavesexchange.js +1 -1
  23. package/dist/cjs/src/woo.js +1 -1
  24. package/js/ccxt.d.ts +1 -1
  25. package/js/ccxt.js +1 -1
  26. package/js/src/abstract/coinbase.d.ts +1 -0
  27. package/js/src/abstract/okx.d.ts +1 -0
  28. package/js/src/ascendex.d.ts +2 -2
  29. package/js/src/base/Exchange.d.ts +4 -0
  30. package/js/src/base/Exchange.js +14 -2
  31. package/js/src/base/types.d.ts +2 -0
  32. package/js/src/bigone.d.ts +2 -2
  33. package/js/src/binance.d.ts +8 -8
  34. package/js/src/binance.js +156 -35
  35. package/js/src/bingx.d.ts +5 -5
  36. package/js/src/bitfinex.d.ts +3 -3
  37. package/js/src/bitfinex2.d.ts +2 -2
  38. package/js/src/bitget.d.ts +5 -5
  39. package/js/src/bitget.js +1 -1
  40. package/js/src/bitmart.d.ts +2 -2
  41. package/js/src/bitmex.d.ts +2 -2
  42. package/js/src/bitrue.d.ts +2 -2
  43. package/js/src/bitso.d.ts +1 -1
  44. package/js/src/bitso.js +18 -2
  45. package/js/src/bitstamp.d.ts +1 -1
  46. package/js/src/bitstamp.js +24 -2
  47. package/js/src/bitvavo.d.ts +1 -1
  48. package/js/src/bl3p.js +6 -0
  49. package/js/src/blockchaincom.js +21 -0
  50. package/js/src/blofin.d.ts +2 -2
  51. package/js/src/btcalpha.js +9 -0
  52. package/js/src/btcbox.js +9 -0
  53. package/js/src/btcmarkets.js +19 -0
  54. package/js/src/bybit.d.ts +7 -7
  55. package/js/src/cex.d.ts +1 -1
  56. package/js/src/coinbase.d.ts +2 -2
  57. package/js/src/coinbase.js +13 -2
  58. package/js/src/coinex.d.ts +4 -4
  59. package/js/src/coinlist.d.ts +2 -2
  60. package/js/src/coinone.d.ts +1 -1
  61. package/js/src/delta.d.ts +2 -2
  62. package/js/src/deribit.d.ts +3 -3
  63. package/js/src/digifinex.d.ts +3 -3
  64. package/js/src/exmo.d.ts +2 -2
  65. package/js/src/gate.d.ts +6 -6
  66. package/js/src/hitbtc.d.ts +2 -2
  67. package/js/src/hollaex.d.ts +1 -1
  68. package/js/src/htx.d.ts +3 -3
  69. package/js/src/huobijp.d.ts +1 -1
  70. package/js/src/kraken.d.ts +2 -2
  71. package/js/src/krakenfutures.d.ts +2 -2
  72. package/js/src/krakenfutures.js +7 -14
  73. package/js/src/kucoin.d.ts +5 -5
  74. package/js/src/kucoinfutures.d.ts +2 -2
  75. package/js/src/latoken.d.ts +1 -1
  76. package/js/src/lbank.d.ts +2 -2
  77. package/js/src/luno.d.ts +1 -1
  78. package/js/src/luno.js +1 -1
  79. package/js/src/mexc.d.ts +4 -4
  80. package/js/src/ndax.d.ts +1 -1
  81. package/js/src/novadax.d.ts +1 -1
  82. package/js/src/okcoin.d.ts +2 -2
  83. package/js/src/okx.d.ts +7 -7
  84. package/js/src/okx.js +2 -2
  85. package/js/src/paymium.d.ts +2 -2
  86. package/js/src/phemex.d.ts +4 -4
  87. package/js/src/poloniex.d.ts +2 -2
  88. package/js/src/poloniexfutures.d.ts +2 -2
  89. package/js/src/poloniexfutures.js +11 -5
  90. package/js/src/pro/bitmart.d.ts +2 -0
  91. package/js/src/pro/bitmart.js +110 -35
  92. package/js/src/pro/bitvavo.d.ts +1 -1
  93. package/js/src/pro/cex.d.ts +2 -2
  94. package/js/src/pro/coinbase.d.ts +2 -2
  95. package/js/src/pro/coinex.d.ts +1 -1
  96. package/js/src/pro/lbank.d.ts +1 -1
  97. package/js/src/pro/mexc.js +1 -1
  98. package/js/src/probit.d.ts +1 -1
  99. package/js/src/timex.d.ts +1 -1
  100. package/js/src/upbit.d.ts +1 -1
  101. package/js/src/wavesexchange.js +1 -1
  102. package/js/src/whitebit.d.ts +2 -2
  103. package/js/src/woo.d.ts +3 -3
  104. package/js/src/woo.js +1 -1
  105. package/js/src/zonda.d.ts +3 -3
  106. package/package.json +2 -2
@@ -8965,6 +8965,18 @@ class Exchange {
8965
8965
  async setLeverage(leverage, symbol = undefined, params = {}) {
8966
8966
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setLeverage() is not supported yet');
8967
8967
  }
8968
+ async fetchLeverage(symbol, params = {}) {
8969
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchLeverage() is not supported yet');
8970
+ }
8971
+ async setPositionMode(hedged, symbol = undefined, params = {}) {
8972
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setPositionMode() is not supported yet');
8973
+ }
8974
+ async setMarginMode(marginMode, symbol = undefined, params = {}) {
8975
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' setMarginMode() is not supported yet');
8976
+ }
8977
+ async fetchDepositAddressesByNetwork(code, params = {}) {
8978
+ throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchDepositAddressesByNetwork() is not supported yet');
8979
+ }
8968
8980
  async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
8969
8981
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchOpenInterestHistory() is not supported yet');
8970
8982
  }
@@ -10191,11 +10203,11 @@ class Exchange {
10191
10203
  * @param {string|undefined} currencyCode unified currency code, but this argument is not required by default, unless there is an exchange (like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
10192
10204
  * @returns {string|undefined} unified network code
10193
10205
  */
10194
- const networkCodesByIds = this.safeValue(this.options, 'networksById', {});
10206
+ const networkCodesByIds = this.safeDict(this.options, 'networksById', {});
10195
10207
  let networkCode = this.safeString(networkCodesByIds, networkId, networkId);
10196
10208
  // replace mainnet network-codes (i.e. ERC20->ETH)
10197
10209
  if (currencyCode !== undefined) {
10198
- const defaultNetworkCodeReplacements = this.safeValue(this.options, 'defaultNetworkCodeReplacements', {});
10210
+ const defaultNetworkCodeReplacements = this.safeDict(this.options, 'defaultNetworkCodeReplacements', {});
10199
10211
  if (currencyCode in defaultNetworkCodeReplacements) {
10200
10212
  const replacementObject = this.safeDict(defaultNetworkCodeReplacements, currencyCode, {});
10201
10213
  networkCode = this.safeString(replacementObject, networkCode, networkCode);
@@ -23020,7 +23032,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23020
23032
  // "msg": "Quantity greater than max quantity."
23021
23033
  // }
23022
23034
  //
23023
- // createOrder, fetchOpenOrders: portfolio margin linear swap and future
23035
+ // createOrder, fetchOpenOrders, fetchOrder, cancelOrder: portfolio margin linear swap and future
23024
23036
  //
23025
23037
  // {
23026
23038
  // "symbol": "BTCUSDT",
@@ -23043,7 +23055,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23043
23055
  // "status": "NEW"
23044
23056
  // }
23045
23057
  //
23046
- // createOrder, fetchOpenOrders: portfolio margin inverse swap and future
23058
+ // createOrder, fetchOpenOrders, fetchOrder, cancelOrder: portfolio margin inverse swap and future
23047
23059
  //
23048
23060
  // {
23049
23061
  // "symbol": "ETHUSD_PERP",
@@ -23109,7 +23121,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23109
23121
  // "priceProtect": false
23110
23122
  // }
23111
23123
  //
23112
- // createOrder, cancelAllOrders: portfolio margin spot margin
23124
+ // createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
23113
23125
  //
23114
23126
  // {
23115
23127
  // "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
@@ -23128,7 +23140,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23128
23140
  // "type": "LIMIT"
23129
23141
  // }
23130
23142
  //
23131
- // fetchOpenOrders: portfolio margin spot margin
23143
+ // fetchOpenOrders, fetchOrder: portfolio margin spot margin
23132
23144
  //
23133
23145
  // {
23134
23146
  // "symbol": "BTCUSDT",
@@ -23153,6 +23165,31 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23153
23165
  // "preventedQuantity": null
23154
23166
  // }
23155
23167
  //
23168
+ // cancelOrder: portfolio margin linear and inverse swap conditional
23169
+ //
23170
+ // {
23171
+ // "strategyId": 3733211,
23172
+ // "newClientStrategyId": "x-xcKtGhcuaf166172ed504cd1bc0396",
23173
+ // "strategyType": "STOP",
23174
+ // "strategyStatus": "CANCELED",
23175
+ // "origQty": "0.010",
23176
+ // "price": "35000.00",
23177
+ // "reduceOnly": false,
23178
+ // "side": "BUY",
23179
+ // "positionSide": "BOTH",
23180
+ // "stopPrice": "50000.00", // ignored with trailing orders
23181
+ // "symbol": "BTCUSDT",
23182
+ // "timeInForce": "GTC",
23183
+ // "activatePrice": null, // only return with trailing orders
23184
+ // "priceRate": null, // only return with trailing orders
23185
+ // "bookTime": 1707270098774,
23186
+ // "updateTime": 1707270119261,
23187
+ // "workingType": "CONTRACT_PRICE",
23188
+ // "priceProtect": false,
23189
+ // "goodTillDate": 0,
23190
+ // "selfTradePreventionMode": "NONE"
23191
+ // }
23192
+ //
23156
23193
  const code = this.safeString(order, 'code');
23157
23194
  if (code !== undefined) {
23158
23195
  // cancelOrders/createOrders might have a partial success
@@ -23763,9 +23800,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23763
23800
  * @see https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
23764
23801
  * @see https://binance-docs.github.io/apidocs/voptions/en/#query-single-order-trade
23765
23802
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data
23803
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-um-order-user_data
23804
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-cm-order-user_data
23805
+ * @see https://binance-docs.github.io/apidocs/pm/en/#query-margin-account-order-user_data
23806
+ * @param {string} id the order id
23766
23807
  * @param {string} symbol unified symbol of the market the order was made in
23767
23808
  * @param {object} [params] extra parameters specific to the exchange API endpoint
23768
23809
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
23810
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account
23769
23811
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
23770
23812
  */
23771
23813
  if (symbol === undefined) {
@@ -23775,11 +23817,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23775
23817
  const market = this.market(symbol);
23776
23818
  const defaultType = this.safeString2(this.options, 'fetchOrder', 'defaultType', 'spot');
23777
23819
  const type = this.safeString(params, 'type', defaultType);
23778
- const [marginMode, query] = this.handleMarginModeAndParams('fetchOrder', params);
23820
+ let marginMode = undefined;
23821
+ [marginMode, params] = this.handleMarginModeAndParams('fetchOrder', params);
23822
+ let isPortfolioMargin = undefined;
23823
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchOrder', 'papi', 'portfolioMargin', false);
23779
23824
  const request = {
23780
23825
  'symbol': market['id'],
23781
23826
  };
23782
- const clientOrderId = this.safeValue2(params, 'origClientOrderId', 'clientOrderId');
23827
+ const clientOrderId = this.safeString2(params, 'origClientOrderId', 'clientOrderId');
23783
23828
  if (clientOrderId !== undefined) {
23784
23829
  if (market['option']) {
23785
23830
  request['clientOrderId'] = clientOrderId;
@@ -23791,25 +23836,40 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
23791
23836
  else {
23792
23837
  request['orderId'] = id;
23793
23838
  }
23794
- const requestParams = this.omit(query, ['type', 'clientOrderId', 'origClientOrderId']);
23839
+ params = this.omit(params, ['type', 'clientOrderId', 'origClientOrderId']);
23795
23840
  let response = undefined;
23796
23841
  if (market['option']) {
23797
- response = await this.eapiPrivateGetOrder(this.extend(request, requestParams));
23842
+ response = await this.eapiPrivateGetOrder(this.extend(request, params));
23798
23843
  }
23799
23844
  else if (market['linear']) {
23800
- response = await this.fapiPrivateGetOrder(this.extend(request, requestParams));
23845
+ if (isPortfolioMargin) {
23846
+ response = await this.papiGetUmOrder(this.extend(request, params));
23847
+ }
23848
+ else {
23849
+ response = await this.fapiPrivateGetOrder(this.extend(request, params));
23850
+ }
23801
23851
  }
23802
23852
  else if (market['inverse']) {
23803
- response = await this.dapiPrivateGetOrder(this.extend(request, requestParams));
23853
+ if (isPortfolioMargin) {
23854
+ response = await this.papiGetCmOrder(this.extend(request, params));
23855
+ }
23856
+ else {
23857
+ response = await this.dapiPrivateGetOrder(this.extend(request, params));
23858
+ }
23804
23859
  }
23805
- else if (type === 'margin' || marginMode !== undefined) {
23806
- if (marginMode === 'isolated') {
23807
- request['isIsolated'] = true;
23860
+ else if ((type === 'margin') || (marginMode !== undefined) || isPortfolioMargin) {
23861
+ if (isPortfolioMargin) {
23862
+ response = await this.papiGetMarginOrder(this.extend(request, params));
23863
+ }
23864
+ else {
23865
+ if (marginMode === 'isolated') {
23866
+ request['isIsolated'] = true;
23867
+ }
23868
+ response = await this.sapiGetMarginOrder(this.extend(request, params));
23808
23869
  }
23809
- response = await this.sapiGetMarginOrder(this.extend(request, requestParams));
23810
23870
  }
23811
23871
  else {
23812
- response = await this.privateGetOrder(this.extend(request, requestParams));
23872
+ response = await this.privateGetOrder(this.extend(request, params));
23813
23873
  }
23814
23874
  return this.parseOrder(response, market);
23815
23875
  }
@@ -24124,9 +24184,16 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24124
24184
  * @see https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
24125
24185
  * @see https://binance-docs.github.io/apidocs/voptions/en/#cancel-option-order-trade
24126
24186
  * @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade
24187
+ * @see https://binance-docs.github.io/apidocs/pm/en/#cancel-um-order-trade
24188
+ * @see https://binance-docs.github.io/apidocs/pm/en/#cancel-cm-order-trade
24189
+ * @see https://binance-docs.github.io/apidocs/pm/en/#cancel-um-conditional-order-trade
24190
+ * @see https://binance-docs.github.io/apidocs/pm/en/#cancel-cm-conditional-order-trade
24191
+ * @see https://binance-docs.github.io/apidocs/pm/en/#cancel-margin-account-order-trade
24127
24192
  * @param {string} id order id
24128
24193
  * @param {string} symbol unified symbol of the market the order was made in
24129
24194
  * @param {object} [params] extra parameters specific to the exchange API endpoint
24195
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
24196
+ * @param {boolean} [params.stop] set to true if you would like to cancel a portfolio margin account conditional order
24130
24197
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
24131
24198
  */
24132
24199
  if (symbol === undefined) {
@@ -24136,43 +24203,80 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
24136
24203
  const market = this.market(symbol);
24137
24204
  const defaultType = this.safeString2(this.options, 'cancelOrder', 'defaultType', 'spot');
24138
24205
  const type = this.safeString(params, 'type', defaultType);
24139
- const [marginMode, query] = this.handleMarginModeAndParams('cancelOrder', params);
24206
+ let marginMode = undefined;
24207
+ [marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
24208
+ let isPortfolioMargin = undefined;
24209
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'cancelOrder', 'papi', 'portfolioMargin', false);
24210
+ const isConditional = this.safeBool2(params, 'stop', 'conditional');
24140
24211
  const request = {
24141
24212
  'symbol': market['id'],
24142
- // 'orderId': id,
24143
- // 'origClientOrderId': id,
24144
24213
  };
24145
- const clientOrderId = this.safeValue2(params, 'origClientOrderId', 'clientOrderId');
24214
+ const clientOrderId = this.safeStringN(params, ['origClientOrderId', 'clientOrderId', 'newClientStrategyId']);
24146
24215
  if (clientOrderId !== undefined) {
24147
24216
  if (market['option']) {
24148
24217
  request['clientOrderId'] = clientOrderId;
24149
24218
  }
24150
24219
  else {
24151
- request['origClientOrderId'] = clientOrderId;
24220
+ if (isPortfolioMargin && isConditional) {
24221
+ request['newClientStrategyId'] = clientOrderId;
24222
+ }
24223
+ else {
24224
+ request['origClientOrderId'] = clientOrderId;
24225
+ }
24152
24226
  }
24153
24227
  }
24154
24228
  else {
24155
- request['orderId'] = id;
24229
+ if (isPortfolioMargin && isConditional) {
24230
+ request['strategyId'] = id;
24231
+ }
24232
+ else {
24233
+ request['orderId'] = id;
24234
+ }
24156
24235
  }
24157
- const requestParams = this.omit(query, ['type', 'origClientOrderId', 'clientOrderId']);
24236
+ params = this.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'conditional']);
24158
24237
  let response = undefined;
24159
24238
  if (market['option']) {
24160
- response = await this.eapiPrivateDeleteOrder(this.extend(request, requestParams));
24239
+ response = await this.eapiPrivateDeleteOrder(this.extend(request, params));
24161
24240
  }
24162
24241
  else if (market['linear']) {
24163
- response = await this.fapiPrivateDeleteOrder(this.extend(request, requestParams));
24242
+ if (isPortfolioMargin) {
24243
+ if (isConditional) {
24244
+ response = await this.papiDeleteUmConditionalOrder(this.extend(request, params));
24245
+ }
24246
+ else {
24247
+ response = await this.papiDeleteUmOrder(this.extend(request, params));
24248
+ }
24249
+ }
24250
+ else {
24251
+ response = await this.fapiPrivateDeleteOrder(this.extend(request, params));
24252
+ }
24164
24253
  }
24165
24254
  else if (market['inverse']) {
24166
- response = await this.dapiPrivateDeleteOrder(this.extend(request, requestParams));
24255
+ if (isPortfolioMargin) {
24256
+ if (isConditional) {
24257
+ response = await this.papiDeleteCmConditionalOrder(this.extend(request, params));
24258
+ }
24259
+ else {
24260
+ response = await this.papiDeleteCmOrder(this.extend(request, params));
24261
+ }
24262
+ }
24263
+ else {
24264
+ response = await this.dapiPrivateDeleteOrder(this.extend(request, params));
24265
+ }
24167
24266
  }
24168
- else if (type === 'margin' || marginMode !== undefined) {
24169
- if (marginMode === 'isolated') {
24170
- request['isIsolated'] = true;
24267
+ else if ((type === 'margin') || (marginMode !== undefined) || isPortfolioMargin) {
24268
+ if (isPortfolioMargin) {
24269
+ response = await this.papiDeleteMarginOrder(this.extend(request, params));
24270
+ }
24271
+ else {
24272
+ if (marginMode === 'isolated') {
24273
+ request['isIsolated'] = true;
24274
+ }
24275
+ response = await this.sapiDeleteMarginOrder(this.extend(request, params));
24171
24276
  }
24172
- response = await this.sapiDeleteMarginOrder(this.extend(request, requestParams));
24173
24277
  }
24174
24278
  else {
24175
- response = await this.privateDeleteOrder(this.extend(request, requestParams));
24279
+ response = await this.privateDeleteOrder(this.extend(request, params));
24176
24280
  }
24177
24281
  return this.parseOrder(response, market);
24178
24282
  }
@@ -27132,9 +27236,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27132
27236
  * @description set the level of leverage for a market
27133
27237
  * @see https://binance-docs.github.io/apidocs/futures/en/#change-initial-leverage-trade
27134
27238
  * @see https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
27239
+ * @see https://binance-docs.github.io/apidocs/pm/en/#change-um-initial-leverage-trade
27240
+ * @see https://binance-docs.github.io/apidocs/pm/en/#change-cm-initial-leverage-trade
27135
27241
  * @param {float} leverage the rate of leverage
27136
27242
  * @param {string} symbol unified market symbol
27137
27243
  * @param {object} [params] extra parameters specific to the exchange API endpoint
27244
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to set the leverage for a trading pair in a portfolio margin account
27138
27245
  * @returns {object} response from the exchange
27139
27246
  */
27140
27247
  if (symbol === undefined) {
@@ -27151,12 +27258,24 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27151
27258
  'symbol': market['id'],
27152
27259
  'leverage': leverage,
27153
27260
  };
27261
+ let isPortfolioMargin = undefined;
27262
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'setLeverage', 'papi', 'portfolioMargin', false);
27154
27263
  let response = undefined;
27155
27264
  if (market['linear']) {
27156
- response = await this.fapiPrivatePostLeverage(this.extend(request, params));
27265
+ if (isPortfolioMargin) {
27266
+ response = await this.papiPostUmLeverage(this.extend(request, params));
27267
+ }
27268
+ else {
27269
+ response = await this.fapiPrivatePostLeverage(this.extend(request, params));
27270
+ }
27157
27271
  }
27158
27272
  else if (market['inverse']) {
27159
- response = await this.dapiPrivatePostLeverage(this.extend(request, params));
27273
+ if (isPortfolioMargin) {
27274
+ response = await this.papiPostCmLeverage(this.extend(request, params));
27275
+ }
27276
+ else {
27277
+ response = await this.dapiPrivatePostLeverage(this.extend(request, params));
27278
+ }
27160
27279
  }
27161
27280
  else {
27162
27281
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' setLeverage() supports linear and inverse contracts only');
@@ -27238,9 +27357,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27238
27357
  * @description set hedged to true or false for a market
27239
27358
  * @see https://binance-docs.github.io/apidocs/futures/en/#change-position-mode-trade
27240
27359
  * @see https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
27360
+ * @see https://binance-docs.github.io/apidocs/pm/en/#change-um-position-mode-trade
27361
+ * @see https://binance-docs.github.io/apidocs/pm/en/#change-cm-position-mode-trade
27241
27362
  * @param {bool} hedged set to true to use dualSidePosition
27242
27363
  * @param {string} symbol not used by binance setPositionMode ()
27243
27364
  * @param {object} [params] extra parameters specific to the exchange API endpoint
27365
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to set the position mode for a portfolio margin account
27244
27366
  * @returns {object} response from the exchange
27245
27367
  */
27246
27368
  const defaultType = this.safeString(this.options, 'defaultType', 'future');
@@ -27248,6 +27370,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27248
27370
  params = this.omit(params, ['type']);
27249
27371
  let subType = undefined;
27250
27372
  [subType, params] = this.handleSubTypeAndParams('setPositionMode', undefined, params);
27373
+ let isPortfolioMargin = undefined;
27374
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'setPositionMode', 'papi', 'portfolioMargin', false);
27251
27375
  let dualSidePosition = undefined;
27252
27376
  if (hedged) {
27253
27377
  dualSidePosition = 'true';
@@ -27260,11 +27384,20 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27260
27384
  };
27261
27385
  let response = undefined;
27262
27386
  if (this.isInverse(type, subType)) {
27263
- response = await this.dapiPrivatePostPositionSideDual(this.extend(request, params));
27387
+ if (isPortfolioMargin) {
27388
+ response = await this.papiPostCmPositionSideDual(this.extend(request, params));
27389
+ }
27390
+ else {
27391
+ response = await this.dapiPrivatePostPositionSideDual(this.extend(request, params));
27392
+ }
27264
27393
  }
27265
27394
  else {
27266
- // default to future
27267
- response = await this.fapiPrivatePostPositionSideDual(this.extend(request, params));
27395
+ if (isPortfolioMargin) {
27396
+ response = await this.papiPostUmPositionSideDual(this.extend(request, params));
27397
+ }
27398
+ else {
27399
+ response = await this.fapiPrivatePostPositionSideDual(this.extend(request, params));
27400
+ }
27268
27401
  }
27269
27402
  //
27270
27403
  // {
@@ -48170,7 +48303,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48170
48303
  const takeProfit = this.safeValue(params, 'takeProfit');
48171
48304
  const isStopLoss = stopLoss !== undefined;
48172
48305
  const isTakeProfit = takeProfit !== undefined;
48173
- const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', price);
48306
+ const trailingTriggerPrice = this.safeString(params, 'trailingTriggerPrice', this.numberToString(price));
48174
48307
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'newCallbackRatio');
48175
48308
  const isTrailingPercentOrder = trailingPercent !== undefined;
48176
48309
  if (this.sum(isTriggerOrder, isStopLossOrder, isTakeProfitOrder, isTrailingPercentOrder) > 1) {
@@ -65860,6 +65993,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
65860
65993
  * @method
65861
65994
  * @name bitso#fetchMarkets
65862
65995
  * @description retrieves data on all markets for bitso
65996
+ * @see https://docs.bitso.com/bitso-api/docs/list-available-books
65863
65997
  * @param {object} [params] extra parameters specific to the exchange API endpoint
65864
65998
  * @returns {object[]} an array of objects representing market data
65865
65999
  */
@@ -66019,6 +66153,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66019
66153
  * @method
66020
66154
  * @name bitso#fetchBalance
66021
66155
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
66156
+ * @see https://docs.bitso.com/bitso-api/docs/get-account-balance
66022
66157
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66023
66158
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
66024
66159
  */
@@ -66056,6 +66191,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66056
66191
  * @method
66057
66192
  * @name bitso#fetchOrderBook
66058
66193
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
66194
+ * @see https://docs.bitso.com/bitso-api/docs/list-order-book
66059
66195
  * @param {string} symbol unified symbol of the market to fetch the order book for
66060
66196
  * @param {int} [limit] the maximum amount of order book entries to return
66061
66197
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -66120,6 +66256,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66120
66256
  * @method
66121
66257
  * @name bitso#fetchTicker
66122
66258
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
66259
+ * @see https://docs.bitso.com/bitso-api/docs/ticker
66123
66260
  * @param {string} symbol unified symbol of the market to fetch the ticker for
66124
66261
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66125
66262
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -66340,6 +66477,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66340
66477
  * @method
66341
66478
  * @name bitso#fetchTrades
66342
66479
  * @description get the list of most recent trades for a particular symbol
66480
+ * @see https://docs.bitso.com/bitso-api/docs/list-trades
66343
66481
  * @param {string} symbol unified symbol of the market to fetch trades for
66344
66482
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
66345
66483
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -66359,6 +66497,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66359
66497
  * @method
66360
66498
  * @name bitso#fetchTradingFees
66361
66499
  * @description fetch the trading fees for multiple markets
66500
+ * @see https://docs.bitso.com/bitso-api/docs/list-fees
66362
66501
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66363
66502
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
66364
66503
  */
@@ -66430,6 +66569,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66430
66569
  * @method
66431
66570
  * @name bitso#fetchMyTrades
66432
66571
  * @description fetch all trades made by the user
66572
+ * @see https://docs.bitso.com/bitso-api/docs/user-trades
66433
66573
  * @param {string} symbol unified market symbol
66434
66574
  * @param {int} [since] the earliest time in ms to fetch trades for
66435
66575
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -66467,6 +66607,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66467
66607
  * @method
66468
66608
  * @name bitso#createOrder
66469
66609
  * @description create a trade order
66610
+ * @see https://docs.bitso.com/bitso-api/docs/place-an-order
66470
66611
  * @param {string} symbol unified symbol of the market to create an order in
66471
66612
  * @param {string} type 'market' or 'limit'
66472
66613
  * @param {string} side 'buy' or 'sell'
@@ -66498,6 +66639,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66498
66639
  * @method
66499
66640
  * @name bitso#cancelOrder
66500
66641
  * @description cancels an open order
66642
+ * @see https://docs.bitso.com/bitso-api/docs/cancel-an-order
66501
66643
  * @param {string} id order id
66502
66644
  * @param {string} symbol not used by bitso cancelOrder ()
66503
66645
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -66514,6 +66656,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66514
66656
  * @method
66515
66657
  * @name bitso#cancelOrders
66516
66658
  * @description cancel multiple orders
66659
+ * @see https://docs.bitso.com/bitso-api/docs/cancel-an-order
66517
66660
  * @param {string[]} ids order ids
66518
66661
  * @param {string} symbol unified market symbol
66519
66662
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -66550,6 +66693,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66550
66693
  * @method
66551
66694
  * @name bitso#cancelAllOrders
66552
66695
  * @description cancel all open orders
66696
+ * @see https://docs.bitso.com/bitso-api/docs/cancel-an-order
66553
66697
  * @param {undefined} symbol bitso does not support canceling orders for only a specific market
66554
66698
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66555
66699
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -66634,6 +66778,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66634
66778
  * @method
66635
66779
  * @name bitso#fetchOpenOrders
66636
66780
  * @description fetch all unfilled currently open orders
66781
+ * @see https://docs.bitso.com/bitso-api/docs/list-open-orders
66637
66782
  * @param {string} symbol unified market symbol
66638
66783
  * @param {int} [since] the earliest time in ms to fetch open orders for
66639
66784
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -66672,6 +66817,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66672
66817
  * @method
66673
66818
  * @name bitso#fetchOrder
66674
66819
  * @description fetches information on an order made by the user
66820
+ * @see https://docs.bitso.com/bitso-api/docs/look-up-orders
66675
66821
  * @param {string} symbol not used by bitso fetchOrder
66676
66822
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66677
66823
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -66694,6 +66840,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66694
66840
  * @method
66695
66841
  * @name bitso#fetchOrderTrades
66696
66842
  * @description fetch all the trades made from a single order
66843
+ * @see https://docs.bitso.com/bitso-api/docs/list-user-trades
66697
66844
  * @param {string} id order id
66698
66845
  * @param {string} symbol unified market symbol
66699
66846
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -66714,6 +66861,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66714
66861
  * @method
66715
66862
  * @name bitso#fetchDeposit
66716
66863
  * @description fetch information on a deposit
66864
+ * @see https://docs.bitso.com/bitso-payouts-funding/docs/fundings
66717
66865
  * @param {string} id deposit id
66718
66866
  * @param {string} code bitso does not support filtering by currency code and will ignore this argument
66719
66867
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -66756,6 +66904,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66756
66904
  * @method
66757
66905
  * @name bitso#fetchDeposits
66758
66906
  * @description fetch all deposits made to an account
66907
+ * @see https://docs.bitso.com/bitso-payouts-funding/docs/fundings
66759
66908
  * @param {string} code unified currency code
66760
66909
  * @param {int} [since] the earliest time in ms to fetch deposits for
66761
66910
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -66831,7 +66980,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66831
66980
  * @name bitso#fetchTransactionFees
66832
66981
  * @deprecated
66833
66982
  * @description please use fetchDepositWithdrawFees instead
66834
- * @see https://bitso.com/api_info#fees
66983
+ * @see https://docs.bitso.com/bitso-api/docs/list-fees
66835
66984
  * @param {string[]|undefined} codes list of unified currency codes
66836
66985
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66837
66986
  * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -66924,7 +67073,7 @@ class bitso extends _abstract_bitso_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
66924
67073
  * @method
66925
67074
  * @name bitso#fetchDepositWithdrawFees
66926
67075
  * @description fetch deposit and withdraw fees
66927
- * @see https://bitso.com/api_info#fees
67076
+ * @see https://docs.bitso.com/bitso-api/docs/list-fees
66928
67077
  * @param {string[]|undefined} codes list of unified currency codes
66929
67078
  * @param {object} [params] extra parameters specific to the exchange API endpoint
66930
67079
  * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -67731,6 +67880,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
67731
67880
  * @method
67732
67881
  * @name bitstamp#fetchMarkets
67733
67882
  * @description retrieves data on all markets for bitstamp
67883
+ * @see https://www.bitstamp.net/api/#tag/Market-info/operation/GetTradingPairsInfo
67734
67884
  * @param {object} [params] extra parameters specific to the exchange API endpoint
67735
67885
  * @returns {object[]} an array of objects representing market data
67736
67886
  */
@@ -67874,6 +68024,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
67874
68024
  * @method
67875
68025
  * @name bitstamp#fetchCurrencies
67876
68026
  * @description fetches all available currencies on an exchange
68027
+ * @see https://www.bitstamp.net/api/#tag/Market-info/operation/GetTradingPairsInfo
67877
68028
  * @param {object} [params] extra parameters specific to the exchange API endpoint
67878
68029
  * @returns {object} an associative dictionary of currencies
67879
68030
  */
@@ -67922,6 +68073,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
67922
68073
  * @method
67923
68074
  * @name bitstamp#fetchOrderBook
67924
68075
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
68076
+ * @see https://www.bitstamp.net/api/#tag/Order-book/operation/GetOrderBook
67925
68077
  * @param {string} symbol unified symbol of the market to fetch the order book for
67926
68078
  * @param {int} [limit] the maximum amount of order book entries to return
67927
68079
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -68007,6 +68159,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68007
68159
  * @method
68008
68160
  * @name bitstamp#fetchTicker
68009
68161
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
68162
+ * @see https://www.bitstamp.net/api/#tag/Tickers/operation/GetMarketTicker
68010
68163
  * @param {string} symbol unified symbol of the market to fetch the ticker for
68011
68164
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68012
68165
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -68039,7 +68192,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68039
68192
  * @method
68040
68193
  * @name bitstamp#fetchTickers
68041
68194
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
68042
- * @see https://www.bitstamp.net/api/#all-tickers
68195
+ * @see https://www.bitstamp.net/api/#tag/Tickers/operation/GetCurrencyPairTickers
68043
68196
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
68044
68197
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68045
68198
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -68269,6 +68422,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68269
68422
  * @method
68270
68423
  * @name bitstamp#fetchTrades
68271
68424
  * @description get the list of most recent trades for a particular symbol
68425
+ * @see https://www.bitstamp.net/api/#tag/Transactions-public/operation/GetTransactions
68272
68426
  * @param {string} symbol unified symbol of the market to fetch trades for
68273
68427
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
68274
68428
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -68403,6 +68557,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68403
68557
  * @method
68404
68558
  * @name bitstamp#fetchBalance
68405
68559
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
68560
+ * @see https://www.bitstamp.net/api/#tag/Account-balances/operation/GetAccountBalances
68406
68561
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68407
68562
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
68408
68563
  */
@@ -68433,6 +68588,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68433
68588
  * @method
68434
68589
  * @name bitstamp#fetchTradingFee
68435
68590
  * @description fetch the trading fees for a market
68591
+ * @see https://www.bitstamp.net/api/#tag/Fees/operation/GetAllTradingFees
68436
68592
  * @param {string} symbol unified market symbol
68437
68593
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68438
68594
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -68473,6 +68629,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68473
68629
  * @method
68474
68630
  * @name bitstamp#fetchTradingFees
68475
68631
  * @description fetch the trading fees for multiple markets
68632
+ * @see https://www.bitstamp.net/api/#tag/Fees/operation/GetAllTradingFees
68476
68633
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68477
68634
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
68478
68635
  */
@@ -68548,7 +68705,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68548
68705
  * @method
68549
68706
  * @name bitstamp#fetchDepositWithdrawFees
68550
68707
  * @description fetch deposit and withdraw fees
68551
- * @see https://www.bitstamp.net/api/#balance
68708
+ * @see https://www.bitstamp.net/api/#tag/Fees/operation/GetAllWithdrawalFees
68552
68709
  * @param {string[]|undefined} codes list of unified currency codes
68553
68710
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68554
68711
  * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
@@ -68681,6 +68838,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68681
68838
  * @method
68682
68839
  * @name bitstamp#cancelOrder
68683
68840
  * @description cancels an open order
68841
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/CancelOrder
68684
68842
  * @param {string} id order id
68685
68843
  * @param {string} symbol unified symbol of the market the order was made in
68686
68844
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -68697,6 +68855,8 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68697
68855
  * @method
68698
68856
  * @name bitstamp#cancelAllOrders
68699
68857
  * @description cancel all open orders
68858
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/CancelAllOrders
68859
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/CancelOrdersForMarket
68700
68860
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
68701
68861
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68702
68862
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -68743,6 +68903,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68743
68903
  * @method
68744
68904
  * @name bitstamp#fetchOrder
68745
68905
  * @description fetches information on an order made by the user
68906
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/GetOrderStatus
68746
68907
  * @param {string} symbol unified symbol of the market the order was made in
68747
68908
  * @param {object} [params] extra parameters specific to the exchange API endpoint
68748
68909
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -68787,6 +68948,8 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68787
68948
  * @method
68788
68949
  * @name bitstamp#fetchMyTrades
68789
68950
  * @description fetch all trades made by the user
68951
+ * @see https://www.bitstamp.net/api/#tag/Transactions-private/operation/GetUserTransactions
68952
+ * @see https://www.bitstamp.net/api/#tag/Transactions-private/operation/GetUserTransactionsForMarket
68790
68953
  * @param {string} symbol unified market symbol
68791
68954
  * @param {int} [since] the earliest time in ms to fetch trades for
68792
68955
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -68814,6 +68977,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68814
68977
  * @method
68815
68978
  * @name bitstamp#fetchDepositsWithdrawals
68816
68979
  * @description fetch history of deposits and withdrawals
68980
+ * @see https://www.bitstamp.net/api/#tag/Transactions-private/operation/GetUserTransactions
68817
68981
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
68818
68982
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
68819
68983
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -68864,6 +69028,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
68864
69028
  * @method
68865
69029
  * @name bitstamp#fetchWithdrawals
68866
69030
  * @description fetch all withdrawals made from an account
69031
+ * @see https://www.bitstamp.net/api/#tag/Withdrawals/operation/GetWithdrawalRequests
68867
69032
  * @param {string} code unified currency code
68868
69033
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
68869
69034
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -69232,6 +69397,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69232
69397
  * @method
69233
69398
  * @name bitstamp#fetchLedger
69234
69399
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
69400
+ * @see https://www.bitstamp.net/api/#tag/Transactions-private/operation/GetUserTransactions
69235
69401
  * @param {string} code unified currency code, default is undefined
69236
69402
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
69237
69403
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -69255,6 +69421,8 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69255
69421
  * @method
69256
69422
  * @name bitstamp#fetchOpenOrders
69257
69423
  * @description fetch all unfilled currently open orders
69424
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/GetAllOpenOrders
69425
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/GetOpenOrdersForMarket
69258
69426
  * @param {string} symbol unified market symbol
69259
69427
  * @param {int} [since] the earliest time in ms to fetch open orders for
69260
69428
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -69302,6 +69470,7 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69302
69470
  * @method
69303
69471
  * @name bitstamp#fetchDepositAddress
69304
69472
  * @description fetch the deposit address for a currency associated with this account
69473
+ * @see https://www.bitstamp.net/api/#tag/Deposits/operation/GetCryptoDepositAddress
69305
69474
  * @param {string} code unified currency code
69306
69475
  * @param {object} [params] extra parameters specific to the exchange API endpoint
69307
69476
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -69328,6 +69497,8 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69328
69497
  * @method
69329
69498
  * @name bitstamp#withdraw
69330
69499
  * @description make a withdrawal
69500
+ * @see https://www.bitstamp.net/api/#tag/Withdrawals/operation/RequestFiatWithdrawal
69501
+ * @see https://www.bitstamp.net/api/#tag/Withdrawals/operation/RequestCryptoWithdrawal
69331
69502
  * @param {string} code unified currency code
69332
69503
  * @param {float} amount the amount to withdraw
69333
69504
  * @param {string} address the address to withdraw to
@@ -74019,6 +74190,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74019
74190
  * @method
74020
74191
  * @name bl3p#fetchBalance
74021
74192
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
74193
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#35---get-account-info--balance
74022
74194
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74023
74195
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
74024
74196
  */
@@ -74039,6 +74211,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74039
74211
  * @method
74040
74212
  * @name bl3p#fetchOrderBook
74041
74213
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
74214
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#22---orderbook
74042
74215
  * @param {string} symbol unified symbol of the market to fetch the order book for
74043
74216
  * @param {int} [limit] the maximum amount of order book entries to return
74044
74217
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -74100,6 +74273,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74100
74273
  * @method
74101
74274
  * @name bl3p#fetchTicker
74102
74275
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
74276
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#21---ticker
74103
74277
  * @param {string} symbol unified symbol of the market to fetch the ticker for
74104
74278
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74105
74279
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -74163,6 +74337,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74163
74337
  * @method
74164
74338
  * @name bl3p#fetchTrades
74165
74339
  * @description get the list of most recent trades for a particular symbol
74340
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/public_api/http.md#23---last-1000-trades
74166
74341
  * @param {string} symbol unified symbol of the market to fetch trades for
74167
74342
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
74168
74343
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -74195,6 +74370,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74195
74370
  * @method
74196
74371
  * @name bl3p#fetchTradingFees
74197
74372
  * @description fetch the trading fees for multiple markets
74373
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#35---get-account-info--balance
74198
74374
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74199
74375
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
74200
74376
  */
@@ -74287,6 +74463,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
74287
74463
  * @method
74288
74464
  * @name bl3p#cancelOrder
74289
74465
  * @description cancels an open order
74466
+ * @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#22---cancel-an-order
74290
74467
  * @param {string} id order id
74291
74468
  * @param {string} symbol unified symbol of the market the order was made in
74292
74469
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -74562,6 +74739,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74562
74739
  * @method
74563
74740
  * @name blockchaincom#fetchMarkets
74564
74741
  * @description retrieves data on all markets for blockchaincom
74742
+ * @see https://api.blockchain.com/v3/#/unauthenticated/getSymbols
74565
74743
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74566
74744
  * @returns {object[]} an array of objects representing market data
74567
74745
  */
@@ -74692,6 +74870,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74692
74870
  * @method
74693
74871
  * @name blockchaincom#fetchOrderBook
74694
74872
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
74873
+ * @see https://api.blockchain.com/v3/#/unauthenticated/getL3OrderBook
74695
74874
  * @param {string} symbol unified symbol of the market to fetch the order book for
74696
74875
  * @param {int} [limit] the maximum amount of order book entries to return
74697
74876
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -74704,6 +74883,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74704
74883
  * @method
74705
74884
  * @name blockchaincom#fetchL3OrderBook
74706
74885
  * @description fetches level 3 information on open orders with bid (buy) and ask (sell) prices, volumes and other data
74886
+ * @see https://api.blockchain.com/v3/#/unauthenticated/getL3OrderBook
74707
74887
  * @param {string} symbol unified market symbol
74708
74888
  * @param {int} [limit] max number of orders to return, default is undefined
74709
74889
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -74774,6 +74954,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74774
74954
  * @method
74775
74955
  * @name blockchaincom#fetchTicker
74776
74956
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
74957
+ * @see https://api.blockchain.com/v3/#/unauthenticated/getTickerBySymbol
74777
74958
  * @param {string} symbol unified symbol of the market to fetch the ticker for
74778
74959
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74779
74960
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -74791,6 +74972,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74791
74972
  * @method
74792
74973
  * @name blockchaincom#fetchTickers
74793
74974
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
74975
+ * @see https://api.blockchain.com/v3/#/unauthenticated/getTickers
74794
74976
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
74795
74977
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74796
74978
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -74871,6 +75053,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74871
75053
  * @method
74872
75054
  * @name blockchaincom#createOrder
74873
75055
  * @description create a trade order
75056
+ * @see https://api.blockchain.com/v3/#/trading/createOrder
74874
75057
  * @param {string} symbol unified symbol of the market to create an order in
74875
75058
  * @param {string} type 'market' or 'limit'
74876
75059
  * @param {string} side 'buy' or 'sell'
@@ -74933,6 +75116,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74933
75116
  * @method
74934
75117
  * @name blockchaincom#cancelOrder
74935
75118
  * @description cancels an open order
75119
+ * @see https://api.blockchain.com/v3/#/trading/deleteOrder
74936
75120
  * @param {string} id order id
74937
75121
  * @param {string} symbol unified symbol of the market the order was made in
74938
75122
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -74952,6 +75136,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74952
75136
  * @method
74953
75137
  * @name blockchaincom#cancelAllOrders
74954
75138
  * @description cancel all open orders
75139
+ * @see https://api.blockchain.com/v3/#/trading/deleteAllOrders
74955
75140
  * @param {string} symbol unified market symbol of the market to cancel orders in, all markets are used if undefined, default is undefined
74956
75141
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74957
75142
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -74977,6 +75162,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
74977
75162
  * @method
74978
75163
  * @name blockchaincom#fetchTradingFees
74979
75164
  * @description fetch the trading fees for multiple markets
75165
+ * @see https://api.blockchain.com/v3/#/trading/getFees
74980
75166
  * @param {object} [params] extra parameters specific to the exchange API endpoint
74981
75167
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
74982
75168
  */
@@ -75008,6 +75194,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75008
75194
  * @method
75009
75195
  * @name blockchaincom#fetchCanceledOrders
75010
75196
  * @description fetches information on multiple canceled orders made by the user
75197
+ * @see https://api.blockchain.com/v3/#/trading/getOrders
75011
75198
  * @param {string} symbol unified market symbol of the market orders were made in
75012
75199
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
75013
75200
  * @param {int} [limit] max number of orders to return, default is undefined
@@ -75022,6 +75209,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75022
75209
  * @method
75023
75210
  * @name blockchaincom#fetchClosedOrders
75024
75211
  * @description fetches information on multiple closed orders made by the user
75212
+ * @see https://api.blockchain.com/v3/#/trading/getOrders
75025
75213
  * @param {string} symbol unified market symbol of the market orders were made in
75026
75214
  * @param {int} [since] the earliest time in ms to fetch orders for
75027
75215
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -75036,6 +75224,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75036
75224
  * @method
75037
75225
  * @name blockchaincom#fetchOpenOrders
75038
75226
  * @description fetch all unfilled currently open orders
75227
+ * @see https://api.blockchain.com/v3/#/trading/getOrders
75039
75228
  * @param {string} symbol unified market symbol
75040
75229
  * @param {int} [since] the earliest time in ms to fetch open orders for
75041
75230
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -75112,6 +75301,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75112
75301
  * @method
75113
75302
  * @name blockchaincom#fetchMyTrades
75114
75303
  * @description fetch all trades made by the user
75304
+ * @see https://api.blockchain.com/v3/#/trading/getFills
75115
75305
  * @param {string} symbol unified market symbol
75116
75306
  * @param {int} [since] the earliest time in ms to fetch trades for
75117
75307
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -75136,6 +75326,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75136
75326
  * @method
75137
75327
  * @name blockchaincom#fetchDepositAddress
75138
75328
  * @description fetch the deposit address for a currency associated with this account
75329
+ * @see https://api.blockchain.com/v3/#/payments/getDepositAddress
75139
75330
  * @param {string} code unified currency code
75140
75331
  * @param {object} [params] extra parameters specific to the exchange API endpoint
75141
75332
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -75249,6 +75440,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75249
75440
  * @method
75250
75441
  * @name blockchaincom#withdraw
75251
75442
  * @description make a withdrawal
75443
+ * @see https://api.blockchain.com/v3/#/payments/createWithdrawal
75252
75444
  * @param {string} code unified currency code
75253
75445
  * @param {float} amount the amount to withdraw
75254
75446
  * @param {string} address the address to withdraw to
@@ -75283,6 +75475,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75283
75475
  * @method
75284
75476
  * @name blockchaincom#fetchWithdrawals
75285
75477
  * @description fetch all withdrawals made from an account
75478
+ * @see https://api.blockchain.com/v3/#/payments/getWithdrawals
75286
75479
  * @param {string} code unified currency code
75287
75480
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
75288
75481
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -75309,6 +75502,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75309
75502
  * @method
75310
75503
  * @name blockchaincom#fetchWithdrawal
75311
75504
  * @description fetch data on a currency withdrawal via the withdrawal id
75505
+ * @see https://api.blockchain.com/v3/#/payments/getWithdrawalById
75312
75506
  * @param {string} id withdrawal id
75313
75507
  * @param {string} code not used by blockchaincom.fetchWithdrawal
75314
75508
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -75326,6 +75520,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75326
75520
  * @method
75327
75521
  * @name blockchaincom#fetchDeposits
75328
75522
  * @description fetch all deposits made to an account
75523
+ * @see https://api.blockchain.com/v3/#/payments/getDeposits
75329
75524
  * @param {string} code unified currency code
75330
75525
  * @param {int} [since] the earliest time in ms to fetch deposits for
75331
75526
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -75352,6 +75547,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75352
75547
  * @method
75353
75548
  * @name blockchaincom#fetchDeposit
75354
75549
  * @description fetch information on a deposit
75550
+ * @see https://api.blockchain.com/v3/#/payments/getDepositById
75355
75551
  * @param {string} id deposit id
75356
75552
  * @param {string} code not used by blockchaincom fetchDeposit ()
75357
75553
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -75370,6 +75566,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75370
75566
  * @method
75371
75567
  * @name blockchaincom#fetchBalance
75372
75568
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
75569
+ * @see https://api.blockchain.com/v3/#/payments/getAccounts
75373
75570
  * @param {object} [params] extra parameters specific to the exchange API endpoint
75374
75571
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
75375
75572
  */
@@ -75416,6 +75613,7 @@ class blockchaincom extends _abstract_blockchaincom_js__WEBPACK_IMPORTED_MODULE_
75416
75613
  * @method
75417
75614
  * @name blockchaincom#fetchOrder
75418
75615
  * @description fetches information on an order made by the user
75616
+ * @see https://api.blockchain.com/v3/#/trading/getOrderById
75419
75617
  * @param {string} symbol not used by blockchaincom fetchOrder
75420
75618
  * @param {object} [params] extra parameters specific to the exchange API endpoint
75421
75619
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -77774,6 +77972,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
77774
77972
  * @method
77775
77973
  * @name btcalpha#fetchMarkets
77776
77974
  * @description retrieves data on all markets for btcalpha
77975
+ * @see https://btc-alpha.github.io/api-docs/#list-all-currencies
77777
77976
  * @param {object} [params] extra parameters specific to the exchange API endpoint
77778
77977
  * @returns {object[]} an array of objects representing market data
77779
77978
  */
@@ -78044,6 +78243,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78044
78243
  * @method
78045
78244
  * @name btcalpha#fetchTrades
78046
78245
  * @description get the list of most recent trades for a particular symbol
78246
+ * @see https://btc-alpha.github.io/api-docs/#list-all-exchanges
78047
78247
  * @param {string} symbol unified symbol of the market to fetch trades for
78048
78248
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
78049
78249
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -78068,6 +78268,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78068
78268
  * @method
78069
78269
  * @name btcalpha#fetchDeposits
78070
78270
  * @description fetch all deposits made to an account
78271
+ * @see https://btc-alpha.github.io/api-docs/#list-own-deposits
78071
78272
  * @param {string} code unified currency code
78072
78273
  * @param {int} [since] the earliest time in ms to fetch deposits for
78073
78274
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -78097,6 +78298,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78097
78298
  * @method
78098
78299
  * @name btcalpha#fetchWithdrawals
78099
78300
  * @description fetch all withdrawals made from an account
78301
+ * @see https://btc-alpha.github.io/api-docs/#list-own-made-withdraws
78100
78302
  * @param {string} code unified currency code
78101
78303
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
78102
78304
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -78204,6 +78406,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78204
78406
  * @method
78205
78407
  * @name btcalpha#fetchOHLCV
78206
78408
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
78409
+ * @see https://btc-alpha.github.io/api-docs/#charts
78207
78410
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
78208
78411
  * @param {string} timeframe the length of time each candle represents
78209
78412
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -78251,6 +78454,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78251
78454
  * @method
78252
78455
  * @name btcalpha#fetchBalance
78253
78456
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
78457
+ * @see https://btc-alpha.github.io/api-docs/#list-own-wallets
78254
78458
  * @param {object} [params] extra parameters specific to the exchange API endpoint
78255
78459
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
78256
78460
  */
@@ -78438,6 +78642,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78438
78642
  * @method
78439
78643
  * @name btcalpha#fetchOpenOrders
78440
78644
  * @description fetch all unfilled currently open orders
78645
+ * @see https://btc-alpha.github.io/api-docs/#list-own-orders
78441
78646
  * @param {string} symbol unified market symbol
78442
78647
  * @param {int} [since] the earliest time in ms to fetch open orders for
78443
78648
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -78454,6 +78659,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78454
78659
  * @method
78455
78660
  * @name btcalpha#fetchClosedOrders
78456
78661
  * @description fetches information on multiple closed orders made by the user
78662
+ * @see https://btc-alpha.github.io/api-docs/#list-own-orders
78457
78663
  * @param {string} symbol unified market symbol of the market orders were made in
78458
78664
  * @param {int} [since] the earliest time in ms to fetch orders for
78459
78665
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -78470,6 +78676,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
78470
78676
  * @method
78471
78677
  * @name btcalpha#fetchMyTrades
78472
78678
  * @description fetch all trades made by the user
78679
+ * @see https://btc-alpha.github.io/api-docs/#list-own-exchanges
78473
78680
  * @param {string} symbol unified market symbol
78474
78681
  * @param {int} [since] the earliest time in ms to fetch trades for
78475
78682
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -78706,6 +78913,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78706
78913
  * @method
78707
78914
  * @name btcbox#fetchBalance
78708
78915
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
78916
+ * @see https://blog.btcbox.jp/en/archives/8762#toc13
78709
78917
  * @param {object} [params] extra parameters specific to the exchange API endpoint
78710
78918
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
78711
78919
  */
@@ -78718,6 +78926,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78718
78926
  * @method
78719
78927
  * @name btcbox#fetchOrderBook
78720
78928
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
78929
+ * @see https://blog.btcbox.jp/en/archives/8762#toc6
78721
78930
  * @param {string} symbol unified symbol of the market to fetch the order book for
78722
78931
  * @param {int} [limit] the maximum amount of order book entries to return
78723
78932
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -78764,6 +78973,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78764
78973
  * @method
78765
78974
  * @name btcbox#fetchTicker
78766
78975
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
78976
+ * @see https://blog.btcbox.jp/en/archives/8762#toc5
78767
78977
  * @param {string} symbol unified symbol of the market to fetch the ticker for
78768
78978
  * @param {object} [params] extra parameters specific to the exchange API endpoint
78769
78979
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -78818,6 +79028,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78818
79028
  * @method
78819
79029
  * @name btcbox#fetchTrades
78820
79030
  * @description get the list of most recent trades for a particular symbol
79031
+ * @see https://blog.btcbox.jp/en/archives/8762#toc7
78821
79032
  * @param {string} symbol unified symbol of the market to fetch trades for
78822
79033
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
78823
79034
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -78850,6 +79061,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78850
79061
  * @method
78851
79062
  * @name btcbox#createOrder
78852
79063
  * @description create a trade order
79064
+ * @see https://blog.btcbox.jp/en/archives/8762#toc18
78853
79065
  * @param {string} symbol unified symbol of the market to create an order in
78854
79066
  * @param {string} type 'market' or 'limit'
78855
79067
  * @param {string} side 'buy' or 'sell'
@@ -78880,6 +79092,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78880
79092
  * @method
78881
79093
  * @name btcbox#cancelOrder
78882
79094
  * @description cancels an open order
79095
+ * @see https://blog.btcbox.jp/en/archives/8762#toc17
78883
79096
  * @param {string} id order id
78884
79097
  * @param {string} symbol unified symbol of the market the order was made in
78885
79098
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -78975,6 +79188,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78975
79188
  * @method
78976
79189
  * @name btcbox#fetchOrder
78977
79190
  * @description fetches information on an order made by the user
79191
+ * @see https://blog.btcbox.jp/en/archives/8762#toc16
78978
79192
  * @param {string} symbol unified symbol of the market the order was made in
78979
79193
  * @param {object} [params] extra parameters specific to the exchange API endpoint
78980
79194
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -79043,6 +79257,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
79043
79257
  * @method
79044
79258
  * @name btcbox#fetchOrders
79045
79259
  * @description fetches information on multiple orders made by the user
79260
+ * @see https://blog.btcbox.jp/en/archives/8762#toc15
79046
79261
  * @param {string} symbol unified market symbol of the market orders were made in
79047
79262
  * @param {int} [since] the earliest time in ms to fetch orders for
79048
79263
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -79056,6 +79271,7 @@ class btcbox extends _abstract_btcbox_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
79056
79271
  * @method
79057
79272
  * @name btcbox#fetchOpenOrders
79058
79273
  * @description fetch all unfilled currently open orders
79274
+ * @see https://blog.btcbox.jp/en/archives/8762#toc15
79059
79275
  * @param {string} symbol unified market symbol
79060
79276
  * @param {int} [since] the earliest time in ms to fetch open orders for
79061
79277
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -79329,6 +79545,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79329
79545
  * @method
79330
79546
  * @name btcmarkets#fetchDepositsWithdrawals
79331
79547
  * @description fetch history of deposits and withdrawals
79548
+ * @see https://docs.btcmarkets.net/v3/#tag/Fund-Management-APIs/paths/~1v3~1transfers/get
79332
79549
  * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
79333
79550
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
79334
79551
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -79342,6 +79559,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79342
79559
  * @method
79343
79560
  * @name btcmarkets#fetchDeposits
79344
79561
  * @description fetch all deposits made to an account
79562
+ * @see https://docs.btcmarkets.net/v3/#tag/Fund-Management-APIs/paths/~1v3~1deposits/get
79345
79563
  * @param {string} code unified currency code
79346
79564
  * @param {int} [since] the earliest time in ms to fetch deposits for
79347
79565
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -79355,6 +79573,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79355
79573
  * @method
79356
79574
  * @name btcmarkets#fetchWithdrawals
79357
79575
  * @description fetch all withdrawals made from an account
79576
+ * @see https://docs.btcmarkets.net/v3/#tag/Fund-Management-APIs/paths/~1v3~1withdrawals/get
79358
79577
  * @param {string} code unified currency code
79359
79578
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
79360
79579
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -79488,6 +79707,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79488
79707
  * @method
79489
79708
  * @name btcmarkets#fetchMarkets
79490
79709
  * @description retrieves data on all markets for btcmarkets
79710
+ * @see https://docs.btcmarkets.net/v3/#tag/Market-Data-APIs/paths/~1v3~1markets/get
79491
79711
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79492
79712
  * @returns {object[]} an array of objects representing market data
79493
79713
  */
@@ -79579,6 +79799,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79579
79799
  * @method
79580
79800
  * @name btcmarkets#fetchTime
79581
79801
  * @description fetches the current integer timestamp in milliseconds from the exchange server
79802
+ * @see https://docs.btcmarkets.net/v3/#tag/Misc-APIs/paths/~1v3~1time/get
79582
79803
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79583
79804
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
79584
79805
  */
@@ -79608,6 +79829,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79608
79829
  * @method
79609
79830
  * @name btcmarkets#fetchBalance
79610
79831
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
79832
+ * @see https://docs.btcmarkets.net/v3/#tag/Account-APIs/paths/~1v3~1accounts~1me~1balances/get
79611
79833
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79612
79834
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
79613
79835
  */
@@ -79640,6 +79862,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79640
79862
  * @method
79641
79863
  * @name btcmarkets#fetchOHLCV
79642
79864
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
79865
+ * @see https://docs.btcmarkets.net/v3/#tag/Market-Data-APIs/paths/~1v3~1markets~1{marketId}~1candles/get
79643
79866
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
79644
79867
  * @param {string} timeframe the length of time each candle represents
79645
79868
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -79679,6 +79902,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79679
79902
  * @method
79680
79903
  * @name btcmarkets#fetchOrderBook
79681
79904
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
79905
+ * @see https://docs.btcmarkets.net/v3/#tag/Market-Data-APIs/paths/~1v3~1markets~1{marketId}~1orderbook/get
79682
79906
  * @param {string} symbol unified symbol of the market to fetch the order book for
79683
79907
  * @param {int} [limit] the maximum amount of order book entries to return
79684
79908
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -79766,6 +79990,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79766
79990
  * @method
79767
79991
  * @name btcmarkets#fetchTicker
79768
79992
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
79993
+ * @see https://docs.btcmarkets.net/v3/#tag/Market-Data-APIs/paths/~1v3~1markets~1{marketId}~1ticker/get
79769
79994
  * @param {string} symbol unified symbol of the market to fetch the ticker for
79770
79995
  * @param {object} [params] extra parameters specific to the exchange API endpoint
79771
79996
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -79874,6 +80099,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79874
80099
  * @method
79875
80100
  * @name btcmarkets#fetchTrades
79876
80101
  * @description get the list of most recent trades for a particular symbol
80102
+ * @see https://docs.btcmarkets.net/v3/#tag/Market-Data-APIs/paths/~1v3~1markets~1{marketId}~1trades/get
79877
80103
  * @param {string} symbol unified symbol of the market to fetch trades for
79878
80104
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
79879
80105
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -79901,6 +80127,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
79901
80127
  * @method
79902
80128
  * @name btcmarkets#createOrder
79903
80129
  * @description create a trade order
80130
+ * @see https://docs.btcmarkets.net/v3/#tag/Order-Placement-APIs/paths/~1v3~1orders/post
79904
80131
  * @param {string} symbol unified symbol of the market to create an order in
79905
80132
  * @param {string} type 'market' or 'limit'
79906
80133
  * @param {string} side 'buy' or 'sell'
@@ -80001,6 +80228,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80001
80228
  * @method
80002
80229
  * @name btcmarkets#cancelOrders
80003
80230
  * @description cancel multiple orders
80231
+ * @see https://docs.btcmarkets.net/v3/#tag/Batch-Order-APIs/paths/~1v3~1batchorders~1{ids}/delete
80004
80232
  * @param {string[]} ids order ids
80005
80233
  * @param {string} symbol not used by btcmarkets cancelOrders ()
80006
80234
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -80020,6 +80248,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80020
80248
  * @method
80021
80249
  * @name btcmarkets#cancelOrder
80022
80250
  * @description cancels an open order
80251
+ * @see https://docs.btcmarkets.net/v3/#operation/cancelOrder
80023
80252
  * @param {string} id order id
80024
80253
  * @param {string} symbol not used by btcmarket cancelOrder ()
80025
80254
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -80139,6 +80368,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80139
80368
  * @method
80140
80369
  * @name btcmarkets#fetchOrder
80141
80370
  * @description fetches information on an order made by the user
80371
+ * @see https://docs.btcmarkets.net/v3/#operation/getOrderById
80142
80372
  * @param {string} symbol not used by btcmarkets fetchOrder
80143
80373
  * @param {object} [params] extra parameters specific to the exchange API endpoint
80144
80374
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -80155,6 +80385,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80155
80385
  * @method
80156
80386
  * @name btcmarkets#fetchOrders
80157
80387
  * @description fetches information on multiple orders made by the user
80388
+ * @see https://docs.btcmarkets.net/v3/#operation/listOrders
80158
80389
  * @param {string} symbol unified market symbol of the market orders were made in
80159
80390
  * @param {int} [since] the earliest time in ms to fetch orders for
80160
80391
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -80184,6 +80415,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80184
80415
  * @method
80185
80416
  * @name btcmarkets#fetchOpenOrders
80186
80417
  * @description fetch all unfilled currently open orders
80418
+ * @see https://docs.btcmarkets.net/v3/#operation/listOrders
80187
80419
  * @param {string} symbol unified market symbol
80188
80420
  * @param {int} [since] the earliest time in ms to fetch open orders for
80189
80421
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -80198,6 +80430,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80198
80430
  * @method
80199
80431
  * @name btcmarkets#fetchClosedOrders
80200
80432
  * @description fetches information on multiple closed orders made by the user
80433
+ * @see https://docs.btcmarkets.net/v3/#operation/listOrders
80201
80434
  * @param {string} symbol unified market symbol of the market orders were made in
80202
80435
  * @param {int} [since] the earliest time in ms to fetch orders for
80203
80436
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -80212,6 +80445,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80212
80445
  * @method
80213
80446
  * @name btcmarkets#fetchMyTrades
80214
80447
  * @description fetch all trades made by the user
80448
+ * @see https://docs.btcmarkets.net/v3/#operation/getTrades
80215
80449
  * @param {string} symbol unified market symbol
80216
80450
  * @param {int} [since] the earliest time in ms to fetch trades for
80217
80451
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -80266,6 +80500,7 @@ class btcmarkets extends _abstract_btcmarkets_js__WEBPACK_IMPORTED_MODULE_0__/*
80266
80500
  * @method
80267
80501
  * @name btcmarkets#withdraw
80268
80502
  * @description make a withdrawal
80503
+ * @see https://docs.btcmarkets.net/v3/#tag/Fund-Management-APIs/paths/~1v3~1withdrawals/post
80269
80504
  * @param {string} code unified currency code
80270
80505
  * @param {float} amount the amount to withdraw
80271
80506
  * @param {string} address the address to withdraw to
@@ -90925,6 +91160,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
90925
91160
  'brokerage/orders/batch_cancel',
90926
91161
  'brokerage/orders/edit',
90927
91162
  'brokerage/orders/edit_preview',
91163
+ 'brokerage/orders/preview',
90928
91164
  'brokerage/portfolios',
90929
91165
  'brokerage/portfolios/move_funds',
90930
91166
  'brokerage/convert/quote',
@@ -92920,11 +93156,12 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
92920
93156
  * @param {string} [params.stop_direction] 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from
92921
93157
  * @param {string} [params.end_time] '2023-05-25T17:01:05.092Z' for 'GTD' orders
92922
93158
  * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
93159
+ * @param {boolean} [params.preview] default to false, wether to use the test/preview endpoint or not
92923
93160
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
92924
93161
  */
92925
93162
  await this.loadMarkets();
92926
93163
  const market = this.market(symbol);
92927
- const request = {
93164
+ let request = {
92928
93165
  'client_order_id': this.uuid(),
92929
93166
  'product_id': market['id'],
92930
93167
  'side': side.toUpperCase(),
@@ -93059,7 +93296,16 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
93059
93296
  }
93060
93297
  }
93061
93298
  params = this.omit(params, ['timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'stop_price', 'stopDirection', 'stop_direction', 'clientOrderId', 'postOnly', 'post_only', 'end_time']);
93062
- const response = await this.v3PrivatePostBrokerageOrders(this.extend(request, params));
93299
+ const preview = this.safeValue2(params, 'preview', 'test', false);
93300
+ let response = undefined;
93301
+ if (preview) {
93302
+ params = this.omit(params, ['preview', 'test']);
93303
+ request = this.omit(request, 'client_order_id');
93304
+ response = await this.v3PrivatePostBrokerageOrdersPreview(this.extend(request, params));
93305
+ }
93306
+ else {
93307
+ response = await this.v3PrivatePostBrokerageOrders(this.extend(request, params));
93308
+ }
93063
93309
  //
93064
93310
  // successful order
93065
93311
  //
@@ -163129,37 +163375,30 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
163129
163375
  id = this.safeString(trade, 'executionId');
163130
163376
  }
163131
163377
  let order = this.safeString(trade, 'order_id');
163132
- let symbolId = this.safeString(trade, 'symbol');
163378
+ let marketId = this.safeString(trade, 'symbol');
163133
163379
  let side = this.safeString(trade, 'side');
163134
163380
  let type = undefined;
163135
163381
  const priorEdit = this.safeValue(trade, 'orderPriorEdit');
163136
163382
  const priorExecution = this.safeValue(trade, 'orderPriorExecution');
163137
163383
  if (priorExecution !== undefined) {
163138
163384
  order = this.safeString(priorExecution, 'orderId');
163139
- symbolId = this.safeString(priorExecution, 'symbol');
163385
+ marketId = this.safeString(priorExecution, 'symbol');
163140
163386
  side = this.safeString(priorExecution, 'side');
163141
163387
  type = this.safeString(priorExecution, 'type');
163142
163388
  }
163143
163389
  else if (priorEdit !== undefined) {
163144
163390
  order = this.safeString(priorEdit, 'orderId');
163145
- symbolId = this.safeString(priorEdit, 'symbol');
163391
+ marketId = this.safeString(priorEdit, 'symbol');
163146
163392
  side = this.safeString(priorEdit, 'type');
163147
163393
  type = this.safeString(priorEdit, 'type');
163148
163394
  }
163149
163395
  if (type !== undefined) {
163150
163396
  type = this.parseOrderType(type);
163151
163397
  }
163152
- let symbol = undefined;
163153
- if (symbolId !== undefined) {
163154
- market = this.safeValue(this.markets_by_id, symbolId);
163155
- if (market === undefined) {
163156
- symbol = symbolId;
163157
- }
163158
- }
163159
- symbol = this.safeString(market, 'symbol', symbol);
163398
+ market = this.safeMarket(marketId, market);
163160
163399
  let cost = undefined;
163400
+ const linear = this.safeBool(market, 'linear');
163161
163401
  if ((amount !== undefined) && (price !== undefined) && (market !== undefined)) {
163162
- const linear = this.safeValue(market, 'linear');
163163
163402
  if (linear) {
163164
163403
  cost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(amount, price); // in quote
163165
163404
  }
@@ -163182,15 +163421,15 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
163182
163421
  return this.safeTrade({
163183
163422
  'info': trade,
163184
163423
  'id': id,
163424
+ 'symbol': this.safeString(market, 'symbol'),
163185
163425
  'timestamp': timestamp,
163186
163426
  'datetime': this.iso8601(timestamp),
163187
- 'symbol': symbol,
163188
163427
  'order': order,
163189
163428
  'type': type,
163190
163429
  'side': side,
163191
163430
  'takerOrMaker': takerOrMaker,
163192
163431
  'price': price,
163193
- 'amount': amount,
163432
+ 'amount': linear ? amount : undefined,
163194
163433
  'cost': cost,
163195
163434
  'fee': undefined,
163196
163435
  });
@@ -179139,7 +179378,7 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
179139
179378
  'pair': market['id'],
179140
179379
  };
179141
179380
  if (since !== undefined) {
179142
- request['since'] = parseInt(since);
179381
+ request['since'] = this.parseToInt(since);
179143
179382
  }
179144
179383
  else {
179145
179384
  const duration = 1000 * 1000 * this.parseTimeframe(timeframe);
@@ -195567,6 +195806,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
195567
195806
  'trade/easy-convert-history': 20,
195568
195807
  'trade/one-click-repay-currency-list': 20,
195569
195808
  'trade/one-click-repay-history': 20,
195809
+ 'trade/account-rate-limit': 1,
195570
195810
  // asset
195571
195811
  'asset/currencies': 5 / 3,
195572
195812
  'asset/balances': 5 / 3,
@@ -196911,7 +197151,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
196911
197151
  if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
196912
197152
  const parts = networkId.split('-');
196913
197153
  const chainPart = this.safeString(parts, 1, networkId);
196914
- const networkCode = this.safeNetwork(chainPart);
197154
+ const networkCode = this.networkIdToCode(chainPart, currency['code']);
196915
197155
  const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
196916
197156
  if (maxPrecision === undefined) {
196917
197157
  maxPrecision = precision;
@@ -198930,7 +199170,6 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
198930
199170
  * @param {int} [since] the earliest time in ms to fetch open orders for
198931
199171
  * @param {int} [limit] the maximum number of open orders structures to retrieve
198932
199172
  * @param {object} [params] extra parameters specific to the exchange API endpoint
198933
- * @param {int} [params.till] Timestamp in ms of the latest time to retrieve orders for
198934
199173
  * @param {bool} [params.stop] True if fetching trigger or conditional orders
198935
199174
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
198936
199175
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
@@ -215376,13 +215615,13 @@ class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MOD
215376
215615
  const trades = this.safeValue(data, 'items', {});
215377
215616
  return this.parseTrades(trades, market, since, limit);
215378
215617
  }
215379
- async setMarginMode(marginMode, symbol, params = {}) {
215618
+ async setMarginMode(marginMode, symbol = undefined, params = {}) {
215380
215619
  /**
215381
215620
  * @method
215382
215621
  * @name poloniexfutures#setMarginMode
215383
215622
  * @description set margin mode to 'cross' or 'isolated'
215384
215623
  * @see https://futures-docs.poloniex.com/#change-margin-mode
215385
- * @param {int} marginMode 0 (isolated) or 1 (cross)
215624
+ * @param {string} marginMode "0" (isolated) or "1" (cross)
215386
215625
  * @param {string} symbol unified market symbol
215387
215626
  * @param {object} [params] extra parameters specific to the exchange API endpoint
215388
215627
  * @returns {object} response from the exchange
@@ -215390,14 +215629,20 @@ class poloniexfutures extends _abstract_poloniexfutures_js__WEBPACK_IMPORTED_MOD
215390
215629
  if (symbol === undefined) {
215391
215630
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
215392
215631
  }
215393
- if ((marginMode !== 0) && (marginMode !== 1)) {
215394
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0 (isolated) or 1 (cross)');
215632
+ if ((marginMode !== '0') && (marginMode !== '1') && (marginMode !== 'isolated') && (marginMode !== 'cross')) {
215633
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' setMarginMode() marginMode must be 0/isolated or 1/cross');
215395
215634
  }
215396
215635
  await this.loadMarkets();
215636
+ if (marginMode === 'isolated') {
215637
+ marginMode = '0';
215638
+ }
215639
+ if (marginMode === 'cross') {
215640
+ marginMode = '1';
215641
+ }
215397
215642
  const market = this.market(symbol);
215398
215643
  const request = {
215399
215644
  'symbol': market['id'],
215400
- 'marginType': marginMode,
215645
+ 'marginType': this.parseToInt(marginMode),
215401
215646
  };
215402
215647
  return await this.privatePostMarginTypeChange(request);
215403
215648
  }
@@ -224937,6 +225182,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
224937
225182
  'watchTicker': true,
224938
225183
  'watchTickers': true,
224939
225184
  'watchOrderBook': true,
225185
+ 'watchOrderBookForSymbols': true,
224940
225186
  'watchOrders': true,
224941
225187
  'watchTrades': true,
224942
225188
  'watchOHLCV': true,
@@ -224963,8 +225209,15 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
224963
225209
  'fetchBalanceSnapshot': true,
224964
225210
  'awaitBalanceSnapshot': false, // whether to wait for the balance snapshot before providing updates
224965
225211
  },
225212
+ //
225213
+ // orderbook channels can have:
225214
+ // - 'depth5', 'depth20', 'depth50' // these endpoints emit full Orderbooks once in every 500ms
225215
+ // - 'depth/increase100' // this endpoint is preferred, because it emits once in 100ms. however, when this value is chosen, it only affects spot-market, but contracts markets automatically `depth50` will be being used
224966
225216
  'watchOrderBook': {
224967
- 'depth': 'depth/increase100', // depth/increase100, depth5, depth20, depth50
225217
+ 'depth': 'depth/increase100',
225218
+ },
225219
+ 'watchOrderBookForSymbols': {
225220
+ 'depth': 'depth/increase100',
224968
225221
  },
224969
225222
  'ws': {
224970
225223
  'inflate': true,
@@ -225011,6 +225264,24 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
225011
225264
  }
225012
225265
  return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
225013
225266
  }
225267
+ async subscribeMultiple(channel, type, symbols, params = {}) {
225268
+ const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
225269
+ const channelType = (type === 'spot') ? 'spot' : 'futures';
225270
+ const actionType = (type === 'spot') ? 'op' : 'action';
225271
+ const rawSubscriptions = [];
225272
+ const messageHashes = [];
225273
+ for (let i = 0; i < symbols.length; i++) {
225274
+ const market = this.market(symbols[i]);
225275
+ const message = channelType + '/' + channel + ':' + market['id'];
225276
+ rawSubscriptions.push(message);
225277
+ messageHashes.push(channel + ':' + market['symbol']);
225278
+ }
225279
+ const request = {
225280
+ 'args': rawSubscriptions,
225281
+ };
225282
+ request[actionType] = 'subscribe';
225283
+ return await this.watchMultiple(url, messageHashes, this.deepExtend(request, params), rawSubscriptions);
225284
+ }
225014
225285
  async watchBalance(params = {}) {
225015
225286
  /**
225016
225287
  * @method
@@ -226069,8 +226340,8 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
226069
226340
  // "symbol": "BTC_USDT"
226070
226341
  // }
226071
226342
  //
226072
- const asks = this.safeValue(message, 'asks', []);
226073
- const bids = this.safeValue(message, 'bids', []);
226343
+ const asks = this.safeList(message, 'asks', []);
226344
+ const bids = this.safeList(message, 'bids', []);
226074
226345
  this.handleDeltas(orderbook['asks'], asks);
226075
226346
  this.handleDeltas(orderbook['bids'], bids);
226076
226347
  const timestamp = this.safeInteger(message, 'ms_t');
@@ -226084,6 +226355,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
226084
226355
  handleOrderBook(client, message) {
226085
226356
  //
226086
226357
  // spot depth-all
226358
+ //
226087
226359
  // {
226088
226360
  // "data": [
226089
226361
  // {
@@ -226103,33 +226375,31 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
226103
226375
  // ],
226104
226376
  // "table": "spot/depth5"
226105
226377
  // }
226378
+ //
226106
226379
  // spot increse depth snapshot
226380
+ //
226107
226381
  // {
226108
226382
  // "data":[
226109
226383
  // {
226110
- // "asks":[
226111
- // [
226112
- // "43652.52",
226113
- // "0.02039"
226114
- // ],
226115
- // ...
226116
- // ],
226117
- // "bids":[
226118
- // [
226119
- // "43652.51",
226120
- // "0.00500"
226384
+ // "asks":[
226385
+ // [ "43652.52", "0.02039" ],
226386
+ // ...
226121
226387
  // ],
226122
- // ...
226123
- // ],
226124
- // "ms_t":1703376836487,
226125
- // "symbol":"BTC_USDT",
226126
- // "type":"snapshot", // or update
226127
- // "version":2141731
226388
+ // "bids":[
226389
+ // [ "43652.51", "0.00500" ],
226390
+ // ...
226391
+ // ],
226392
+ // "ms_t":1703376836487,
226393
+ // "symbol":"BTC_USDT",
226394
+ // "type":"snapshot", // or update
226395
+ // "version":2141731
226128
226396
  // }
226129
226397
  // ],
226130
226398
  // "table":"spot/depth/increase100"
226131
226399
  // }
226400
+ //
226132
226401
  // swap
226402
+ //
226133
226403
  // {
226134
226404
  // "group":"futures/depth50:BTCUSDT",
226135
226405
  // "data":{
@@ -226150,50 +226420,69 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
226150
226420
  // }
226151
226421
  // }
226152
226422
  //
226153
- const data = this.safeValue(message, 'data');
226154
- if (data === undefined) {
226423
+ const isSpot = ('table' in message);
226424
+ let datas = [];
226425
+ if (isSpot) {
226426
+ datas = this.safeList(message, 'data', datas);
226427
+ }
226428
+ else {
226429
+ const orderBookEntry = this.safeDict(message, 'data');
226430
+ if (orderBookEntry !== undefined) {
226431
+ datas.push(orderBookEntry);
226432
+ }
226433
+ }
226434
+ const length = datas.length;
226435
+ if (length <= 0) {
226155
226436
  return;
226156
226437
  }
226157
- const depths = this.safeValue(data, 'depths');
226158
- const isSpot = (depths === undefined);
226159
- const table = this.safeString2(message, 'table', 'group');
226438
+ const channelName = this.safeString2(message, 'table', 'group');
226160
226439
  // find limit subscribed to
226161
226440
  const limitsToCheck = ['100', '50', '20', '10', '5'];
226162
226441
  let limit = 0;
226163
226442
  for (let i = 0; i < limitsToCheck.length; i++) {
226164
226443
  const limitString = limitsToCheck[i];
226165
- if (table.indexOf(limitString) >= 0) {
226444
+ if (channelName.indexOf(limitString) >= 0) {
226166
226445
  limit = this.parseToInt(limitString);
226167
226446
  break;
226168
226447
  }
226169
226448
  }
226170
226449
  if (isSpot) {
226171
- for (let i = 0; i < data.length; i++) {
226172
- const update = data[i];
226450
+ const channel = channelName.replace('spot/', '');
226451
+ for (let i = 0; i < datas.length; i++) {
226452
+ const update = datas[i];
226173
226453
  const marketId = this.safeString(update, 'symbol');
226174
226454
  const symbol = this.safeSymbol(marketId);
226175
- let orderbook = this.safeValue(this.orderbooks, symbol);
226455
+ let orderbook = this.safeDict(this.orderbooks, symbol);
226176
226456
  if (orderbook === undefined) {
226177
226457
  orderbook = this.orderBook({}, limit);
226178
226458
  orderbook['symbol'] = symbol;
226179
226459
  this.orderbooks[symbol] = orderbook;
226180
226460
  }
226181
226461
  const type = this.safeValue(update, 'type');
226182
- if ((type === 'snapshot') || (!(table.indexOf('increase') >= 0))) {
226462
+ if ((type === 'snapshot') || (!(channelName.indexOf('increase') >= 0))) {
226183
226463
  orderbook.reset({});
226184
226464
  }
226185
226465
  this.handleOrderBookMessage(client, update, orderbook);
226186
226466
  const timestamp = this.safeInteger(update, 'ms_t');
226187
- orderbook['timestamp'] = timestamp;
226188
- orderbook['datetime'] = this.iso8601(timestamp);
226189
- const messageHash = table + ':' + marketId;
226467
+ if (orderbook['timestamp'] === undefined) {
226468
+ orderbook['timestamp'] = timestamp;
226469
+ orderbook['datetime'] = this.iso8601(timestamp);
226470
+ }
226471
+ const messageHash = channelName + ':' + marketId;
226190
226472
  client.resolve(orderbook, messageHash);
226473
+ // resolve ForSymbols
226474
+ const messageHashForMulti = channel + ':' + symbol;
226475
+ client.resolve(orderbook, messageHashForMulti);
226191
226476
  }
226192
226477
  }
226193
226478
  else {
226479
+ const tableParts = channelName.split(':');
226480
+ const channel = tableParts[0].replace('futures/', '');
226481
+ const data = datas[0]; // contract markets always contain only one member
226482
+ const depths = data['depths'];
226194
226483
  const marketId = this.safeString(data, 'symbol');
226195
226484
  const symbol = this.safeSymbol(marketId);
226196
- let orderbook = this.safeValue(this.orderbooks, symbol);
226485
+ let orderbook = this.safeDict(this.orderbooks, symbol);
226197
226486
  if (orderbook === undefined) {
226198
226487
  orderbook = this.orderBook({}, limit);
226199
226488
  orderbook['symbol'] = symbol;
@@ -226222,9 +226511,40 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
226222
226511
  const timestamp = this.safeInteger(data, 'ms_t');
226223
226512
  orderbook['timestamp'] = timestamp;
226224
226513
  orderbook['datetime'] = this.iso8601(timestamp);
226225
- const messageHash = table;
226514
+ const messageHash = channelName;
226226
226515
  client.resolve(orderbook, messageHash);
226516
+ // resolve ForSymbols
226517
+ const messageHashForMulti = channel + ':' + symbol;
226518
+ client.resolve(orderbook, messageHashForMulti);
226519
+ }
226520
+ }
226521
+ async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
226522
+ /**
226523
+ * @method
226524
+ * @name bitmart#watchOrderBookForSymbols
226525
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
226526
+ * @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
226527
+ * @param {string[]} symbols unified array of symbols
226528
+ * @param {int} [limit] the maximum amount of order book entries to return
226529
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
226530
+ * @param {string} [params.depth] the type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
226531
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
226532
+ */
226533
+ await this.loadMarkets();
226534
+ symbols = this.marketSymbols(symbols, undefined, false, true);
226535
+ if (symbols.length > 20) {
226536
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.NotSupported(this.id + ' watchOrderBookForSymbols() accepts a maximum of 20 symbols in one request');
226227
226537
  }
226538
+ const market = this.market(symbols[0]);
226539
+ let channel = undefined;
226540
+ [channel, params] = this.handleOptionAndParams(params, 'watchOrderBookForSymbols', 'depth', 'depth/increase100');
226541
+ let type = 'spot';
226542
+ [type, params] = this.handleMarketTypeAndParams('watchOrderBookForSymbols', market, params);
226543
+ if (type === 'swap' && channel === 'depth/increase100') {
226544
+ channel = 'depth50';
226545
+ }
226546
+ const orderbook = await this.subscribeMultiple(channel, type, symbols, params);
226547
+ return orderbook.limit();
226228
226548
  }
226229
226549
  async authenticate(type, params = {}) {
226230
226550
  this.checkRequiredCredentials();
@@ -256339,7 +256659,7 @@ class mexc extends _mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
256339
256659
  }
256340
256660
  try {
256341
256661
  this.handleDelta(storedOrderBook, data);
256342
- const timestamp = this.safeInteger(message, 't');
256662
+ const timestamp = this.safeInteger2(message, 't', 'ts');
256343
256663
  storedOrderBook['timestamp'] = timestamp;
256344
256664
  storedOrderBook['datetime'] = this.iso8601(timestamp);
256345
256665
  }
@@ -286182,7 +286502,7 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
286182
286502
  },
286183
286503
  },
286184
286504
  'currencies': {
286185
- 'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.parseNumber('8') }),
286505
+ 'WX': this.safeCurrencyStructure({ 'id': 'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc', 'numericId': undefined, 'code': 'WX', 'precision': this.parseToInt('8') }),
286186
286506
  },
286187
286507
  'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_1__/* .DECIMAL_PLACES */ .nr,
286188
286508
  'options': {
@@ -292837,7 +293157,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
292837
293157
  if (stopPrice !== undefined) {
292838
293158
  request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
292839
293159
  }
292840
- const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', price);
293160
+ const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
292841
293161
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
292842
293162
  const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
292843
293163
  const isTrailingAmountOrder = trailingAmount !== undefined;
@@ -304136,7 +304456,7 @@ SOFTWARE.
304136
304456
 
304137
304457
  //-----------------------------------------------------------------------------
304138
304458
  // this is updated by vss.js when building
304139
- const version = '4.2.38';
304459
+ const version = '4.2.39';
304140
304460
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
304141
304461
  //-----------------------------------------------------------------------------
304142
304462