ccxt 4.2.34 → 4.2.36

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.
@@ -475,6 +475,7 @@ class bitfinex extends bitfinex$1 {
475
475
  * @method
476
476
  * @name bitfinex#fetchTradingFees
477
477
  * @description fetch the trading fees for multiple markets
478
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
478
479
  * @param {object} [params] extra parameters specific to the exchange API endpoint
479
480
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
480
481
  */
@@ -557,6 +558,8 @@ class bitfinex extends bitfinex$1 {
557
558
  * @method
558
559
  * @name bitfinex#fetchMarkets
559
560
  * @description retrieves data on all markets for bitfinex
561
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
562
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
560
563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
561
564
  * @returns {object[]} an array of objects representing market data
562
565
  */
@@ -681,6 +684,7 @@ class bitfinex extends bitfinex$1 {
681
684
  * @method
682
685
  * @name bitfinex#fetchBalance
683
686
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
687
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
684
688
  * @param {object} [params] extra parameters specific to the exchange API endpoint
685
689
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
686
690
  */
@@ -738,6 +742,7 @@ class bitfinex extends bitfinex$1 {
738
742
  * @method
739
743
  * @name bitfinex#transfer
740
744
  * @description transfer currency internally between wallets on the same account
745
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
741
746
  * @param {string} code unified currency code
742
747
  * @param {float} amount amount to transfer
743
748
  * @param {string} fromAccount account to transfer from
@@ -823,6 +828,7 @@ class bitfinex extends bitfinex$1 {
823
828
  * @method
824
829
  * @name bitfinex#fetchOrderBook
825
830
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
831
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
826
832
  * @param {string} symbol unified symbol of the market to fetch the order book for
827
833
  * @param {int} [limit] the maximum amount of order book entries to return
828
834
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -865,6 +871,7 @@ class bitfinex extends bitfinex$1 {
865
871
  * @method
866
872
  * @name bitfinex#fetchTicker
867
873
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
874
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
868
875
  * @param {string} symbol unified symbol of the market to fetch the ticker for
869
876
  * @param {object} [params] extra parameters specific to the exchange API endpoint
870
877
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -981,6 +988,7 @@ class bitfinex extends bitfinex$1 {
981
988
  * @method
982
989
  * @name bitfinex#fetchTrades
983
990
  * @description get the list of most recent trades for a particular symbol
991
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-trades
984
992
  * @param {string} symbol unified symbol of the market to fetch trades for
985
993
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
986
994
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1016,6 +1024,7 @@ class bitfinex extends bitfinex$1 {
1016
1024
  * @method
1017
1025
  * @name bitfinex#fetchMyTrades
1018
1026
  * @description fetch all trades made by the user
1027
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
1019
1028
  * @param {string} symbol unified market symbol
1020
1029
  * @param {int} [since] the earliest time in ms to fetch trades for
1021
1030
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1044,6 +1053,7 @@ class bitfinex extends bitfinex$1 {
1044
1053
  * @method
1045
1054
  * @name bitfinex#createOrder
1046
1055
  * @description create a trade order
1056
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
1047
1057
  * @param {string} symbol unified symbol of the market to create an order in
1048
1058
  * @param {string} type 'market' or 'limit'
1049
1059
  * @param {string} side 'buy' or 'sell'
@@ -1111,6 +1121,7 @@ class bitfinex extends bitfinex$1 {
1111
1121
  * @method
1112
1122
  * @name bitfinex#cancelOrder
1113
1123
  * @description cancels an open order
1124
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
1114
1125
  * @param {string} id order id
1115
1126
  * @param {string} symbol not used by bitfinex cancelOrder ()
1116
1127
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1127,6 +1138,7 @@ class bitfinex extends bitfinex$1 {
1127
1138
  * @method
1128
1139
  * @name bitfinex#cancelAllOrders
1129
1140
  * @description cancel all open orders
1141
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1130
1142
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1131
1143
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1132
1144
  * @returns {object} response from exchange
@@ -1211,6 +1223,7 @@ class bitfinex extends bitfinex$1 {
1211
1223
  * @method
1212
1224
  * @name bitfinex#fetchOpenOrders
1213
1225
  * @description fetch all unfilled currently open orders
1226
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
1214
1227
  * @param {string} symbol unified market symbol
1215
1228
  * @param {int} [since] the earliest time in ms to fetch open orders for
1216
1229
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1235,6 +1248,7 @@ class bitfinex extends bitfinex$1 {
1235
1248
  * @method
1236
1249
  * @name bitfinex#fetchClosedOrders
1237
1250
  * @description fetches information on multiple closed orders made by the user
1251
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
1238
1252
  * @param {string} symbol unified market symbol of the market orders were made in
1239
1253
  * @param {int} [since] the earliest time in ms to fetch orders for
1240
1254
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1260,6 +1274,7 @@ class bitfinex extends bitfinex$1 {
1260
1274
  * @method
1261
1275
  * @name bitfinex#fetchOrder
1262
1276
  * @description fetches information on an order made by the user
1277
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
1263
1278
  * @param {string} symbol not used by bitfinex fetchOrder
1264
1279
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1265
1280
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1296,6 +1311,7 @@ class bitfinex extends bitfinex$1 {
1296
1311
  * @method
1297
1312
  * @name bitfinex#fetchOHLCV
1298
1313
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1314
+ * @see https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
1299
1315
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1300
1316
  * @param {string} timeframe the length of time each candle represents
1301
1317
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1340,6 +1356,7 @@ class bitfinex extends bitfinex$1 {
1340
1356
  * @method
1341
1357
  * @name bitfinex#createDepositAddress
1342
1358
  * @description create a currency deposit address
1359
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1343
1360
  * @param {string} code unified currency code of the currency for the deposit address
1344
1361
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1345
1362
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1355,6 +1372,7 @@ class bitfinex extends bitfinex$1 {
1355
1372
  * @method
1356
1373
  * @name bitfinex#fetchDepositAddress
1357
1374
  * @description fetch the deposit address for a currency associated with this account
1375
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1358
1376
  * @param {string} code unified currency code
1359
1377
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1360
1378
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1388,6 +1406,7 @@ class bitfinex extends bitfinex$1 {
1388
1406
  * @method
1389
1407
  * @name bitfinex#fetchDepositsWithdrawals
1390
1408
  * @description fetch history of deposits and withdrawals
1409
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
1391
1410
  * @param {string} code unified currency code for the currency of the deposit/withdrawals
1392
1411
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
1393
1412
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -1524,6 +1543,7 @@ class bitfinex extends bitfinex$1 {
1524
1543
  * @method
1525
1544
  * @name bitfinex#withdraw
1526
1545
  * @description make a withdrawal
1546
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
1527
1547
  * @param {string} code unified currency code
1528
1548
  * @param {float} amount the amount to withdraw
1529
1549
  * @param {string} address the address to withdraw to
@@ -1574,6 +1594,7 @@ class bitfinex extends bitfinex$1 {
1574
1594
  * @method
1575
1595
  * @name bitfinex#fetchPositions
1576
1596
  * @description fetch all open positions
1597
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
1577
1598
  * @param {string[]|undefined} symbols list of unified market symbols
1578
1599
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1579
1600
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -25,11 +25,13 @@ class bitfinex2 extends bitfinex2$1 {
25
25
  'has': {
26
26
  'CORS': undefined,
27
27
  'spot': true,
28
- 'margin': undefined,
28
+ 'margin': true,
29
29
  'swap': true,
30
30
  'future': undefined,
31
31
  'option': undefined,
32
32
  'addMargin': false,
33
+ 'borrowCrossMargin': false,
34
+ 'borrowIsolatedMargin': false,
33
35
  'cancelAllOrders': true,
34
36
  'cancelOrder': true,
35
37
  'cancelOrders': true,
@@ -46,8 +48,13 @@ class bitfinex2 extends bitfinex2$1 {
46
48
  'createTriggerOrder': true,
47
49
  'editOrder': true,
48
50
  'fetchBalance': true,
51
+ 'fetchBorrowInterest': false,
52
+ 'fetchBorrowRateHistories': false,
53
+ 'fetchBorrowRateHistory': false,
49
54
  'fetchClosedOrder': true,
50
55
  'fetchClosedOrders': true,
56
+ 'fetchCrossBorrowRate': false,
57
+ 'fetchCrossBorrowRates': false,
51
58
  'fetchCurrencies': true,
52
59
  'fetchDepositAddress': true,
53
60
  'fetchDepositsWithdrawals': true,
@@ -56,6 +63,8 @@ class bitfinex2 extends bitfinex2$1 {
56
63
  'fetchFundingRateHistory': true,
57
64
  'fetchFundingRates': true,
58
65
  'fetchIndexOHLCV': false,
66
+ 'fetchIsolatedBorrowRate': false,
67
+ 'fetchIsolatedBorrowRates': false,
59
68
  'fetchLedger': true,
60
69
  'fetchLeverage': false,
61
70
  'fetchLeverageTiers': false,
@@ -83,6 +92,8 @@ class bitfinex2 extends bitfinex2$1 {
83
92
  'fetchTransactionFees': undefined,
84
93
  'fetchTransactions': 'emulated',
85
94
  'reduceMargin': false,
95
+ 'repayCrossMargin': false,
96
+ 'repayIsolatedMargin': false,
86
97
  'setLeverage': false,
87
98
  'setMargin': true,
88
99
  'setMarginMode': false,
@@ -3273,6 +3273,7 @@ class bitget extends bitget$1 {
3273
3273
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3274
3274
  * @param {int} [params.until] timestamp in ms of the latest candle to fetch
3275
3275
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3276
+ * @param {string} [params.price] *swap only* "mark" (to fetch mark price candles) or "index" (to fetch index price candles)
3276
3277
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3277
3278
  */
3278
3279
  await this.loadMarkets();
@@ -3302,68 +3303,56 @@ class bitget extends bitget$1 {
3302
3303
  if (limit !== undefined) {
3303
3304
  request['limit'] = limit;
3304
3305
  }
3305
- const options = this.safeValue(this.options, 'fetchOHLCV', {});
3306
- const spotOptions = this.safeValue(options, 'spot', {});
3307
- const defaultSpotMethod = this.safeString(spotOptions, 'method', 'publicSpotGetV2SpotMarketCandles');
3308
- const method = this.safeString(params, 'method', defaultSpotMethod);
3309
- params = this.omit(params, 'method');
3310
- if (method !== 'publicSpotGetV2SpotMarketHistoryCandles') {
3311
- if (since !== undefined) {
3312
- request['startTime'] = since;
3313
- }
3314
- if (until !== undefined) {
3315
- request['endTime'] = until;
3306
+ if (since !== undefined) {
3307
+ request['startTime'] = since;
3308
+ }
3309
+ if (since !== undefined) {
3310
+ if (limit === undefined) {
3311
+ limit = 100; // exchange default
3316
3312
  }
3313
+ const duration = this.parseTimeframe(timeframe) * 1000;
3314
+ request['endTime'] = this.sum(since, duration * (limit + 1)) - 1; // limit + 1)) - 1 is needed for when since is not the exact timestamp of a candle
3315
+ }
3316
+ else if (until !== undefined) {
3317
+ request['endTime'] = until;
3318
+ }
3319
+ else {
3320
+ request['endTime'] = this.milliseconds();
3317
3321
  }
3318
3322
  let response = undefined;
3323
+ const thirtyOneDaysAgo = this.milliseconds() - 2678400000;
3319
3324
  if (market['spot']) {
3320
- if (method === 'publicSpotGetV2SpotMarketCandles') {
3321
- response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
3322
- }
3323
- else if (method === 'publicSpotGetV2SpotMarketHistoryCandles') {
3324
- if (since !== undefined) {
3325
- if (limit === undefined) {
3326
- limit = 100; // exchange default
3327
- }
3328
- const duration = this.parseTimeframe(timeframe) * 1000;
3329
- request['endTime'] = this.sum(since, duration * limit);
3330
- }
3331
- else if (until !== undefined) {
3332
- request['endTime'] = until;
3333
- }
3334
- else {
3335
- request['endTime'] = this.milliseconds();
3336
- }
3325
+ if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
3337
3326
  response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
3338
3327
  }
3328
+ else {
3329
+ response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
3330
+ }
3339
3331
  }
3340
3332
  else {
3341
- const swapOptions = this.safeValue(options, 'swap', {});
3342
- const defaultSwapMethod = this.safeString(swapOptions, 'method', 'publicMixGetV2MixMarketCandles');
3343
- const swapMethod = this.safeString(params, 'method', defaultSwapMethod);
3344
3333
  const priceType = this.safeString(params, 'price');
3345
- params = this.omit(params, ['method', 'price']);
3334
+ params = this.omit(params, ['price']);
3346
3335
  let productType = undefined;
3347
3336
  [productType, params] = this.handleProductTypeAndParams(market, params);
3348
3337
  request['productType'] = productType;
3349
- if ((priceType === 'mark') || (swapMethod === 'publicMixGetV2MixMarketHistoryMarkCandles')) {
3338
+ if (priceType === 'mark') {
3350
3339
  response = await this.publicMixGetV2MixMarketHistoryMarkCandles(this.extend(request, params));
3351
3340
  }
3352
- else if ((priceType === 'index') || (swapMethod === 'publicMixGetV2MixMarketHistoryIndexCandles')) {
3341
+ else if (priceType === 'index') {
3353
3342
  response = await this.publicMixGetV2MixMarketHistoryIndexCandles(this.extend(request, params));
3354
3343
  }
3355
- else if (swapMethod === 'publicMixGetV2MixMarketCandles') {
3356
- response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
3357
- }
3358
- else if (swapMethod === 'publicMixGetV2MixMarketHistoryCandles') {
3344
+ else if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
3359
3345
  response = await this.publicMixGetV2MixMarketHistoryCandles(this.extend(request, params));
3360
3346
  }
3347
+ else {
3348
+ response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
3349
+ }
3361
3350
  }
3362
3351
  if (response === '') {
3363
3352
  return []; // happens when a new token is listed
3364
3353
  }
3365
3354
  // [ ["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"] ]
3366
- const data = this.safeValue(response, 'data', response);
3355
+ const data = this.safeList(response, 'data', response);
3367
3356
  return this.parseOHLCVs(data, market, timeframe, since, limit);
3368
3357
  }
3369
3358
  async fetchBalance(params = {}) {
@@ -188,6 +188,7 @@ class bithumb extends bithumb$1 {
188
188
  * @method
189
189
  * @name bithumb#fetchMarkets
190
190
  * @description retrieves data on all markets for bithumb
191
+ * @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
191
192
  * @param {object} [params] extra parameters specific to the exchange API endpoint
192
193
  * @returns {object[]} an array of objects representing market data
193
194
  */
@@ -290,6 +291,7 @@ class bithumb extends bithumb$1 {
290
291
  * @method
291
292
  * @name bithumb#fetchBalance
292
293
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
294
+ * @see https://apidocs.bithumb.com/reference/%EB%B3%B4%EC%9C%A0%EC%9E%90%EC%82%B0-%EC%A1%B0%ED%9A%8C
293
295
  * @param {object} [params] extra parameters specific to the exchange API endpoint
294
296
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
295
297
  */
@@ -305,6 +307,7 @@ class bithumb extends bithumb$1 {
305
307
  * @method
306
308
  * @name bithumb#fetchOrderBook
307
309
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
310
+ * @see https://apidocs.bithumb.com/reference/%ED%98%B8%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
308
311
  * @param {string} symbol unified symbol of the market to fetch the order book for
309
312
  * @param {int} [limit] the maximum amount of order book entries to return
310
313
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -397,6 +400,7 @@ class bithumb extends bithumb$1 {
397
400
  * @method
398
401
  * @name bithumb#fetchTickers
399
402
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
403
+ * @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C-all
400
404
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
401
405
  * @param {object} [params] extra parameters specific to the exchange API endpoint
402
406
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -454,6 +458,7 @@ class bithumb extends bithumb$1 {
454
458
  * @method
455
459
  * @name bithumb#fetchTicker
456
460
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
461
+ * @see https://apidocs.bithumb.com/reference/%ED%98%84%EC%9E%AC%EA%B0%80-%EC%A0%95%EB%B3%B4-%EC%A1%B0%ED%9A%8C
457
462
  * @param {string} symbol unified symbol of the market to fetch the ticker for
458
463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
459
464
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -512,6 +517,7 @@ class bithumb extends bithumb$1 {
512
517
  * @method
513
518
  * @name bithumb#fetchOHLCV
514
519
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
520
+ * @see https://apidocs.bithumb.com/reference/candlestick-rest-api
515
521
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
516
522
  * @param {string} timeframe the length of time each candle represents
517
523
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -636,6 +642,7 @@ class bithumb extends bithumb$1 {
636
642
  * @method
637
643
  * @name bithumb#fetchTrades
638
644
  * @description get the list of most recent trades for a particular symbol
645
+ * @see https://apidocs.bithumb.com/reference/%EC%B5%9C%EA%B7%BC-%EC%B2%B4%EA%B2%B0-%EB%82%B4%EC%97%AD
639
646
  * @param {string} symbol unified symbol of the market to fetch trades for
640
647
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
641
648
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -674,6 +681,9 @@ class bithumb extends bithumb$1 {
674
681
  * @method
675
682
  * @name bithumb#createOrder
676
683
  * @description create a trade order
684
+ * @see https://apidocs.bithumb.com/reference/%EC%A7%80%EC%A0%95%EA%B0%80-%EC%A3%BC%EB%AC%B8%ED%95%98%EA%B8%B0
685
+ * @see https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EC%88%98%ED%95%98%EA%B8%B0
686
+ * @see https://apidocs.bithumb.com/reference/%EC%8B%9C%EC%9E%A5%EA%B0%80-%EB%A7%A4%EB%8F%84%ED%95%98%EA%B8%B0
677
687
  * @param {string} symbol unified symbol of the market to create an order in
678
688
  * @param {string} type 'market' or 'limit'
679
689
  * @param {string} side 'buy' or 'sell'
@@ -715,6 +725,7 @@ class bithumb extends bithumb$1 {
715
725
  * @method
716
726
  * @name bithumb#fetchOrder
717
727
  * @description fetches information on an order made by the user
728
+ * @see https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%83%81%EC%84%B8-%EC%A1%B0%ED%9A%8C
718
729
  * @param {string} symbol unified symbol of the market the order was made in
719
730
  * @param {object} [params] extra parameters specific to the exchange API endpoint
720
731
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -873,6 +884,7 @@ class bithumb extends bithumb$1 {
873
884
  * @method
874
885
  * @name bithumb#fetchOpenOrders
875
886
  * @description fetch all unfilled currently open orders
887
+ * @see https://apidocs.bithumb.com/reference/%EA%B1%B0%EB%9E%98-%EC%A3%BC%EB%AC%B8%EB%82%B4%EC%97%AD-%EC%A1%B0%ED%9A%8C
876
888
  * @param {string} symbol unified market symbol
877
889
  * @param {int} [since] the earliest time in ms to fetch open orders for
878
890
  * @param {int} [limit] the maximum number of open order structures to retrieve
@@ -921,6 +933,7 @@ class bithumb extends bithumb$1 {
921
933
  * @method
922
934
  * @name bithumb#cancelOrder
923
935
  * @description cancels an open order
936
+ * @see https://apidocs.bithumb.com/reference/%EC%A3%BC%EB%AC%B8-%EC%B7%A8%EC%86%8C%ED%95%98%EA%B8%B0
924
937
  * @param {string} id order id
925
938
  * @param {string} symbol unified symbol of the market the order was made in
926
939
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -956,6 +969,7 @@ class bithumb extends bithumb$1 {
956
969
  * @method
957
970
  * @name bithumb#withdraw
958
971
  * @description make a withdrawal
972
+ * @see https://apidocs.bithumb.com/reference/%EC%BD%94%EC%9D%B8-%EC%B6%9C%EA%B8%88%ED%95%98%EA%B8%B0-%EA%B0%9C%EC%9D%B8
959
973
  * @param {string} code unified currency code
960
974
  * @param {float} amount the amount to withdraw
961
975
  * @param {string} address the address to withdraw to
@@ -151,10 +151,32 @@ class krakenfutures extends krakenfutures$1 {
151
151
  },
152
152
  'fees': {
153
153
  'trading': {
154
- 'tierBased': false,
154
+ 'tierBased': true,
155
155
  'percentage': true,
156
- 'maker': this.parseNumber('-0.0002'),
157
- 'taker': this.parseNumber('0.00075'),
156
+ 'taker': this.parseNumber('0.0005'),
157
+ 'maker': this.parseNumber('0.0002'),
158
+ 'tiers': {
159
+ 'taker': [
160
+ [this.parseNumber('0'), this.parseNumber('0.0005')],
161
+ [this.parseNumber('100000'), this.parseNumber('0.0004')],
162
+ [this.parseNumber('1000000'), this.parseNumber('0.0003')],
163
+ [this.parseNumber('5000000'), this.parseNumber('0.00025')],
164
+ [this.parseNumber('10000000'), this.parseNumber('0.0002')],
165
+ [this.parseNumber('20000000'), this.parseNumber('0.00015')],
166
+ [this.parseNumber('50000000'), this.parseNumber('0.000125')],
167
+ [this.parseNumber('100000000'), this.parseNumber('0.0001')],
168
+ ],
169
+ 'maker': [
170
+ [this.parseNumber('0'), this.parseNumber('0.0002')],
171
+ [this.parseNumber('100000'), this.parseNumber('0.0015')],
172
+ [this.parseNumber('1000000'), this.parseNumber('0.000125')],
173
+ [this.parseNumber('5000000'), this.parseNumber('0.0001')],
174
+ [this.parseNumber('10000000'), this.parseNumber('0.000075')],
175
+ [this.parseNumber('20000000'), this.parseNumber('0.00005')],
176
+ [this.parseNumber('50000000'), this.parseNumber('0.000025')],
177
+ [this.parseNumber('100000000'), this.parseNumber('0')],
178
+ ],
179
+ },
158
180
  },
159
181
  },
160
182
  'exceptions': {
@@ -51,8 +51,8 @@ class binance extends binance$1 {
51
51
  },
52
52
  'api': {
53
53
  'ws': {
54
- 'spot': 'wss://stream.binance.com/ws',
55
- 'margin': 'wss://stream.binance.com/ws',
54
+ 'spot': 'wss://stream.binance.com:9443/ws',
55
+ 'margin': 'wss://stream.binance.com:9443/ws',
56
56
  'future': 'wss://fstream.binance.com/ws',
57
57
  'delivery': 'wss://dstream.binance.com/ws',
58
58
  'ws': 'wss://ws-api.binance.com:443/ws-api/v3',
@@ -2439,7 +2439,7 @@ class binance extends binance$1 {
2439
2439
  return this.safePosition({
2440
2440
  'info': position,
2441
2441
  'id': undefined,
2442
- 'symbol': this.safeSymbol(marketId, undefined, undefined, 'future'),
2442
+ 'symbol': this.safeSymbol(marketId, undefined, undefined, 'contract'),
2443
2443
  'notional': undefined,
2444
2444
  'marginMode': this.safeString(position, 'mt'),
2445
2445
  'liquidationPrice': undefined,
@@ -2593,9 +2593,9 @@ class binance extends binance$1 {
2593
2593
  const messageHash = 'myTrades';
2594
2594
  const executionType = this.safeString(message, 'x');
2595
2595
  if (executionType === 'TRADE') {
2596
- const trade = this.parseTrade(message);
2596
+ const trade = this.parseWsTrade(message);
2597
2597
  const orderId = this.safeString(trade, 'order');
2598
- let tradeFee = this.safeValue(trade, 'fee');
2598
+ let tradeFee = this.safeValue(trade, 'fee', {});
2599
2599
  tradeFee = this.extend({}, tradeFee);
2600
2600
  const symbol = this.safeString(trade, 'symbol');
2601
2601
  if (orderId !== undefined && tradeFee !== undefined && symbol !== undefined) {
@@ -1543,11 +1543,12 @@ class woo extends woo$1 {
1543
1543
  * @method
1544
1544
  * @name woo#fetchOHLCV
1545
1545
  * @see https://docs.woo.org/#kline-public
1546
+ * @see https://docs.woo.org/#kline-historical-data-public
1546
1547
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1547
1548
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1548
1549
  * @param {string} timeframe the length of time each candle represents
1549
1550
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1550
- * @param {int} [limit] the maximum amount of candles to fetch
1551
+ * @param {int} [limit] max=1000, max=100 when since is defined and is less than (now - (999 * (timeframe in ms)))
1551
1552
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1552
1553
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1553
1554
  */
@@ -1557,42 +1558,70 @@ class woo extends woo$1 {
1557
1558
  'symbol': market['id'],
1558
1559
  'type': this.safeString(this.timeframes, timeframe, timeframe),
1559
1560
  };
1560
- if (limit !== undefined) {
1561
+ let useHistEndpoint = since !== undefined;
1562
+ if ((limit !== undefined) && (since !== undefined)) {
1563
+ const oneThousandCandles = this.parseTimeframe(timeframe) * 1000 * 999; // 999 because there will be delay between this and the request, causing the latest candle to be excluded sometimes
1564
+ const startWithLimit = this.milliseconds() - oneThousandCandles;
1565
+ useHistEndpoint = since < startWithLimit;
1566
+ }
1567
+ if (useHistEndpoint) {
1568
+ request['start_time'] = since;
1569
+ }
1570
+ else if (limit !== undefined) { // the hist endpoint does not accept limit
1561
1571
  request['limit'] = Math.min(limit, 1000);
1562
1572
  }
1563
- const response = await this.v1PublicGetKline(this.extend(request, params));
1564
- // {
1565
- // "success": true,
1566
- // "rows": [
1567
- // {
1568
- // "open": "0.94238",
1569
- // "close": "0.94271",
1570
- // "low": "0.94238",
1571
- // "high": "0.94296",
1572
- // "volume": "73.55",
1573
- // "amount": "69.32040520",
1574
- // "symbol": "SPOT_WOO_USDT",
1575
- // "type": "1m",
1576
- // "start_timestamp": "1641584700000",
1577
- // "end_timestamp": "1641584760000"
1578
- // },
1579
- // {
1580
- // "open": "0.94186",
1581
- // "close": "0.94186",
1582
- // "low": "0.94186",
1583
- // "high": "0.94186",
1584
- // "volume": "64.00",
1585
- // "amount": "60.27904000",
1586
- // "symbol": "SPOT_WOO_USDT",
1587
- // "type": "1m",
1588
- // "start_timestamp": "1641584640000",
1589
- // "end_timestamp": "1641584700000"
1590
- // },
1591
- // ...
1592
- // ]
1593
- // }
1594
- const data = this.safeValue(response, 'rows', []);
1595
- return this.parseOHLCVs(data, market, timeframe, since, limit);
1573
+ let response = undefined;
1574
+ if (!useHistEndpoint) {
1575
+ response = await this.v1PublicGetKline(this.extend(request, params));
1576
+ //
1577
+ // {
1578
+ // "success": true,
1579
+ // "rows": [
1580
+ // {
1581
+ // "open": "0.94238",
1582
+ // "close": "0.94271",
1583
+ // "low": "0.94238",
1584
+ // "high": "0.94296",
1585
+ // "volume": "73.55",
1586
+ // "amount": "69.32040520",
1587
+ // "symbol": "SPOT_WOO_USDT",
1588
+ // "type": "1m",
1589
+ // "start_timestamp": "1641584700000",
1590
+ // "end_timestamp": "1641584760000"
1591
+ // },
1592
+ // ...
1593
+ // ]
1594
+ // }
1595
+ //
1596
+ }
1597
+ else {
1598
+ response = await this.v1PubGetHistKline(this.extend(request, params));
1599
+ response = this.safeDict(response, 'data');
1600
+ //
1601
+ // {
1602
+ // "success": true,
1603
+ // "data": {
1604
+ // "rows": [
1605
+ // {
1606
+ // "symbol": "SPOT_BTC_USDT",
1607
+ // "open": 44181.40000000,
1608
+ // "close": 44174.29000000,
1609
+ // "high": 44193.44000000,
1610
+ // "low": 44148.34000000,
1611
+ // "volume": 110.11930100,
1612
+ // "amount": 4863796.24318878,
1613
+ // "type": "1m",
1614
+ // "start_timestamp": 1704153600000,
1615
+ // "end_timestamp": 1704153660000
1616
+ // },
1617
+ // ...
1618
+ // ]
1619
+ // }
1620
+ // }
1621
+ //
1622
+ }
1623
+ const rows = this.safeValue(response, 'rows', []);
1624
+ return this.parseOHLCVs(rows, market, timeframe, since, limit);
1596
1625
  }
1597
1626
  parseOHLCV(ohlcv, market = undefined) {
1598
1627
  // example response in fetchOHLCV
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.33";
7
+ declare const version = "4.2.35";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.34';
41
+ const version = '4.2.36';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';