ccxt 4.1.27 → 4.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -48,7 +48,7 @@ Current feature list:
48
48
  | [![mexc](https://user-images.githubusercontent.com/1294454/137283979-8b2a818d-8633-461b-bfca-de89e8c446b2.jpg)](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | mexc | [MEXC Global](https://m.mexc.com/auth/signup?inviteCode=1FQ1G) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://mxcdevelop.github.io/apidocs/spot_v3_en/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
49
49
  | [![okx](https://user-images.githubusercontent.com/1294454/152485636-38b19e4a-bece-4dec-979a-5982859ffc04.jpg)](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) | okx | [OKX](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) | [![API Version 5](https://img.shields.io/badge/5-lightgray)](https://www.okx.com/docs-v5/en/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with OKX using CCXT's referral link for a 20% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d20%25&color=orange)](https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023) |
50
50
  | [![wavesexchange](https://user-images.githubusercontent.com/1294454/84547058-5fb27d80-ad0b-11ea-8711-78ac8b3c7f31.jpg)](https://wx.network) | wavesexchange | [Waves.Exchange](https://wx.network) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.wx.network) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | | |
51
- | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://referral.woo.org/BAJS6oNmZb3vi3RGA) | woo | [WOO X](https://referral.woo.org/BAJS6oNmZb3vi3RGA) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woo.org/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | |
51
+ | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woo.org/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) | [![Sign up with WOO X using CCXT's referral link for a 35% discount!](https://img.shields.io/static/v1?label=Fee&message=%2d35%25&color=orange)](https://x.woo.org/register?ref=YWOWC96B) |
52
52
 
53
53
  ## Supported Cryptocurrency Exchange Markets
54
54
 
@@ -149,7 +149,7 @@ The CCXT library currently supports the following 97 cryptocurrency exchange mar
149
149
  | [![wavesexchange](https://user-images.githubusercontent.com/1294454/84547058-5fb27d80-ad0b-11ea-8711-78ac8b3c7f31.jpg)](https://wx.network) | wavesexchange | [Waves.Exchange](https://wx.network) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.wx.network) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | |
150
150
  | [![wazirx](https://user-images.githubusercontent.com/1294454/148647666-c109c20b-f8ac-472f-91c3-5f658cb90f49.jpeg)](https://wazirx.com/invite/k7rrnks5) | wazirx | [WazirX](https://wazirx.com/invite/k7rrnks5) | [![API Version 2](https://img.shields.io/badge/2-lightgray)](https://docs.wazirx.com/#public-rest-api-for-wazirx) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
151
151
  | [![whitebit](https://user-images.githubusercontent.com/1294454/66732963-8eb7dd00-ee66-11e9-849b-10d9282bb9e0.jpg)](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | whitebit | [WhiteBit](https://whitebit.com/referral/d9bdf40e-28f2-4b52-b2f9-cd1415d82963) | [![API Version 4](https://img.shields.io/badge/4-lightgray)](https://github.com/whitebit-exchange/api-docs) | | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
152
- | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://referral.woo.org/BAJS6oNmZb3vi3RGA) | woo | [WOO X](https://referral.woo.org/BAJS6oNmZb3vi3RGA) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woo.org/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
152
+ | [![woo](https://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpg)](https://x.woo.org/register?ref=YWOWC96B) | woo | [WOO X](https://x.woo.org/register?ref=YWOWC96B) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://docs.woo.org/) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
153
153
  | [![yobit](https://user-images.githubusercontent.com/1294454/27766910-cdcbfdae-5eea-11e7-9859-03fea873272d.jpg)](https://www.yobit.net) | yobit | [YoBit](https://www.yobit.net) | [![API Version 3](https://img.shields.io/badge/3-lightgray)](https://www.yobit.net/en/api/) | | |
154
154
  | [![zaif](https://user-images.githubusercontent.com/1294454/27766927-39ca2ada-5eeb-11e7-972f-1b4199518ca6.jpg)](https://zaif.jp) | zaif | [Zaif](https://zaif.jp) | [![API Version 1](https://img.shields.io/badge/1-lightgray)](https://techbureau-api-document.readthedocs.io/ja/latest/index.html) | | |
155
155
  | [![zonda](https://user-images.githubusercontent.com/1294454/159202310-a0e38007-5e7c-4ba9-a32f-c8263a0291fe.jpg)](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | zonda | [Zonda](https://auth.zondaglobal.com/ref/jHlbB4mIkdS1) | [![API Version *](https://img.shields.io/badge/*-lightgray)](https://docs.zonda.exchange/) | | |
@@ -210,13 +210,13 @@ console.log(version, Object.keys(exchanges));
210
210
 
211
211
  All-in-one browser bundle (dependencies included), served from a CDN of your choice:
212
212
 
213
- * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.27/dist/ccxt.browser.js
214
- * unpkg: https://unpkg.com/ccxt@4.1.27/dist/ccxt.browser.js
213
+ * jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.1.29/dist/ccxt.browser.js
214
+ * unpkg: https://unpkg.com/ccxt@4.1.29/dist/ccxt.browser.js
215
215
 
216
216
  CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
217
217
 
218
218
  ```HTML
219
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.27/dist/ccxt.browser.js"></script>
219
+ <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.1.29/dist/ccxt.browser.js"></script>
220
220
  ```
221
221
 
222
222
  Creates a global `ccxt` object:
@@ -38838,6 +38838,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
38838
38838
  'editOrder': true,
38839
38839
  'fetchAccounts': false,
38840
38840
  'fetchBalance': true,
38841
+ 'fetchBorrowInterest': true,
38841
38842
  'fetchBorrowRate': true,
38842
38843
  'fetchBorrowRateHistories': false,
38843
38844
  'fetchBorrowRateHistory': false,
@@ -45172,6 +45173,147 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
45172
45173
  'info': info,
45173
45174
  };
45174
45175
  }
45176
+ async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
45177
+ /**
45178
+ * @method
45179
+ * @name bitget#fetchBorrowInterest
45180
+ * @description fetch the interest owed by the user for borrowing currency for margin trading
45181
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-interest-records
45182
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-interest-records
45183
+ * @param {string} [code] unified currency code
45184
+ * @param {string} [symbol] unified market symbol when fetching interest in isolated markets
45185
+ * @param {int} [since] the earliest time in ms to fetch borrow interest for
45186
+ * @param {int} [limit] the maximum number of structures to retrieve
45187
+ * @param {object} [params] extra parameters specific to the bitget api endpoint
45188
+ * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
45189
+ */
45190
+ await this.loadMarkets();
45191
+ let market = undefined;
45192
+ if (symbol !== undefined) {
45193
+ market = this.market(symbol);
45194
+ }
45195
+ const request = {};
45196
+ let currency = undefined;
45197
+ if (code !== undefined) {
45198
+ currency = this.currency(code);
45199
+ request['coin'] = currency['id'];
45200
+ }
45201
+ if (since !== undefined) {
45202
+ request['startTime'] = since;
45203
+ }
45204
+ else {
45205
+ request['startTime'] = this.milliseconds() - 7776000000;
45206
+ }
45207
+ if (limit !== undefined) {
45208
+ request['pageSize'] = limit;
45209
+ }
45210
+ let response = undefined;
45211
+ let marginMode = undefined;
45212
+ [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params, 'cross');
45213
+ if (marginMode === 'isolated') {
45214
+ this.checkRequiredSymbol('fetchBorrowInterest', symbol);
45215
+ request['symbol'] = market['info']['symbolName'];
45216
+ response = await this.privateMarginGetIsolatedInterestList(this.extend(request, params));
45217
+ }
45218
+ else if (marginMode === 'cross') {
45219
+ response = await this.privateMarginGetCrossInterestList(this.extend(request, params));
45220
+ }
45221
+ //
45222
+ // isolated
45223
+ //
45224
+ // {
45225
+ // "code": "00000",
45226
+ // "msg": "success",
45227
+ // "requestTime": 1698282523888,
45228
+ // "data": {
45229
+ // "resultList": [
45230
+ // {
45231
+ // "interestId": "1100560904468705284",
45232
+ // "interestCoin": "USDT",
45233
+ // "interestRate": "0.000126279",
45234
+ // "loanCoin": "USDT",
45235
+ // "amount": "0.00000298",
45236
+ // "type": "scheduled",
45237
+ // "symbol": "BTCUSDT",
45238
+ // "ctime": "1698120000000"
45239
+ // },
45240
+ // ],
45241
+ // "maxId": "1100560904468705284",
45242
+ // "minId": "1096915487398965249"
45243
+ // }
45244
+ // }
45245
+ //
45246
+ // cross
45247
+ //
45248
+ // {
45249
+ // "code": "00000",
45250
+ // "msg": "success",
45251
+ // "requestTime": 1698282552126,
45252
+ // "data": {
45253
+ // "resultList": [
45254
+ // {
45255
+ // "interestId": "1099126154352799744",
45256
+ // "interestCoin": "USDT",
45257
+ // "interestRate": "0.000126279",
45258
+ // "loanCoin": "USDT",
45259
+ // "amount": "0.00002631",
45260
+ // "type": "scheduled",
45261
+ // "ctime": "1697778000000"
45262
+ // },
45263
+ // ],
45264
+ // "maxId": "1099126154352799744",
45265
+ // "minId": "1096917004629716993"
45266
+ // }
45267
+ // }
45268
+ //
45269
+ const data = this.safeValue(response, 'data', {});
45270
+ const rows = this.safeValue(data, 'resultList', []);
45271
+ const interest = this.parseBorrowInterests(rows, market);
45272
+ return this.filterByCurrencySinceLimit(interest, code, since, limit);
45273
+ }
45274
+ parseBorrowInterest(info, market = undefined) {
45275
+ //
45276
+ // isolated
45277
+ //
45278
+ // {
45279
+ // "interestId": "1100560904468705284",
45280
+ // "interestCoin": "USDT",
45281
+ // "interestRate": "0.000126279",
45282
+ // "loanCoin": "USDT",
45283
+ // "amount": "0.00000298",
45284
+ // "type": "scheduled",
45285
+ // "symbol": "BTCUSDT",
45286
+ // "ctime": "1698120000000"
45287
+ // }
45288
+ //
45289
+ // cross
45290
+ //
45291
+ // {
45292
+ // "interestId": "1099126154352799744",
45293
+ // "interestCoin": "USDT",
45294
+ // "interestRate": "0.000126279",
45295
+ // "loanCoin": "USDT",
45296
+ // "amount": "0.00002631",
45297
+ // "type": "scheduled",
45298
+ // "ctime": "1697778000000"
45299
+ // }
45300
+ //
45301
+ const marketId = this.safeString(info, 'symbol');
45302
+ market = this.safeMarket(marketId, market);
45303
+ const marginMode = (marketId !== undefined) ? 'isolated' : 'cross';
45304
+ const timestamp = this.safeInteger(info, 'ctime');
45305
+ return {
45306
+ 'symbol': this.safeString(market, 'symbol'),
45307
+ 'marginMode': marginMode,
45308
+ 'currency': this.safeCurrencyCode(this.safeString(info, 'interestCoin')),
45309
+ 'interest': this.safeNumber(info, 'amount'),
45310
+ 'interestRate': this.safeNumber(info, 'interestRate'),
45311
+ 'amountBorrowed': undefined,
45312
+ 'timestamp': timestamp,
45313
+ 'datetime': this.iso8601(timestamp),
45314
+ 'info': info,
45315
+ };
45316
+ }
45175
45317
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
45176
45318
  if (!response) {
45177
45319
  return undefined; // fallback to default error handler
@@ -74231,6 +74373,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74231
74373
  'v5/position/trading-stop': 5,
74232
74374
  'v5/position/set-auto-add-margin': 2.5,
74233
74375
  'v5/position/add-margin': 2.5,
74376
+ 'v5/position/confirm-pending-mmr': 2.5,
74234
74377
  // account
74235
74378
  'v5/account/upgrade-to-uta': 2.5,
74236
74379
  'v5/account/set-margin-mode': 2.5,
@@ -76804,8 +76947,11 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
76804
76947
  // "time": 1672125441042
76805
76948
  // }
76806
76949
  //
76950
+ const timestamp = this.safeInteger(response, 'time');
76807
76951
  const result = {
76808
76952
  'info': response,
76953
+ 'timestamp': timestamp,
76954
+ 'datetime': this.iso8601(timestamp),
76809
76955
  };
76810
76956
  const responseResult = this.safeValue(response, 'result', {});
76811
76957
  const currencyList = this.safeValueN(responseResult, ['loanAccountList', 'list', 'balance']);
@@ -99082,6 +99228,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
99082
99228
  'borrowMargin': true,
99083
99229
  'cancelAllOrders': true,
99084
99230
  'cancelOrder': true,
99231
+ 'cancelOrders': true,
99085
99232
  'createOrder': true,
99086
99233
  'createOrders': true,
99087
99234
  'fetchAccounts': true,
@@ -100476,6 +100623,37 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
100476
100623
  const result = this.safeValue(response, 'result', {});
100477
100624
  return this.parseOrder(result, market);
100478
100625
  }
100626
+ async cancelOrders(ids, symbol = undefined, params = {}) {
100627
+ /**
100628
+ * @method
100629
+ * @name cryptocom#cancelOrders
100630
+ * @description cancel multiple orders
100631
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order-list-list
100632
+ * @param {string[]} ids order ids
100633
+ * @param {string} symbol unified market symbol
100634
+ * @param {object} [params] extra parameters specific to the okx api endpoint
100635
+ * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
100636
+ */
100637
+ this.checkRequiredSymbol('cancelOrders', symbol);
100638
+ await this.loadMarkets();
100639
+ const market = this.market(symbol);
100640
+ const orderRequests = [];
100641
+ for (let i = 0; i < ids.length; i++) {
100642
+ const id = ids[i];
100643
+ const order = {
100644
+ 'instrument_name': market['id'],
100645
+ 'order_id': id.toString(),
100646
+ };
100647
+ orderRequests.push(order);
100648
+ }
100649
+ const request = {
100650
+ 'contingency_type': 'LIST',
100651
+ 'order_list': orderRequests,
100652
+ };
100653
+ const response = await this.v1PrivatePostPrivateCancelOrderList(this.extend(request, params));
100654
+ const result = this.safeValue(response, 'result', []);
100655
+ return this.parseOrders(result, market, undefined, undefined, params);
100656
+ }
100479
100657
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
100480
100658
  /**
100481
100659
  * @method
@@ -147665,6 +147843,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
147665
147843
  /**
147666
147844
  * @method
147667
147845
  * @name krakenfutures#fetchOrderBook
147846
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-orderbook
147668
147847
  * @description Fetches a list of open orders in a market
147669
147848
  * @param {string} symbol Unified market symbol
147670
147849
  * @param {int} [limit] Not used by krakenfutures
@@ -147711,6 +147890,15 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
147711
147890
  return this.parseOrderBook(response['orderBook'], symbol, timestamp);
147712
147891
  }
147713
147892
  async fetchTickers(symbols = undefined, params = {}) {
147893
+ /**
147894
+ * @method
147895
+ * @name krakenfutures#fetchTickers
147896
+ * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
147897
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-tickers
147898
+ * @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
147899
+ * @param {object} [params] extra parameters specific to the krakenfutures api endpoint
147900
+ * @returns {object} an array of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
147901
+ */
147714
147902
  await this.loadMarkets();
147715
147903
  const response = await this.publicGetTickers(params);
147716
147904
  //
@@ -147910,6 +148098,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
147910
148098
  /**
147911
148099
  * @method
147912
148100
  * @name krakenfutures#fetchTrades
148101
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-trade-history
147913
148102
  * @descriptions Fetch a history of filled trades that this account has made
147914
148103
  * @param {string} symbol Unified CCXT market symbol
147915
148104
  * @param {int} [since] Timestamp in ms of earliest trade. Not used by krakenfutures except in combination with params.until
@@ -148231,6 +148420,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148231
148420
  /**
148232
148421
  * @method
148233
148422
  * @name krakenfutures#editOrder
148423
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-edit-order
148234
148424
  * @description Edit an open order on the exchange
148235
148425
  * @param {string} id order id
148236
148426
  * @param {string} symbol Not used by Krakenfutures
@@ -148260,6 +148450,10 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148260
148450
  }
148261
148451
  async cancelOrder(id, symbol = undefined, params = {}) {
148262
148452
  /**
148453
+ * @method
148454
+ * @name krakenfutures#cancelOrder
148455
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-cancel-order
148456
+ * @description Cancel an open order on the exchange
148263
148457
  * @param {string} id Order id
148264
148458
  * @param {string} symbol Not used by Krakenfutures
148265
148459
  * @param {object} [params] Exchange specific params
@@ -148343,6 +148537,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148343
148537
  /**
148344
148538
  * @method
148345
148539
  * @name krakenfutures#cancelAllOrders
148540
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-cancel-all-orders
148346
148541
  * @description Cancels all orders on the exchange, including trigger orders
148347
148542
  * @param {str} symbol Unified market symbol
148348
148543
  * @param {dict} [params] Exchange specific params
@@ -148359,6 +148554,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148359
148554
  /**
148360
148555
  * @method
148361
148556
  * @name krakenfutures#fetchOpenOrders
148557
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-get-open-orders
148362
148558
  * @description Gets all open orders, including trigger orders, for an account from the exchange api
148363
148559
  * @param {string} symbol Unified market symbol
148364
148560
  * @param {int} [since] Timestamp (ms) of earliest order. (Not used by kraken api but filtered internally by CCXT)
@@ -148766,6 +148962,18 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148766
148962
  });
148767
148963
  }
148768
148964
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
148965
+ /**
148966
+ * @method
148967
+ * @name krakenfutures#fetchMyTrades
148968
+ * @description fetch all trades made by the user
148969
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-historical-data-get-your-fills
148970
+ * @param {string} symbol unified market symbol
148971
+ * @param {int} [since] *not used by the api* the earliest time in ms to fetch trades for
148972
+ * @param {int} [limit] the maximum number of trades structures to retrieve
148973
+ * @param {object} [params] extra parameters specific to the bybit api endpoint
148974
+ * @param {int} [params.until] the latest time in ms to fetch entries for
148975
+ * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
148976
+ */
148769
148977
  await this.loadMarkets();
148770
148978
  let market = undefined;
148771
148979
  if (symbol !== undefined) {
@@ -148798,9 +149006,10 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148798
149006
  /**
148799
149007
  * @method
148800
149008
  * @name krakenfutures#fetchBalance
149009
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-account-information-get-wallets
148801
149010
  * @description Fetch the balance for a sub-account, all sub-account balances are inside 'info' in the response
148802
149011
  * @param {object} [params] Exchange specific parameters
148803
- * @param {string} [params.type] The sub-account type to query the balance of, possible values include 'flex', 'cash'/'main'/'funding', or a market symbol * defaults to 'cash' *
149012
+ * @param {string} [params.type] The sub-account type to query the balance of, possible values include 'flex', 'cash'/'main'/'funding', or a market symbol * defaults to 'flex' *
148804
149013
  * @param {string} [params.symbol] A unified market symbol, when assigned the balance for a trading market that matches the symbol is returned
148805
149014
  * @returns A [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
148806
149015
  */
@@ -148904,7 +149113,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
148904
149113
  type = symbol;
148905
149114
  }
148906
149115
  if (type === undefined) {
148907
- type = (symbol === undefined) ? 'cash' : symbol;
149116
+ type = (symbol === undefined) ? 'flex' : symbol;
148908
149117
  }
148909
149118
  const accountName = this.parseAccount(type);
148910
149119
  const accounts = this.safeValue(response, 'accounts');
@@ -149102,6 +149311,17 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
149102
149311
  };
149103
149312
  }
149104
149313
  async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
149314
+ /**
149315
+ * @method
149316
+ * @name krakenfutures#fetchFundingRateHistory
149317
+ * @description fetches historical funding rate prices
149318
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-historical-funding-rates-historical-funding-rates
149319
+ * @param {string} symbol unified symbol of the market to fetch the funding rate history for
149320
+ * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
149321
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
149322
+ * @param {object} [params] extra parameters specific to the api endpoint
149323
+ * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
149324
+ */
149105
149325
  this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
149106
149326
  await this.loadMarkets();
149107
149327
  const market = this.market(symbol);
@@ -149144,6 +149364,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
149144
149364
  /**
149145
149365
  * @method
149146
149366
  * @name krakenfutures#fetchPositions
149367
+ * @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
149147
149368
  * @description Fetches current contract trading positions
149148
149369
  * @param {string[]} symbols List of unified symbols
149149
149370
  * @param {object} [params] Not used by krakenfutures
@@ -149223,7 +149444,7 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
149223
149444
  'entryPrice': this.safeNumber(position, 'price'),
149224
149445
  'notional': undefined,
149225
149446
  'leverage': leverage,
149226
- 'unrealizedPnl': this.safeNumber(position, 'unrealizedFunding'),
149447
+ 'unrealizedPnl': undefined,
149227
149448
  'contracts': this.safeNumber(position, 'size'),
149228
149449
  'contractSize': this.safeNumber(market, 'contractSize'),
149229
149450
  'marginRatio': undefined,
@@ -149236,6 +149457,15 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
149236
149457
  };
149237
149458
  }
149238
149459
  async fetchLeverageTiers(symbols = undefined, params = {}) {
149460
+ /**
149461
+ * @method
149462
+ * @name krakenfutures#fetchLeverageTiers
149463
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-instrument-details-get-instruments
149464
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
149465
+ * @param {string[]|undefined} symbols list of unified market symbols
149466
+ * @param {object} [params] extra parameters specific to the krakenfutures api endpoint
149467
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}, indexed by market symbols
149468
+ */
149239
149469
  await this.loadMarkets();
149240
149470
  const response = await this.publicGetInstruments(params);
149241
149471
  //
@@ -149415,6 +149645,8 @@ class krakenfutures extends _abstract_krakenfutures_js__WEBPACK_IMPORTED_MODULE_
149415
149645
  /**
149416
149646
  * @method
149417
149647
  * @name krakenfutures#transfer
149648
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-wallet-transfer
149649
+ * @see https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-withdrawal-to-spot-wallet
149418
149650
  * @description transfers currencies between sub-accounts
149419
149651
  * @param {string} code Unified currency code
149420
149652
  * @param {float} amount Size of the transfer
@@ -166081,6 +166313,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
166081
166313
  'cancelOrders': undefined,
166082
166314
  'createDepositAddress': true,
166083
166315
  'createOrder': true,
166316
+ 'createOrders': true,
166084
166317
  'createReduceOnlyOrder': true,
166085
166318
  'deposit': undefined,
166086
166319
  'editOrder': undefined,
@@ -168125,7 +168358,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
168125
168358
  return await this.createSwapOrder(market, type, side, amount, price, marginMode, query);
168126
168359
  }
168127
168360
  }
168128
- async createSpotOrder(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
168361
+ createSpotOrderRequest(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
168129
168362
  const symbol = market['symbol'];
168130
168363
  const orderSide = (side === 'buy') ? 'BUY' : 'SELL';
168131
168364
  const request = {
@@ -168162,19 +168395,28 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
168162
168395
  request['newClientOrderId'] = clientOrderId;
168163
168396
  params = this.omit(params, ['type', 'clientOrderId']);
168164
168397
  }
168165
- let method = 'spotPrivatePostOrder';
168166
168398
  if (marginMode !== undefined) {
168167
168399
  if (marginMode !== 'isolated') {
168168
168400
  throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrder() does not support marginMode ' + marginMode + ' for spot-margin trading');
168169
168401
  }
168170
- method = 'spotPrivatePostMarginOrder';
168171
168402
  }
168172
168403
  let postOnly = undefined;
168173
168404
  [postOnly, params] = this.handlePostOnly(type === 'market', type === 'LIMIT_MAKER', params);
168174
168405
  if (postOnly) {
168175
168406
  request['type'] = 'LIMIT_MAKER';
168176
168407
  }
168177
- const response = await this[method](this.extend(request, params));
168408
+ return this.extend(request, params);
168409
+ }
168410
+ async createSpotOrder(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
168411
+ await this.loadMarkets();
168412
+ const request = this.createSpotOrderRequest(market, type, side, amount, price, marginMode, params);
168413
+ let response = undefined;
168414
+ if (marginMode !== undefined) {
168415
+ response = await this.spotPrivatePostMarginOrder(this.extend(request, params));
168416
+ }
168417
+ else {
168418
+ response = await this.spotPrivatePostOrder(this.extend(request, params));
168419
+ }
168178
168420
  //
168179
168421
  // spot
168180
168422
  //
@@ -168307,6 +168549,70 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
168307
168549
  const data = this.safeString(response, 'data');
168308
168550
  return this.parseOrder(data, market);
168309
168551
  }
168552
+ async createOrders(orders, params = {}) {
168553
+ /**
168554
+ * @method
168555
+ * @name mexc#createOrders
168556
+ * @description *spot only* *all orders must have the same symbol* create a list of trade orders
168557
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
168558
+ * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
168559
+ * @param {object} [params] extra parameters specific to api endpoint
168560
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
168561
+ */
168562
+ await this.loadMarkets();
168563
+ const ordersRequests = [];
168564
+ let symbol = undefined;
168565
+ for (let i = 0; i < orders.length; i++) {
168566
+ const rawOrder = orders[i];
168567
+ const marketId = this.safeString(rawOrder, 'symbol');
168568
+ const market = this.market(marketId);
168569
+ if (!market['spot']) {
168570
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' createOrders() is only supported for spot markets');
168571
+ }
168572
+ if (symbol === undefined) {
168573
+ symbol = marketId;
168574
+ }
168575
+ else {
168576
+ if (symbol !== marketId) {
168577
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' createOrders() requires all orders to have the same symbol');
168578
+ }
168579
+ }
168580
+ const type = this.safeString(rawOrder, 'type');
168581
+ const side = this.safeString(rawOrder, 'side');
168582
+ const amount = this.safeValue(rawOrder, 'amount');
168583
+ const price = this.safeValue(rawOrder, 'price');
168584
+ const orderParams = this.safeValue(rawOrder, 'params', {});
168585
+ let marginMode = undefined;
168586
+ [marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
168587
+ const orderRequest = this.createSpotOrderRequest(market, type, side, amount, price, marginMode, orderParams);
168588
+ ordersRequests.push(orderRequest);
168589
+ }
168590
+ const request = {
168591
+ 'batchOrders': ordersRequests,
168592
+ };
168593
+ const response = await this.spotPrivatePostBatchOrders(request);
168594
+ //
168595
+ // [
168596
+ // {
168597
+ // "symbol": "BTCUSDT",
168598
+ // "orderId": "1196315350023612316",
168599
+ // "newClientOrderId": "hio8279hbdsds",
168600
+ // "orderListId": -1
168601
+ // },
168602
+ // {
168603
+ // "newClientOrderId": "123456",
168604
+ // "msg": "The minimum transaction volume cannot be less than:0.5USDT",
168605
+ // "code": 30002
168606
+ // },
168607
+ // {
168608
+ // "symbol": "BTCUSDT",
168609
+ // "orderId": "1196315350023612318",
168610
+ // "orderListId": -1
168611
+ // }
168612
+ // ]
168613
+ //
168614
+ return this.parseOrders(response);
168615
+ }
168310
168616
  async fetchOrder(id, symbol = undefined, params = {}) {
168311
168617
  /**
168312
168618
  * @method
@@ -169167,6 +169473,23 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
169167
169473
  // "updateTime": "1648984276000",
169168
169474
  // }
169169
169475
  //
169476
+ // createOrders error
169477
+ //
169478
+ // {
169479
+ // "newClientOrderId": "123456",
169480
+ // "msg": "The minimum transaction volume cannot be less than:0.5USDT",
169481
+ // "code": 30002
169482
+ // }
169483
+ //
169484
+ const code = this.safeInteger(order, 'code');
169485
+ if (code !== undefined) {
169486
+ // error upon placing multiple orders
169487
+ return this.safeOrder({
169488
+ 'info': order,
169489
+ 'status': 'rejected',
169490
+ 'clientOrderId': this.safeString(order, 'newClientOrderId'),
169491
+ });
169492
+ }
169170
169493
  let id = undefined;
169171
169494
  if (typeof order === 'string') {
169172
169495
  id = order;
@@ -179873,6 +180196,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
179873
180196
  'sprd/order': 1,
179874
180197
  'sprd/cancel-order': 1,
179875
180198
  'sprd/mass-cancel': 1,
180199
+ 'sprd/amend-order': 1,
179876
180200
  // trade
179877
180201
  'trade/order': 1 / 3,
179878
180202
  'trade/batch-orders': 1 / 15,
@@ -267036,7 +267360,10 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
267036
267360
  'fees': [
267037
267361
  'https://support.woo.org/hc/en-001/articles/4404611795353--Trading-Fees',
267038
267362
  ],
267039
- 'referral': 'https://referral.woo.org/BAJS6oNmZb3vi3RGA',
267363
+ 'referral': {
267364
+ 'url': 'https://x.woo.org/register?ref=YWOWC96B',
267365
+ 'discount': 0.35,
267366
+ },
267040
267367
  },
267041
267368
  'api': {
267042
267369
  'v1': {
@@ -279068,7 +279395,7 @@ SOFTWARE.
279068
279395
 
279069
279396
  //-----------------------------------------------------------------------------
279070
279397
  // this is updated by vss.js when building
279071
- const version = '4.1.27';
279398
+ const version = '4.1.29';
279072
279399
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
279073
279400
  //-----------------------------------------------------------------------------
279074
279401