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.
- package/CONTRIBUTING.md +3 -2
- package/README.md +5 -5
- package/dist/ccxt.browser.js +880 -329
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -3
- package/dist/cjs/src/base/ws/Client.js +5 -2
- package/dist/cjs/src/binance.js +395 -115
- package/dist/cjs/src/bitfinex.js +21 -0
- package/dist/cjs/src/bitfinex2.js +122 -122
- package/dist/cjs/src/bitget.js +28 -39
- package/dist/cjs/src/bithumb.js +14 -0
- package/dist/cjs/src/bitmex.js +22 -3
- package/dist/cjs/src/bybit.js +13 -4
- package/dist/cjs/src/pro/binance.js +2 -2
- package/dist/cjs/src/pro/gemini.js +190 -3
- package/dist/cjs/src/woo.js +64 -35
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -3
- package/js/src/base/types.d.ts +2 -0
- package/js/src/base/ws/Client.js +5 -2
- package/js/src/binance.js +395 -115
- package/js/src/bitfinex.js +21 -0
- package/js/src/bitfinex2.js +122 -122
- package/js/src/bitget.js +28 -39
- package/js/src/bithumb.js +14 -0
- package/js/src/bitmex.js +22 -3
- package/js/src/bybit.js +13 -4
- package/js/src/pro/binance.js +2 -2
- package/js/src/pro/gemini.d.ts +5 -0
- package/js/src/pro/gemini.js +191 -4
- package/js/src/woo.js +64 -35
- package/package.json +2 -2
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -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}
|
|
@@ -134,149 +134,149 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
134
134
|
'api': {
|
|
135
135
|
'public': {
|
|
136
136
|
'get': {
|
|
137
|
-
'conf/{config}': 2.
|
|
138
|
-
'conf/pub:{action}:{object}': 2.
|
|
139
|
-
'conf/pub:{action}:{object}:{detail}': 2.
|
|
140
|
-
'conf/pub:map:{object}': 2.
|
|
141
|
-
'conf/pub:map:{object}:{detail}': 2.
|
|
142
|
-
'conf/pub:map:currency:{detail}': 2.
|
|
143
|
-
'conf/pub:map:currency:sym': 2.
|
|
144
|
-
'conf/pub:map:currency:label': 2.
|
|
145
|
-
'conf/pub:map:currency:unit': 2.
|
|
146
|
-
'conf/pub:map:currency:undl': 2.
|
|
147
|
-
'conf/pub:map:currency:pool': 2.
|
|
148
|
-
'conf/pub:map:currency:explorer': 2.
|
|
149
|
-
'conf/pub:map:currency:tx:fee': 2.
|
|
150
|
-
'conf/pub:map:tx:method': 2.
|
|
151
|
-
'conf/pub:list:{object}': 2.
|
|
152
|
-
'conf/pub:list:{object}:{detail}': 2.
|
|
153
|
-
'conf/pub:list:currency': 2.
|
|
154
|
-
'conf/pub:list:pair:exchange': 2.
|
|
155
|
-
'conf/pub:list:pair:margin': 2.
|
|
156
|
-
'conf/pub:list:pair:futures': 2.
|
|
157
|
-
'conf/pub:list:competitions': 2.
|
|
158
|
-
'conf/pub:info:{object}': 2.
|
|
159
|
-
'conf/pub:info:{object}:{detail}': 2.
|
|
160
|
-
'conf/pub:info:pair': 2.
|
|
161
|
-
'conf/pub:info:pair:futures': 2.
|
|
162
|
-
'conf/pub:info:tx:status': 2.
|
|
163
|
-
'conf/pub:fees': 2.
|
|
137
|
+
'conf/{config}': 2.7,
|
|
138
|
+
'conf/pub:{action}:{object}': 2.7,
|
|
139
|
+
'conf/pub:{action}:{object}:{detail}': 2.7,
|
|
140
|
+
'conf/pub:map:{object}': 2.7,
|
|
141
|
+
'conf/pub:map:{object}:{detail}': 2.7,
|
|
142
|
+
'conf/pub:map:currency:{detail}': 2.7,
|
|
143
|
+
'conf/pub:map:currency:sym': 2.7,
|
|
144
|
+
'conf/pub:map:currency:label': 2.7,
|
|
145
|
+
'conf/pub:map:currency:unit': 2.7,
|
|
146
|
+
'conf/pub:map:currency:undl': 2.7,
|
|
147
|
+
'conf/pub:map:currency:pool': 2.7,
|
|
148
|
+
'conf/pub:map:currency:explorer': 2.7,
|
|
149
|
+
'conf/pub:map:currency:tx:fee': 2.7,
|
|
150
|
+
'conf/pub:map:tx:method': 2.7,
|
|
151
|
+
'conf/pub:list:{object}': 2.7,
|
|
152
|
+
'conf/pub:list:{object}:{detail}': 2.7,
|
|
153
|
+
'conf/pub:list:currency': 2.7,
|
|
154
|
+
'conf/pub:list:pair:exchange': 2.7,
|
|
155
|
+
'conf/pub:list:pair:margin': 2.7,
|
|
156
|
+
'conf/pub:list:pair:futures': 2.7,
|
|
157
|
+
'conf/pub:list:competitions': 2.7,
|
|
158
|
+
'conf/pub:info:{object}': 2.7,
|
|
159
|
+
'conf/pub:info:{object}:{detail}': 2.7,
|
|
160
|
+
'conf/pub:info:pair': 2.7,
|
|
161
|
+
'conf/pub:info:pair:futures': 2.7,
|
|
162
|
+
'conf/pub:info:tx:status': 2.7,
|
|
163
|
+
'conf/pub:fees': 2.7,
|
|
164
164
|
'platform/status': 8,
|
|
165
|
-
'tickers': 2.
|
|
166
|
-
'ticker/{symbol}': 2.
|
|
167
|
-
'tickers/hist': 2.
|
|
168
|
-
'trades/{symbol}/hist': 2.
|
|
165
|
+
'tickers': 2.7,
|
|
166
|
+
'ticker/{symbol}': 2.7,
|
|
167
|
+
'tickers/hist': 2.7,
|
|
168
|
+
'trades/{symbol}/hist': 2.7,
|
|
169
169
|
'book/{symbol}/{precision}': 1,
|
|
170
170
|
'book/{symbol}/P0': 1,
|
|
171
171
|
'book/{symbol}/P1': 1,
|
|
172
172
|
'book/{symbol}/P2': 1,
|
|
173
173
|
'book/{symbol}/P3': 1,
|
|
174
174
|
'book/{symbol}/R0': 1,
|
|
175
|
-
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.
|
|
176
|
-
'stats1/{key}:{size}:{symbol}:{side}/last': 2.
|
|
177
|
-
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.
|
|
178
|
-
'stats1/{key}:{size}:{symbol}/{section}': 2.
|
|
179
|
-
'stats1/{key}:{size}:{symbol}/last': 2.
|
|
180
|
-
'stats1/{key}:{size}:{symbol}/hist': 2.
|
|
181
|
-
'stats1/{key}:{size}:{symbol}:long/last': 2.
|
|
182
|
-
'stats1/{key}:{size}:{symbol}:long/hist': 2.
|
|
183
|
-
'stats1/{key}:{size}:{symbol}:short/last': 2.
|
|
184
|
-
'stats1/{key}:{size}:{symbol}:short/hist': 2.
|
|
185
|
-
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.
|
|
186
|
-
'candles/trade:{timeframe}:{symbol}/{section}': 2.
|
|
187
|
-
'candles/trade:{timeframe}:{symbol}/last': 2.
|
|
188
|
-
'candles/trade:{timeframe}:{symbol}/hist': 2.
|
|
189
|
-
'status/{type}': 2.
|
|
190
|
-
'status/deriv': 2.
|
|
191
|
-
'status/deriv/{symbol}/hist': 2.
|
|
175
|
+
'stats1/{key}:{size}:{symbol}:{side}/{section}': 2.7,
|
|
176
|
+
'stats1/{key}:{size}:{symbol}:{side}/last': 2.7,
|
|
177
|
+
'stats1/{key}:{size}:{symbol}:{side}/hist': 2.7,
|
|
178
|
+
'stats1/{key}:{size}:{symbol}/{section}': 2.7,
|
|
179
|
+
'stats1/{key}:{size}:{symbol}/last': 2.7,
|
|
180
|
+
'stats1/{key}:{size}:{symbol}/hist': 2.7,
|
|
181
|
+
'stats1/{key}:{size}:{symbol}:long/last': 2.7,
|
|
182
|
+
'stats1/{key}:{size}:{symbol}:long/hist': 2.7,
|
|
183
|
+
'stats1/{key}:{size}:{symbol}:short/last': 2.7,
|
|
184
|
+
'stats1/{key}:{size}:{symbol}:short/hist': 2.7,
|
|
185
|
+
'candles/trade:{timeframe}:{symbol}:{period}/{section}': 2.7,
|
|
186
|
+
'candles/trade:{timeframe}:{symbol}/{section}': 2.7,
|
|
187
|
+
'candles/trade:{timeframe}:{symbol}/last': 2.7,
|
|
188
|
+
'candles/trade:{timeframe}:{symbol}/hist': 2.7,
|
|
189
|
+
'status/{type}': 2.7,
|
|
190
|
+
'status/deriv': 2.7,
|
|
191
|
+
'status/deriv/{symbol}/hist': 2.7,
|
|
192
192
|
'liquidations/hist': 80,
|
|
193
|
-
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.
|
|
194
|
-
'rankings/{key}:{timeframe}:{symbol}/hist': 2.
|
|
195
|
-
'pulse/hist': 2.
|
|
196
|
-
'pulse/profile/{nickname}': 2.
|
|
193
|
+
'rankings/{key}:{timeframe}:{symbol}/{section}': 2.7,
|
|
194
|
+
'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
|
|
195
|
+
'pulse/hist': 2.7,
|
|
196
|
+
'pulse/profile/{nickname}': 2.7,
|
|
197
197
|
'funding/stats/{symbol}/hist': 10, // ratelimit not in docs
|
|
198
198
|
},
|
|
199
199
|
'post': {
|
|
200
|
-
'calc/trade/avg': 2.
|
|
201
|
-
'calc/fx': 2.
|
|
200
|
+
'calc/trade/avg': 2.7,
|
|
201
|
+
'calc/fx': 2.7,
|
|
202
202
|
},
|
|
203
203
|
},
|
|
204
204
|
'private': {
|
|
205
205
|
'post': {
|
|
206
206
|
// 'auth/r/orders/{symbol}/new', // outdated
|
|
207
207
|
// 'auth/r/stats/perf:{timeframe}/hist', // outdated
|
|
208
|
-
'auth/r/wallets': 2.
|
|
209
|
-
'auth/r/wallets/hist': 2.
|
|
210
|
-
'auth/r/orders': 2.
|
|
211
|
-
'auth/r/orders/{symbol}': 2.
|
|
212
|
-
'auth/w/order/submit': 2.
|
|
213
|
-
'auth/w/order/update': 2.
|
|
214
|
-
'auth/w/order/cancel': 2.
|
|
215
|
-
'auth/w/order/multi': 2.
|
|
216
|
-
'auth/w/order/cancel/multi': 2.
|
|
217
|
-
'auth/r/orders/{symbol}/hist': 2.
|
|
218
|
-
'auth/r/orders/hist': 2.
|
|
219
|
-
'auth/r/order/{symbol}:{id}/trades': 2.
|
|
220
|
-
'auth/r/trades/{symbol}/hist': 2.
|
|
221
|
-
'auth/r/trades/hist': 2.
|
|
222
|
-
'auth/r/ledgers/{currency}/hist': 2.
|
|
223
|
-
'auth/r/ledgers/hist': 2.
|
|
224
|
-
'auth/r/info/margin/{key}': 2.
|
|
225
|
-
'auth/r/info/margin/base': 2.
|
|
226
|
-
'auth/r/info/margin/sym_all': 2.
|
|
227
|
-
'auth/r/positions': 2.
|
|
228
|
-
'auth/w/position/claim': 2.
|
|
229
|
-
'auth/w/position/increase:': 2.
|
|
230
|
-
'auth/r/position/increase/info': 2.
|
|
231
|
-
'auth/r/positions/hist': 2.
|
|
232
|
-
'auth/r/positions/audit': 2.
|
|
233
|
-
'auth/r/positions/snap': 2.
|
|
234
|
-
'auth/w/deriv/collateral/set': 2.
|
|
235
|
-
'auth/w/deriv/collateral/limits': 2.
|
|
236
|
-
'auth/r/funding/offers': 2.
|
|
237
|
-
'auth/r/funding/offers/{symbol}': 2.
|
|
238
|
-
'auth/w/funding/offer/submit': 2.
|
|
239
|
-
'auth/w/funding/offer/cancel': 2.
|
|
240
|
-
'auth/w/funding/offer/cancel/all': 2.
|
|
241
|
-
'auth/w/funding/close': 2.
|
|
242
|
-
'auth/w/funding/auto': 2.
|
|
243
|
-
'auth/w/funding/keep': 2.
|
|
244
|
-
'auth/r/funding/offers/{symbol}/hist': 2.
|
|
245
|
-
'auth/r/funding/offers/hist': 2.
|
|
246
|
-
'auth/r/funding/loans': 2.
|
|
247
|
-
'auth/r/funding/loans/hist': 2.
|
|
248
|
-
'auth/r/funding/loans/{symbol}': 2.
|
|
249
|
-
'auth/r/funding/loans/{symbol}/hist': 2.
|
|
250
|
-
'auth/r/funding/credits': 2.
|
|
251
|
-
'auth/r/funding/credits/hist': 2.
|
|
252
|
-
'auth/r/funding/credits/{symbol}': 2.
|
|
253
|
-
'auth/r/funding/credits/{symbol}/hist': 2.
|
|
254
|
-
'auth/r/funding/trades/{symbol}/hist': 2.
|
|
255
|
-
'auth/r/funding/trades/hist': 2.
|
|
256
|
-
'auth/r/info/funding/{key}': 2.
|
|
257
|
-
'auth/r/info/user': 2.
|
|
258
|
-
'auth/r/summary': 2.
|
|
259
|
-
'auth/r/logins/hist': 2.
|
|
260
|
-
'auth/r/permissions': 2.
|
|
261
|
-
'auth/w/token': 2.
|
|
262
|
-
'auth/r/audit/hist': 2.
|
|
263
|
-
'auth/w/transfer': 2.
|
|
208
|
+
'auth/r/wallets': 2.7,
|
|
209
|
+
'auth/r/wallets/hist': 2.7,
|
|
210
|
+
'auth/r/orders': 2.7,
|
|
211
|
+
'auth/r/orders/{symbol}': 2.7,
|
|
212
|
+
'auth/w/order/submit': 2.7,
|
|
213
|
+
'auth/w/order/update': 2.7,
|
|
214
|
+
'auth/w/order/cancel': 2.7,
|
|
215
|
+
'auth/w/order/multi': 2.7,
|
|
216
|
+
'auth/w/order/cancel/multi': 2.7,
|
|
217
|
+
'auth/r/orders/{symbol}/hist': 2.7,
|
|
218
|
+
'auth/r/orders/hist': 2.7,
|
|
219
|
+
'auth/r/order/{symbol}:{id}/trades': 2.7,
|
|
220
|
+
'auth/r/trades/{symbol}/hist': 2.7,
|
|
221
|
+
'auth/r/trades/hist': 2.7,
|
|
222
|
+
'auth/r/ledgers/{currency}/hist': 2.7,
|
|
223
|
+
'auth/r/ledgers/hist': 2.7,
|
|
224
|
+
'auth/r/info/margin/{key}': 2.7,
|
|
225
|
+
'auth/r/info/margin/base': 2.7,
|
|
226
|
+
'auth/r/info/margin/sym_all': 2.7,
|
|
227
|
+
'auth/r/positions': 2.7,
|
|
228
|
+
'auth/w/position/claim': 2.7,
|
|
229
|
+
'auth/w/position/increase:': 2.7,
|
|
230
|
+
'auth/r/position/increase/info': 2.7,
|
|
231
|
+
'auth/r/positions/hist': 2.7,
|
|
232
|
+
'auth/r/positions/audit': 2.7,
|
|
233
|
+
'auth/r/positions/snap': 2.7,
|
|
234
|
+
'auth/w/deriv/collateral/set': 2.7,
|
|
235
|
+
'auth/w/deriv/collateral/limits': 2.7,
|
|
236
|
+
'auth/r/funding/offers': 2.7,
|
|
237
|
+
'auth/r/funding/offers/{symbol}': 2.7,
|
|
238
|
+
'auth/w/funding/offer/submit': 2.7,
|
|
239
|
+
'auth/w/funding/offer/cancel': 2.7,
|
|
240
|
+
'auth/w/funding/offer/cancel/all': 2.7,
|
|
241
|
+
'auth/w/funding/close': 2.7,
|
|
242
|
+
'auth/w/funding/auto': 2.7,
|
|
243
|
+
'auth/w/funding/keep': 2.7,
|
|
244
|
+
'auth/r/funding/offers/{symbol}/hist': 2.7,
|
|
245
|
+
'auth/r/funding/offers/hist': 2.7,
|
|
246
|
+
'auth/r/funding/loans': 2.7,
|
|
247
|
+
'auth/r/funding/loans/hist': 2.7,
|
|
248
|
+
'auth/r/funding/loans/{symbol}': 2.7,
|
|
249
|
+
'auth/r/funding/loans/{symbol}/hist': 2.7,
|
|
250
|
+
'auth/r/funding/credits': 2.7,
|
|
251
|
+
'auth/r/funding/credits/hist': 2.7,
|
|
252
|
+
'auth/r/funding/credits/{symbol}': 2.7,
|
|
253
|
+
'auth/r/funding/credits/{symbol}/hist': 2.7,
|
|
254
|
+
'auth/r/funding/trades/{symbol}/hist': 2.7,
|
|
255
|
+
'auth/r/funding/trades/hist': 2.7,
|
|
256
|
+
'auth/r/info/funding/{key}': 2.7,
|
|
257
|
+
'auth/r/info/user': 2.7,
|
|
258
|
+
'auth/r/summary': 2.7,
|
|
259
|
+
'auth/r/logins/hist': 2.7,
|
|
260
|
+
'auth/r/permissions': 2.7,
|
|
261
|
+
'auth/w/token': 2.7,
|
|
262
|
+
'auth/r/audit/hist': 2.7,
|
|
263
|
+
'auth/w/transfer': 2.7,
|
|
264
264
|
'auth/w/deposit/address': 24,
|
|
265
265
|
'auth/w/deposit/invoice': 24,
|
|
266
266
|
'auth/w/withdraw': 24,
|
|
267
|
-
'auth/r/movements/{currency}/hist': 2.
|
|
268
|
-
'auth/r/movements/hist': 2.
|
|
269
|
-
'auth/r/alerts': 5.
|
|
270
|
-
'auth/w/alert/set': 2.
|
|
271
|
-
'auth/w/alert/price:{symbol}:{price}/del': 2.
|
|
272
|
-
'auth/w/alert/{type}:{symbol}:{price}/del': 2.
|
|
273
|
-
'auth/calc/order/avail': 2.
|
|
274
|
-
'auth/w/settings/set': 2.
|
|
275
|
-
'auth/r/settings': 2.
|
|
276
|
-
'auth/w/settings/del': 2.
|
|
277
|
-
'auth/r/pulse/hist': 2.
|
|
267
|
+
'auth/r/movements/{currency}/hist': 2.7,
|
|
268
|
+
'auth/r/movements/hist': 2.7,
|
|
269
|
+
'auth/r/alerts': 5.34,
|
|
270
|
+
'auth/w/alert/set': 2.7,
|
|
271
|
+
'auth/w/alert/price:{symbol}:{price}/del': 2.7,
|
|
272
|
+
'auth/w/alert/{type}:{symbol}:{price}/del': 2.7,
|
|
273
|
+
'auth/calc/order/avail': 2.7,
|
|
274
|
+
'auth/w/settings/set': 2.7,
|
|
275
|
+
'auth/r/settings': 2.7,
|
|
276
|
+
'auth/w/settings/del': 2.7,
|
|
277
|
+
'auth/r/pulse/hist': 2.7,
|
|
278
278
|
'auth/w/pulse/add': 16,
|
|
279
|
-
'auth/w/pulse/del': 2.
|
|
279
|
+
'auth/w/pulse/del': 2.7,
|
|
280
280
|
},
|
|
281
281
|
},
|
|
282
282
|
},
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -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
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
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 (
|
|
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, ['
|
|
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 (
|
|
3338
|
+
if (priceType === 'mark') {
|
|
3350
3339
|
response = await this.publicMixGetV2MixMarketHistoryMarkCandles(this.extend(request, params));
|
|
3351
3340
|
}
|
|
3352
|
-
else if (
|
|
3341
|
+
else if (priceType === 'index') {
|
|
3353
3342
|
response = await this.publicMixGetV2MixMarketHistoryIndexCandles(this.extend(request, params));
|
|
3354
3343
|
}
|
|
3355
|
-
else if (
|
|
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.
|
|
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 = {}) {
|