ccxt 4.2.35 → 4.2.37

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.
@@ -478,6 +478,7 @@ export default class bitfinex extends Exchange {
478
478
  * @method
479
479
  * @name bitfinex#fetchTradingFees
480
480
  * @description fetch the trading fees for multiple markets
481
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
481
482
  * @param {object} [params] extra parameters specific to the exchange API endpoint
482
483
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
483
484
  */
@@ -560,6 +561,8 @@ export default class bitfinex extends Exchange {
560
561
  * @method
561
562
  * @name bitfinex#fetchMarkets
562
563
  * @description retrieves data on all markets for bitfinex
564
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
565
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
563
566
  * @param {object} [params] extra parameters specific to the exchange API endpoint
564
567
  * @returns {object[]} an array of objects representing market data
565
568
  */
@@ -684,6 +687,7 @@ export default class bitfinex extends Exchange {
684
687
  * @method
685
688
  * @name bitfinex#fetchBalance
686
689
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
690
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
687
691
  * @param {object} [params] extra parameters specific to the exchange API endpoint
688
692
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
689
693
  */
@@ -741,6 +745,7 @@ export default class bitfinex extends Exchange {
741
745
  * @method
742
746
  * @name bitfinex#transfer
743
747
  * @description transfer currency internally between wallets on the same account
748
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
744
749
  * @param {string} code unified currency code
745
750
  * @param {float} amount amount to transfer
746
751
  * @param {string} fromAccount account to transfer from
@@ -826,6 +831,7 @@ export default class bitfinex extends Exchange {
826
831
  * @method
827
832
  * @name bitfinex#fetchOrderBook
828
833
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
834
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
829
835
  * @param {string} symbol unified symbol of the market to fetch the order book for
830
836
  * @param {int} [limit] the maximum amount of order book entries to return
831
837
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -868,6 +874,7 @@ export default class bitfinex extends Exchange {
868
874
  * @method
869
875
  * @name bitfinex#fetchTicker
870
876
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
877
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
871
878
  * @param {string} symbol unified symbol of the market to fetch the ticker for
872
879
  * @param {object} [params] extra parameters specific to the exchange API endpoint
873
880
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -984,6 +991,7 @@ export default class bitfinex extends Exchange {
984
991
  * @method
985
992
  * @name bitfinex#fetchTrades
986
993
  * @description get the list of most recent trades for a particular symbol
994
+ * @see https://docs.bitfinex.com/v1/reference/rest-public-trades
987
995
  * @param {string} symbol unified symbol of the market to fetch trades for
988
996
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
989
997
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1019,6 +1027,7 @@ export default class bitfinex extends Exchange {
1019
1027
  * @method
1020
1028
  * @name bitfinex#fetchMyTrades
1021
1029
  * @description fetch all trades made by the user
1030
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
1022
1031
  * @param {string} symbol unified market symbol
1023
1032
  * @param {int} [since] the earliest time in ms to fetch trades for
1024
1033
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1047,6 +1056,7 @@ export default class bitfinex extends Exchange {
1047
1056
  * @method
1048
1057
  * @name bitfinex#createOrder
1049
1058
  * @description create a trade order
1059
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
1050
1060
  * @param {string} symbol unified symbol of the market to create an order in
1051
1061
  * @param {string} type 'market' or 'limit'
1052
1062
  * @param {string} side 'buy' or 'sell'
@@ -1114,6 +1124,7 @@ export default class bitfinex extends Exchange {
1114
1124
  * @method
1115
1125
  * @name bitfinex#cancelOrder
1116
1126
  * @description cancels an open order
1127
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
1117
1128
  * @param {string} id order id
1118
1129
  * @param {string} symbol not used by bitfinex cancelOrder ()
1119
1130
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1130,6 +1141,7 @@ export default class bitfinex extends Exchange {
1130
1141
  * @method
1131
1142
  * @name bitfinex#cancelAllOrders
1132
1143
  * @description cancel all open orders
1144
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1133
1145
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1134
1146
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1135
1147
  * @returns {object} response from exchange
@@ -1214,6 +1226,7 @@ export default class bitfinex extends Exchange {
1214
1226
  * @method
1215
1227
  * @name bitfinex#fetchOpenOrders
1216
1228
  * @description fetch all unfilled currently open orders
1229
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
1217
1230
  * @param {string} symbol unified market symbol
1218
1231
  * @param {int} [since] the earliest time in ms to fetch open orders for
1219
1232
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1238,6 +1251,7 @@ export default class bitfinex extends Exchange {
1238
1251
  * @method
1239
1252
  * @name bitfinex#fetchClosedOrders
1240
1253
  * @description fetches information on multiple closed orders made by the user
1254
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
1241
1255
  * @param {string} symbol unified market symbol of the market orders were made in
1242
1256
  * @param {int} [since] the earliest time in ms to fetch orders for
1243
1257
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1263,6 +1277,7 @@ export default class bitfinex extends Exchange {
1263
1277
  * @method
1264
1278
  * @name bitfinex#fetchOrder
1265
1279
  * @description fetches information on an order made by the user
1280
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
1266
1281
  * @param {string} symbol not used by bitfinex fetchOrder
1267
1282
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1268
1283
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1299,6 +1314,7 @@ export default class bitfinex extends Exchange {
1299
1314
  * @method
1300
1315
  * @name bitfinex#fetchOHLCV
1301
1316
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1317
+ * @see https://docs.bitfinex.com/reference/rest-public-candles#aggregate-funding-currency-candles
1302
1318
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1303
1319
  * @param {string} timeframe the length of time each candle represents
1304
1320
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1343,6 +1359,7 @@ export default class bitfinex extends Exchange {
1343
1359
  * @method
1344
1360
  * @name bitfinex#createDepositAddress
1345
1361
  * @description create a currency deposit address
1362
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1346
1363
  * @param {string} code unified currency code of the currency for the deposit address
1347
1364
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1348
1365
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1358,6 +1375,7 @@ export default class bitfinex extends Exchange {
1358
1375
  * @method
1359
1376
  * @name bitfinex#fetchDepositAddress
1360
1377
  * @description fetch the deposit address for a currency associated with this account
1378
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1361
1379
  * @param {string} code unified currency code
1362
1380
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1363
1381
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
@@ -1391,6 +1409,7 @@ export default class bitfinex extends Exchange {
1391
1409
  * @method
1392
1410
  * @name bitfinex#fetchDepositsWithdrawals
1393
1411
  * @description fetch history of deposits and withdrawals
1412
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
1394
1413
  * @param {string} code unified currency code for the currency of the deposit/withdrawals
1395
1414
  * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
1396
1415
  * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
@@ -1527,6 +1546,7 @@ export default class bitfinex extends Exchange {
1527
1546
  * @method
1528
1547
  * @name bitfinex#withdraw
1529
1548
  * @description make a withdrawal
1549
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
1530
1550
  * @param {string} code unified currency code
1531
1551
  * @param {float} amount the amount to withdraw
1532
1552
  * @param {string} address the address to withdraw to
@@ -1577,6 +1597,7 @@ export default class bitfinex extends Exchange {
1577
1597
  * @method
1578
1598
  * @name bitfinex#fetchPositions
1579
1599
  * @description fetch all open positions
1600
+ * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
1580
1601
  * @param {string[]|undefined} symbols list of unified market symbols
1581
1602
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1582
1603
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -137,149 +137,149 @@ export default class bitfinex2 extends Exchange {
137
137
  'api': {
138
138
  'public': {
139
139
  'get': {
140
- 'conf/{config}': 2.66,
141
- 'conf/pub:{action}:{object}': 2.66,
142
- 'conf/pub:{action}:{object}:{detail}': 2.66,
143
- 'conf/pub:map:{object}': 2.66,
144
- 'conf/pub:map:{object}:{detail}': 2.66,
145
- 'conf/pub:map:currency:{detail}': 2.66,
146
- 'conf/pub:map:currency:sym': 2.66,
147
- 'conf/pub:map:currency:label': 2.66,
148
- 'conf/pub:map:currency:unit': 2.66,
149
- 'conf/pub:map:currency:undl': 2.66,
150
- 'conf/pub:map:currency:pool': 2.66,
151
- 'conf/pub:map:currency:explorer': 2.66,
152
- 'conf/pub:map:currency:tx:fee': 2.66,
153
- 'conf/pub:map:tx:method': 2.66,
154
- 'conf/pub:list:{object}': 2.66,
155
- 'conf/pub:list:{object}:{detail}': 2.66,
156
- 'conf/pub:list:currency': 2.66,
157
- 'conf/pub:list:pair:exchange': 2.66,
158
- 'conf/pub:list:pair:margin': 2.66,
159
- 'conf/pub:list:pair:futures': 2.66,
160
- 'conf/pub:list:competitions': 2.66,
161
- 'conf/pub:info:{object}': 2.66,
162
- 'conf/pub:info:{object}:{detail}': 2.66,
163
- 'conf/pub:info:pair': 2.66,
164
- 'conf/pub:info:pair:futures': 2.66,
165
- 'conf/pub:info:tx:status': 2.66,
166
- 'conf/pub:fees': 2.66,
140
+ 'conf/{config}': 2.7,
141
+ 'conf/pub:{action}:{object}': 2.7,
142
+ 'conf/pub:{action}:{object}:{detail}': 2.7,
143
+ 'conf/pub:map:{object}': 2.7,
144
+ 'conf/pub:map:{object}:{detail}': 2.7,
145
+ 'conf/pub:map:currency:{detail}': 2.7,
146
+ 'conf/pub:map:currency:sym': 2.7,
147
+ 'conf/pub:map:currency:label': 2.7,
148
+ 'conf/pub:map:currency:unit': 2.7,
149
+ 'conf/pub:map:currency:undl': 2.7,
150
+ 'conf/pub:map:currency:pool': 2.7,
151
+ 'conf/pub:map:currency:explorer': 2.7,
152
+ 'conf/pub:map:currency:tx:fee': 2.7,
153
+ 'conf/pub:map:tx:method': 2.7,
154
+ 'conf/pub:list:{object}': 2.7,
155
+ 'conf/pub:list:{object}:{detail}': 2.7,
156
+ 'conf/pub:list:currency': 2.7,
157
+ 'conf/pub:list:pair:exchange': 2.7,
158
+ 'conf/pub:list:pair:margin': 2.7,
159
+ 'conf/pub:list:pair:futures': 2.7,
160
+ 'conf/pub:list:competitions': 2.7,
161
+ 'conf/pub:info:{object}': 2.7,
162
+ 'conf/pub:info:{object}:{detail}': 2.7,
163
+ 'conf/pub:info:pair': 2.7,
164
+ 'conf/pub:info:pair:futures': 2.7,
165
+ 'conf/pub:info:tx:status': 2.7,
166
+ 'conf/pub:fees': 2.7,
167
167
  'platform/status': 8,
168
- 'tickers': 2.66,
169
- 'ticker/{symbol}': 2.66,
170
- 'tickers/hist': 2.66,
171
- 'trades/{symbol}/hist': 2.66,
168
+ 'tickers': 2.7,
169
+ 'ticker/{symbol}': 2.7,
170
+ 'tickers/hist': 2.7,
171
+ 'trades/{symbol}/hist': 2.7,
172
172
  'book/{symbol}/{precision}': 1,
173
173
  'book/{symbol}/P0': 1,
174
174
  'book/{symbol}/P1': 1,
175
175
  'book/{symbol}/P2': 1,
176
176
  'book/{symbol}/P3': 1,
177
177
  'book/{symbol}/R0': 1,
178
- 'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.66,
179
- 'stats1/{key}:{size}:{symbol}:{side}/last': 2.66,
180
- 'stats1/{key}:{size}:{symbol}:{side}/hist': 2.66,
181
- 'stats1/{key}:{size}:{symbol}/{section}': 2.66,
182
- 'stats1/{key}:{size}:{symbol}/last': 2.66,
183
- 'stats1/{key}:{size}:{symbol}/hist': 2.66,
184
- 'stats1/{key}:{size}:{symbol}:long/last': 2.66,
185
- 'stats1/{key}:{size}:{symbol}:long/hist': 2.66,
186
- 'stats1/{key}:{size}:{symbol}:short/last': 2.66,
187
- 'stats1/{key}:{size}:{symbol}:short/hist': 2.66,
188
- 'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.66,
189
- 'candles/trade:{timeframe}:{symbol}/{section}': 2.66,
190
- 'candles/trade:{timeframe}:{symbol}/last': 2.66,
191
- 'candles/trade:{timeframe}:{symbol}/hist': 2.66,
192
- 'status/{type}': 2.66,
193
- 'status/deriv': 2.66,
194
- 'status/deriv/{symbol}/hist': 2.66,
178
+ 'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.7,
179
+ 'stats1/{key}:{size}:{symbol}:{side}/last': 2.7,
180
+ 'stats1/{key}:{size}:{symbol}:{side}/hist': 2.7,
181
+ 'stats1/{key}:{size}:{symbol}/{section}': 2.7,
182
+ 'stats1/{key}:{size}:{symbol}/last': 2.7,
183
+ 'stats1/{key}:{size}:{symbol}/hist': 2.7,
184
+ 'stats1/{key}:{size}:{symbol}:long/last': 2.7,
185
+ 'stats1/{key}:{size}:{symbol}:long/hist': 2.7,
186
+ 'stats1/{key}:{size}:{symbol}:short/last': 2.7,
187
+ 'stats1/{key}:{size}:{symbol}:short/hist': 2.7,
188
+ 'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.7,
189
+ 'candles/trade:{timeframe}:{symbol}/{section}': 2.7,
190
+ 'candles/trade:{timeframe}:{symbol}/last': 2.7,
191
+ 'candles/trade:{timeframe}:{symbol}/hist': 2.7,
192
+ 'status/{type}': 2.7,
193
+ 'status/deriv': 2.7,
194
+ 'status/deriv/{symbol}/hist': 2.7,
195
195
  'liquidations/hist': 80,
196
- 'rankings/{key}:{timeframe}:{symbol}/{section}': 2.66,
197
- 'rankings/{key}:{timeframe}:{symbol}/hist': 2.66,
198
- 'pulse/hist': 2.66,
199
- 'pulse/profile/{nickname}': 2.66,
196
+ 'rankings/{key}:{timeframe}:{symbol}/{section}': 2.7,
197
+ 'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
198
+ 'pulse/hist': 2.7,
199
+ 'pulse/profile/{nickname}': 2.7,
200
200
  'funding/stats/{symbol}/hist': 10, // ratelimit not in docs
201
201
  },
202
202
  'post': {
203
- 'calc/trade/avg': 2.66,
204
- 'calc/fx': 2.66,
203
+ 'calc/trade/avg': 2.7,
204
+ 'calc/fx': 2.7,
205
205
  },
206
206
  },
207
207
  'private': {
208
208
  'post': {
209
209
  // 'auth/r/orders/{symbol}/new', // outdated
210
210
  // 'auth/r/stats/perf:{timeframe}/hist', // outdated
211
- 'auth/r/wallets': 2.66,
212
- 'auth/r/wallets/hist': 2.66,
213
- 'auth/r/orders': 2.66,
214
- 'auth/r/orders/{symbol}': 2.66,
215
- 'auth/w/order/submit': 2.66,
216
- 'auth/w/order/update': 2.66,
217
- 'auth/w/order/cancel': 2.66,
218
- 'auth/w/order/multi': 2.66,
219
- 'auth/w/order/cancel/multi': 2.66,
220
- 'auth/r/orders/{symbol}/hist': 2.66,
221
- 'auth/r/orders/hist': 2.66,
222
- 'auth/r/order/{symbol}:{id}/trades': 2.66,
223
- 'auth/r/trades/{symbol}/hist': 2.66,
224
- 'auth/r/trades/hist': 2.66,
225
- 'auth/r/ledgers/{currency}/hist': 2.66,
226
- 'auth/r/ledgers/hist': 2.66,
227
- 'auth/r/info/margin/{key}': 2.66,
228
- 'auth/r/info/margin/base': 2.66,
229
- 'auth/r/info/margin/sym_all': 2.66,
230
- 'auth/r/positions': 2.66,
231
- 'auth/w/position/claim': 2.66,
232
- 'auth/w/position/increase:': 2.66,
233
- 'auth/r/position/increase/info': 2.66,
234
- 'auth/r/positions/hist': 2.66,
235
- 'auth/r/positions/audit': 2.66,
236
- 'auth/r/positions/snap': 2.66,
237
- 'auth/w/deriv/collateral/set': 2.66,
238
- 'auth/w/deriv/collateral/limits': 2.66,
239
- 'auth/r/funding/offers': 2.66,
240
- 'auth/r/funding/offers/{symbol}': 2.66,
241
- 'auth/w/funding/offer/submit': 2.66,
242
- 'auth/w/funding/offer/cancel': 2.66,
243
- 'auth/w/funding/offer/cancel/all': 2.66,
244
- 'auth/w/funding/close': 2.66,
245
- 'auth/w/funding/auto': 2.66,
246
- 'auth/w/funding/keep': 2.66,
247
- 'auth/r/funding/offers/{symbol}/hist': 2.66,
248
- 'auth/r/funding/offers/hist': 2.66,
249
- 'auth/r/funding/loans': 2.66,
250
- 'auth/r/funding/loans/hist': 2.66,
251
- 'auth/r/funding/loans/{symbol}': 2.66,
252
- 'auth/r/funding/loans/{symbol}/hist': 2.66,
253
- 'auth/r/funding/credits': 2.66,
254
- 'auth/r/funding/credits/hist': 2.66,
255
- 'auth/r/funding/credits/{symbol}': 2.66,
256
- 'auth/r/funding/credits/{symbol}/hist': 2.66,
257
- 'auth/r/funding/trades/{symbol}/hist': 2.66,
258
- 'auth/r/funding/trades/hist': 2.66,
259
- 'auth/r/info/funding/{key}': 2.66,
260
- 'auth/r/info/user': 2.66,
261
- 'auth/r/summary': 2.66,
262
- 'auth/r/logins/hist': 2.66,
263
- 'auth/r/permissions': 2.66,
264
- 'auth/w/token': 2.66,
265
- 'auth/r/audit/hist': 2.66,
266
- 'auth/w/transfer': 2.66,
211
+ 'auth/r/wallets': 2.7,
212
+ 'auth/r/wallets/hist': 2.7,
213
+ 'auth/r/orders': 2.7,
214
+ 'auth/r/orders/{symbol}': 2.7,
215
+ 'auth/w/order/submit': 2.7,
216
+ 'auth/w/order/update': 2.7,
217
+ 'auth/w/order/cancel': 2.7,
218
+ 'auth/w/order/multi': 2.7,
219
+ 'auth/w/order/cancel/multi': 2.7,
220
+ 'auth/r/orders/{symbol}/hist': 2.7,
221
+ 'auth/r/orders/hist': 2.7,
222
+ 'auth/r/order/{symbol}:{id}/trades': 2.7,
223
+ 'auth/r/trades/{symbol}/hist': 2.7,
224
+ 'auth/r/trades/hist': 2.7,
225
+ 'auth/r/ledgers/{currency}/hist': 2.7,
226
+ 'auth/r/ledgers/hist': 2.7,
227
+ 'auth/r/info/margin/{key}': 2.7,
228
+ 'auth/r/info/margin/base': 2.7,
229
+ 'auth/r/info/margin/sym_all': 2.7,
230
+ 'auth/r/positions': 2.7,
231
+ 'auth/w/position/claim': 2.7,
232
+ 'auth/w/position/increase:': 2.7,
233
+ 'auth/r/position/increase/info': 2.7,
234
+ 'auth/r/positions/hist': 2.7,
235
+ 'auth/r/positions/audit': 2.7,
236
+ 'auth/r/positions/snap': 2.7,
237
+ 'auth/w/deriv/collateral/set': 2.7,
238
+ 'auth/w/deriv/collateral/limits': 2.7,
239
+ 'auth/r/funding/offers': 2.7,
240
+ 'auth/r/funding/offers/{symbol}': 2.7,
241
+ 'auth/w/funding/offer/submit': 2.7,
242
+ 'auth/w/funding/offer/cancel': 2.7,
243
+ 'auth/w/funding/offer/cancel/all': 2.7,
244
+ 'auth/w/funding/close': 2.7,
245
+ 'auth/w/funding/auto': 2.7,
246
+ 'auth/w/funding/keep': 2.7,
247
+ 'auth/r/funding/offers/{symbol}/hist': 2.7,
248
+ 'auth/r/funding/offers/hist': 2.7,
249
+ 'auth/r/funding/loans': 2.7,
250
+ 'auth/r/funding/loans/hist': 2.7,
251
+ 'auth/r/funding/loans/{symbol}': 2.7,
252
+ 'auth/r/funding/loans/{symbol}/hist': 2.7,
253
+ 'auth/r/funding/credits': 2.7,
254
+ 'auth/r/funding/credits/hist': 2.7,
255
+ 'auth/r/funding/credits/{symbol}': 2.7,
256
+ 'auth/r/funding/credits/{symbol}/hist': 2.7,
257
+ 'auth/r/funding/trades/{symbol}/hist': 2.7,
258
+ 'auth/r/funding/trades/hist': 2.7,
259
+ 'auth/r/info/funding/{key}': 2.7,
260
+ 'auth/r/info/user': 2.7,
261
+ 'auth/r/summary': 2.7,
262
+ 'auth/r/logins/hist': 2.7,
263
+ 'auth/r/permissions': 2.7,
264
+ 'auth/w/token': 2.7,
265
+ 'auth/r/audit/hist': 2.7,
266
+ 'auth/w/transfer': 2.7,
267
267
  'auth/w/deposit/address': 24,
268
268
  'auth/w/deposit/invoice': 24,
269
269
  'auth/w/withdraw': 24,
270
- 'auth/r/movements/{currency}/hist': 2.66,
271
- 'auth/r/movements/hist': 2.66,
272
- 'auth/r/alerts': 5.33,
273
- 'auth/w/alert/set': 2.66,
274
- 'auth/w/alert/price:{symbol}:{price}/del': 2.66,
275
- 'auth/w/alert/{type}:{symbol}:{price}/del': 2.66,
276
- 'auth/calc/order/avail': 2.66,
277
- 'auth/w/settings/set': 2.66,
278
- 'auth/r/settings': 2.66,
279
- 'auth/w/settings/del': 2.66,
280
- 'auth/r/pulse/hist': 2.66,
270
+ 'auth/r/movements/{currency}/hist': 2.7,
271
+ 'auth/r/movements/hist': 2.7,
272
+ 'auth/r/alerts': 5.34,
273
+ 'auth/w/alert/set': 2.7,
274
+ 'auth/w/alert/price:{symbol}:{price}/del': 2.7,
275
+ 'auth/w/alert/{type}:{symbol}:{price}/del': 2.7,
276
+ 'auth/calc/order/avail': 2.7,
277
+ 'auth/w/settings/set': 2.7,
278
+ 'auth/r/settings': 2.7,
279
+ 'auth/w/settings/del': 2.7,
280
+ 'auth/r/pulse/hist': 2.7,
281
281
  'auth/w/pulse/add': 16,
282
- 'auth/w/pulse/del': 2.66,
282
+ 'auth/w/pulse/del': 2.7,
283
283
  },
284
284
  },
285
285
  },
package/js/src/bitget.js CHANGED
@@ -3276,6 +3276,7 @@ export default class bitget extends Exchange {
3276
3276
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3277
3277
  * @param {int} [params.until] timestamp in ms of the latest candle to fetch
3278
3278
  * @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)
3279
+ * @param {string} [params.price] *swap only* "mark" (to fetch mark price candles) or "index" (to fetch index price candles)
3279
3280
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3280
3281
  */
3281
3282
  await this.loadMarkets();
@@ -3305,68 +3306,56 @@ export default class bitget extends Exchange {
3305
3306
  if (limit !== undefined) {
3306
3307
  request['limit'] = limit;
3307
3308
  }
3308
- const options = this.safeValue(this.options, 'fetchOHLCV', {});
3309
- const spotOptions = this.safeValue(options, 'spot', {});
3310
- const defaultSpotMethod = this.safeString(spotOptions, 'method', 'publicSpotGetV2SpotMarketCandles');
3311
- const method = this.safeString(params, 'method', defaultSpotMethod);
3312
- params = this.omit(params, 'method');
3313
- if (method !== 'publicSpotGetV2SpotMarketHistoryCandles') {
3314
- if (since !== undefined) {
3315
- request['startTime'] = since;
3316
- }
3317
- if (until !== undefined) {
3318
- request['endTime'] = until;
3309
+ if (since !== undefined) {
3310
+ request['startTime'] = since;
3311
+ }
3312
+ if (since !== undefined) {
3313
+ if (limit === undefined) {
3314
+ limit = 100; // exchange default
3319
3315
  }
3316
+ const duration = this.parseTimeframe(timeframe) * 1000;
3317
+ 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
3318
+ }
3319
+ else if (until !== undefined) {
3320
+ request['endTime'] = until;
3321
+ }
3322
+ else {
3323
+ request['endTime'] = this.milliseconds();
3320
3324
  }
3321
3325
  let response = undefined;
3326
+ const thirtyOneDaysAgo = this.milliseconds() - 2678400000;
3322
3327
  if (market['spot']) {
3323
- if (method === 'publicSpotGetV2SpotMarketCandles') {
3324
- response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
3325
- }
3326
- else if (method === 'publicSpotGetV2SpotMarketHistoryCandles') {
3327
- if (since !== undefined) {
3328
- if (limit === undefined) {
3329
- limit = 100; // exchange default
3330
- }
3331
- const duration = this.parseTimeframe(timeframe) * 1000;
3332
- request['endTime'] = this.sum(since, duration * limit);
3333
- }
3334
- else if (until !== undefined) {
3335
- request['endTime'] = until;
3336
- }
3337
- else {
3338
- request['endTime'] = this.milliseconds();
3339
- }
3328
+ if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
3340
3329
  response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
3341
3330
  }
3331
+ else {
3332
+ response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
3333
+ }
3342
3334
  }
3343
3335
  else {
3344
- const swapOptions = this.safeValue(options, 'swap', {});
3345
- const defaultSwapMethod = this.safeString(swapOptions, 'method', 'publicMixGetV2MixMarketCandles');
3346
- const swapMethod = this.safeString(params, 'method', defaultSwapMethod);
3347
3336
  const priceType = this.safeString(params, 'price');
3348
- params = this.omit(params, ['method', 'price']);
3337
+ params = this.omit(params, ['price']);
3349
3338
  let productType = undefined;
3350
3339
  [productType, params] = this.handleProductTypeAndParams(market, params);
3351
3340
  request['productType'] = productType;
3352
- if ((priceType === 'mark') || (swapMethod === 'publicMixGetV2MixMarketHistoryMarkCandles')) {
3341
+ if (priceType === 'mark') {
3353
3342
  response = await this.publicMixGetV2MixMarketHistoryMarkCandles(this.extend(request, params));
3354
3343
  }
3355
- else if ((priceType === 'index') || (swapMethod === 'publicMixGetV2MixMarketHistoryIndexCandles')) {
3344
+ else if (priceType === 'index') {
3356
3345
  response = await this.publicMixGetV2MixMarketHistoryIndexCandles(this.extend(request, params));
3357
3346
  }
3358
- else if (swapMethod === 'publicMixGetV2MixMarketCandles') {
3359
- response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
3360
- }
3361
- else if (swapMethod === 'publicMixGetV2MixMarketHistoryCandles') {
3347
+ else if ((since !== undefined) && (since < thirtyOneDaysAgo)) {
3362
3348
  response = await this.publicMixGetV2MixMarketHistoryCandles(this.extend(request, params));
3363
3349
  }
3350
+ else {
3351
+ response = await this.publicMixGetV2MixMarketCandles(this.extend(request, params));
3352
+ }
3364
3353
  }
3365
3354
  if (response === '') {
3366
3355
  return []; // happens when a new token is listed
3367
3356
  }
3368
3357
  // [ ["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"] ]
3369
- const data = this.safeValue(response, 'data', response);
3358
+ const data = this.safeList(response, 'data', response);
3370
3359
  return this.parseOHLCVs(data, market, timeframe, since, limit);
3371
3360
  }
3372
3361
  async fetchBalance(params = {}) {